riscv: Move virtio scan to board_late_init()
[platform/kernel/u-boot.git] / arch / riscv / Kconfig
1 menu "RISC-V architecture"
2         depends on RISCV
3
4 config SYS_ARCH
5         default "riscv"
6
7 choice
8         prompt "Target select"
9         optional
10
11 config TARGET_AE350
12         bool "Support ae350"
13
14 config TARGET_MICROCHIP_ICICLE
15         bool "Support Microchip PolarFire-SoC Icicle Board"
16
17 config TARGET_QEMU_VIRT
18         bool "Support QEMU Virt Board"
19         select BOARD_LATE_INIT
20
21 config TARGET_SIFIVE_UNLEASHED
22         bool "Support SiFive Unleashed Board"
23
24 config TARGET_SIFIVE_UNMATCHED
25         bool "Support SiFive Unmatched Board"
26         select SYS_CACHE_SHIFT_6
27
28 config TARGET_STARFIVE_VISIONFIVE2
29         bool "Support StarFive VisionFive2 Board"
30         select BOARD_LATE_INIT
31
32 config TARGET_TH1520_LPI4A
33         bool "Support Sipeed's TH1520 Lichee PI 4A Board"
34         select SYS_CACHE_SHIFT_6
35
36 config TARGET_SIPEED_MAIX
37         bool "Support Sipeed Maix Board"
38         select SYS_CACHE_SHIFT_6
39
40 config TARGET_OPENPITON_RISCV64
41         bool "Support RISC-V cores on OpenPiton SoC"
42
43 endchoice
44
45 config SYS_ICACHE_OFF
46         bool "Do not enable icache"
47         help
48           Do not enable instruction cache in U-Boot.
49
50 config SPL_SYS_ICACHE_OFF
51         bool "Do not enable icache in SPL"
52         depends on SPL
53         default SYS_ICACHE_OFF
54         help
55           Do not enable instruction cache in SPL.
56
57 config SYS_DCACHE_OFF
58         bool "Do not enable dcache"
59         help
60           Do not enable data cache in U-Boot.
61
62 config SPL_SYS_DCACHE_OFF
63         bool "Do not enable dcache in SPL"
64         depends on SPL
65         default SYS_DCACHE_OFF
66         help
67           Do not enable data cache in SPL.
68
69 config SPL_ZERO_MEM_BEFORE_USE
70         bool "Zero memory before use"
71         depends on SPL
72         default n
73         help
74           Zero stack/GD/malloc area in SPL before using them, this is needed for
75           Sifive core devices that uses L2 cache to store SPL.
76
77 # board-specific options below
78 source "board/AndesTech/ae350/Kconfig"
79 source "board/emulation/qemu-riscv/Kconfig"
80 source "board/microchip/mpfs_icicle/Kconfig"
81 source "board/sifive/unleashed/Kconfig"
82 source "board/sifive/unmatched/Kconfig"
83 source "board/thead/th1520_lpi4a/Kconfig"
84 source "board/openpiton/riscv64/Kconfig"
85 source "board/sipeed/maix/Kconfig"
86 source "board/starfive/visionfive2/Kconfig"
87
88 # platform-specific options below
89 source "arch/riscv/cpu/andesv5/Kconfig"
90 source "arch/riscv/cpu/fu540/Kconfig"
91 source "arch/riscv/cpu/fu740/Kconfig"
92 source "arch/riscv/cpu/generic/Kconfig"
93 source "arch/riscv/cpu/jh7110/Kconfig"
94
95 # architecture-specific options below
96
97 choice
98         prompt "Base ISA"
99         default ARCH_RV32I
100
101 config ARCH_RV32I
102         bool "RV32I"
103         select 32BIT
104         help
105           Choose this option to target the RV32I base integer instruction set.
106
107 config ARCH_RV64I
108         bool "RV64I"
109         select 64BIT
110         select PHYS_64BIT
111         help
112           Choose this option to target the RV64I base integer instruction set.
113
114 endchoice
115
116 choice
117         prompt "Code Model"
118         default CMODEL_MEDLOW
119
120 config CMODEL_MEDLOW
121         bool "medium low code model"
122         help
123           U-Boot and its statically defined symbols must lie within a single 2 GiB
124           address range and must lie between absolute addresses -2 GiB and +2 GiB.
125
126 config CMODEL_MEDANY
127         bool "medium any code model"
128         help
129           U-Boot and its statically defined symbols must be within any single 2 GiB
130           address range.
131
132 endchoice
133
134 choice
135         prompt "Run Mode"
136         default RISCV_MMODE
137
138 config RISCV_MMODE
139         bool "Machine"
140         help
141           Choose this option to build U-Boot for RISC-V M-Mode.
142
143 config RISCV_SMODE
144         bool "Supervisor"
145         help
146           Choose this option to build U-Boot for RISC-V S-Mode.
147
148 endchoice
149
150 choice
151         prompt "SPL Run Mode"
152         default SPL_RISCV_MMODE
153         depends on SPL
154
155 config SPL_RISCV_MMODE
156         bool "Machine"
157         help
158           Choose this option to build U-Boot SPL for RISC-V M-Mode.
159
160 config SPL_RISCV_SMODE
161         bool "Supervisor"
162         help
163           Choose this option to build U-Boot SPL for RISC-V S-Mode.
164
165 endchoice
166
167 config RISCV_ISA_C
168         bool "Emit compressed instructions"
169         default y
170         help
171           Adds "C" to the ISA subsets that the toolchain is allowed to emit
172           when building U-Boot, which results in compressed instructions in the
173           U-Boot binary.
174
175 config RISCV_ISA_F
176         bool "Standard extension for Single-Precision Floating Point"
177         default y
178         help
179           Adds "F" to the ISA string passed to the compiler.
180
181 config RISCV_ISA_D
182         bool "Standard extension for Double-Precision Floating Point"
183         depends on RISCV_ISA_F
184         default y
185         help
186           Adds "D" to the ISA string passed to the compiler and changes the
187           riscv32 ABI from ilp32 to ilp32d and the riscv64 ABI from lp64 to
188           lp64d.
189
190 config RISCV_ISA_A
191         def_bool y
192
193 config 32BIT
194         bool
195
196 config 64BIT
197         bool
198
199 config DMA_ADDR_T_64BIT
200         bool
201         default y if 64BIT
202
203 config RISCV_ACLINT
204         bool
205         depends on RISCV_MMODE
206         select REGMAP
207         select SYSCON
208         help
209           The RISC-V ACLINT block holds memory-mapped control and status registers
210           associated with software and timer interrupts.
211
212 config SPL_RISCV_ACLINT
213         bool
214         depends on SPL_RISCV_MMODE
215         select SPL_REGMAP
216         select SPL_SYSCON
217         help
218           The RISC-V ACLINT block holds memory-mapped control and status registers
219           associated with software and timer interrupts.
220
221 config SIFIVE_CACHE
222         bool
223         help
224           This enables the operations to configure SiFive cache
225
226 config ANDES_PLICSW
227         bool
228         depends on RISCV_MMODE || SPL_RISCV_MMODE
229         select REGMAP
230         select SYSCON
231         select SPL_REGMAP if SPL
232         select SPL_SYSCON if SPL
233         help
234           The Andes PLICSW block holds memory-mapped claim and pending
235           registers associated with software interrupt.
236
237 config SMP
238         bool "Symmetric Multi-Processing"
239         depends on SBI_V01 || !RISCV_SMODE
240         help
241           This enables support for systems with more than one CPU. If
242           you say N here, U-Boot will run on single and multiprocessor
243           machines, but will use only one CPU of a multiprocessor
244           machine. If you say Y here, U-Boot will run on many, but not
245           all, single processor machines.
246
247 config SPL_SMP
248         bool "Symmetric Multi-Processing in SPL"
249         depends on SPL && SPL_RISCV_MMODE
250         default y
251         help
252           This enables support for systems with more than one CPU in SPL.
253           If you say N here, U-Boot SPL will run on single and multiprocessor
254           machines, but will use only one CPU of a multiprocessor
255           machine. If you say Y here, U-Boot SPL will run on many, but not
256           all, single processor machines.
257
258 config NR_CPUS
259         int "Maximum number of CPUs (2-32)"
260         range 2 32
261         depends on SMP || SPL_SMP
262         default 8
263         help
264           On multiprocessor machines, U-Boot sets up a stack for each CPU.
265           Stack memory is pre-allocated. U-Boot must therefore know the
266           maximum number of CPUs that may be present.
267
268 config SBI
269         bool
270         default y if RISCV_SMODE || SPL_RISCV_SMODE
271
272 choice
273         prompt "SBI support"
274         default SBI_V02
275
276 config SBI_V01
277         bool "SBI v0.1 support"
278         depends on SBI
279         help
280           This config allows kernel to use SBI v0.1 APIs. This will be
281           deprecated in future once legacy M-mode software are no longer in use.
282
283 config SBI_V02
284         bool "SBI v0.2 or later support"
285         depends on SBI
286         help
287           The SBI specification introduced the concept of extensions in version
288           v0.2. With this configuration option U-Boot can detect and use SBI
289           extensions. With the HSM extension introduced in SBI 0.2, only a
290           single hart needs to boot and enter the operating system. The booting
291           hart can bring up secondary harts one by one afterwards.
292
293           Choose this option if OpenSBI release v0.7 or above is used together
294           with U-Boot.
295
296 endchoice
297
298 config SBI_IPI
299         bool
300         depends on SBI
301         default y if RISCV_SMODE || SPL_RISCV_SMODE
302         depends on SMP
303
304 config XIP
305         bool "XIP mode"
306         help
307           XIP (eXecute In Place) is a method for executing code directly
308           from a NOR flash memory without copying the code to ram.
309           Say yes here if U-Boot boots from flash directly.
310
311 config SPL_XIP
312         bool "Enable XIP mode for SPL"
313         help
314           If SPL starts in read-only memory (XIP for example) then we shouldn't
315           rely on lock variables (for example hart_lottery and available_harts_lock),
316           this affects only SPL, other stages should proceed as non-XIP.
317
318 config AVAILABLE_HARTS
319         bool "Send IPI by available harts"
320         default y
321         help
322           By default, IPI sending mechanism will depend on available_harts.
323           If disable this, it will send IPI by CPUs node numbers of device tree.
324
325 config SHOW_REGS
326         bool "Show registers on unhandled exception"
327
328 config RISCV_PRIV_1_9
329         bool "Use version 1.9 of the RISC-V priviledged specification"
330         help
331           Older versions of the RISC-V priviledged specification had
332           separate counter enable CSRs for each privilege mode. Writing
333           to the unified mcounteren CSR on a processor implementing the
334           old specification will result in an illegal instruction
335           exception. In addition to counter CSR changes, the way virtual
336           memory is configured was also changed.
337
338 config STACK_SIZE_SHIFT
339         int
340         default 14
341
342 config OF_BOARD_FIXUP
343         default y if OF_SEPARATE && RISCV_SMODE
344
345 menu "Use assembly optimized implementation of memory routines"
346
347 config USE_ARCH_MEMCPY
348         bool "Use an assembly optimized implementation of memcpy"
349         default y
350         help
351           Enable the generation of an optimized version of memcpy.
352           Such an implementation may be faster under some conditions
353           but may increase the binary size.
354
355 config SPL_USE_ARCH_MEMCPY
356         bool "Use an assembly optimized implementation of memcpy for SPL"
357         default y if USE_ARCH_MEMCPY
358         depends on SPL
359         help
360           Enable the generation of an optimized version of memcpy.
361           Such an implementation may be faster under some conditions
362           but may increase the binary size.
363
364 config TPL_USE_ARCH_MEMCPY
365         bool "Use an assembly optimized implementation of memcpy for TPL"
366         default y if USE_ARCH_MEMCPY
367         depends on TPL
368         help
369           Enable the generation of an optimized version of memcpy.
370           Such an implementation may be faster under some conditions
371           but may increase the binary size.
372
373 config USE_ARCH_MEMMOVE
374         bool "Use an assembly optimized implementation of memmove"
375         default y
376         help
377           Enable the generation of an optimized version of memmove.
378           Such an implementation may be faster under some conditions
379           but may increase the binary size.
380
381 config SPL_USE_ARCH_MEMMOVE
382         bool "Use an assembly optimized implementation of memmove for SPL"
383         default y if USE_ARCH_MEMCPY
384         depends on SPL
385         help
386           Enable the generation of an optimized version of memmove.
387           Such an implementation may be faster under some conditions
388           but may increase the binary size.
389
390 config TPL_USE_ARCH_MEMMOVE
391         bool "Use an assembly optimized implementation of memmove for TPL"
392         default y if USE_ARCH_MEMCPY
393         depends on TPL
394         help
395           Enable the generation of an optimized version of memmove.
396           Such an implementation may be faster under some conditions
397           but may increase the binary size.
398
399 config USE_ARCH_MEMSET
400         bool "Use an assembly optimized implementation of memset"
401         default y
402         help
403           Enable the generation of an optimized version of memset.
404           Such an implementation may be faster under some conditions
405           but may increase the binary size.
406
407 config SPL_USE_ARCH_MEMSET
408         bool "Use an assembly optimized implementation of memset for SPL"
409         default y if USE_ARCH_MEMSET
410         depends on SPL
411         help
412           Enable the generation of an optimized version of memset.
413           Such an implementation may be faster under some conditions
414           but may increase the binary size.
415
416 config TPL_USE_ARCH_MEMSET
417         bool "Use an assembly optimized implementation of memset for TPL"
418         default y if USE_ARCH_MEMSET
419         depends on TPL
420         help
421           Enable the generation of an optimized version of memset.
422           Such an implementation may be faster under some conditions
423           but may increase the binary size.
424
425 endmenu
426
427 endmenu