1 ## SPDX-License-Identifier: GPL-2.0-only
22 config RISCV_CODEMODEL
25 config ARCH_RISCV_M_DISABLED
29 # Whether a SOC implements M mode.
30 # M mode is the most privileged mode, it is
31 # the equivalent in some ways of x86 SMM mode
32 # save that in M mode it is impossible to turn
34 # While the spec requires it, there is at least
35 # one implementation that will not have it due
36 # to security concerns.
38 default y if ARCH_RISCV && !ARCH_RISCV_M_DISABLED
42 # S (supervisor) mode is for kernels. It is optional.
46 config RISCV_HAS_OPENSBI
50 bool "Use OpenSBI to hand over control to payload"
51 depends on ARCH_RISCV_M && ARCH_RISCV_S
52 depends on RISCV_HAS_OPENSBI
55 Load OpenSBI after payload has been loaded and use it to
56 provide the SBI and to handover control to payload.
58 config OPENSBI_PLATFORM
60 depends on RISCV_HAS_OPENSBI
62 The OpenSBI platform to build for.
64 config OPENSBI_TEXT_START
66 depends on RISCV_HAS_OPENSBI
68 The linking address used to build opensbi.
70 config OPENSBI_FW_DYNAMIC_BOOT_HART
72 default RISCV_WORKING_HARTID
74 This specifies the hart that OpenSBI will use to boot the payload. If set to
75 value -1, OpenSBI will use a 'lottery' scheme to figure it out itself.
76 This hart must be able to execute in the Supervisor priviledged mode, since
77 that is the mode usually used for the payload. If the hart does not support
78 Supervisor mode OpenSBI will again look for a hart that does support it.
81 # U (user) mode is for programs.
89 config ARCH_BOOTBLOCK_RISCV
93 config ARCH_VERSTAGE_RISCV
97 config ARCH_ROMSTAGE_RISCV
101 config ARCH_RAMSTAGE_RISCV
105 config RISCV_USE_ARCH_TIMER
109 config RISCV_WORKING_HARTID
112 # Newer SoC have the menvconfig register.
113 # Very few SOC do not have this.
114 # Older SoC, such as the SiFive FU[57]40, that
115 # do not have this register, should set this
117 config RISCV_SOC_HAS_MENVCFG
121 endif # if ARCH_RISCV