Skip to content

Commit eded8bc

Browse files
damien-lemoalpaul-walmsley-sifive
authored andcommitted
riscv: don't allow selecting SBI based drivers for M-mode
When running in M-mode we can't use SBI based drivers. Add a new CONFIG_RISCV_SBI that drivers that do SBI calls can depend on instead. Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Anup Patel <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Paul Walmsley <[email protected]>
1 parent a4c3733 commit eded8bc

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

arch/riscv/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ config ARCH_MMAP_RND_BITS_MAX
7676
config RISCV_M_MODE
7777
bool
7878

79+
# set if we are running in S-mode and can use SBI calls
80+
config RISCV_SBI
81+
bool
82+
depends on !RISCV_M_MODE
83+
default y
84+
7985
config MMU
8086
def_bool y
8187

drivers/tty/hvc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ config HVC_DCC
8989

9090
config HVC_RISCV_SBI
9191
bool "RISC-V SBI console support"
92-
depends on RISCV
92+
depends on RISCV_SBI
9393
select HVC_DRIVER
9494
help
9595
This enables support for console output via RISC-V SBI calls, which

drivers/tty/serial/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ config SERIAL_EARLYCON_ARM_SEMIHOST
8888

8989
config SERIAL_EARLYCON_RISCV_SBI
9090
bool "Early console using RISC-V SBI"
91-
depends on RISCV
91+
depends on RISCV_SBI
9292
select SERIAL_CORE
9393
select SERIAL_CORE_CONSOLE
9494
select SERIAL_EARLYCON

0 commit comments

Comments
 (0)