blob: d8efbaa78d67602bf46ff73a89cdd33f2381dd16 [file] [log] [blame]
Thomas Gleixnerec8f24b2019-05-19 13:07:45 +01001# SPDX-License-Identifier: GPL-2.0-only
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -07002#
3# For a description of the syntax of this configuration file,
Mauro Carvalho Chehabcd238ef2019-06-12 14:52:48 -03004# see Documentation/kbuild/kconfig-language.rst.
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -07005#
6
Christoph Hellwigc3e4ed02018-04-27 08:38:23 +02007config 64BIT
8 bool
9
10config 32BIT
11 bool
12
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070013config RISCV
14 def_bool y
Christoph Hellwigd4a451d2018-04-03 16:24:20 +020015 # even on 32-bit, physical (and DMA) addresses are > 32-bits
16 select PHYS_ADDR_T_64BIT
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070017 select OF
18 select OF_EARLY_FLATTREE
19 select OF_IRQ
Christoph Hellwigad97f9d2019-06-13 09:09:03 +020020 select ARCH_HAS_BINFMT_FLAT
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070021 select ARCH_WANT_FRAME_POINTERS
22 select CLONE_BACKWARDS
23 select COMMON_CLK
24 select GENERIC_CLOCKEVENTS
25 select GENERIC_CPU_DEVICES
26 select GENERIC_IRQ_SHOW
27 select GENERIC_PCI_IOMAP
Anup Patel9b9afe42018-12-04 15:59:51 +053028 select GENERIC_SCHED_CLOCK
Christoph Hellwig6bd33e12019-10-28 13:10:41 +010029 select GENERIC_STRNCPY_FROM_USER if MMU
30 select GENERIC_STRNLEN_USER if MMU
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070031 select GENERIC_SMP_IDLE_THREAD
Christoph Hellwig09afac72019-04-15 11:14:35 +020032 select GENERIC_ATOMIC64 if !64BIT
Christoph Hellwig38af5782019-08-13 11:27:56 +020033 select GENERIC_IOREMAP
David Abdurachmanovefe75c42018-10-29 11:48:53 +010034 select HAVE_ARCH_AUDITSYSCALL
David Abdurachmanov53406272019-10-04 17:12:22 -070035 select HAVE_ARCH_SECCOMP_FILTER
Masahiro Yamada2ff2b7e2019-08-19 14:54:20 +090036 select HAVE_ASM_MODVERSIONS
Christoph Hellwig5ec9c4f2018-01-16 09:37:50 +010037 select HAVE_MEMBLOCK_NODE_MAP
Christoph Hellwig6bd33e12019-10-28 13:10:41 +010038 select HAVE_DMA_CONTIGUOUS if MMU
Jim Wilsonb90edb32018-10-16 14:42:59 -070039 select HAVE_FUTEX_CMPXCHG if FUTEX
Alan Kao178e9fc2018-04-20 07:27:49 +080040 select HAVE_PERF_EVENTS
Mao Han98a93b02019-09-05 11:46:35 +080041 select HAVE_PERF_REGS
42 select HAVE_PERF_USER_STACK_DUMP
David Abdurachmanov5aeb1b32018-12-06 16:26:35 +010043 select HAVE_SYSCALL_TRACEPOINTS
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070044 select IRQ_DOMAIN
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070045 select SPARSE_IRQ
46 select SYSCTL_EXCEPTION_TRACE
47 select HAVE_ARCH_TRACEHOOK
Christoph Hellwigeb01d422018-11-15 20:05:32 +010048 select HAVE_PCI
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070049 select MODULES_USE_ELF_RELA if MODULES
Zong Li2cffc952018-12-07 17:02:16 +080050 select MODULE_SECTIONS if MODULES
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070051 select THREAD_INFO_IN_TASK
Christoph Hellwig2eac9c22018-11-15 20:05:33 +010052 select PCI_DOMAINS_GENERIC if PCI
Christoph Hellwigeb01d422018-11-15 20:05:32 +010053 select PCI_MSI if PCI
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070054 select RISCV_TIMER
Christoph Hellwig6bd33e12019-10-28 13:10:41 +010055 select UACCESS_MEMCPY if !MMU
Palmer Dabbeltcc6c9842018-03-07 15:57:28 -080056 select GENERIC_IRQ_MULTI_HANDLER
Atish Patra03f11f02019-06-27 12:53:00 -070057 select GENERIC_ARCH_TOPOLOGY if SMP
Laurent Dufour3010a5e2018-06-07 17:06:08 -070058 select ARCH_HAS_PTE_SPECIAL
Will Deaconb0129802019-02-22 14:45:42 +000059 select ARCH_HAS_MMIOWB
Björn Töpel2353ecc2019-02-05 13:41:22 +010060 select HAVE_EBPF_JIT if 64BIT
Yash Shah91abaea2019-05-06 16:57:06 +053061 select EDAC_SUPPORT
Alexandre Ghiti9e953cd2019-05-26 08:50:38 -040062 select ARCH_HAS_GIGANTIC_PAGE
63 select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
Logan Gunthorped95f1a52019-08-28 15:40:54 -060064 select SPARSEMEM_STATIC if 32BIT
Alexandre Ghiti54c95a12019-09-23 15:39:21 -070065 select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
Christoph Hellwig6bd33e12019-10-28 13:10:41 +010066 select HAVE_ARCH_MMAP_RND_BITS if MMU
Alexandre Ghiti54c95a12019-09-23 15:39:21 -070067
68config ARCH_MMAP_RND_BITS_MIN
69 default 18 if 64BIT
70 default 8
71
72# max bits determined by the following formula:
73# VA_BITS - PAGE_SHIFT - 3
74config ARCH_MMAP_RND_BITS_MAX
75 default 24 if 64BIT # SV39 based
76 default 17
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070077
Christoph Hellwiga4c37332019-10-28 13:10:32 +010078# set if we run in machine mode, cleared if we run in supervisor mode
79config RISCV_M_MODE
80 bool
Christoph Hellwig6bd33e12019-10-28 13:10:41 +010081 default !MMU
Christoph Hellwiga4c37332019-10-28 13:10:32 +010082
Damien Le Moaleded8bc2019-10-28 13:10:33 +010083# set if we are running in S-mode and can use SBI calls
84config RISCV_SBI
85 bool
86 depends on !RISCV_M_MODE
87 default y
88
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070089config MMU
Christoph Hellwig6bd33e12019-10-28 13:10:41 +010090 bool "MMU-based Paged Memory Management Support"
91 default y
92 help
93 Select if you want MMU-based virtualised addressing space
94 support by paged memory management. If unsure, say 'Y'.
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070095
Christoph Hellwig5ec9c4f2018-01-16 09:37:50 +010096config ZONE_DMA32
97 bool
Christoph Hellwigf1306f02018-04-27 08:41:09 +020098 default y if 64BIT
Christoph Hellwig5ec9c4f2018-01-16 09:37:50 +010099
Logan Gunthorped95f1a52019-08-28 15:40:54 -0600100config VA_BITS
101 int
102 default 32 if 32BIT
103 default 39 if 64BIT
104
105config PA_BITS
106 int
107 default 34 if 32BIT
108 default 56 if 64BIT
109
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700110config PAGE_OFFSET
111 hex
112 default 0xC0000000 if 32BIT && MAXPHYSMEM_2GB
Christoph Hellwig6bd33e12019-10-28 13:10:41 +0100113 default 0x80000000 if 64BIT && !MMU
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700114 default 0xffffffff80000000 if 64BIT && MAXPHYSMEM_2GB
115 default 0xffffffe000000000 if 64BIT && MAXPHYSMEM_128GB
116
Logan Gunthorped95f1a52019-08-28 15:40:54 -0600117config ARCH_FLATMEM_ENABLE
118 def_bool y
119
120config ARCH_SPARSEMEM_ENABLE
121 def_bool y
122 select SPARSEMEM_VMEMMAP_ENABLE
123
124config ARCH_SELECT_MEMORY_MODEL
125 def_bool ARCH_SPARSEMEM_ENABLE
126
Alexandre Ghiti9e953cd2019-05-26 08:50:38 -0400127config ARCH_WANT_GENERAL_HUGETLB
128 def_bool y
129
130config SYS_SUPPORTS_HUGETLBFS
131 def_bool y
132
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700133config STACKTRACE_SUPPORT
134 def_bool y
135
Alan Kao10626c32017-12-18 17:52:48 +0800136config TRACE_IRQFLAGS_SUPPORT
137 def_bool y
138
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700139config GENERIC_BUG
140 def_bool y
141 depends on BUG
142 select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
143
144config GENERIC_BUG_RELATIVE_POINTERS
145 bool
146
147config GENERIC_CALIBRATE_DELAY
148 def_bool y
149
150config GENERIC_CSUM
151 def_bool y
152
153config GENERIC_HWEIGHT
154 def_bool y
155
Anup Patelf2c17aa2019-01-07 20:57:01 +0530156config FIX_EARLYCON_MEM
Andreas Schwab0312a3d2019-12-17 12:15:16 +0100157 def_bool MMU
Anup Patelf2c17aa2019-01-07 20:57:01 +0530158
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700159config PGTABLE_LEVELS
160 int
161 default 3 if 64BIT
162 default 2
163
Loys Ollivier0cbb8a32019-06-17 21:29:48 +0200164source "arch/riscv/Kconfig.socs"
165
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700166menu "Platform type"
167
168choice
169 prompt "Base ISA"
170 default ARCH_RV64I
171 help
Antony Pavlov86cca812019-01-08 22:45:57 +0300172 This selects the base ISA that this kernel will target and must match
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700173 the target platform.
174
175config ARCH_RV32I
176 bool "RV32I"
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700177 select 32BIT
Matt Redfearne3d59802018-04-11 08:50:17 +0100178 select GENERIC_LIB_ASHLDI3
179 select GENERIC_LIB_ASHRDI3
180 select GENERIC_LIB_LSHRDI3
Zong Li8f791252018-06-25 16:49:38 +0800181 select GENERIC_LIB_UCMPDI2
Christoph Hellwig6bd33e12019-10-28 13:10:41 +0100182 select MMU
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700183
184config ARCH_RV64I
185 bool "RV64I"
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700186 select 64BIT
Ard Biesheuvelc12d3362019-11-08 13:22:27 +0100187 select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && GCC_VERSION >= 50000
Alan Kao10626c32017-12-18 17:52:48 +0800188 select HAVE_FUNCTION_TRACER
189 select HAVE_FUNCTION_GRAPH_TRACER
Alan Kaoa1d2a6b2018-02-13 13:13:16 +0800190 select HAVE_FTRACE_MCOUNT_RECORD
Christoph Hellwig6bd33e12019-10-28 13:10:41 +0100191 select HAVE_DYNAMIC_FTRACE if MMU
192 select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
193 select SWIOTLB if MMU
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700194
195endchoice
196
197# We must be able to map all physical memory into the kernel, but the compiler
198# is still a bit more efficient when generating code if it's setup in a manner
199# such that it can only map 2GiB of memory.
200choice
201 prompt "Kernel Code Model"
202 default CMODEL_MEDLOW if 32BIT
203 default CMODEL_MEDANY if 64BIT
204
205 config CMODEL_MEDLOW
206 bool "medium low code model"
207 config CMODEL_MEDANY
208 bool "medium any code model"
209endchoice
210
Zong Liab1ef682018-03-15 16:50:41 +0800211config MODULE_SECTIONS
212 bool
213 select HAVE_MOD_ARCH_SPECIFIC
214
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700215choice
216 prompt "Maximum Physical Memory"
217 default MAXPHYSMEM_2GB if 32BIT
218 default MAXPHYSMEM_2GB if 64BIT && CMODEL_MEDLOW
219 default MAXPHYSMEM_128GB if 64BIT && CMODEL_MEDANY
220
221 config MAXPHYSMEM_2GB
222 bool "2GiB"
223 config MAXPHYSMEM_128GB
224 depends on 64BIT && CMODEL_MEDANY
225 bool "128GiB"
226endchoice
227
228
229config SMP
230 bool "Symmetric Multi-Processing"
231 help
232 This enables support for systems with more than one CPU. If
233 you say N here, the kernel will run on single and
234 multiprocessor machines, but will use only one CPU of a
235 multiprocessor machine. If you say Y here, the kernel will run
236 on many, but not all, single processor machines. On a single
237 processor machine, the kernel will run faster if you say N
238 here.
239
240 If you don't know what to do here, say N.
241
242config NR_CPUS
243 int "Maximum number of CPUs (2-32)"
244 range 2 32
245 depends on SMP
246 default "8"
247
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700248choice
249 prompt "CPU Tuning"
250 default TUNE_GENERIC
251
252config TUNE_GENERIC
253 bool "generic"
254
255endchoice
256
257config RISCV_ISA_C
258 bool "Emit compressed instructions when building Linux"
259 default y
260 help
261 Adds "C" to the ISA subsets that the toolchain is allowed to emit
262 when building Linux, which results in compressed instructions in the
263 Linux binary.
264
265 If you don't know what to do here, say Y.
266
Alan Kao178e9fc2018-04-20 07:27:49 +0800267menu "supported PMU type"
268 depends on PERF_EVENTS
269
270config RISCV_BASE_PMU
271 bool "Base Performance Monitoring Unit"
272 def_bool y
273 help
274 A base PMU that serves as a reference implementation and has limited
275 feature of perf. It can run on any RISC-V machines so serves as the
276 fallback, but this option can also be disable to reduce kernel size.
277
278endmenu
279
Alan Kao9671f702018-10-09 10:18:33 +0800280config FPU
281 bool "FPU support"
282 default y
283 help
284 Say N here if you want to disable all floating-point related procedure
285 in the kernel.
286
287 If you don't know what to do here, say Y.
288
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700289endmenu
290
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300291menu "Kernel features"
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700292
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700293source "kernel/Kconfig.hz"
294
David Abdurachmanov53406272019-10-04 17:12:22 -0700295config SECCOMP
296 bool "Enable seccomp to safely compute untrusted bytecode"
297 help
298 This kernel feature is useful for number crunching applications
299 that may need to compute untrusted bytecode during their
300 execution. By using pipes or other transports made available to
301 the process as file descriptors supporting the read/write
302 syscalls, it's possible to isolate those applications in
303 their own address space using seccomp. Once seccomp is
304 enabled via prctl(PR_SET_SECCOMP), it cannot be disabled
305 and the task is only allowed to execute a few safe syscalls
306 defined by each seccomp mode.
307
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700308endmenu
309
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300310menu "Boot options"
311
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300312config CMDLINE
Nick Kossifidis3aed8c42018-11-18 02:06:56 +0200313 string "Built-in kernel command line"
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300314 help
Nick Kossifidis3aed8c42018-11-18 02:06:56 +0200315 For most platforms, the arguments for the kernel's command line
316 are provided at run-time, during boot. However, there are cases
317 where either no arguments are being provided or the provided
318 arguments are insufficient or even invalid.
319
320 When that occurs, it is possible to define a built-in command
321 line here and choose how the kernel should use it later on.
322
323choice
324 prompt "Built-in command line usage" if CMDLINE != ""
325 default CMDLINE_FALLBACK
326 help
327 Choose how the kernel will handle the provided built-in command
328 line.
329
330config CMDLINE_FALLBACK
331 bool "Use bootloader kernel arguments if available"
332 help
333 Use the built-in command line as fallback in case we get nothing
334 during boot. This is the default behaviour.
335
336config CMDLINE_EXTEND
337 bool "Extend bootloader kernel arguments"
338 help
339 The command-line arguments provided during boot will be
340 appended to the built-in command line. This is useful in
341 cases where the provided arguments are insufficient and
342 you don't want to or cannot modify them.
343
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300344
345config CMDLINE_FORCE
Nick Kossifidis3aed8c42018-11-18 02:06:56 +0200346 bool "Always use the default kernel command string"
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300347 help
Nick Kossifidis3aed8c42018-11-18 02:06:56 +0200348 Always use the built-in command line, even if we get one during
349 boot. This is useful in case you need to override the provided
350 command line on systems where you don't have or want control
351 over it.
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300352
Nick Kossifidis3aed8c42018-11-18 02:06:56 +0200353endchoice
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300354
355endmenu
356
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700357menu "Power management options"
358
Masahiro Yamada8636a1f2018-12-11 20:01:04 +0900359source "kernel/power/Kconfig"
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700360
361endmenu