| 1 |
## SPDX-License-Identifier: GPL-2.0-only |
| 2 |
|
| 3 |
config ARCH_RISCV_RV64 |
| 4 |
bool |
| 5 |
select ARCH_RISCV |
| 6 |
|
| 7 |
config ARCH_RISCV_RV32 |
| 8 |
bool |
| 9 |
select ARCH_RISCV |
| 10 |
|
| 11 |
config ARCH_RISCV |
| 12 |
bool |
| 13 |
|
| 14 |
if ARCH_RISCV |
| 15 |
|
| 16 |
config RISCV_ARCH |
| 17 |
string |
| 18 |
|
| 19 |
config RISCV_ABI |
| 20 |
string |
| 21 |
|
| 22 |
config RISCV_CODEMODEL |
| 23 |
string |
| 24 |
|
| 25 |
config ARCH_RISCV_M_DISABLED |
| 26 |
bool |
| 27 |
|
| 28 |
config ARCH_RISCV_M |
| 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 |
| 33 |
# on paging. |
| 34 |
# While the spec requires it, there is at least |
| 35 |
# one implementation that will not have it due |
| 36 |
# to security concerns. |
| 37 |
bool |
| 38 |
default y if ARCH_RISCV && !ARCH_RISCV_M_DISABLED |
| 39 |
default n |
| 40 |
|
| 41 |
config ARCH_RISCV_S |
| 42 |
# S (supervisor) mode is for kernels. It is optional. |
| 43 |
bool |
| 44 |
default n |
| 45 |
|
| 46 |
config RISCV_HAS_OPENSBI |
| 47 |
def_bool n |
| 48 |
|
| 49 |
config RISCV_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 |
| 53 |
default n |
| 54 |
help |
| 55 |
Load OpenSBI after payload has been loaded and use it to |
| 56 |
provide the SBI and to handover control to payload. |
| 57 |
|
| 58 |
if RISCV_OPENSBI |
| 59 |
|
| 60 |
config OPENSBI_BLOB |
| 61 |
bool "Include OpenSBI ELF binary blob" |
| 62 |
depends on RISCV_OPENSBI |
| 63 |
help |
| 64 |
If enabled it allows to specify a file path to an already compiled OpenSBI binary. |
| 65 |
If disabled the OpenSBI binary will be compiled from upstream OpenSBI repository. |
| 66 |
This option is discouraged as compatibility with out-of-tree blobs may break anytime. |
| 67 |
|
| 68 |
config OPENSBI_BLOB_PATH |
| 69 |
string "Path to external opensbi.elf" |
| 70 |
depends on OPENSBI_BLOB |
| 71 |
help |
| 72 |
Absolute (or relative to coreboot directory) path to the OpenSBI ELF file. |
| 73 |
|
| 74 |
config OPENSBI_PLATFORM |
| 75 |
string |
| 76 |
help |
| 77 |
The OpenSBI platform to build for. |
| 78 |
|
| 79 |
config OPENSBI_TEXT_START |
| 80 |
hex |
| 81 |
help |
| 82 |
The linking address used to build opensbi. |
| 83 |
|
| 84 |
config OPENSBI_FW_DYNAMIC_BOOT_HART |
| 85 |
int |
| 86 |
default RISCV_WORKING_HARTID |
| 87 |
help |
| 88 |
This specifies the hart that OpenSBI will use to boot the payload. If set to |
| 89 |
value -1, OpenSBI will use a 'lottery' scheme to figure it out itself. |
| 90 |
This hart must be able to execute in the Supervisor priviledged mode, since |
| 91 |
that is the mode usually used for the payload. If the hart does not support |
| 92 |
Supervisor mode OpenSBI will again look for a hart that does support it. |
| 93 |
|
| 94 |
endif # RISCV_OPENSBI |
| 95 |
|
| 96 |
config ARCH_RISCV_U |
| 97 |
# U (user) mode is for programs. |
| 98 |
bool |
| 99 |
default n |
| 100 |
|
| 101 |
config ARCH_RISCV_PMP |
| 102 |
bool |
| 103 |
default n |
| 104 |
|
| 105 |
config ARCH_BOOTBLOCK_RISCV |
| 106 |
bool |
| 107 |
default n |
| 108 |
|
| 109 |
config ARCH_VERSTAGE_RISCV |
| 110 |
bool |
| 111 |
default n |
| 112 |
|
| 113 |
config ARCH_ROMSTAGE_RISCV |
| 114 |
bool |
| 115 |
default n |
| 116 |
|
| 117 |
config ARCH_RAMSTAGE_RISCV |
| 118 |
bool |
| 119 |
default n |
| 120 |
|
| 121 |
config RISCV_USE_ARCH_TIMER |
| 122 |
bool |
| 123 |
default n |
| 124 |
|
| 125 |
config RISCV_WORKING_HARTID |
| 126 |
int |
| 127 |
|
| 128 |
# Newer SoC have the menvconfig register. |
| 129 |
# Very few SOC do not have this. |
| 130 |
# Older SoC, such as the SiFive FU[57]40, that |
| 131 |
# do not have this register, should set this |
| 132 |
# to n. |
| 133 |
config RISCV_SOC_HAS_MENVCFG |
| 134 |
bool |
| 135 |
default y |
| 136 |
|
| 137 |
config RISCV_GET_HART_COUNT_AT_RUNTIME |
| 138 |
bool |
| 139 |
default n |
| 140 |
help |
| 141 |
Usually RISC-V SOCs have a specific amount of harts (CONFIG_MAX_CPUS). |
| 142 |
It is however possible that the amount of harts can only be known at runtime. |
| 143 |
This is for example the case for socketed and for emulation systems. |
| 144 |
SOC/Mainboards select this option in case the number of harts is not known at |
| 145 |
build time. In this case the SOC must have a scheme in place to discover all harts. |
| 146 |
|
| 147 |
config RISCV_DTS |
| 148 |
bool |
| 149 |
default n |
| 150 |
help |
| 151 |
This option is selected by mainboards that include a devicetree |
| 152 |
source file (not to be confused with the coreboot devicetree.cb files). |
| 153 |
The devicetree will be preprocessed and compiled into a FDT (flattened devicetree). |
| 154 |
Said FDT will be put into a CBFS file for use in runtime. |
| 155 |
|
| 156 |
config RISCV_DTS_FILE |
| 157 |
string |
| 158 |
depends on RISCV_DTS |
| 159 |
help |
| 160 |
Path to the devicetree source file in .dts format. |
| 161 |
|
| 162 |
endif # if ARCH_RISCV |