]> git.ipfire.org Git - thirdparty/linux.git/blame - arch/riscv/Kconfig
Merge tag 'io_uring-5.7-2020-05-22' of git://git.kernel.dk/linux-block
[thirdparty/linux.git] / arch / riscv / Kconfig
CommitLineData
ec8f24b7 1# SPDX-License-Identifier: GPL-2.0-only
fbe934d6
PD
2#
3# For a description of the syntax of this configuration file,
cd238eff 4# see Documentation/kbuild/kconfig-language.rst.
fbe934d6
PD
5#
6
c3e4ed01
CH
7config 64BIT
8 bool
9
10config 32BIT
11 bool
12
fbe934d6
PD
13config RISCV
14 def_bool y
15 select OF
16 select OF_EARLY_FLATTREE
17 select OF_IRQ
ad97f9df 18 select ARCH_HAS_BINFMT_FLAT
fbe934d6
PD
19 select ARCH_WANT_FRAME_POINTERS
20 select CLONE_BACKWARDS
21 select COMMON_CLK
22 select GENERIC_CLOCKEVENTS
fbe934d6
PD
23 select GENERIC_IRQ_SHOW
24 select GENERIC_PCI_IOMAP
9b9afe4a 25 select GENERIC_SCHED_CLOCK
6bd33e1e
CH
26 select GENERIC_STRNCPY_FROM_USER if MMU
27 select GENERIC_STRNLEN_USER if MMU
fbe934d6 28 select GENERIC_SMP_IDLE_THREAD
09afac77 29 select GENERIC_ATOMIC64 if !64BIT
38af5782 30 select GENERIC_IOREMAP
59c4da86 31 select GENERIC_PTDUMP if MMU
efe75c49 32 select HAVE_ARCH_AUDITSYSCALL
5340627e 33 select HAVE_ARCH_SECCOMP_FILTER
2ff2b7ec 34 select HAVE_ASM_MODVERSIONS
5ec9c4ff 35 select HAVE_MEMBLOCK_NODE_MAP
6bd33e1e 36 select HAVE_DMA_CONTIGUOUS if MMU
b90edb33 37 select HAVE_FUTEX_CMPXCHG if FUTEX
178e9fc4 38 select HAVE_PERF_EVENTS
98a93b0b
MH
39 select HAVE_PERF_REGS
40 select HAVE_PERF_USER_STACK_DUMP
5aeb1b36 41 select HAVE_SYSCALL_TRACEPOINTS
fbe934d6 42 select IRQ_DOMAIN
fbe934d6
PD
43 select SPARSE_IRQ
44 select SYSCTL_EXCEPTION_TRACE
45 select HAVE_ARCH_TRACEHOOK
eb01d42a 46 select HAVE_PCI
fbe934d6 47 select MODULES_USE_ELF_RELA if MODULES
2cffc956 48 select MODULE_SECTIONS if MODULES
fbe934d6 49 select THREAD_INFO_IN_TASK
2eac9c2d 50 select PCI_DOMAINS_GENERIC if PCI
eb01d42a 51 select PCI_MSI if PCI
fbe934d6 52 select RISCV_TIMER
cc6c9848 53 select GENERIC_IRQ_MULTI_HANDLER
03f11f03 54 select GENERIC_ARCH_TOPOLOGY if SMP
3010a5ea 55 select ARCH_HAS_PTE_SPECIAL
b012980d 56 select ARCH_HAS_MMIOWB
21e24140 57 select ARCH_HAS_DEBUG_VIRTUAL if MMU
93bbb255 58 select HAVE_EBPF_JIT if MMU
91abaeaa 59 select EDAC_SUPPORT
9e953cda 60 select ARCH_HAS_GIGANTIC_PAGE
395a21ff 61 select ARCH_HAS_SET_DIRECT_MAP
d3ab332a 62 select ARCH_HAS_SET_MEMORY
a5fe13c7 63 select ARCH_HAS_STRICT_KERNEL_RWX if MMU
9e953cda 64 select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
d95f1a54 65 select SPARSEMEM_STATIC if 32BIT
54c95a11 66 select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
6bd33e1e 67 select HAVE_ARCH_MMAP_RND_BITS if MMU
0da310e8 68 select ARCH_HAS_GCOV_PROFILE_ALL
20bda4ed 69 select HAVE_COPY_THREAD_TLS
8ad8b727 70 select HAVE_ARCH_KASAN if MMU && 64BIT
54c95a11
AG
71
72config ARCH_MMAP_RND_BITS_MIN
73 default 18 if 64BIT
74 default 8
75
76# max bits determined by the following formula:
77# VA_BITS - PAGE_SHIFT - 3
78config ARCH_MMAP_RND_BITS_MAX
79 default 24 if 64BIT # SV39 based
80 default 17
fbe934d6 81
a4c3733d
CH
82# set if we run in machine mode, cleared if we run in supervisor mode
83config RISCV_M_MODE
84 bool
6bd33e1e 85 default !MMU
a4c3733d 86
eded8bc6
DLM
87# set if we are running in S-mode and can use SBI calls
88config RISCV_SBI
89 bool
90 depends on !RISCV_M_MODE
91 default y
92
fbe934d6 93config MMU
6bd33e1e
CH
94 bool "MMU-based Paged Memory Management Support"
95 default y
96 help
97 Select if you want MMU-based virtualised addressing space
98 support by paged memory management. If unsure, say 'Y'.
fbe934d6 99
5ec9c4ff
CH
100config ZONE_DMA32
101 bool
f1306f04 102 default y if 64BIT
5ec9c4ff 103
d95f1a54
LG
104config VA_BITS
105 int
106 default 32 if 32BIT
107 default 39 if 64BIT
108
109config PA_BITS
110 int
111 default 34 if 32BIT
112 default 56 if 64BIT
113
fbe934d6
PD
114config PAGE_OFFSET
115 hex
116 default 0xC0000000 if 32BIT && MAXPHYSMEM_2GB
6bd33e1e 117 default 0x80000000 if 64BIT && !MMU
fbe934d6
PD
118 default 0xffffffff80000000 if 64BIT && MAXPHYSMEM_2GB
119 default 0xffffffe000000000 if 64BIT && MAXPHYSMEM_128GB
120
d95f1a54
LG
121config ARCH_FLATMEM_ENABLE
122 def_bool y
123
124config ARCH_SPARSEMEM_ENABLE
125 def_bool y
aa273420 126 depends on MMU
d95f1a54
LG
127 select SPARSEMEM_VMEMMAP_ENABLE
128
129config ARCH_SELECT_MEMORY_MODEL
130 def_bool ARCH_SPARSEMEM_ENABLE
131
9e953cda
AG
132config ARCH_WANT_GENERAL_HUGETLB
133 def_bool y
134
5fde3db5
ZL
135config ARCH_SUPPORTS_DEBUG_PAGEALLOC
136 def_bool y
137
9e953cda 138config SYS_SUPPORTS_HUGETLBFS
69868418 139 depends on MMU
9e953cda
AG
140 def_bool y
141
fbe934d6
PD
142config STACKTRACE_SUPPORT
143 def_bool y
144
10626c32
AK
145config TRACE_IRQFLAGS_SUPPORT
146 def_bool y
147
fbe934d6
PD
148config GENERIC_BUG
149 def_bool y
150 depends on BUG
151 select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
152
153config GENERIC_BUG_RELATIVE_POINTERS
154 bool
155
156config GENERIC_CALIBRATE_DELAY
157 def_bool y
158
159config GENERIC_CSUM
160 def_bool y
161
162config GENERIC_HWEIGHT
163 def_bool y
164
f2c17aab 165config FIX_EARLYCON_MEM
0312a3d4 166 def_bool MMU
f2c17aab 167
fbe934d6
PD
168config PGTABLE_LEVELS
169 int
170 default 3 if 64BIT
171 default 2
172
0cbb8a32
LO
173source "arch/riscv/Kconfig.socs"
174
fbe934d6
PD
175menu "Platform type"
176
177choice
178 prompt "Base ISA"
179 default ARCH_RV64I
180 help
86cca81a 181 This selects the base ISA that this kernel will target and must match
fbe934d6
PD
182 the target platform.
183
184config ARCH_RV32I
185 bool "RV32I"
fbe934d6 186 select 32BIT
e3d59805
MR
187 select GENERIC_LIB_ASHLDI3
188 select GENERIC_LIB_ASHRDI3
189 select GENERIC_LIB_LSHRDI3
8f79125d 190 select GENERIC_LIB_UCMPDI2
6bd33e1e 191 select MMU
fbe934d6
PD
192
193config ARCH_RV64I
194 bool "RV64I"
fbe934d6 195 select 64BIT
c12d3362 196 select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && GCC_VERSION >= 50000
10626c32
AK
197 select HAVE_FUNCTION_TRACER
198 select HAVE_FUNCTION_GRAPH_TRACER
a1d2a6b4 199 select HAVE_FTRACE_MCOUNT_RECORD
6bd33e1e
CH
200 select HAVE_DYNAMIC_FTRACE if MMU
201 select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
202 select SWIOTLB if MMU
fbe934d6
PD
203
204endchoice
205
206# We must be able to map all physical memory into the kernel, but the compiler
207# is still a bit more efficient when generating code if it's setup in a manner
208# such that it can only map 2GiB of memory.
209choice
210 prompt "Kernel Code Model"
211 default CMODEL_MEDLOW if 32BIT
212 default CMODEL_MEDANY if 64BIT
213
214 config CMODEL_MEDLOW
215 bool "medium low code model"
216 config CMODEL_MEDANY
217 bool "medium any code model"
218endchoice
219
ab1ef68e
ZL
220config MODULE_SECTIONS
221 bool
222 select HAVE_MOD_ARCH_SPECIFIC
223
fbe934d6
PD
224choice
225 prompt "Maximum Physical Memory"
226 default MAXPHYSMEM_2GB if 32BIT
227 default MAXPHYSMEM_2GB if 64BIT && CMODEL_MEDLOW
228 default MAXPHYSMEM_128GB if 64BIT && CMODEL_MEDANY
229
230 config MAXPHYSMEM_2GB
231 bool "2GiB"
232 config MAXPHYSMEM_128GB
233 depends on 64BIT && CMODEL_MEDANY
234 bool "128GiB"
235endchoice
236
237
238config SMP
239 bool "Symmetric Multi-Processing"
240 help
241 This enables support for systems with more than one CPU. If
242 you say N here, the kernel will run on single and
243 multiprocessor machines, but will use only one CPU of a
244 multiprocessor machine. If you say Y here, the kernel will run
245 on many, but not all, single processor machines. On a single
246 processor machine, the kernel will run faster if you say N
247 here.
248
249 If you don't know what to do here, say N.
250
251config NR_CPUS
252 int "Maximum number of CPUs (2-32)"
253 range 2 32
254 depends on SMP
255 default "8"
256
f1e58583
AP
257config HOTPLUG_CPU
258 bool "Support for hot-pluggable CPUs"
259 depends on SMP
260 select GENERIC_IRQ_MIGRATION
261 help
262
263 Say Y here to experiment with turning CPUs off and on. CPUs
264 can be controlled through /sys/devices/system/cpu.
265
266 Say N if you want to disable CPU hotplug.
267
fbe934d6
PD
268choice
269 prompt "CPU Tuning"
270 default TUNE_GENERIC
271
272config TUNE_GENERIC
273 bool "generic"
274
275endchoice
276
277config RISCV_ISA_C
278 bool "Emit compressed instructions when building Linux"
279 default y
280 help
281 Adds "C" to the ISA subsets that the toolchain is allowed to emit
282 when building Linux, which results in compressed instructions in the
283 Linux binary.
284
285 If you don't know what to do here, say Y.
286
178e9fc4
AK
287menu "supported PMU type"
288 depends on PERF_EVENTS
289
290config RISCV_BASE_PMU
291 bool "Base Performance Monitoring Unit"
292 def_bool y
293 help
294 A base PMU that serves as a reference implementation and has limited
295 feature of perf. It can run on any RISC-V machines so serves as the
296 fallback, but this option can also be disable to reduce kernel size.
297
298endmenu
299
9671f706
AK
300config FPU
301 bool "FPU support"
302 default y
303 help
304 Say N here if you want to disable all floating-point related procedure
305 in the kernel.
306
307 If you don't know what to do here, say Y.
308
fbe934d6
PD
309endmenu
310
aef53f97 311menu "Kernel features"
fbe934d6 312
fbe934d6
PD
313source "kernel/Kconfig.hz"
314
5340627e
DA
315config SECCOMP
316 bool "Enable seccomp to safely compute untrusted bytecode"
317 help
318 This kernel feature is useful for number crunching applications
319 that may need to compute untrusted bytecode during their
320 execution. By using pipes or other transports made available to
321 the process as file descriptors supporting the read/write
322 syscalls, it's possible to isolate those applications in
323 their own address space using seccomp. Once seccomp is
324 enabled via prctl(PR_SET_SECCOMP), it cannot be disabled
325 and the task is only allowed to execute a few safe syscalls
326 defined by each seccomp mode.
327
efca1398
AP
328config RISCV_SBI_V01
329 bool "SBI v0.1 support"
330 default y
331 depends on RISCV_SBI
332 help
333 This config allows kernel to use SBI v0.1 APIs. This will be
334 deprecated in future once legacy M-mode software are no longer in use.
fbe934d6
PD
335endmenu
336
aef53f97
NK
337menu "Boot options"
338
3aed8c43
NK
339config CMDLINE
340 string "Built-in kernel command line"
aef53f97 341 help
3aed8c43
NK
342 For most platforms, the arguments for the kernel's command line
343 are provided at run-time, during boot. However, there are cases
344 where either no arguments are being provided or the provided
345 arguments are insufficient or even invalid.
aef53f97 346
3aed8c43
NK
347 When that occurs, it is possible to define a built-in command
348 line here and choose how the kernel should use it later on.
aef53f97 349
3aed8c43
NK
350choice
351 prompt "Built-in command line usage" if CMDLINE != ""
352 default CMDLINE_FALLBACK
353 help
354 Choose how the kernel will handle the provided built-in command
355 line.
aef53f97 356
3aed8c43
NK
357config CMDLINE_FALLBACK
358 bool "Use bootloader kernel arguments if available"
aef53f97 359 help
3aed8c43
NK
360 Use the built-in command line as fallback in case we get nothing
361 during boot. This is the default behaviour.
362
363config CMDLINE_EXTEND
364 bool "Extend bootloader kernel arguments"
365 help
366 The command-line arguments provided during boot will be
367 appended to the built-in command line. This is useful in
368 cases where the provided arguments are insufficient and
369 you don't want to or cannot modify them.
370
aef53f97
NK
371
372config CMDLINE_FORCE
3aed8c43 373 bool "Always use the default kernel command string"
aef53f97 374 help
3aed8c43
NK
375 Always use the built-in command line, even if we get one during
376 boot. This is useful in case you need to override the provided
377 command line on systems where you don't have or want control
378 over it.
aef53f97 379
3aed8c43 380endchoice
aef53f97
NK
381
382endmenu
383
fbe934d6
PD
384menu "Power management options"
385
8636a1f9 386source "kernel/power/Kconfig"
fbe934d6
PD
387
388endmenu