18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci#
38c2ecf20Sopenharmony_ci# For a description of the syntax of this configuration file,
48c2ecf20Sopenharmony_ci# see Documentation/kbuild/kconfig-language.rst.
58c2ecf20Sopenharmony_ci#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciconfig 64BIT
88c2ecf20Sopenharmony_ci	bool
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciconfig 32BIT
118c2ecf20Sopenharmony_ci	bool
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciconfig RISCV
148c2ecf20Sopenharmony_ci	def_bool y
158c2ecf20Sopenharmony_ci	select ARCH_CLOCKSOURCE_INIT
168c2ecf20Sopenharmony_ci	select ARCH_SUPPORTS_ATOMIC_RMW
178c2ecf20Sopenharmony_ci	select ARCH_STACKWALK
188c2ecf20Sopenharmony_ci	select ARCH_HAS_BINFMT_FLAT
198c2ecf20Sopenharmony_ci	select ARCH_HAS_DEBUG_VM_PGTABLE
208c2ecf20Sopenharmony_ci	select ARCH_HAS_DEBUG_VIRTUAL if MMU
218c2ecf20Sopenharmony_ci	select ARCH_HAS_DEBUG_WX
228c2ecf20Sopenharmony_ci	select ARCH_HAS_GCOV_PROFILE_ALL
238c2ecf20Sopenharmony_ci	select ARCH_HAS_GIGANTIC_PAGE
248c2ecf20Sopenharmony_ci	select ARCH_HAS_KCOV
258c2ecf20Sopenharmony_ci	select ARCH_HAS_MMIOWB
268c2ecf20Sopenharmony_ci	select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
278c2ecf20Sopenharmony_ci	select ARCH_HAS_PTE_SPECIAL
288c2ecf20Sopenharmony_ci	select ARCH_HAS_SET_DIRECT_MAP
298c2ecf20Sopenharmony_ci	select ARCH_HAS_SET_MEMORY
308c2ecf20Sopenharmony_ci	select ARCH_HAS_STRICT_KERNEL_RWX if MMU
318c2ecf20Sopenharmony_ci	select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
328c2ecf20Sopenharmony_ci	select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
338c2ecf20Sopenharmony_ci	select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT if MMU
348c2ecf20Sopenharmony_ci	select ARCH_WANT_FRAME_POINTERS
358c2ecf20Sopenharmony_ci	select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
368c2ecf20Sopenharmony_ci	select CLONE_BACKWARDS
378c2ecf20Sopenharmony_ci	select CLINT_TIMER if !MMU
388c2ecf20Sopenharmony_ci	select COMMON_CLK
398c2ecf20Sopenharmony_ci	select EDAC_SUPPORT
408c2ecf20Sopenharmony_ci	select GENERIC_ARCH_TOPOLOGY
418c2ecf20Sopenharmony_ci	select GENERIC_ATOMIC64 if !64BIT
428c2ecf20Sopenharmony_ci	select GENERIC_CLOCKEVENTS
438c2ecf20Sopenharmony_ci	select GENERIC_EARLY_IOREMAP
448c2ecf20Sopenharmony_ci	select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO
458c2ecf20Sopenharmony_ci	select GENERIC_IOREMAP
468c2ecf20Sopenharmony_ci	select GENERIC_IRQ_MULTI_HANDLER
478c2ecf20Sopenharmony_ci	select GENERIC_IRQ_SHOW
488c2ecf20Sopenharmony_ci	select GENERIC_PCI_IOMAP
498c2ecf20Sopenharmony_ci	select GENERIC_PTDUMP if MMU
508c2ecf20Sopenharmony_ci	select GENERIC_SCHED_CLOCK
518c2ecf20Sopenharmony_ci	select GENERIC_SMP_IDLE_THREAD
528c2ecf20Sopenharmony_ci	select GENERIC_STRNCPY_FROM_USER if MMU
538c2ecf20Sopenharmony_ci	select GENERIC_STRNLEN_USER if MMU
548c2ecf20Sopenharmony_ci	select GENERIC_TIME_VSYSCALL if MMU && 64BIT
558c2ecf20Sopenharmony_ci	select HANDLE_DOMAIN_IRQ
568c2ecf20Sopenharmony_ci	select HAVE_ARCH_AUDITSYSCALL
578c2ecf20Sopenharmony_ci	select HAVE_ARCH_JUMP_LABEL
588c2ecf20Sopenharmony_ci	select HAVE_ARCH_JUMP_LABEL_RELATIVE
598c2ecf20Sopenharmony_ci	select HAVE_ARCH_KASAN if MMU && 64BIT
608c2ecf20Sopenharmony_ci	select HAVE_ARCH_KGDB
618c2ecf20Sopenharmony_ci	select HAVE_ARCH_KGDB_QXFER_PKT
628c2ecf20Sopenharmony_ci	select HAVE_ARCH_MMAP_RND_BITS if MMU
638c2ecf20Sopenharmony_ci	select HAVE_ARCH_SECCOMP_FILTER
648c2ecf20Sopenharmony_ci	select HAVE_ARCH_TRACEHOOK
658c2ecf20Sopenharmony_ci	select HAVE_ASM_MODVERSIONS
668c2ecf20Sopenharmony_ci	select HAVE_CONTEXT_TRACKING
678c2ecf20Sopenharmony_ci	select HAVE_DEBUG_KMEMLEAK
688c2ecf20Sopenharmony_ci	select HAVE_DMA_CONTIGUOUS if MMU
698c2ecf20Sopenharmony_ci	select HAVE_EBPF_JIT if MMU
708c2ecf20Sopenharmony_ci	select HAVE_FUTEX_CMPXCHG if FUTEX
718c2ecf20Sopenharmony_ci	select HAVE_GCC_PLUGINS
728c2ecf20Sopenharmony_ci	select HAVE_GENERIC_VDSO if MMU && 64BIT
738c2ecf20Sopenharmony_ci	select HAVE_PCI
748c2ecf20Sopenharmony_ci	select HAVE_PERF_EVENTS
758c2ecf20Sopenharmony_ci	select HAVE_PERF_REGS
768c2ecf20Sopenharmony_ci	select HAVE_PERF_USER_STACK_DUMP
778c2ecf20Sopenharmony_ci	select HAVE_STACKPROTECTOR
788c2ecf20Sopenharmony_ci	select HAVE_SYSCALL_TRACEPOINTS
798c2ecf20Sopenharmony_ci	select IRQ_DOMAIN
808c2ecf20Sopenharmony_ci	select MODULES_USE_ELF_RELA if MODULES
818c2ecf20Sopenharmony_ci	select MODULE_SECTIONS if MODULES
828c2ecf20Sopenharmony_ci	select OF
838c2ecf20Sopenharmony_ci	select OF_EARLY_FLATTREE
848c2ecf20Sopenharmony_ci	select OF_IRQ
858c2ecf20Sopenharmony_ci	select PCI_DOMAINS_GENERIC if PCI
868c2ecf20Sopenharmony_ci	select PCI_MSI if PCI
878c2ecf20Sopenharmony_ci	select RISCV_INTC
888c2ecf20Sopenharmony_ci	select RISCV_TIMER if RISCV_SBI
898c2ecf20Sopenharmony_ci	select SPARSE_IRQ
908c2ecf20Sopenharmony_ci	select SYSCTL_EXCEPTION_TRACE
918c2ecf20Sopenharmony_ci	select THREAD_INFO_IN_TASK
928c2ecf20Sopenharmony_ci	select UACCESS_MEMCPY if !MMU
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ciconfig ARCH_MMAP_RND_BITS_MIN
958c2ecf20Sopenharmony_ci	default 18 if 64BIT
968c2ecf20Sopenharmony_ci	default 8
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci# max bits determined by the following formula:
998c2ecf20Sopenharmony_ci#  VA_BITS - PAGE_SHIFT - 3
1008c2ecf20Sopenharmony_ciconfig ARCH_MMAP_RND_BITS_MAX
1018c2ecf20Sopenharmony_ci	default 24 if 64BIT # SV39 based
1028c2ecf20Sopenharmony_ci	default 17
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci# set if we run in machine mode, cleared if we run in supervisor mode
1058c2ecf20Sopenharmony_ciconfig RISCV_M_MODE
1068c2ecf20Sopenharmony_ci	bool
1078c2ecf20Sopenharmony_ci	default !MMU
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci# set if we are running in S-mode and can use SBI calls
1108c2ecf20Sopenharmony_ciconfig RISCV_SBI
1118c2ecf20Sopenharmony_ci	bool
1128c2ecf20Sopenharmony_ci	depends on !RISCV_M_MODE
1138c2ecf20Sopenharmony_ci	default y
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ciconfig MMU
1168c2ecf20Sopenharmony_ci	bool "MMU-based Paged Memory Management Support"
1178c2ecf20Sopenharmony_ci	default y
1188c2ecf20Sopenharmony_ci	help
1198c2ecf20Sopenharmony_ci	  Select if you want MMU-based virtualised addressing space
1208c2ecf20Sopenharmony_ci	  support by paged memory management. If unsure, say 'Y'.
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ciconfig ZONE_DMA32
1238c2ecf20Sopenharmony_ci	bool
1248c2ecf20Sopenharmony_ci	default y if 64BIT
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ciconfig VA_BITS
1278c2ecf20Sopenharmony_ci	int
1288c2ecf20Sopenharmony_ci	default 32 if 32BIT
1298c2ecf20Sopenharmony_ci	default 39 if 64BIT
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ciconfig PA_BITS
1328c2ecf20Sopenharmony_ci	int
1338c2ecf20Sopenharmony_ci	default 34 if 32BIT
1348c2ecf20Sopenharmony_ci	default 56 if 64BIT
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ciconfig PAGE_OFFSET
1378c2ecf20Sopenharmony_ci	hex
1388c2ecf20Sopenharmony_ci	default 0xC0000000 if 32BIT && MAXPHYSMEM_1GB
1398c2ecf20Sopenharmony_ci	default 0x80000000 if 64BIT && !MMU
1408c2ecf20Sopenharmony_ci	default 0xffffffff80000000 if 64BIT && MAXPHYSMEM_2GB
1418c2ecf20Sopenharmony_ci	default 0xffffffe000000000 if 64BIT && MAXPHYSMEM_128GB
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ciconfig KASAN_SHADOW_OFFSET
1448c2ecf20Sopenharmony_ci	hex
1458c2ecf20Sopenharmony_ci	depends on KASAN_GENERIC
1468c2ecf20Sopenharmony_ci	default 0xdfffffc800000000 if 64BIT
1478c2ecf20Sopenharmony_ci	default 0xffffffff if 32BIT
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ciconfig ARCH_FLATMEM_ENABLE
1508c2ecf20Sopenharmony_ci	def_bool y
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ciconfig ARCH_SPARSEMEM_ENABLE
1538c2ecf20Sopenharmony_ci	def_bool y
1548c2ecf20Sopenharmony_ci	depends on MMU
1558c2ecf20Sopenharmony_ci	select SPARSEMEM_STATIC if 32BIT && SPARSEMEM
1568c2ecf20Sopenharmony_ci	select SPARSEMEM_VMEMMAP_ENABLE if 64BIT
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ciconfig ARCH_SELECT_MEMORY_MODEL
1598c2ecf20Sopenharmony_ci	def_bool ARCH_SPARSEMEM_ENABLE
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ciconfig ARCH_WANT_GENERAL_HUGETLB
1628c2ecf20Sopenharmony_ci	def_bool y
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ciconfig ARCH_SUPPORTS_DEBUG_PAGEALLOC
1658c2ecf20Sopenharmony_ci	def_bool y
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ciconfig SYS_SUPPORTS_HUGETLBFS
1688c2ecf20Sopenharmony_ci	depends on MMU
1698c2ecf20Sopenharmony_ci	def_bool y
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ciconfig STACKTRACE_SUPPORT
1728c2ecf20Sopenharmony_ci	def_bool y
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ciconfig TRACE_IRQFLAGS_SUPPORT
1758c2ecf20Sopenharmony_ci	def_bool y
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ciconfig GENERIC_BUG
1788c2ecf20Sopenharmony_ci	def_bool y
1798c2ecf20Sopenharmony_ci	depends on BUG
1808c2ecf20Sopenharmony_ci	select GENERIC_BUG_RELATIVE_POINTERS if 64BIT
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ciconfig GENERIC_BUG_RELATIVE_POINTERS
1838c2ecf20Sopenharmony_ci	bool
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ciconfig GENERIC_CALIBRATE_DELAY
1868c2ecf20Sopenharmony_ci	def_bool y
1878c2ecf20Sopenharmony_ci
1888c2ecf20Sopenharmony_ciconfig GENERIC_CSUM
1898c2ecf20Sopenharmony_ci	def_bool y
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ciconfig GENERIC_HWEIGHT
1928c2ecf20Sopenharmony_ci	def_bool y
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ciconfig FIX_EARLYCON_MEM
1958c2ecf20Sopenharmony_ci	def_bool MMU
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ciconfig PGTABLE_LEVELS
1988c2ecf20Sopenharmony_ci	int
1998c2ecf20Sopenharmony_ci	default 3 if 64BIT
2008c2ecf20Sopenharmony_ci	default 2
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ciconfig LOCKDEP_SUPPORT
2038c2ecf20Sopenharmony_ci	def_bool y
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_cisource "arch/riscv/Kconfig.socs"
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_cimenu "Platform type"
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_cichoice
2108c2ecf20Sopenharmony_ci	prompt "Base ISA"
2118c2ecf20Sopenharmony_ci	default ARCH_RV64I
2128c2ecf20Sopenharmony_ci	help
2138c2ecf20Sopenharmony_ci	  This selects the base ISA that this kernel will target and must match
2148c2ecf20Sopenharmony_ci	  the target platform.
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ciconfig ARCH_RV32I
2178c2ecf20Sopenharmony_ci	bool "RV32I"
2188c2ecf20Sopenharmony_ci	select 32BIT
2198c2ecf20Sopenharmony_ci	select GENERIC_LIB_ASHLDI3
2208c2ecf20Sopenharmony_ci	select GENERIC_LIB_ASHRDI3
2218c2ecf20Sopenharmony_ci	select GENERIC_LIB_LSHRDI3
2228c2ecf20Sopenharmony_ci	select GENERIC_LIB_UCMPDI2
2238c2ecf20Sopenharmony_ci	select MMU
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ciconfig ARCH_RV64I
2268c2ecf20Sopenharmony_ci	bool "RV64I"
2278c2ecf20Sopenharmony_ci	select 64BIT
2288c2ecf20Sopenharmony_ci	select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && GCC_VERSION >= 50000
2298c2ecf20Sopenharmony_ci	select HAVE_DYNAMIC_FTRACE if MMU
2308c2ecf20Sopenharmony_ci	select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
2318c2ecf20Sopenharmony_ci	select HAVE_FTRACE_MCOUNT_RECORD
2328c2ecf20Sopenharmony_ci	select HAVE_FUNCTION_GRAPH_TRACER
2338c2ecf20Sopenharmony_ci	select HAVE_FUNCTION_TRACER
2348c2ecf20Sopenharmony_ci	select SWIOTLB if MMU
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ciendchoice
2378c2ecf20Sopenharmony_ci
2388c2ecf20Sopenharmony_ci# We must be able to map all physical memory into the kernel, but the compiler
2398c2ecf20Sopenharmony_ci# is still a bit more efficient when generating code if it's setup in a manner
2408c2ecf20Sopenharmony_ci# such that it can only map 2GiB of memory.
2418c2ecf20Sopenharmony_cichoice
2428c2ecf20Sopenharmony_ci	prompt "Kernel Code Model"
2438c2ecf20Sopenharmony_ci	default CMODEL_MEDLOW if 32BIT
2448c2ecf20Sopenharmony_ci	default CMODEL_MEDANY if 64BIT
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci	config CMODEL_MEDLOW
2478c2ecf20Sopenharmony_ci		bool "medium low code model"
2488c2ecf20Sopenharmony_ci	config CMODEL_MEDANY
2498c2ecf20Sopenharmony_ci		bool "medium any code model"
2508c2ecf20Sopenharmony_ciendchoice
2518c2ecf20Sopenharmony_ci
2528c2ecf20Sopenharmony_ciconfig MODULE_SECTIONS
2538c2ecf20Sopenharmony_ci	bool
2548c2ecf20Sopenharmony_ci	select HAVE_MOD_ARCH_SPECIFIC
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_cichoice
2578c2ecf20Sopenharmony_ci	prompt "Maximum Physical Memory"
2588c2ecf20Sopenharmony_ci	default MAXPHYSMEM_1GB if 32BIT
2598c2ecf20Sopenharmony_ci	default MAXPHYSMEM_2GB if 64BIT && CMODEL_MEDLOW
2608c2ecf20Sopenharmony_ci	default MAXPHYSMEM_128GB if 64BIT && CMODEL_MEDANY
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ci	config MAXPHYSMEM_1GB
2638c2ecf20Sopenharmony_ci		depends on 32BIT
2648c2ecf20Sopenharmony_ci		bool "1GiB"
2658c2ecf20Sopenharmony_ci	config MAXPHYSMEM_2GB
2668c2ecf20Sopenharmony_ci		depends on 64BIT && CMODEL_MEDLOW
2678c2ecf20Sopenharmony_ci		bool "2GiB"
2688c2ecf20Sopenharmony_ci	config MAXPHYSMEM_128GB
2698c2ecf20Sopenharmony_ci		depends on 64BIT && CMODEL_MEDANY
2708c2ecf20Sopenharmony_ci		bool "128GiB"
2718c2ecf20Sopenharmony_ciendchoice
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_ciconfig SMP
2758c2ecf20Sopenharmony_ci	bool "Symmetric Multi-Processing"
2768c2ecf20Sopenharmony_ci	help
2778c2ecf20Sopenharmony_ci	  This enables support for systems with more than one CPU.  If
2788c2ecf20Sopenharmony_ci	  you say N here, the kernel will run on single and
2798c2ecf20Sopenharmony_ci	  multiprocessor machines, but will use only one CPU of a
2808c2ecf20Sopenharmony_ci	  multiprocessor machine. If you say Y here, the kernel will run
2818c2ecf20Sopenharmony_ci	  on many, but not all, single processor machines. On a single
2828c2ecf20Sopenharmony_ci	  processor machine, the kernel will run faster if you say N
2838c2ecf20Sopenharmony_ci	  here.
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_ci	  If you don't know what to do here, say N.
2868c2ecf20Sopenharmony_ci
2878c2ecf20Sopenharmony_ciconfig NR_CPUS
2888c2ecf20Sopenharmony_ci	int "Maximum number of CPUs (2-32)"
2898c2ecf20Sopenharmony_ci	range 2 32
2908c2ecf20Sopenharmony_ci	depends on SMP
2918c2ecf20Sopenharmony_ci	default "8"
2928c2ecf20Sopenharmony_ci
2938c2ecf20Sopenharmony_ciconfig HOTPLUG_CPU
2948c2ecf20Sopenharmony_ci	bool "Support for hot-pluggable CPUs"
2958c2ecf20Sopenharmony_ci	depends on SMP
2968c2ecf20Sopenharmony_ci	select GENERIC_IRQ_MIGRATION
2978c2ecf20Sopenharmony_ci	help
2988c2ecf20Sopenharmony_ci
2998c2ecf20Sopenharmony_ci	  Say Y here to experiment with turning CPUs off and on.  CPUs
3008c2ecf20Sopenharmony_ci	  can be controlled through /sys/devices/system/cpu.
3018c2ecf20Sopenharmony_ci
3028c2ecf20Sopenharmony_ci	  Say N if you want to disable CPU hotplug.
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_cichoice
3058c2ecf20Sopenharmony_ci	prompt "CPU Tuning"
3068c2ecf20Sopenharmony_ci	default TUNE_GENERIC
3078c2ecf20Sopenharmony_ci
3088c2ecf20Sopenharmony_ciconfig TUNE_GENERIC
3098c2ecf20Sopenharmony_ci	bool "generic"
3108c2ecf20Sopenharmony_ci
3118c2ecf20Sopenharmony_ciendchoice
3128c2ecf20Sopenharmony_ci
3138c2ecf20Sopenharmony_ciconfig RISCV_ISA_C
3148c2ecf20Sopenharmony_ci	bool "Emit compressed instructions when building Linux"
3158c2ecf20Sopenharmony_ci	default y
3168c2ecf20Sopenharmony_ci	help
3178c2ecf20Sopenharmony_ci	   Adds "C" to the ISA subsets that the toolchain is allowed to emit
3188c2ecf20Sopenharmony_ci	   when building Linux, which results in compressed instructions in the
3198c2ecf20Sopenharmony_ci	   Linux binary.
3208c2ecf20Sopenharmony_ci
3218c2ecf20Sopenharmony_ci	   If you don't know what to do here, say Y.
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_cimenu "supported PMU type"
3248c2ecf20Sopenharmony_ci	depends on PERF_EVENTS
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ciconfig RISCV_BASE_PMU
3278c2ecf20Sopenharmony_ci	bool "Base Performance Monitoring Unit"
3288c2ecf20Sopenharmony_ci	def_bool y
3298c2ecf20Sopenharmony_ci	help
3308c2ecf20Sopenharmony_ci	  A base PMU that serves as a reference implementation and has limited
3318c2ecf20Sopenharmony_ci	  feature of perf.  It can run on any RISC-V machines so serves as the
3328c2ecf20Sopenharmony_ci	  fallback, but this option can also be disable to reduce kernel size.
3338c2ecf20Sopenharmony_ci
3348c2ecf20Sopenharmony_ciendmenu
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_ciconfig TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
3378c2ecf20Sopenharmony_ci	def_bool y
3388c2ecf20Sopenharmony_ci	# https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=aed44286efa8ae8717a77d94b51ac3614e2ca6dc
3398c2ecf20Sopenharmony_ci	depends on AS_IS_GNU && AS_VERSION >= 23800
3408c2ecf20Sopenharmony_ci	help
3418c2ecf20Sopenharmony_ci	  Newer binutils versions default to ISA spec version 20191213 which
3428c2ecf20Sopenharmony_ci	  moves some instructions from the I extension to the Zicsr and Zifencei
3438c2ecf20Sopenharmony_ci	  extensions.
3448c2ecf20Sopenharmony_ci
3458c2ecf20Sopenharmony_ciconfig TOOLCHAIN_NEEDS_OLD_ISA_SPEC
3468c2ecf20Sopenharmony_ci	def_bool y
3478c2ecf20Sopenharmony_ci	depends on TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI
3488c2ecf20Sopenharmony_ci	# https://github.com/llvm/llvm-project/commit/22e199e6afb1263c943c0c0d4498694e15bf8a16
3498c2ecf20Sopenharmony_ci	depends on CC_IS_CLANG && CLANG_VERSION < 170000
3508c2ecf20Sopenharmony_ci	help
3518c2ecf20Sopenharmony_ci	  Certain versions of clang do not support zicsr and zifencei via -march
3528c2ecf20Sopenharmony_ci	  but newer versions of binutils require it for the reasons noted in the
3538c2ecf20Sopenharmony_ci	  help text of CONFIG_TOOLCHAIN_NEEDS_EXPLICIT_ZICSR_ZIFENCEI. This
3548c2ecf20Sopenharmony_ci	  option causes an older ISA spec compatible with these older versions
3558c2ecf20Sopenharmony_ci	  of clang to be passed to GAS, which has the same result as passing zicsr
3568c2ecf20Sopenharmony_ci	  and zifencei to -march.
3578c2ecf20Sopenharmony_ci
3588c2ecf20Sopenharmony_ciconfig FPU
3598c2ecf20Sopenharmony_ci	bool "FPU support"
3608c2ecf20Sopenharmony_ci	default y
3618c2ecf20Sopenharmony_ci	help
3628c2ecf20Sopenharmony_ci	  Say N here if you want to disable all floating-point related procedure
3638c2ecf20Sopenharmony_ci	  in the kernel.
3648c2ecf20Sopenharmony_ci
3658c2ecf20Sopenharmony_ci	  If you don't know what to do here, say Y.
3668c2ecf20Sopenharmony_ci
3678c2ecf20Sopenharmony_ciendmenu
3688c2ecf20Sopenharmony_ci
3698c2ecf20Sopenharmony_cimenu "Kernel features"
3708c2ecf20Sopenharmony_ci
3718c2ecf20Sopenharmony_cisource "kernel/Kconfig.hz"
3728c2ecf20Sopenharmony_ci
3738c2ecf20Sopenharmony_ciconfig RISCV_SBI_V01
3748c2ecf20Sopenharmony_ci	bool "SBI v0.1 support"
3758c2ecf20Sopenharmony_ci	default y
3768c2ecf20Sopenharmony_ci	depends on RISCV_SBI
3778c2ecf20Sopenharmony_ci	help
3788c2ecf20Sopenharmony_ci	  This config allows kernel to use SBI v0.1 APIs. This will be
3798c2ecf20Sopenharmony_ci	  deprecated in future once legacy M-mode software are no longer in use.
3808c2ecf20Sopenharmony_ciendmenu
3818c2ecf20Sopenharmony_ci
3828c2ecf20Sopenharmony_cimenu "Boot options"
3838c2ecf20Sopenharmony_ci
3848c2ecf20Sopenharmony_ciconfig CMDLINE
3858c2ecf20Sopenharmony_ci	string "Built-in kernel command line"
3868c2ecf20Sopenharmony_ci	help
3878c2ecf20Sopenharmony_ci	  For most platforms, the arguments for the kernel's command line
3888c2ecf20Sopenharmony_ci	  are provided at run-time, during boot. However, there are cases
3898c2ecf20Sopenharmony_ci	  where either no arguments are being provided or the provided
3908c2ecf20Sopenharmony_ci	  arguments are insufficient or even invalid.
3918c2ecf20Sopenharmony_ci
3928c2ecf20Sopenharmony_ci	  When that occurs, it is possible to define a built-in command
3938c2ecf20Sopenharmony_ci	  line here and choose how the kernel should use it later on.
3948c2ecf20Sopenharmony_ci
3958c2ecf20Sopenharmony_cichoice
3968c2ecf20Sopenharmony_ci	prompt "Built-in command line usage" if CMDLINE != ""
3978c2ecf20Sopenharmony_ci	default CMDLINE_FALLBACK
3988c2ecf20Sopenharmony_ci	help
3998c2ecf20Sopenharmony_ci	  Choose how the kernel will handle the provided built-in command
4008c2ecf20Sopenharmony_ci	  line.
4018c2ecf20Sopenharmony_ci
4028c2ecf20Sopenharmony_ciconfig CMDLINE_FALLBACK
4038c2ecf20Sopenharmony_ci	bool "Use bootloader kernel arguments if available"
4048c2ecf20Sopenharmony_ci	help
4058c2ecf20Sopenharmony_ci	  Use the built-in command line as fallback in case we get nothing
4068c2ecf20Sopenharmony_ci	  during boot. This is the default behaviour.
4078c2ecf20Sopenharmony_ci
4088c2ecf20Sopenharmony_ciconfig CMDLINE_EXTEND
4098c2ecf20Sopenharmony_ci	bool "Extend bootloader kernel arguments"
4108c2ecf20Sopenharmony_ci	help
4118c2ecf20Sopenharmony_ci	  The command-line arguments provided during boot will be
4128c2ecf20Sopenharmony_ci	  appended to the built-in command line. This is useful in
4138c2ecf20Sopenharmony_ci	  cases where the provided arguments are insufficient and
4148c2ecf20Sopenharmony_ci	  you don't want to or cannot modify them.
4158c2ecf20Sopenharmony_ci
4168c2ecf20Sopenharmony_ci
4178c2ecf20Sopenharmony_ciconfig CMDLINE_FORCE
4188c2ecf20Sopenharmony_ci	bool "Always use the default kernel command string"
4198c2ecf20Sopenharmony_ci	help
4208c2ecf20Sopenharmony_ci	  Always use the built-in command line, even if we get one during
4218c2ecf20Sopenharmony_ci	  boot. This is useful in case you need to override the provided
4228c2ecf20Sopenharmony_ci	  command line on systems where you don't have or want control
4238c2ecf20Sopenharmony_ci	  over it.
4248c2ecf20Sopenharmony_ci
4258c2ecf20Sopenharmony_ciendchoice
4268c2ecf20Sopenharmony_ci
4278c2ecf20Sopenharmony_ciconfig EFI_STUB
4288c2ecf20Sopenharmony_ci	bool
4298c2ecf20Sopenharmony_ci
4308c2ecf20Sopenharmony_ciconfig EFI
4318c2ecf20Sopenharmony_ci	bool "UEFI runtime support"
4328c2ecf20Sopenharmony_ci	depends on OF
4338c2ecf20Sopenharmony_ci	select LIBFDT
4348c2ecf20Sopenharmony_ci	select UCS2_STRING
4358c2ecf20Sopenharmony_ci	select EFI_PARAMS_FROM_FDT
4368c2ecf20Sopenharmony_ci	select EFI_STUB
4378c2ecf20Sopenharmony_ci	select EFI_GENERIC_STUB
4388c2ecf20Sopenharmony_ci	select EFI_RUNTIME_WRAPPERS
4398c2ecf20Sopenharmony_ci	select RISCV_ISA_C
4408c2ecf20Sopenharmony_ci	depends on MMU
4418c2ecf20Sopenharmony_ci	default y
4428c2ecf20Sopenharmony_ci	help
4438c2ecf20Sopenharmony_ci	  This option provides support for runtime services provided
4448c2ecf20Sopenharmony_ci	  by UEFI firmware (such as non-volatile variables, realtime
4458c2ecf20Sopenharmony_ci	  clock, and platform reset). A UEFI stub is also provided to
4468c2ecf20Sopenharmony_ci	  allow the kernel to be booted as an EFI application. This
4478c2ecf20Sopenharmony_ci	  is only useful on systems that have UEFI firmware.
4488c2ecf20Sopenharmony_ci
4498c2ecf20Sopenharmony_ciendmenu
4508c2ecf20Sopenharmony_ci
4518c2ecf20Sopenharmony_ciconfig BUILTIN_DTB
4528c2ecf20Sopenharmony_ci	def_bool n
4538c2ecf20Sopenharmony_ci	depends on RISCV_M_MODE
4548c2ecf20Sopenharmony_ci	depends on OF
4558c2ecf20Sopenharmony_ci
4568c2ecf20Sopenharmony_cimenu "Power management options"
4578c2ecf20Sopenharmony_ci
4588c2ecf20Sopenharmony_cisource "kernel/power/Kconfig"
4598c2ecf20Sopenharmony_ci
4608c2ecf20Sopenharmony_ciendmenu
4618c2ecf20Sopenharmony_ci
4628c2ecf20Sopenharmony_cisource "drivers/firmware/Kconfig"
463