Merge branch irq/misc-6.4 into irq/irqchip-next
[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_INTC
132         select RISCV_TIMER if RISCV_SBI
133         select SIFIVE_PLIC
134         select SPARSE_IRQ
135         select SYSCTL_EXCEPTION_TRACE
136         select THREAD_INFO_IN_TASK
137         select TRACE_IRQFLAGS_SUPPORT
138         select UACCESS_MEMCPY if !MMU
139         select ZONE_DMA32 if 64BIT
140         select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && $(cc-option,-fpatchable-function-entry=8)
141         select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
142         select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
143         select HAVE_FUNCTION_GRAPH_TRACER
144         select HAVE_FUNCTION_TRACER if !XIP_KERNEL && !PREEMPTION
145
146 config ARCH_MMAP_RND_BITS_MIN
147         default 18 if 64BIT
148         default 8
149
150 config ARCH_MMAP_RND_COMPAT_BITS_MIN
151         default 8
152
153 # max bits determined by the following formula:
154 #  VA_BITS - PAGE_SHIFT - 3
155 config ARCH_MMAP_RND_BITS_MAX
156         default 24 if 64BIT # SV39 based
157         default 17
158
159 config ARCH_MMAP_RND_COMPAT_BITS_MAX
160         default 17
161
162 # set if we run in machine mode, cleared if we run in supervisor mode
163 config RISCV_M_MODE
164         bool
165         default !MMU
166
167 # set if we are running in S-mode and can use SBI calls
168 config RISCV_SBI
169         bool
170         depends on !RISCV_M_MODE
171         default y
172
173 config MMU
174         bool "MMU-based Paged Memory Management Support"
175         default y
176         help
177           Select if you want MMU-based virtualised addressing space
178           support by paged memory management. If unsure, say 'Y'.
179
180 config PAGE_OFFSET
181         hex
182         default 0xC0000000 if 32BIT
183         default 0x80000000 if 64BIT && !MMU
184         default 0xff60000000000000 if 64BIT
185
186 config KASAN_SHADOW_OFFSET
187         hex
188         depends on KASAN_GENERIC
189         default 0xdfffffff00000000 if 64BIT
190         default 0xffffffff if 32BIT
191
192 config ARCH_FLATMEM_ENABLE
193         def_bool !NUMA
194
195 config ARCH_SPARSEMEM_ENABLE
196         def_bool y
197         depends on MMU
198         select SPARSEMEM_STATIC if 32BIT && SPARSEMEM
199         select SPARSEMEM_VMEMMAP_ENABLE if 64BIT
200
201 config ARCH_SELECT_MEMORY_MODEL
202         def_bool ARCH_SPARSEMEM_ENABLE
203
204 config ARCH_SUPPORTS_UPROBES
205         def_bool y
206
207 config STACKTRACE_SUPPORT
208         def_bool y
209
210 config GENERIC_BUG
211         def_bool y
212         depends on BUG
213         select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
214
215 config GENERIC_BUG_RELATIVE_POINTERS
216         bool
217
218 config GENERIC_CALIBRATE_DELAY
219         def_bool y
220
221 config GENERIC_CSUM
222         def_bool y
223
224 config GENERIC_HWEIGHT
225         def_bool y
226
227 config FIX_EARLYCON_MEM
228         def_bool MMU
229
230 config PGTABLE_LEVELS
231         int
232         default 5 if 64BIT
233         default 2
234
235 config LOCKDEP_SUPPORT
236         def_bool y
237
238 config RISCV_DMA_NONCOHERENT
239         bool
240         select ARCH_HAS_DMA_PREP_COHERENT
241         select ARCH_HAS_SETUP_DMA_OPS
242         select ARCH_HAS_SYNC_DMA_FOR_CPU
243         select ARCH_HAS_SYNC_DMA_FOR_DEVICE
244         select DMA_DIRECT_REMAP
245
246 config AS_HAS_INSN
247         def_bool $(as-instr,.insn r 51$(comma) 0$(comma) 0$(comma) t0$(comma) t0$(comma) zero)
248
249 source "arch/riscv/Kconfig.socs"
250 source "arch/riscv/Kconfig.erratas"
251
252 menu "Platform type"
253
254 config NONPORTABLE
255         bool "Allow configurations that result in non-portable kernels"
256         help
257           RISC-V kernel binaries are compatible between all known systems
258           whenever possible, but there are some use cases that can only be
259           satisfied by configurations that result in kernel binaries that are
260           not portable between systems.
261
262           Selecting N does not guarantee kernels will be portable to all known
263           systems.  Selecting any of the options guarded by NONPORTABLE will
264           result in kernel binaries that are unlikely to be portable between
265           systems.
266
267           If unsure, say N.
268
269 choice
270         prompt "Base ISA"
271         default ARCH_RV64I
272         help
273           This selects the base ISA that this kernel will target and must match
274           the target platform.
275
276 config ARCH_RV32I
277         bool "RV32I"
278         depends on NONPORTABLE
279         select 32BIT
280         select GENERIC_LIB_ASHLDI3
281         select GENERIC_LIB_ASHRDI3
282         select GENERIC_LIB_LSHRDI3
283         select GENERIC_LIB_UCMPDI2
284         select MMU
285
286 config ARCH_RV64I
287         bool "RV64I"
288         select 64BIT
289         select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
290         select SWIOTLB if MMU
291
292 endchoice
293
294 # We must be able to map all physical memory into the kernel, but the compiler
295 # is still a bit more efficient when generating code if it's setup in a manner
296 # such that it can only map 2GiB of memory.
297 choice
298         prompt "Kernel Code Model"
299         default CMODEL_MEDLOW if 32BIT
300         default CMODEL_MEDANY if 64BIT
301
302         config CMODEL_MEDLOW
303                 bool "medium low code model"
304         config CMODEL_MEDANY
305                 bool "medium any code model"
306 endchoice
307
308 config MODULE_SECTIONS
309         bool
310         select HAVE_MOD_ARCH_SPECIFIC
311
312 config SMP
313         bool "Symmetric Multi-Processing"
314         help
315           This enables support for systems with more than one CPU.  If
316           you say N here, the kernel will run on single and
317           multiprocessor machines, but will use only one CPU of a
318           multiprocessor machine. If you say Y here, the kernel will run
319           on many, but not all, single processor machines. On a single
320           processor machine, the kernel will run faster if you say N
321           here.
322
323           If you don't know what to do here, say N.
324
325 config NR_CPUS
326         int "Maximum number of CPUs (2-512)"
327         depends on SMP
328         range 2 512 if !RISCV_SBI_V01
329         range 2 32 if RISCV_SBI_V01 && 32BIT
330         range 2 64 if RISCV_SBI_V01 && 64BIT
331         default "32" if 32BIT
332         default "64" if 64BIT
333
334 config HOTPLUG_CPU
335         bool "Support for hot-pluggable CPUs"
336         depends on SMP
337         select GENERIC_IRQ_MIGRATION
338         help
339
340           Say Y here to experiment with turning CPUs off and on.  CPUs
341           can be controlled through /sys/devices/system/cpu.
342
343           Say N if you want to disable CPU hotplug.
344
345 choice
346         prompt "CPU Tuning"
347         default TUNE_GENERIC
348
349 config TUNE_GENERIC
350         bool "generic"
351
352 endchoice
353
354 # Common NUMA Features
355 config NUMA
356         bool "NUMA Memory Allocation and Scheduler Support"
357         depends on SMP && MMU
358         select ARCH_SUPPORTS_NUMA_BALANCING
359         select GENERIC_ARCH_NUMA
360         select NEED_PER_CPU_EMBED_FIRST_CHUNK
361         select OF_NUMA
362         select USE_PERCPU_NUMA_NODE_ID
363         help
364           Enable NUMA (Non-Uniform Memory Access) support.
365
366           The kernel will try to allocate memory used by a CPU on the
367           local memory of the CPU and add some more NUMA awareness to the kernel.
368
369 config NODES_SHIFT
370         int "Maximum NUMA Nodes (as a power of 2)"
371         range 1 10
372         default "2"
373         depends on NUMA
374         help
375           Specify the maximum number of NUMA Nodes available on the target
376           system.  Increases memory reserved to accommodate various tables.
377
378 config RISCV_ALTERNATIVE
379         bool
380         depends on !XIP_KERNEL
381         help
382           This Kconfig allows the kernel to automatically patch the
383           errata required by the execution platform at run time. The
384           code patching is performed once in the boot stages. It means
385           that the overhead from this mechanism is just taken once.
386
387 config RISCV_ALTERNATIVE_EARLY
388         bool
389         depends on RISCV_ALTERNATIVE
390         help
391           Allows early patching of the kernel for special errata
392
393 config RISCV_ISA_C
394         bool "Emit compressed instructions when building Linux"
395         default y
396         help
397           Adds "C" to the ISA subsets that the toolchain is allowed to emit
398           when building Linux, which results in compressed instructions in the
399           Linux binary.
400
401           If you don't know what to do here, say Y.
402
403 config RISCV_ISA_SVPBMT
404         bool "SVPBMT extension support"
405         depends on 64BIT && MMU
406         depends on !XIP_KERNEL
407         default y
408         select RISCV_ALTERNATIVE
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 !XIP_KERNEL && MMU
434         select 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 !XIP_KERNEL && MMU
449         default y
450         select RISCV_ALTERNATIVE
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"