aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/lib/sbi.c
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2020-03-09 19:35:30 -0700
committerAndes <uboot@andestech.com>2020-03-17 11:29:54 +0800
commit1b3c8d64020f835823aedc1c4d293e34a78bd1b8 (patch)
tree1f9df90b50ed39cb27423f63f6424b633a2fd4fa /arch/riscv/lib/sbi.c
parent1e32715602d3da294eaf4e70542c4be65e77a839 (diff)
downloadu-boot-1b3c8d64020f835823aedc1c4d293e34a78bd1b8.zip
u-boot-1b3c8d64020f835823aedc1c4d293e34a78bd1b8.tar.gz
u-boot-1b3c8d64020f835823aedc1c4d293e34a78bd1b8.tar.bz2
riscv: Introduce a new config for SBI v0.1
We now have SBI v0.2 which is more scalable and extendable to handle future needs for RISC-V supervisor interfaces. Introduce a new config and move all SBI v0.1 code under that config. This allows to implement the new replacement SBI extensions cleanly and remove v0.1 extensions easily in future. Currently, the config is enabled by default. Once all M-mode software, with v0.1, is no longer in use, this config option and all relevant code can be easily removed. This commit is inspired from Linux kernel patch: https://patchwork.kernel.org/patch/11407361/ Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Pragnesh Patel <pragnesh.patel@sifive.com>
Diffstat (limited to 'arch/riscv/lib/sbi.c')
-rw-r--r--arch/riscv/lib/sbi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/riscv/lib/sbi.c b/arch/riscv/lib/sbi.c
index 4b6a9e0..604a3a8 100644
--- a/arch/riscv/lib/sbi.c
+++ b/arch/riscv/lib/sbi.c
@@ -39,6 +39,8 @@ struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0,
return ret;
}
+#ifdef CONFIG_SBI_V01
+
/**
* sbi_console_putchar() - Writes given character to the console device.
* @ch: The data to be written to the console.
@@ -84,6 +86,8 @@ void sbi_shutdown(void)
sbi_ecall(SBI_EXT_0_1_SHUTDOWN, 0, 0, 0, 0, 0, 0, 0);
}
+#endif /* CONFIG_SBI_V01 */
+
/**
* sbi_set_timer() - Program the timer for next timer event.
* @stime_value: The value after which next timer event should fire.