139055bcfcae567ebdd8b6de15e7aa460b13bda9
[platform/kernel/linux-starfive.git] / arch / riscv / Kconfig
1 # SPDX-License-Identifier: GPL-2.0-only
2 #
3 # For a description of the syntax of this configuration file,
4 # see Documentation/kbuild/kconfig-language.rst.
5 #
6
7 config 64BIT
8         bool
9
10 config 32BIT
11         bool
12
13 config RISCV
14         def_bool y
15         select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
16         select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
17         select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE
18         select ARCH_HAS_BINFMT_FLAT
19         select ARCH_HAS_CURRENT_STACK_POINTER
20         select ARCH_HAS_DEBUG_VIRTUAL if MMU
21         select ARCH_HAS_DEBUG_VM_PGTABLE
22         select ARCH_HAS_DEBUG_WX
23         select ARCH_HAS_FORTIFY_SOURCE
24         select ARCH_HAS_GCOV_PROFILE_ALL
25         select ARCH_HAS_GIGANTIC_PAGE
26         select ARCH_HAS_KCOV
27         select ARCH_HAS_MMIOWB
28         select ARCH_HAS_PMEM_API
29         select ARCH_HAS_PTE_SPECIAL
30         select ARCH_HAS_SET_DIRECT_MAP if MMU
31         select ARCH_HAS_SET_MEMORY if MMU
32         select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
33         select ARCH_HAS_STRICT_MODULE_RWX if MMU && !XIP_KERNEL
34         select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
35         select ARCH_HAS_UBSAN_SANITIZE_ALL
36         select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
37         select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
38         select ARCH_STACKWALK
39         select ARCH_SUPPORTS_ATOMIC_RMW
40         select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
41         select ARCH_SUPPORTS_HUGETLBFS if MMU
42         select ARCH_SUPPORTS_PAGE_TABLE_CHECK if MMU
43         select ARCH_USE_MEMTEST
44         select ARCH_USE_QUEUED_RWLOCKS
45         select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
46         select ARCH_WANT_FRAME_POINTERS
47         select ARCH_WANT_GENERAL_HUGETLB
48         select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
49         select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
50         select ARCH_WANT_LD_ORPHAN_WARN if !XIP_KERNEL
51         select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
52         select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
53         select BUILDTIME_TABLE_SORT if MMU
54         select CLINT_TIMER if !MMU
55         select CLONE_BACKWARDS
56         select COMMON_CLK
57         select CPU_PM if CPU_IDLE
58         select EDAC_SUPPORT
59         select GENERIC_ARCH_TOPOLOGY
60         select GENERIC_ATOMIC64 if !64BIT
61         select GENERIC_CLOCKEVENTS_BROADCAST if SMP
62         select GENERIC_EARLY_IOREMAP
63         select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO
64         select GENERIC_IDLE_POLL_SETUP
65         select GENERIC_IOREMAP if MMU
66         select GENERIC_IRQ_IPI if SMP
67         select GENERIC_IRQ_IPI_MUX if SMP
68         select GENERIC_IRQ_MULTI_HANDLER
69         select GENERIC_IRQ_SHOW
70         select GENERIC_IRQ_SHOW_LEVEL
71         select GENERIC_LIB_DEVMEM_IS_ALLOWED
72         select GENERIC_PCI_IOMAP
73         select GENERIC_PTDUMP if MMU
74         select GENERIC_SCHED_CLOCK
75         select GENERIC_SMP_IDLE_THREAD
76         select GENERIC_TIME_VSYSCALL if MMU && 64BIT
77         select GENERIC_VDSO_TIME_NS if HAVE_GENERIC_VDSO
78         select HARDIRQS_SW_RESEND
79         select HAVE_ARCH_AUDITSYSCALL
80         select HAVE_ARCH_HUGE_VMALLOC if HAVE_ARCH_HUGE_VMAP
81         select HAVE_ARCH_HUGE_VMAP if MMU && 64BIT && !XIP_KERNEL
82         select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
83         select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL
84         select HAVE_ARCH_KASAN if MMU && 64BIT
85         select HAVE_ARCH_KASAN_VMALLOC if MMU && 64BIT
86         select HAVE_ARCH_KFENCE if MMU && 64BIT
87         select HAVE_ARCH_KGDB if !XIP_KERNEL
88         select HAVE_ARCH_KGDB_QXFER_PKT
89         select HAVE_ARCH_MMAP_RND_BITS if MMU
90         select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
91         select HAVE_ARCH_SECCOMP_FILTER
92         select HAVE_ARCH_THREAD_STRUCT_WHITELIST
93         select HAVE_ARCH_TRACEHOOK
94         select HAVE_ARCH_TRANSPARENT_HUGEPAGE if 64BIT && MMU
95         select HAVE_ARCH_VMAP_STACK if MMU && 64BIT
96         select HAVE_ASM_MODVERSIONS
97         select HAVE_CONTEXT_TRACKING_USER
98         select HAVE_DEBUG_KMEMLEAK
99         select HAVE_DMA_CONTIGUOUS if MMU
100         select HAVE_EBPF_JIT if MMU
101         select HAVE_FUNCTION_ARG_ACCESS_API
102         select HAVE_FUNCTION_ERROR_INJECTION
103         select HAVE_GCC_PLUGINS
104         select HAVE_GENERIC_VDSO if MMU && 64BIT
105         select HAVE_IRQ_TIME_ACCOUNTING
106         select HAVE_KPROBES if !XIP_KERNEL
107         select HAVE_KPROBES_ON_FTRACE if !XIP_KERNEL
108         select HAVE_KRETPROBES if !XIP_KERNEL
109         select HAVE_RETHOOK if !XIP_KERNEL
110         select HAVE_MOVE_PMD
111         select HAVE_MOVE_PUD
112         select HAVE_PCI
113         select HAVE_PERF_EVENTS
114         select HAVE_PERF_REGS
115         select HAVE_PERF_USER_STACK_DUMP
116         select HAVE_POSIX_CPU_TIMERS_TASK_WORK
117         select HAVE_REGS_AND_STACK_ACCESS_API
118         select HAVE_RSEQ
119         select HAVE_STACKPROTECTOR
120         select HAVE_SYSCALL_TRACEPOINTS
121         select IRQ_DOMAIN
122         select IRQ_FORCED_THREADING
123         select MODULES_USE_ELF_RELA if MODULES
124         select MODULE_SECTIONS if MODULES
125         select OF
126         select OF_DMA_DEFAULT_COHERENT
127         select OF_EARLY_FLATTREE
128         select OF_IRQ
129         select PCI_DOMAINS_GENERIC if PCI
130         select PCI_MSI if PCI
131         select RISCV_ALTERNATIVE if !XIP_KERNEL
132         select RISCV_INTC
133         select RISCV_TIMER if RISCV_SBI
134         select SIFIVE_PLIC
135         select SPARSE_IRQ
136         select SYSCTL_EXCEPTION_TRACE
137         select THREAD_INFO_IN_TASK
138         select TRACE_IRQFLAGS_SUPPORT
139         select UACCESS_MEMCPY if !MMU
140         select ZONE_DMA32 if 64BIT
141         select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && $(cc-option,-fpatchable-function-entry=8)
142         select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
143         select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
144         select HAVE_FUNCTION_GRAPH_TRACER
145         select HAVE_FUNCTION_TRACER if !XIP_KERNEL && !PREEMPTION
146
147 config ARCH_MMAP_RND_BITS_MIN
148         default 18 if 64BIT
149         default 8
150
151 config ARCH_MMAP_RND_COMPAT_BITS_MIN
152         default 8
153
154 # max bits determined by the following formula:
155 #  VA_BITS - PAGE_SHIFT - 3
156 config ARCH_MMAP_RND_BITS_MAX
157         default 24 if 64BIT # SV39 based
158         default 17
159
160 config ARCH_MMAP_RND_COMPAT_BITS_MAX
161         default 17
162
163 # set if we run in machine mode, cleared if we run in supervisor mode
164 config RISCV_M_MODE
165         bool
166         default !MMU
167
168 # set if we are running in S-mode and can use SBI calls
169 config RISCV_SBI
170         bool
171         depends on !RISCV_M_MODE
172         default y
173
174 config MMU
175         bool "MMU-based Paged Memory Management Support"
176         default y
177         help
178           Select if you want MMU-based virtualised addressing space
179           support by paged memory management. If unsure, say 'Y'.
180
181 config PAGE_OFFSET
182         hex
183         default 0xC0000000 if 32BIT
184         default 0x80000000 if 64BIT && !MMU
185         default 0xff60000000000000 if 64BIT
186
187 config KASAN_SHADOW_OFFSET
188         hex
189         depends on KASAN_GENERIC
190         default 0xdfffffff00000000 if 64BIT
191         default 0xffffffff if 32BIT
192
193 config ARCH_FLATMEM_ENABLE
194         def_bool !NUMA
195
196 config ARCH_SPARSEMEM_ENABLE
197         def_bool y
198         depends on MMU
199         select SPARSEMEM_STATIC if 32BIT && SPARSEMEM
200         select SPARSEMEM_VMEMMAP_ENABLE if 64BIT
201
202 config ARCH_SELECT_MEMORY_MODEL
203         def_bool ARCH_SPARSEMEM_ENABLE
204
205 config ARCH_SUPPORTS_UPROBES
206         def_bool y
207
208 config STACKTRACE_SUPPORT
209         def_bool y
210
211 config GENERIC_BUG
212         def_bool y
213         depends on BUG
214         select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
215
216 config GENERIC_BUG_RELATIVE_POINTERS
217         bool
218
219 config GENERIC_CALIBRATE_DELAY
220         def_bool y
221
222 config GENERIC_CSUM
223         def_bool y
224
225 config GENERIC_HWEIGHT
226         def_bool y
227
228 config FIX_EARLYCON_MEM
229         def_bool MMU
230
231 config PGTABLE_LEVELS
232         int
233         default 5 if 64BIT
234         default 2
235
236 config LOCKDEP_SUPPORT
237         def_bool y
238
239 config RISCV_DMA_NONCOHERENT
240         bool
241         select ARCH_HAS_DMA_PREP_COHERENT
242         select ARCH_HAS_SETUP_DMA_OPS
243         select ARCH_HAS_SYNC_DMA_FOR_CPU
244         select ARCH_HAS_SYNC_DMA_FOR_DEVICE
245         select DMA_DIRECT_REMAP
246
247 config AS_HAS_INSN
248         def_bool $(as-instr,.insn r 51$(comma) 0$(comma) 0$(comma) t0$(comma) t0$(comma) zero)
249
250 source "arch/riscv/Kconfig.socs"
251 source "arch/riscv/Kconfig.erratas"
252
253 menu "Platform type"
254
255 config NONPORTABLE
256         bool "Allow configurations that result in non-portable kernels"
257         help
258           RISC-V kernel binaries are compatible between all known systems
259           whenever possible, but there are some use cases that can only be
260           satisfied by configurations that result in kernel binaries that are
261           not portable between systems.
262
263           Selecting N does not guarantee kernels will be portable to all known
264           systems.  Selecting any of the options guarded by NONPORTABLE will
265           result in kernel binaries that are unlikely to be portable between
266           systems.
267
268           If unsure, say N.
269
270 choice
271         prompt "Base ISA"
272         default ARCH_RV64I
273         help
274           This selects the base ISA that this kernel will target and must match
275           the target platform.
276
277 config ARCH_RV32I
278         bool "RV32I"
279         depends on NONPORTABLE
280         select 32BIT
281         select GENERIC_LIB_ASHLDI3
282         select GENERIC_LIB_ASHRDI3
283         select GENERIC_LIB_LSHRDI3
284         select GENERIC_LIB_UCMPDI2
285         select MMU
286
287 config ARCH_RV64I
288         bool "RV64I"
289         select 64BIT
290         select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
291         select SWIOTLB if MMU
292
293 endchoice
294
295 # We must be able to map all physical memory into the kernel, but the compiler
296 # is still a bit more efficient when generating code if it's setup in a manner
297 # such that it can only map 2GiB of memory.
298 choice
299         prompt "Kernel Code Model"
300         default CMODEL_MEDLOW if 32BIT
301         default CMODEL_MEDANY if 64BIT
302
303         config CMODEL_MEDLOW
304                 bool "medium low code model"
305         config CMODEL_MEDANY
306                 bool "medium any code model"
307 endchoice
308
309 config MODULE_SECTIONS
310         bool
311         select HAVE_MOD_ARCH_SPECIFIC
312
313 config SMP
314         bool "Symmetric Multi-Processing"
315         help
316           This enables support for systems with more than one CPU.  If
317           you say N here, the kernel will run on single and
318           multiprocessor machines, but will use only one CPU of a
319           multiprocessor machine. If you say Y here, the kernel will run
320           on many, but not all, single processor machines. On a single
321           processor machine, the kernel will run faster if you say N
322           here.
323
324           If you don't know what to do here, say N.
325
326 config NR_CPUS
327         int "Maximum number of CPUs (2-512)"
328         depends on SMP
329         range 2 512 if !RISCV_SBI_V01
330         range 2 32 if RISCV_SBI_V01 && 32BIT
331         range 2 64 if RISCV_SBI_V01 && 64BIT
332         default "32" if 32BIT
333         default "64" if 64BIT
334
335 config HOTPLUG_CPU
336         bool "Support for hot-pluggable CPUs"
337         depends on SMP
338         select GENERIC_IRQ_MIGRATION
339         help
340
341           Say Y here to experiment with turning CPUs off and on.  CPUs
342           can be controlled through /sys/devices/system/cpu.
343
344           Say N if you want to disable CPU hotplug.
345
346 choice
347         prompt "CPU Tuning"
348         default TUNE_GENERIC
349
350 config TUNE_GENERIC
351         bool "generic"
352
353 endchoice
354
355 # Common NUMA Features
356 config NUMA
357         bool "NUMA Memory Allocation and Scheduler Support"
358         depends on SMP && MMU
359         select ARCH_SUPPORTS_NUMA_BALANCING
360         select GENERIC_ARCH_NUMA
361         select NEED_PER_CPU_EMBED_FIRST_CHUNK
362         select OF_NUMA
363         select USE_PERCPU_NUMA_NODE_ID
364         help
365           Enable NUMA (Non-Uniform Memory Access) support.
366
367           The kernel will try to allocate memory used by a CPU on the
368           local memory of the CPU and add some more NUMA awareness to the kernel.
369
370 config NODES_SHIFT
371         int "Maximum NUMA Nodes (as a power of 2)"
372         range 1 10
373         default "2"
374         depends on NUMA
375         help
376           Specify the maximum number of NUMA Nodes available on the target
377           system.  Increases memory reserved to accommodate various tables.
378
379 config RISCV_ALTERNATIVE
380         bool
381         depends on !XIP_KERNEL
382         help
383           This Kconfig allows the kernel to automatically patch the
384           errata required by the execution platform at run time. The
385           code patching is performed once in the boot stages. It means
386           that the overhead from this mechanism is just taken once.
387
388 config RISCV_ALTERNATIVE_EARLY
389         bool
390         depends on RISCV_ALTERNATIVE
391         help
392           Allows early patching of the kernel for special errata
393
394 config RISCV_ISA_C
395         bool "Emit compressed instructions when building Linux"
396         default y
397         help
398           Adds "C" to the ISA subsets that the toolchain is allowed to emit
399           when building Linux, which results in compressed instructions in the
400           Linux binary.
401
402           If you don't know what to do here, say Y.
403
404 config RISCV_ISA_SVPBMT
405         bool "SVPBMT extension support"
406         depends on 64BIT && MMU
407         depends on RISCV_ALTERNATIVE
408         default y
409         help
410            Adds support to dynamically detect the presence of the SVPBMT
411            ISA-extension (Supervisor-mode: page-based memory types) and
412            enable its usage.
413
414            The memory type for a page contains a combination of attributes
415            that indicate the cacheability, idempotency, and ordering
416            properties for access to that page.
417
418            The SVPBMT extension is only available on 64Bit cpus.
419
420            If you don't know what to do here, say Y.
421
422 config TOOLCHAIN_HAS_ZBB
423         bool
424         default y
425         depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zbb)
426         depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zbb)
427         depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
428         depends on AS_IS_GNU
429
430 config RISCV_ISA_ZBB
431         bool "Zbb extension support for bit manipulation instructions"
432         depends on TOOLCHAIN_HAS_ZBB
433         depends on MMU
434         depends on RISCV_ALTERNATIVE
435         default y
436         help
437            Adds support to dynamically detect the presence of the ZBB
438            extension (basic bit manipulation) and enable its usage.
439
440            The Zbb extension provides instructions to accelerate a number
441            of bit-specific operations (count bit population, sign extending,
442            bitrotation, etc).
443
444            If you don't know what to do here, say Y.
445
446 config RISCV_ISA_ZICBOM
447         bool "Zicbom extension support for non-coherent DMA operation"
448         depends on MMU
449         depends on RISCV_ALTERNATIVE
450         default y
451         select RISCV_DMA_NONCOHERENT
452         help
453            Adds support to dynamically detect the presence of the ZICBOM
454            extension (Cache Block Management Operations) and enable its
455            usage.
456
457            The Zicbom extension can be used to handle for example
458            non-coherent DMA support on devices that need it.
459
460            If you don't know what to do here, say Y.
461
462 config TOOLCHAIN_HAS_ZIHINTPAUSE
463         bool
464         default y
465         depends on !64BIT || $(cc-option,-mabi=lp64 -march=rv64ima_zihintpause)
466         depends on !32BIT || $(cc-option,-mabi=ilp32 -march=rv32ima_zihintpause)
467         depends on LLD_VERSION >= 150000 || LD_VERSION >= 23600
468
469 config TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
470         def_bool y
471         # https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=aed44286efa8ae8717a77d94b51ac3614e2ca6dc
472         depends on AS_IS_GNU && AS_VERSION >= 23800
473         help
474           Newer binutils versions default to ISA spec version 20191213 which
475           moves some instructions from the I extension to the Zicsr and Zifencei
476           extensions.
477
478 config TOOLCHAIN_NEEDS_OLD_ISA_SPEC
479         def_bool y
480         depends on TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
481         # https://github.com/llvm/llvm-project/commit/22e199e6afb1263c943c0c0d4498694e15bf8a16
482         depends on CC_IS_CLANG && CLANG_VERSION < 170000
483         help
484           Certain versions of clang do not support zicsr and zifencei via -march
485           but newer versions of binutils require it for the reasons noted in the
486           help text of CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI. This
487           option causes an older ISA spec compatible with these older versions
488           of clang to be passed to GAS, which has the same result as passing zicsr
489           and zifencei to -march.
490
491 config FPU
492         bool "FPU support"
493         default y
494         help
495           Say N here if you want to disable all floating-point related procedure
496           in the kernel.
497
498           If you don't know what to do here, say Y.
499
500 endmenu # "Platform type"
501
502 menu "Kernel features"
503
504 source "kernel/Kconfig.hz"
505
506 config RISCV_SBI_V01
507         bool "SBI v0.1 support"
508         depends on RISCV_SBI
509         help
510           This config allows kernel to use SBI v0.1 APIs. This will be
511           deprecated in future once legacy M-mode software are no longer in use.
512
513 config RISCV_BOOT_SPINWAIT
514         bool "Spinwait booting method"
515         depends on SMP
516         default y if RISCV_SBI_V01 || RISCV_M_MODE
517         help
518           This enables support for booting Linux via spinwait method. In the
519           spinwait method, all cores randomly jump to Linux. One of the cores
520           gets chosen via lottery and all other keep spinning on a percpu
521           variable. This method cannot support CPU hotplug and sparse hartid
522           scheme. It should be only enabled for M-mode Linux or platforms relying
523           on older firmware without SBI HSM extension. All other platforms should
524           rely on ordered booting via SBI HSM extension which gets chosen
525           dynamically at runtime if the firmware supports it.
526
527           Since spinwait is incompatible with sparse hart IDs, it requires
528           NR_CPUS be large enough to contain the physical hart ID of the first
529           hart to enter Linux.
530
531           If unsure what to do here, say N.
532
533 config KEXEC
534         bool "Kexec system call"
535         depends on MMU
536         select HOTPLUG_CPU if SMP
537         select KEXEC_CORE
538         help
539           kexec is a system call that implements the ability to shutdown your
540           current kernel, and to start another kernel. It is like a reboot
541           but it is independent of the system firmware. And like a reboot
542           you can start any kernel with it, not just Linux.
543
544           The name comes from the similarity to the exec system call.
545
546 config KEXEC_FILE
547         bool "kexec file based systmem call"
548         depends on 64BIT && MMU
549         select HAVE_IMA_KEXEC if IMA
550         select KEXEC_CORE
551         select KEXEC_ELF
552         help
553           This is new version of kexec system call. This system call is
554           file based and takes file descriptors as system call argument
555           for kernel and initramfs as opposed to list of segments as
556           accepted by previous system call.
557
558           If you don't know what to do here, say Y.
559
560 config ARCH_HAS_KEXEC_PURGATORY
561         def_bool KEXEC_FILE
562         depends on CRYPTO=y
563         depends on CRYPTO_SHA256=y
564
565 config CRASH_DUMP
566         bool "Build kdump crash kernel"
567         help
568           Generate crash dump after being started by kexec. This should
569           be normally only set in special crash dump kernels which are
570           loaded in the main kernel with kexec-tools into a specially
571           reserved region and then later executed after a crash by
572           kdump/kexec.
573
574           For more details see Documentation/admin-guide/kdump/kdump.rst
575
576 config COMPAT
577         bool "Kernel support for 32-bit U-mode"
578         default 64BIT
579         depends on 64BIT && MMU
580         help
581           This option enables support for a 32-bit U-mode running under a 64-bit
582           kernel at S-mode. riscv32-specific components such as system calls,
583           the user helper functions (vdso), signal rt_frame functions and the
584           ptrace interface are handled appropriately by the kernel.
585
586           If you want to execute 32-bit userspace applications, say Y.
587
588 endmenu # "Kernel features"
589
590 menu "Boot options"
591
592 config CMDLINE
593         string "Built-in kernel command line"
594         help
595           For most platforms, the arguments for the kernel's command line
596           are provided at run-time, during boot. However, there are cases
597           where either no arguments are being provided or the provided
598           arguments are insufficient or even invalid.
599
600           When that occurs, it is possible to define a built-in command
601           line here and choose how the kernel should use it later on.
602
603 choice
604         prompt "Built-in command line usage" if CMDLINE != ""
605         default CMDLINE_FALLBACK
606         help
607           Choose how the kernel will handle the provided built-in command
608           line.
609
610 config CMDLINE_FALLBACK
611         bool "Use bootloader kernel arguments if available"
612         help
613           Use the built-in command line as fallback in case we get nothing
614           during boot. This is the default behaviour.
615
616 config CMDLINE_EXTEND
617         bool "Extend bootloader kernel arguments"
618         help
619           The command-line arguments provided during boot will be
620           appended to the built-in command line. This is useful in
621           cases where the provided arguments are insufficient and
622           you don't want to or cannot modify them.
623
624 config CMDLINE_FORCE
625         bool "Always use the default kernel command string"
626         help
627           Always use the built-in command line, even if we get one during
628           boot. This is useful in case you need to override the provided
629           command line on systems where you don't have or want control
630           over it.
631
632 endchoice
633
634 config EFI_STUB
635         bool
636
637 config EFI
638         bool "UEFI runtime support"
639         depends on OF && !XIP_KERNEL
640         depends on MMU
641         default y
642         select EFI_GENERIC_STUB
643         select EFI_PARAMS_FROM_FDT
644         select EFI_RUNTIME_WRAPPERS
645         select EFI_STUB
646         select LIBFDT
647         select RISCV_ISA_C
648         select UCS2_STRING
649         help
650           This option provides support for runtime services provided
651           by UEFI firmware (such as non-volatile variables, realtime
652           clock, and platform reset). A UEFI stub is also provided to
653           allow the kernel to be booted as an EFI application. This
654           is only useful on systems that have UEFI firmware.
655
656 config CC_HAVE_STACKPROTECTOR_TLS
657         def_bool $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=tp -mstack-protector-guard-offset=0)
658
659 config STACKPROTECTOR_PER_TASK
660         def_bool y
661         depends on !RANDSTRUCT
662         depends on STACKPROTECTOR && CC_HAVE_STACKPROTECTOR_TLS
663
664 config PHYS_RAM_BASE_FIXED
665         bool "Explicitly specified physical RAM address"
666         depends on NONPORTABLE
667         default n
668
669 config PHYS_RAM_BASE
670         hex "Platform Physical RAM address"
671         depends on PHYS_RAM_BASE_FIXED
672         default "0x80000000"
673         help
674           This is the physical address of RAM in the system. It has to be
675           explicitly specified to run early relocations of read-write data
676           from flash to RAM.
677
678 config XIP_KERNEL
679         bool "Kernel Execute-In-Place from ROM"
680         depends on MMU && SPARSEMEM && NONPORTABLE
681         # This prevents XIP from being enabled by all{yes,mod}config, which
682         # fail to build since XIP doesn't support large kernels.
683         depends on !COMPILE_TEST
684         select PHYS_RAM_BASE_FIXED
685         help
686           Execute-In-Place allows the kernel to run from non-volatile storage
687           directly addressable by the CPU, such as NOR flash. This saves RAM
688           space since the text section of the kernel is not loaded from flash
689           to RAM.  Read-write sections, such as the data section and stack,
690           are still copied to RAM.  The XIP kernel is not compressed since
691           it has to run directly from flash, so it will take more space to
692           store it.  The flash address used to link the kernel object files,
693           and for storing it, is configuration dependent. Therefore, if you
694           say Y here, you must know the proper physical address where to
695           store the kernel image depending on your own flash memory usage.
696
697           Also note that the make target becomes "make xipImage" rather than
698           "make zImage" or "make Image".  The final kernel binary to put in
699           ROM memory will be arch/riscv/boot/xipImage.
700
701           SPARSEMEM is required because the kernel text and rodata that are
702           flash resident are not backed by memmap, then any attempt to get
703           a struct page on those regions will trigger a fault.
704
705           If unsure, say N.
706
707 config XIP_PHYS_ADDR
708         hex "XIP Kernel Physical Location"
709         depends on XIP_KERNEL
710         default "0x21000000"
711         help
712           This is the physical address in your flash memory the kernel will
713           be linked for and stored to.  This address is dependent on your
714           own flash usage.
715
716 endmenu # "Boot options"
717
718 config BUILTIN_DTB
719         bool
720         depends on OF && NONPORTABLE
721         default y if XIP_KERNEL
722
723 config PORTABLE
724         bool
725         default !NONPORTABLE
726         select EFI
727         select MMU
728         select OF
729
730 menu "Power management options"
731
732 source "kernel/power/Kconfig"
733
734 endmenu # "Power management options"
735
736 menu "CPU Power Management"
737
738 source "drivers/cpuidle/Kconfig"
739
740 source "drivers/cpufreq/Kconfig"
741
742 endmenu # "CPU Power Management"
743
744 source "arch/riscv/kvm/Kconfig"