blob: 469a70bd8da6a47403a3d61a92ed3911a1aac9fe [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
Vincent Chenad5d1122020-06-09 22:14:48 +080015 select ARCH_CLOCKSOURCE_INIT
Chenxi Mao234e9d72020-06-05 13:15:10 +080016 select ARCH_SUPPORTS_ATOMIC_RMW
Mike Rapoport5d6ad662020-12-14 19:10:30 -080017 select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
Kefeng Wang5cb00802020-11-13 14:42:23 +080018 select ARCH_STACKWALK
Christoph Hellwigad97f9d2019-06-13 09:09:03 +020019 select ARCH_HAS_BINFMT_FLAT
Emil Renner Berthing925ac7b2020-07-14 23:26:11 +020020 select ARCH_HAS_DEBUG_VM_PGTABLE
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070021 select ARCH_HAS_DEBUG_VIRTUAL if MMU
Zong Lib422d282020-06-03 16:03:55 -070022 select ARCH_HAS_DEBUG_WX
Kefeng Wang95301412021-02-25 15:03:03 +080023 select ARCH_HAS_FORTIFY_SOURCE
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070024 select ARCH_HAS_GCOV_PROFILE_ALL
25 select ARCH_HAS_GIGANTIC_PAGE
Tobias Klauser20d38f72020-06-26 14:40:56 +020026 select ARCH_HAS_KCOV
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070027 select ARCH_HAS_MMIOWB
28 select ARCH_HAS_PTE_SPECIAL
29 select ARCH_HAS_SET_DIRECT_MAP
30 select ARCH_HAS_SET_MEMORY
Vitaly Wool44c92252021-04-13 02:35:14 -040031 select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
32 select ARCH_HAS_STRICT_MODULE_RWX if MMU && !XIP_KERNEL
Guo Ren2f100582021-03-07 10:24:46 +080033 select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
Vincent Chenfc0c7692020-06-23 13:36:59 +080034 select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
35 select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
Anshuman Khandual855f9a82021-05-04 18:38:13 -070036 select ARCH_SUPPORTS_HUGETLBFS if MMU
Kefeng Wang97a03102021-05-07 17:47:15 +080037 select ARCH_USE_MEMTEST
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070038 select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070039 select ARCH_WANT_FRAME_POINTERS
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070040 select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
Damien Le Moal09accc32021-04-17 10:10:09 +090041 select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070042 select CLONE_BACKWARDS
Palmer Dabbeltd5be89a2020-09-14 09:56:30 -070043 select CLINT_TIMER if !MMU
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070044 select COMMON_CLK
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070045 select EDAC_SUPPORT
46 select GENERIC_ARCH_TOPOLOGY if SMP
47 select GENERIC_ATOMIC64 if !64BIT
Guo Ren2f100582021-03-07 10:24:46 +080048 select GENERIC_CLOCKEVENTS_BROADCAST if SMP
Atish Patra6262f662020-09-17 15:37:11 -070049 select GENERIC_EARLY_IOREMAP
Vincent Chenad5d1122020-06-09 22:14:48 +080050 select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070051 select GENERIC_IOREMAP
52 select GENERIC_IRQ_MULTI_HANDLER
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070053 select GENERIC_IRQ_SHOW
Palmer Dabbelt78ed4732020-07-09 11:51:17 -070054 select GENERIC_LIB_DEVMEM_IS_ALLOWED
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070055 select GENERIC_PCI_IOMAP
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070056 select GENERIC_PTDUMP if MMU
Anup Patel9b9afe42018-12-04 15:59:51 +053057 select GENERIC_SCHED_CLOCK
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070058 select GENERIC_SMP_IDLE_THREAD
Christoph Hellwig6bd33e12019-10-28 13:10:41 +010059 select GENERIC_STRNCPY_FROM_USER if MMU
60 select GENERIC_STRNLEN_USER if MMU
Vincent Chenad5d1122020-06-09 22:14:48 +080061 select GENERIC_TIME_VSYSCALL if MMU && 64BIT
Anup Patel6b7ce8922020-06-01 14:45:40 +053062 select HANDLE_DOMAIN_IRQ
David Abdurachmanovefe75c42018-10-29 11:48:53 +010063 select HAVE_ARCH_AUDITSYSCALL
Jisheng Zhang42e0e0b2021-05-11 00:28:38 +080064 select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
65 select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070066 select HAVE_ARCH_KASAN if MMU && 64BIT
Nylon Chene178d672021-01-16 13:58:35 +080067 select HAVE_ARCH_KASAN_VMALLOC if MMU && 64BIT
Jisheng Zhang42e0e0b2021-05-11 00:28:38 +080068 select HAVE_ARCH_KGDB if !XIP_KERNEL
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070069 select HAVE_ARCH_KGDB_QXFER_PKT
70 select HAVE_ARCH_MMAP_RND_BITS if MMU
David Abdurachmanov53406272019-10-04 17:12:22 -070071 select HAVE_ARCH_SECCOMP_FILTER
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070072 select HAVE_ARCH_TRACEHOOK
Masahiro Yamada2ff2b7e2019-08-19 14:54:20 +090073 select HAVE_ASM_MODVERSIONS
Greentime Hued48b292020-06-24 17:03:16 +080074 select HAVE_CONTEXT_TRACKING
Tobias Klausercbb3d912020-06-27 12:50:50 +020075 select HAVE_DEBUG_KMEMLEAK
Christoph Hellwig6bd33e12019-10-28 13:10:41 +010076 select HAVE_DMA_CONTIGUOUS if MMU
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070077 select HAVE_EBPF_JIT if MMU
Guo Renee55ff82020-12-17 16:01:45 +000078 select HAVE_FUNCTION_ERROR_INJECTION
Jim Wilsonb90edb32018-10-16 14:42:59 -070079 select HAVE_FUTEX_CMPXCHG if FUTEX
Tobias Klauser20d38f72020-06-26 14:40:56 +020080 select HAVE_GCC_PLUGINS
Vincent Chenad5d1122020-06-09 22:14:48 +080081 select HAVE_GENERIC_VDSO if MMU && 64BIT
Kefeng Wang31564b82020-10-28 12:28:42 +080082 select HAVE_IRQ_TIME_ACCOUNTING
Jisheng Zhang42e0e0b2021-05-11 00:28:38 +080083 select HAVE_KPROBES if !XIP_KERNEL
84 select HAVE_KPROBES_ON_FTRACE if !XIP_KERNEL
85 select HAVE_KRETPROBES if !XIP_KERNEL
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070086 select HAVE_PCI
Alan Kao178e9fc2018-04-20 07:27:49 +080087 select HAVE_PERF_EVENTS
Mao Han98a93b02019-09-05 11:46:35 +080088 select HAVE_PERF_REGS
89 select HAVE_PERF_USER_STACK_DUMP
Patrick Stählindcdc7a532020-12-17 16:01:37 +000090 select HAVE_REGS_AND_STACK_ACCESS_API
Guo Renf2c96992020-07-10 16:19:57 +000091 select HAVE_STACKPROTECTOR
David Abdurachmanov5aeb1b32018-12-06 16:26:35 +010092 select HAVE_SYSCALL_TRACEPOINTS
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070093 select IRQ_DOMAIN
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070094 select MODULES_USE_ELF_RELA if MODULES
Zong Li2cffc952018-12-07 17:02:16 +080095 select MODULE_SECTIONS if MODULES
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -070096 select OF
97 select OF_EARLY_FLATTREE
98 select OF_IRQ
Christoph Hellwig2eac9c22018-11-15 20:05:33 +010099 select PCI_DOMAINS_GENERIC if PCI
Christoph Hellwigeb01d422018-11-15 20:05:32 +0100100 select PCI_MSI if PCI
Anup Patele71ee062020-06-01 14:45:43 +0530101 select RISCV_INTC
Anup Patel2bc3fc82020-08-17 18:12:50 +0530102 select RISCV_TIMER if RISCV_SBI
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -0700103 select SPARSE_IRQ
104 select SYSCTL_EXCEPTION_TRACE
105 select THREAD_INFO_IN_TASK
Christoph Hellwig11129e82020-09-07 07:58:22 +0200106 select UACCESS_MEMCPY if !MMU
Kefeng Wang63703f32021-06-30 18:52:20 -0700107 select ZONE_DMA32 if 64BIT
Alexandre Ghiti54c95a12019-09-23 15:39:21 -0700108
109config ARCH_MMAP_RND_BITS_MIN
110 default 18 if 64BIT
111 default 8
112
113# max bits determined by the following formula:
114# VA_BITS - PAGE_SHIFT - 3
115config ARCH_MMAP_RND_BITS_MAX
116 default 24 if 64BIT # SV39 based
117 default 17
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700118
Christoph Hellwiga4c37332019-10-28 13:10:32 +0100119# set if we run in machine mode, cleared if we run in supervisor mode
120config RISCV_M_MODE
121 bool
Christoph Hellwig6bd33e12019-10-28 13:10:41 +0100122 default !MMU
Christoph Hellwiga4c37332019-10-28 13:10:32 +0100123
Damien Le Moaleded8bc2019-10-28 13:10:33 +0100124# set if we are running in S-mode and can use SBI calls
125config RISCV_SBI
126 bool
127 depends on !RISCV_M_MODE
128 default y
129
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700130config MMU
Christoph Hellwig6bd33e12019-10-28 13:10:41 +0100131 bool "MMU-based Paged Memory Management Support"
132 default y
133 help
134 Select if you want MMU-based virtualised addressing space
135 support by paged memory management. If unsure, say 'Y'.
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700136
Logan Gunthorped95f1a52019-08-28 15:40:54 -0600137config VA_BITS
138 int
139 default 32 if 32BIT
140 default 39 if 64BIT
141
142config PA_BITS
143 int
144 default 34 if 32BIT
145 default 56 if 64BIT
146
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700147config PAGE_OFFSET
148 hex
Atish Patrae5577932021-01-11 15:45:04 -0800149 default 0xC0000000 if 32BIT && MAXPHYSMEM_1GB
Christoph Hellwig6bd33e12019-10-28 13:10:41 +0100150 default 0x80000000 if 64BIT && !MMU
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700151 default 0xffffffff80000000 if 64BIT && MAXPHYSMEM_2GB
152 default 0xffffffe000000000 if 64BIT && MAXPHYSMEM_128GB
153
Logan Gunthorped95f1a52019-08-28 15:40:54 -0600154config ARCH_FLATMEM_ENABLE
Atish Patra4f0e8ee2020-11-18 16:38:29 -0800155 def_bool !NUMA
Logan Gunthorped95f1a52019-08-28 15:40:54 -0600156
157config ARCH_SPARSEMEM_ENABLE
158 def_bool y
Damien Le Moalaa2734202020-02-12 19:34:24 +0900159 depends on MMU
Kefeng Wang199fc6b2021-03-29 11:13:07 +0800160 select SPARSEMEM_STATIC if 32BIT && SPARSEMEM
Kefeng Wanga5406a72021-03-15 20:03:07 +0800161 select SPARSEMEM_VMEMMAP_ENABLE if 64BIT
Logan Gunthorped95f1a52019-08-28 15:40:54 -0600162
163config ARCH_SELECT_MEMORY_MODEL
164 def_bool ARCH_SPARSEMEM_ENABLE
165
Alexandre Ghiti9e953cd2019-05-26 08:50:38 -0400166config ARCH_WANT_GENERAL_HUGETLB
167 def_bool y
168
Guo Ren74784082020-12-17 16:01:44 +0000169config ARCH_SUPPORTS_UPROBES
170 def_bool y
171
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700172config STACKTRACE_SUPPORT
173 def_bool y
174
Alan Kao10626c32017-12-18 17:52:48 +0800175config TRACE_IRQFLAGS_SUPPORT
176 def_bool y
177
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700178config GENERIC_BUG
179 def_bool y
180 depends on BUG
181 select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
182
183config GENERIC_BUG_RELATIVE_POINTERS
184 bool
185
186config GENERIC_CALIBRATE_DELAY
187 def_bool y
188
189config GENERIC_CSUM
190 def_bool y
191
192config GENERIC_HWEIGHT
193 def_bool y
194
Anup Patelf2c17aa2019-01-07 20:57:01 +0530195config FIX_EARLYCON_MEM
Andreas Schwab0312a3d2019-12-17 12:15:16 +0100196 def_bool MMU
Anup Patelf2c17aa2019-01-07 20:57:01 +0530197
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700198config PGTABLE_LEVELS
199 int
200 default 3 if 64BIT
201 default 2
202
Guo Ren3c469792020-06-27 13:57:08 +0000203config LOCKDEP_SUPPORT
204 def_bool y
205
Loys Ollivier0cbb8a32019-06-17 21:29:48 +0200206source "arch/riscv/Kconfig.socs"
Vincent Chen6f4eea92021-03-22 22:26:03 +0800207source "arch/riscv/Kconfig.erratas"
Loys Ollivier0cbb8a32019-06-17 21:29:48 +0200208
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700209menu "Platform type"
210
211choice
212 prompt "Base ISA"
213 default ARCH_RV64I
214 help
Antony Pavlov86cca812019-01-08 22:45:57 +0300215 This selects the base ISA that this kernel will target and must match
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700216 the target platform.
217
218config ARCH_RV32I
219 bool "RV32I"
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700220 select 32BIT
Matt Redfearne3d59802018-04-11 08:50:17 +0100221 select GENERIC_LIB_ASHLDI3
222 select GENERIC_LIB_ASHRDI3
223 select GENERIC_LIB_LSHRDI3
Zong Li8f791252018-06-25 16:49:38 +0800224 select GENERIC_LIB_UCMPDI2
Christoph Hellwig6bd33e12019-10-28 13:10:41 +0100225 select MMU
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700226
227config ARCH_RV64I
228 bool "RV64I"
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700229 select 64BIT
Ard Biesheuvelc12d3362019-11-08 13:22:27 +0100230 select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && GCC_VERSION >= 50000
Jisheng Zhang42e0e0b2021-05-11 00:28:38 +0800231 select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && $(cc-option,-fpatchable-function-entry=8)
Christoph Hellwig6bd33e12019-10-28 13:10:41 +0100232 select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
Jisheng Zhang42e0e0b2021-05-11 00:28:38 +0800233 select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
Palmer Dabbelte8c7ef72020-06-04 13:55:14 -0700234 select HAVE_FUNCTION_GRAPH_TRACER
Jisheng Zhang42e0e0b2021-05-11 00:28:38 +0800235 select HAVE_FUNCTION_TRACER if !XIP_KERNEL
Christoph Hellwig6bd33e12019-10-28 13:10:41 +0100236 select SWIOTLB if MMU
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700237
238endchoice
239
240# We must be able to map all physical memory into the kernel, but the compiler
241# is still a bit more efficient when generating code if it's setup in a manner
242# such that it can only map 2GiB of memory.
243choice
244 prompt "Kernel Code Model"
245 default CMODEL_MEDLOW if 32BIT
246 default CMODEL_MEDANY if 64BIT
247
248 config CMODEL_MEDLOW
249 bool "medium low code model"
250 config CMODEL_MEDANY
251 bool "medium any code model"
252endchoice
253
Zong Liab1ef682018-03-15 16:50:41 +0800254config MODULE_SECTIONS
255 bool
256 select HAVE_MOD_ARCH_SPECIFIC
257
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700258choice
259 prompt "Maximum Physical Memory"
Atish Patrae5577932021-01-11 15:45:04 -0800260 default MAXPHYSMEM_1GB if 32BIT
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700261 default MAXPHYSMEM_2GB if 64BIT && CMODEL_MEDLOW
262 default MAXPHYSMEM_128GB if 64BIT && CMODEL_MEDANY
263
Atish Patrae5577932021-01-11 15:45:04 -0800264 config MAXPHYSMEM_1GB
Atish Patrade5f4b82021-01-29 11:00:38 -0800265 depends on 32BIT
Atish Patrae5577932021-01-11 15:45:04 -0800266 bool "1GiB"
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700267 config MAXPHYSMEM_2GB
Atish Patrade5f4b82021-01-29 11:00:38 -0800268 depends on 64BIT && CMODEL_MEDLOW
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700269 bool "2GiB"
270 config MAXPHYSMEM_128GB
271 depends on 64BIT && CMODEL_MEDANY
272 bool "128GiB"
273endchoice
274
275
276config SMP
277 bool "Symmetric Multi-Processing"
278 help
279 This enables support for systems with more than one CPU. If
280 you say N here, the kernel will run on single and
281 multiprocessor machines, but will use only one CPU of a
282 multiprocessor machine. If you say Y here, the kernel will run
283 on many, but not all, single processor machines. On a single
284 processor machine, the kernel will run faster if you say N
285 here.
286
287 If you don't know what to do here, say N.
288
289config NR_CPUS
290 int "Maximum number of CPUs (2-32)"
291 range 2 32
292 depends on SMP
293 default "8"
294
Atish Patraf1e58582020-03-17 18:11:44 -0700295config HOTPLUG_CPU
296 bool "Support for hot-pluggable CPUs"
297 depends on SMP
298 select GENERIC_IRQ_MIGRATION
299 help
300
301 Say Y here to experiment with turning CPUs off and on. CPUs
302 can be controlled through /sys/devices/system/cpu.
303
304 Say N if you want to disable CPU hotplug.
305
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700306choice
307 prompt "CPU Tuning"
308 default TUNE_GENERIC
309
310config TUNE_GENERIC
311 bool "generic"
312
313endchoice
314
Atish Patra4f0e8ee2020-11-18 16:38:29 -0800315# Common NUMA Features
316config NUMA
317 bool "NUMA Memory Allocation and Scheduler Support"
Kefeng Wang1adbc292021-03-30 21:25:31 +0800318 depends on SMP && MMU
Atish Patra4f0e8ee2020-11-18 16:38:29 -0800319 select GENERIC_ARCH_NUMA
320 select OF_NUMA
321 select ARCH_SUPPORTS_NUMA_BALANCING
322 help
323 Enable NUMA (Non-Uniform Memory Access) support.
324
325 The kernel will try to allocate memory used by a CPU on the
326 local memory of the CPU and add some more NUMA awareness to the kernel.
327
328config NODES_SHIFT
329 int "Maximum NUMA Nodes (as a power of 2)"
330 range 1 10
331 default "2"
Mike Rapoporta9ee6cf2021-06-28 19:43:01 -0700332 depends on NUMA
Atish Patra4f0e8ee2020-11-18 16:38:29 -0800333 help
334 Specify the maximum number of NUMA Nodes available on the target
335 system. Increases memory reserved to accommodate various tables.
336
337config USE_PERCPU_NUMA_NODE_ID
338 def_bool y
339 depends on NUMA
340
341config NEED_PER_CPU_EMBED_FIRST_CHUNK
342 def_bool y
343 depends on NUMA
344
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700345config RISCV_ISA_C
346 bool "Emit compressed instructions when building Linux"
347 default y
348 help
349 Adds "C" to the ISA subsets that the toolchain is allowed to emit
350 when building Linux, which results in compressed instructions in the
351 Linux binary.
352
353 If you don't know what to do here, say Y.
354
Alan Kao178e9fc2018-04-20 07:27:49 +0800355menu "supported PMU type"
356 depends on PERF_EVENTS
357
358config RISCV_BASE_PMU
359 bool "Base Performance Monitoring Unit"
360 def_bool y
361 help
362 A base PMU that serves as a reference implementation and has limited
363 feature of perf. It can run on any RISC-V machines so serves as the
364 fallback, but this option can also be disable to reduce kernel size.
365
366endmenu
367
Alan Kao9671f702018-10-09 10:18:33 +0800368config FPU
369 bool "FPU support"
370 default y
371 help
372 Say N here if you want to disable all floating-point related procedure
373 in the kernel.
374
375 If you don't know what to do here, say Y.
376
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700377endmenu
378
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300379menu "Kernel features"
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700380
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700381source "kernel/Kconfig.hz"
382
Atish Patraefca1392020-03-17 18:11:37 -0700383config RISCV_SBI_V01
384 bool "SBI v0.1 support"
385 default y
386 depends on RISCV_SBI
387 help
388 This config allows kernel to use SBI v0.1 APIs. This will be
389 deprecated in future once legacy M-mode software are no longer in use.
Nick Kossifidisfba8a862021-04-19 03:55:36 +0300390
391config KEXEC
392 bool "Kexec system call"
393 select KEXEC_CORE
394 select HOTPLUG_CPU if SMP
395 depends on MMU
396 help
397 kexec is a system call that implements the ability to shutdown your
398 current kernel, and to start another kernel. It is like a reboot
399 but it is independent of the system firmware. And like a reboot
400 you can start any kernel with it, not just Linux.
401
402 The name comes from the similarity to the exec system call.
403
Nick Kossifidis56409752021-04-19 03:55:39 +0300404config CRASH_DUMP
405 bool "Build kdump crash kernel"
406 help
407 Generate crash dump after being started by kexec. This should
408 be normally only set in special crash dump kernels which are
409 loaded in the main kernel with kexec-tools into a specially
410 reserved region and then later executed after a crash by
411 kdump/kexec.
412
413 For more details see Documentation/admin-guide/kdump/kdump.rst
Nick Kossifidisfba8a862021-04-19 03:55:36 +0300414
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700415endmenu
416
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300417menu "Boot options"
418
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300419config CMDLINE
Nick Kossifidis3aed8c42018-11-18 02:06:56 +0200420 string "Built-in kernel command line"
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300421 help
Nick Kossifidis3aed8c42018-11-18 02:06:56 +0200422 For most platforms, the arguments for the kernel's command line
423 are provided at run-time, during boot. However, there are cases
424 where either no arguments are being provided or the provided
425 arguments are insufficient or even invalid.
426
427 When that occurs, it is possible to define a built-in command
428 line here and choose how the kernel should use it later on.
429
430choice
431 prompt "Built-in command line usage" if CMDLINE != ""
432 default CMDLINE_FALLBACK
433 help
434 Choose how the kernel will handle the provided built-in command
435 line.
436
437config CMDLINE_FALLBACK
438 bool "Use bootloader kernel arguments if available"
439 help
440 Use the built-in command line as fallback in case we get nothing
441 during boot. This is the default behaviour.
442
443config CMDLINE_EXTEND
444 bool "Extend bootloader kernel arguments"
445 help
446 The command-line arguments provided during boot will be
447 appended to the built-in command line. This is useful in
448 cases where the provided arguments are insufficient and
449 you don't want to or cannot modify them.
450
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300451
452config CMDLINE_FORCE
Nick Kossifidis3aed8c42018-11-18 02:06:56 +0200453 bool "Always use the default kernel command string"
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300454 help
Nick Kossifidis3aed8c42018-11-18 02:06:56 +0200455 Always use the built-in command line, even if we get one during
456 boot. This is useful in case you need to override the provided
457 command line on systems where you don't have or want control
458 over it.
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300459
Nick Kossifidis3aed8c42018-11-18 02:06:56 +0200460endchoice
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300461
Atish Patrad7071742020-09-17 15:37:14 -0700462config EFI_STUB
463 bool
464
465config EFI
466 bool "UEFI runtime support"
Vitaly Wool44c92252021-04-13 02:35:14 -0400467 depends on OF && !XIP_KERNEL
Atish Patrad7071742020-09-17 15:37:14 -0700468 select LIBFDT
469 select UCS2_STRING
470 select EFI_PARAMS_FROM_FDT
471 select EFI_STUB
472 select EFI_GENERIC_STUB
Atish Patrab91540d2020-09-17 15:37:15 -0700473 select EFI_RUNTIME_WRAPPERS
Atish Patrad7071742020-09-17 15:37:14 -0700474 select RISCV_ISA_C
Atish Patrab91540d2020-09-17 15:37:15 -0700475 depends on MMU
Atish Patrad7071742020-09-17 15:37:14 -0700476 default y
477 help
478 This option provides support for runtime services provided
479 by UEFI firmware (such as non-volatile variables, realtime
480 clock, and platform reset). A UEFI stub is also provided to
481 allow the kernel to be booted as an EFI application. This
482 is only useful on systems that have UEFI firmware.
483
Guo Renfea2fed2020-12-17 16:29:18 +0000484config CC_HAVE_STACKPROTECTOR_TLS
485 def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
486
487config STACKPROTECTOR_PER_TASK
488 def_bool y
489 depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_TLS
490
Vitaly Wool44c92252021-04-13 02:35:14 -0400491config PHYS_RAM_BASE_FIXED
492 bool "Explicitly specified physical RAM address"
493 default n
494
495config PHYS_RAM_BASE
496 hex "Platform Physical RAM address"
497 depends on PHYS_RAM_BASE_FIXED
498 default "0x80000000"
499 help
500 This is the physical address of RAM in the system. It has to be
501 explicitly specified to run early relocations of read-write data
502 from flash to RAM.
503
504config XIP_KERNEL
505 bool "Kernel Execute-In-Place from ROM"
506 depends on MMU && SPARSEMEM
507 # This prevents XIP from being enabled by all{yes,mod}config, which
508 # fail to build since XIP doesn't support large kernels.
509 depends on !COMPILE_TEST
510 select PHYS_RAM_BASE_FIXED
511 help
512 Execute-In-Place allows the kernel to run from non-volatile storage
513 directly addressable by the CPU, such as NOR flash. This saves RAM
514 space since the text section of the kernel is not loaded from flash
515 to RAM. Read-write sections, such as the data section and stack,
516 are still copied to RAM. The XIP kernel is not compressed since
517 it has to run directly from flash, so it will take more space to
518 store it. The flash address used to link the kernel object files,
519 and for storing it, is configuration dependent. Therefore, if you
520 say Y here, you must know the proper physical address where to
521 store the kernel image depending on your own flash memory usage.
522
523 Also note that the make target becomes "make xipImage" rather than
524 "make zImage" or "make Image". The final kernel binary to put in
525 ROM memory will be arch/riscv/boot/xipImage.
526
527 SPARSEMEM is required because the kernel text and rodata that are
528 flash resident are not backed by memmap, then any attempt to get
529 a struct page on those regions will trigger a fault.
530
531 If unsure, say N.
532
533config XIP_PHYS_ADDR
534 hex "XIP Kernel Physical Location"
535 depends on XIP_KERNEL
536 default "0x21000000"
537 help
538 This is the physical address in your flash memory the kernel will
539 be linked for and stored to. This address is dependent on your
540 own flash usage.
541
Nick Kossifidisaef53f92018-09-20 01:48:15 +0300542endmenu
543
Palmer Dabbelt2d268252020-04-14 13:43:24 +0900544config BUILTIN_DTB
Vitaly Wool44c92252021-04-13 02:35:14 -0400545 bool
Palmer Dabbelt2d268252020-04-14 13:43:24 +0900546 depends on OF
Vitaly Wool44c92252021-04-13 02:35:14 -0400547 default y if XIP_KERNEL
Palmer Dabbelt2d268252020-04-14 13:43:24 +0900548
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700549menu "Power management options"
550
Masahiro Yamada8636a1f2018-12-11 20:01:04 +0900551source "kernel/power/Kconfig"
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -0700552
553endmenu
Atish Patrad7071742020-09-17 15:37:14 -0700554
555source "drivers/firmware/Kconfig"