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