]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd/sbi: display new extensions
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 12 Apr 2023 08:38:16 +0000 (10:38 +0200)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Thu, 6 Jul 2023 09:28:08 +0000 (17:28 +0800)
OpenSBI already implements some extensions that are not ratified yet:

* Debug Console Extension (DBCN)
* System Suspend Extension (SUSP)
* Collaborative Processor Performance Control Extension (CPPC)

Allow the sbi command to display these.

Provide the FID definitions of the Debug Console Extension. We can use that
extension for an early debug console driver.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
arch/riscv/include/asm/sbi.h
cmd/riscv/sbi.c

index 81fcfe0b3638295f2b079515f394d66793b6d3ac..769369997dda38f756fd4cceffa2f0def524d906 100644 (file)
@@ -28,6 +28,9 @@ enum sbi_ext_id {
        SBI_EXT_HSM = 0x48534D,
        SBI_EXT_SRST = 0x53525354,
        SBI_EXT_PMU = 0x504D55,
+       SBI_EXT_DBCN = 0x4442434E,
+       SBI_EXT_SUSP = 0x53555350,
+       SBI_EXT_CPPC = 0x43505043,
 };
 
 enum sbi_ext_base_fid {
@@ -89,6 +92,12 @@ enum sbi_srst_reset_reason {
        SBI_SRST_RESET_REASON_SYS_FAILURE,
 };
 
+enum sbi_ext_dbcn_fid {
+       SBI_EXT_DBCN_CONSOLE_WRITE = 0,
+       SBI_EXT_DBCN_CONSOLE_READ,
+       SBI_EXT_DBCN_CONSOLE_WRITE_BYTE,
+};
+
 #ifdef CONFIG_SBI_V01
 #define SBI_EXT_SET_TIMER              SBI_EXT_0_1_SET_TIMER
 #define SBI_FID_SET_TIMER              0
index 6f2cad4e7eda73c0503b4fd0bb9d067df46c9f41..c4707fe52078b99b92cf71362df779be1532604d 100644 (file)
@@ -46,6 +46,9 @@ static struct sbi_ext extensions[] = {
        { SBI_EXT_HSM,                        "Hart State Management Extension" },
        { SBI_EXT_SRST,                       "System Reset Extension" },
        { SBI_EXT_PMU,                        "Performance Monitoring Unit Extension" },
+       { SBI_EXT_DBCN,                       "Debug Console Extension" },
+       { SBI_EXT_SUSP,                       "System Suspend Extension" },
+       { SBI_EXT_CPPC,                       "Collaborative Processor Performance Control Extension" },
 };
 
 static int do_sbi(struct cmd_tbl *cmdtp, int flag, int argc,