blob: 557c4a8c4087dd4518b109298137592f8eeefedc [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001# SPDX-License-Identifier: GPL-2.0-only
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002#
3# For a description of the syntax of this configuration file,
David Brazdil0f672f62019-12-10 10:32:29 +00004# see Documentation/kbuild/kconfig-language.rst.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00005#
6
7config 64BIT
8 bool
9
10config 32BIT
11 bool
12
13config RISCV
14 def_bool y
Olivier Deprez157378f2022-04-04 15:47:50 +020015 select ARCH_CLOCKSOURCE_INIT
16 select ARCH_SUPPORTS_ATOMIC_RMW
David Brazdil0f672f62019-12-10 10:32:29 +000017 select ARCH_HAS_BINFMT_FLAT
Olivier Deprez157378f2022-04-04 15:47:50 +020018 select ARCH_HAS_DEBUG_VM_PGTABLE
19 select ARCH_HAS_DEBUG_VIRTUAL if MMU
20 select ARCH_HAS_DEBUG_WX
21 select ARCH_HAS_GCOV_PROFILE_ALL
22 select ARCH_HAS_GIGANTIC_PAGE
23 select ARCH_HAS_KCOV
24 select ARCH_HAS_MMIOWB
25 select ARCH_HAS_PTE_SPECIAL
26 select ARCH_HAS_SET_DIRECT_MAP
27 select ARCH_HAS_SET_MEMORY
28 select ARCH_HAS_STRICT_KERNEL_RWX if MMU
29 select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
30 select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
31 select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000032 select ARCH_WANT_FRAME_POINTERS
Olivier Deprez157378f2022-04-04 15:47:50 +020033 select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000034 select CLONE_BACKWARDS
Olivier Deprez157378f2022-04-04 15:47:50 +020035 select CLINT_TIMER if !MMU
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000036 select COMMON_CLK
Olivier Deprez157378f2022-04-04 15:47:50 +020037 select EDAC_SUPPORT
Olivier Deprez92d4c212022-12-06 15:05:30 +010038 select GENERIC_ARCH_TOPOLOGY
Olivier Deprez157378f2022-04-04 15:47:50 +020039 select GENERIC_ATOMIC64 if !64BIT
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000040 select GENERIC_CLOCKEVENTS
Olivier Deprez157378f2022-04-04 15:47:50 +020041 select GENERIC_EARLY_IOREMAP
42 select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO
43 select GENERIC_IOREMAP
44 select GENERIC_IRQ_MULTI_HANDLER
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000045 select GENERIC_IRQ_SHOW
46 select GENERIC_PCI_IOMAP
Olivier Deprez157378f2022-04-04 15:47:50 +020047 select GENERIC_PTDUMP if MMU
David Brazdil0f672f62019-12-10 10:32:29 +000048 select GENERIC_SCHED_CLOCK
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000049 select GENERIC_SMP_IDLE_THREAD
Olivier Deprez157378f2022-04-04 15:47:50 +020050 select GENERIC_STRNCPY_FROM_USER if MMU
51 select GENERIC_STRNLEN_USER if MMU
52 select GENERIC_TIME_VSYSCALL if MMU && 64BIT
53 select HANDLE_DOMAIN_IRQ
David Brazdil0f672f62019-12-10 10:32:29 +000054 select HAVE_ARCH_AUDITSYSCALL
Olivier Deprez157378f2022-04-04 15:47:50 +020055 select HAVE_ARCH_JUMP_LABEL
56 select HAVE_ARCH_JUMP_LABEL_RELATIVE
57 select HAVE_ARCH_KASAN if MMU && 64BIT
58 select HAVE_ARCH_KGDB
59 select HAVE_ARCH_KGDB_QXFER_PKT
60 select HAVE_ARCH_MMAP_RND_BITS if MMU
61 select HAVE_ARCH_SECCOMP_FILTER
62 select HAVE_ARCH_TRACEHOOK
David Brazdil0f672f62019-12-10 10:32:29 +000063 select HAVE_ASM_MODVERSIONS
Olivier Deprez157378f2022-04-04 15:47:50 +020064 select HAVE_CONTEXT_TRACKING
65 select HAVE_DEBUG_KMEMLEAK
66 select HAVE_DMA_CONTIGUOUS if MMU
67 select HAVE_EBPF_JIT if MMU
David Brazdil0f672f62019-12-10 10:32:29 +000068 select HAVE_FUTEX_CMPXCHG if FUTEX
Olivier Deprez157378f2022-04-04 15:47:50 +020069 select HAVE_GCC_PLUGINS
70 select HAVE_GENERIC_VDSO if MMU && 64BIT
71 select HAVE_PCI
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000072 select HAVE_PERF_EVENTS
David Brazdil0f672f62019-12-10 10:32:29 +000073 select HAVE_PERF_REGS
74 select HAVE_PERF_USER_STACK_DUMP
Olivier Deprez157378f2022-04-04 15:47:50 +020075 select HAVE_STACKPROTECTOR
David Brazdil0f672f62019-12-10 10:32:29 +000076 select HAVE_SYSCALL_TRACEPOINTS
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000077 select IRQ_DOMAIN
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000078 select MODULES_USE_ELF_RELA if MODULES
David Brazdil0f672f62019-12-10 10:32:29 +000079 select MODULE_SECTIONS if MODULES
Olivier Deprez157378f2022-04-04 15:47:50 +020080 select OF
81 select OF_EARLY_FLATTREE
82 select OF_IRQ
David Brazdil0f672f62019-12-10 10:32:29 +000083 select PCI_DOMAINS_GENERIC if PCI
84 select PCI_MSI if PCI
Olivier Deprez157378f2022-04-04 15:47:50 +020085 select RISCV_INTC
86 select RISCV_TIMER if RISCV_SBI
87 select SPARSE_IRQ
88 select SYSCTL_EXCEPTION_TRACE
89 select THREAD_INFO_IN_TASK
90 select UACCESS_MEMCPY if !MMU
David Brazdil0f672f62019-12-10 10:32:29 +000091
92config ARCH_MMAP_RND_BITS_MIN
93 default 18 if 64BIT
94 default 8
95
96# max bits determined by the following formula:
97# VA_BITS - PAGE_SHIFT - 3
98config ARCH_MMAP_RND_BITS_MAX
99 default 24 if 64BIT # SV39 based
100 default 17
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000101
Olivier Deprez157378f2022-04-04 15:47:50 +0200102# set if we run in machine mode, cleared if we run in supervisor mode
103config RISCV_M_MODE
104 bool
105 default !MMU
106
107# set if we are running in S-mode and can use SBI calls
108config RISCV_SBI
109 bool
110 depends on !RISCV_M_MODE
111 default y
112
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000113config MMU
Olivier Deprez157378f2022-04-04 15:47:50 +0200114 bool "MMU-based Paged Memory Management Support"
115 default y
116 help
117 Select if you want MMU-based virtualised addressing space
118 support by paged memory management. If unsure, say 'Y'.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000119
120config ZONE_DMA32
121 bool
122 default y if 64BIT
123
David Brazdil0f672f62019-12-10 10:32:29 +0000124config VA_BITS
125 int
126 default 32 if 32BIT
127 default 39 if 64BIT
128
129config PA_BITS
130 int
131 default 34 if 32BIT
132 default 56 if 64BIT
133
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000134config PAGE_OFFSET
135 hex
Olivier Deprez157378f2022-04-04 15:47:50 +0200136 default 0xC0000000 if 32BIT && MAXPHYSMEM_1GB
137 default 0x80000000 if 64BIT && !MMU
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000138 default 0xffffffff80000000 if 64BIT && MAXPHYSMEM_2GB
139 default 0xffffffe000000000 if 64BIT && MAXPHYSMEM_128GB
140
Olivier Deprez157378f2022-04-04 15:47:50 +0200141config KASAN_SHADOW_OFFSET
142 hex
143 depends on KASAN_GENERIC
144 default 0xdfffffc800000000 if 64BIT
145 default 0xffffffff if 32BIT
146
David Brazdil0f672f62019-12-10 10:32:29 +0000147config ARCH_FLATMEM_ENABLE
148 def_bool y
149
150config ARCH_SPARSEMEM_ENABLE
151 def_bool y
Olivier Deprez0e641232021-09-23 10:07:05 +0200152 depends on MMU
153 select SPARSEMEM_STATIC if 32BIT && SPARSEMEM
154 select SPARSEMEM_VMEMMAP_ENABLE if 64BIT
David Brazdil0f672f62019-12-10 10:32:29 +0000155
156config ARCH_SELECT_MEMORY_MODEL
157 def_bool ARCH_SPARSEMEM_ENABLE
158
159config ARCH_WANT_GENERAL_HUGETLB
160 def_bool y
161
Olivier Deprez157378f2022-04-04 15:47:50 +0200162config ARCH_SUPPORTS_DEBUG_PAGEALLOC
163 def_bool y
164
David Brazdil0f672f62019-12-10 10:32:29 +0000165config SYS_SUPPORTS_HUGETLBFS
Olivier Deprez157378f2022-04-04 15:47:50 +0200166 depends on MMU
David Brazdil0f672f62019-12-10 10:32:29 +0000167 def_bool y
168
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000169config STACKTRACE_SUPPORT
170 def_bool y
171
172config TRACE_IRQFLAGS_SUPPORT
173 def_bool y
174
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000175config GENERIC_BUG
176 def_bool y
177 depends on BUG
178 select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
179
180config GENERIC_BUG_RELATIVE_POINTERS
181 bool
182
183config GENERIC_CALIBRATE_DELAY
184 def_bool y
185
186config GENERIC_CSUM
187 def_bool y
188
189config GENERIC_HWEIGHT
190 def_bool y
191
David Brazdil0f672f62019-12-10 10:32:29 +0000192config FIX_EARLYCON_MEM
Olivier Deprez157378f2022-04-04 15:47:50 +0200193 def_bool MMU
David Brazdil0f672f62019-12-10 10:32:29 +0000194
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000195config PGTABLE_LEVELS
196 int
197 default 3 if 64BIT
198 default 2
199
Olivier Deprez157378f2022-04-04 15:47:50 +0200200config LOCKDEP_SUPPORT
201 def_bool y
202
David Brazdil0f672f62019-12-10 10:32:29 +0000203source "arch/riscv/Kconfig.socs"
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000204
205menu "Platform type"
206
207choice
208 prompt "Base ISA"
209 default ARCH_RV64I
210 help
David Brazdil0f672f62019-12-10 10:32:29 +0000211 This selects the base ISA that this kernel will target and must match
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000212 the target platform.
213
214config ARCH_RV32I
215 bool "RV32I"
216 select 32BIT
217 select GENERIC_LIB_ASHLDI3
218 select GENERIC_LIB_ASHRDI3
219 select GENERIC_LIB_LSHRDI3
220 select GENERIC_LIB_UCMPDI2
Olivier Deprez157378f2022-04-04 15:47:50 +0200221 select MMU
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000222
223config ARCH_RV64I
224 bool "RV64I"
225 select 64BIT
Olivier Deprez157378f2022-04-04 15:47:50 +0200226 select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && GCC_VERSION >= 50000
227 select HAVE_DYNAMIC_FTRACE if MMU
228 select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000229 select HAVE_FTRACE_MCOUNT_RECORD
Olivier Deprez157378f2022-04-04 15:47:50 +0200230 select HAVE_FUNCTION_GRAPH_TRACER
231 select HAVE_FUNCTION_TRACER
232 select SWIOTLB if MMU
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000233
234endchoice
235
236# We must be able to map all physical memory into the kernel, but the compiler
237# is still a bit more efficient when generating code if it's setup in a manner
238# such that it can only map 2GiB of memory.
239choice
240 prompt "Kernel Code Model"
241 default CMODEL_MEDLOW if 32BIT
242 default CMODEL_MEDANY if 64BIT
243
244 config CMODEL_MEDLOW
245 bool "medium low code model"
246 config CMODEL_MEDANY
247 bool "medium any code model"
248endchoice
249
250config MODULE_SECTIONS
251 bool
252 select HAVE_MOD_ARCH_SPECIFIC
253
254choice
255 prompt "Maximum Physical Memory"
Olivier Deprez157378f2022-04-04 15:47:50 +0200256 default MAXPHYSMEM_1GB if 32BIT
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000257 default MAXPHYSMEM_2GB if 64BIT && CMODEL_MEDLOW
258 default MAXPHYSMEM_128GB if 64BIT && CMODEL_MEDANY
259
Olivier Deprez157378f2022-04-04 15:47:50 +0200260 config MAXPHYSMEM_1GB
261 depends on 32BIT
262 bool "1GiB"
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000263 config MAXPHYSMEM_2GB
Olivier Deprez157378f2022-04-04 15:47:50 +0200264 depends on 64BIT && CMODEL_MEDLOW
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000265 bool "2GiB"
266 config MAXPHYSMEM_128GB
267 depends on 64BIT && CMODEL_MEDANY
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000268 bool "128GiB"
269endchoice
270
271
272config SMP
273 bool "Symmetric Multi-Processing"
274 help
275 This enables support for systems with more than one CPU. If
276 you say N here, the kernel will run on single and
277 multiprocessor machines, but will use only one CPU of a
278 multiprocessor machine. If you say Y here, the kernel will run
279 on many, but not all, single processor machines. On a single
280 processor machine, the kernel will run faster if you say N
281 here.
282
283 If you don't know what to do here, say N.
284
285config NR_CPUS
286 int "Maximum number of CPUs (2-32)"
287 range 2 32
288 depends on SMP
289 default "8"
290
Olivier Deprez157378f2022-04-04 15:47:50 +0200291config HOTPLUG_CPU
292 bool "Support for hot-pluggable CPUs"
293 depends on SMP
294 select GENERIC_IRQ_MIGRATION
295 help
296
297 Say Y here to experiment with turning CPUs off and on. CPUs
298 can be controlled through /sys/devices/system/cpu.
299
300 Say N if you want to disable CPU hotplug.
301
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000302choice
303 prompt "CPU Tuning"
304 default TUNE_GENERIC
305
306config TUNE_GENERIC
307 bool "generic"
308
309endchoice
310
311config RISCV_ISA_C
312 bool "Emit compressed instructions when building Linux"
313 default y
314 help
315 Adds "C" to the ISA subsets that the toolchain is allowed to emit
316 when building Linux, which results in compressed instructions in the
317 Linux binary.
318
319 If you don't know what to do here, say Y.
320
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000321menu "supported PMU type"
322 depends on PERF_EVENTS
323
324config RISCV_BASE_PMU
325 bool "Base Performance Monitoring Unit"
326 def_bool y
327 help
328 A base PMU that serves as a reference implementation and has limited
329 feature of perf. It can run on any RISC-V machines so serves as the
330 fallback, but this option can also be disable to reduce kernel size.
331
332endmenu
333
David Brazdil0f672f62019-12-10 10:32:29 +0000334config FPU
335 bool "FPU support"
336 default y
337 help
338 Say N here if you want to disable all floating-point related procedure
339 in the kernel.
340
341 If you don't know what to do here, say Y.
342
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000343endmenu
344
David Brazdil0f672f62019-12-10 10:32:29 +0000345menu "Kernel features"
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000346
347source "kernel/Kconfig.hz"
348
Olivier Deprez157378f2022-04-04 15:47:50 +0200349config RISCV_SBI_V01
350 bool "SBI v0.1 support"
351 default y
352 depends on RISCV_SBI
353 help
354 This config allows kernel to use SBI v0.1 APIs. This will be
355 deprecated in future once legacy M-mode software are no longer in use.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000356endmenu
357
David Brazdil0f672f62019-12-10 10:32:29 +0000358menu "Boot options"
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000359
David Brazdil0f672f62019-12-10 10:32:29 +0000360config CMDLINE
361 string "Built-in kernel command line"
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000362 help
David Brazdil0f672f62019-12-10 10:32:29 +0000363 For most platforms, the arguments for the kernel's command line
364 are provided at run-time, during boot. However, there are cases
365 where either no arguments are being provided or the provided
366 arguments are insufficient or even invalid.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000367
David Brazdil0f672f62019-12-10 10:32:29 +0000368 When that occurs, it is possible to define a built-in command
369 line here and choose how the kernel should use it later on.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000370
David Brazdil0f672f62019-12-10 10:32:29 +0000371choice
372 prompt "Built-in command line usage" if CMDLINE != ""
373 default CMDLINE_FALLBACK
374 help
375 Choose how the kernel will handle the provided built-in command
376 line.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000377
David Brazdil0f672f62019-12-10 10:32:29 +0000378config CMDLINE_FALLBACK
379 bool "Use bootloader kernel arguments if available"
380 help
381 Use the built-in command line as fallback in case we get nothing
382 during boot. This is the default behaviour.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000383
David Brazdil0f672f62019-12-10 10:32:29 +0000384config CMDLINE_EXTEND
385 bool "Extend bootloader kernel arguments"
386 help
387 The command-line arguments provided during boot will be
388 appended to the built-in command line. This is useful in
389 cases where the provided arguments are insufficient and
390 you don't want to or cannot modify them.
391
392
393config CMDLINE_FORCE
394 bool "Always use the default kernel command string"
395 help
396 Always use the built-in command line, even if we get one during
397 boot. This is useful in case you need to override the provided
398 command line on systems where you don't have or want control
399 over it.
400
401endchoice
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000402
Olivier Deprez157378f2022-04-04 15:47:50 +0200403config EFI_STUB
404 bool
405
406config EFI
407 bool "UEFI runtime support"
408 depends on OF
409 select LIBFDT
410 select UCS2_STRING
411 select EFI_PARAMS_FROM_FDT
412 select EFI_STUB
413 select EFI_GENERIC_STUB
414 select EFI_RUNTIME_WRAPPERS
415 select RISCV_ISA_C
416 depends on MMU
417 default y
418 help
419 This option provides support for runtime services provided
420 by UEFI firmware (such as non-volatile variables, realtime
421 clock, and platform reset). A UEFI stub is also provided to
422 allow the kernel to be booted as an EFI application. This
423 is only useful on systems that have UEFI firmware.
424
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000425endmenu
426
Olivier Deprez157378f2022-04-04 15:47:50 +0200427config BUILTIN_DTB
428 def_bool n
429 depends on RISCV_M_MODE
430 depends on OF
431
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000432menu "Power management options"
433
David Brazdil0f672f62019-12-10 10:32:29 +0000434source "kernel/power/Kconfig"
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000435
436endmenu
Olivier Deprez157378f2022-04-04 15:47:50 +0200437
438source "drivers/firmware/Kconfig"