#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#

config RISCV
	def_bool y
	select OF
	select OF_EARLY_FLATTREE
	select OF_IRQ
	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
	select ARCH_WANT_FRAME_POINTERS
	select CLONE_BACKWARDS
	select COMMON_CLK
	select GENERIC_CLOCKEVENTS
	select GENERIC_CPU_DEVICES
	select GENERIC_IRQ_SHOW
	select GENERIC_PCI_IOMAP
	select GENERIC_STRNCPY_FROM_USER
	select GENERIC_STRNLEN_USER
	select GENERIC_SMP_IDLE_THREAD
	select GENERIC_ATOMIC64 if !64BIT || !ISA_A
	select ARCH_WANT_OPTIONAL_GPIOLIB
	select HAVE_MEMBLOCK
	select HAVE_DMA_API_DEBUG
	select HAVE_DMA_CONTIGUOUS
	select HAVE_GENERIC_DMA_COHERENT
	select IRQ_DOMAIN
	select NO_BOOTMEM
	select ISA_A if SMP
	select SYSRISCV_ATOMIC if !ISA_A
	select SPARSE_IRQ
	select SYSCTL_EXCEPTION_TRACE
	select HAVE_ARCH_TRACEHOOK
	select MODULES_USE_ELF_RELA if MODULES

config MMU
	def_bool y

# even on 32-bit, physical (and DMA) addresses are > 32-bits
config ARCH_PHYS_ADDR_T_64BIT
	def_bool y

config ARCH_DMA_ADDR_T_64BIT
	def_bool y

config STACKTRACE_SUPPORT
	def_bool y

config RWSEM_GENERIC_SPINLOCK
	def_bool y

config GENERIC_BUG
	def_bool y
	depends on BUG
	select GENERIC_BUG_RELATIVE_POINTERS if 64BIT

config GENERIC_BUG_RELATIVE_POINTERS
	bool

config GENERIC_CALIBRATE_DELAY
	def_bool y

config GENERIC_CSUM
	def_bool y

config GENERIC_HWEIGHT
	def_bool y

config PGTABLE_LEVELS
	int
	default 3 if 64BIT
	default 2

config HAVE_KPROBES
	def_bool n

config DMA_NOOP_OPS
	def_bool y

menu "Platform type"

config SMP
	bool "Symmetric Multi-Processing"
	help
	  This enables support for systems with more than one CPU.  If
	  you say N here, the kernel will run on single and
	  multiprocessor machines, but will use only one CPU of a
	  multiprocessor machine. If you say Y here, the kernel will run
	  on many, but not all, single processor machines. On a single
	  processor machine, the kernel will run faster if you say N
	  here.

	  If you don't know what to do here, say N.

config NR_CPUS
	int "Maximum number of CPUs (2-32)"
	range 2 32
	depends on SMP
	default "8"

config CPU_SUPPORTS_32BIT_KERNEL
	bool
config CPU_SUPPORTS_64BIT_KERNEL
	bool

choice
	prompt "Base ISA"
	default ARCH_RV64I

config ARCH_RV32I
	bool "RV32I"
	select CPU_SUPPORTS_32BIT_KERNEL
	select 32BIT

config ARCH_RV64I
	bool "RV64I"
	select CPU_SUPPORTS_64BIT_KERNEL
	select 64BIT

endchoice

choice
	prompt "CPU Tuning"
	default TUNE_GENERIC

config TUNE_GENERIC
	bool "generic"

endchoice

config PLIC
	bool "Platform-Level Interrupt Controller"
	default y
	help
	   This enables support for the PLIC chip found in standard RISC-V
	   systems. The PLIC is the top-most interrupt controller found in
	   the system, connected directly to the core complex. All other
	   interrupt sources (MSI, GPIO, etc) are subordinate to the PLIC.

	   If you don't know what to do here, say Y.

config SBI_CONSOLE
	tristate "SBI console support"
	select TTY
	default y

config SBI_DISK
	tristate "SBI disk support"
	default y

config GENERIC_BLKDEV
        tristate "Generic Block Device"
        default y

config ICENET
        tristate "IceNet Ethernet NIC"
        default y

config ISA_C
	bool "Emit compressed instructions when building Linux"
	default n

config ISA_A
	bool "Emit atomic instructions when building Linux"
	default y

config SYSRISCV_ATOMIC
	bool "Include support for atomic operation syscalls"
	default n
	help
	  If atomic memory instructions are present, i.e.,
	  CONFIG_ISA_A, this includes support for the syscall that
	  provides atomic accesses.  This is only useful to run
	  binaries that require atomic access but were compiled with
	  -mno-atomic.

	  If CONFIG_ISA_A is unset, this option is mandatory.

config RV_PUM
	def_bool y
	prompt "Protect User Memory" if EXPERT
	---help---
	  Protect User Memory (PUM) prevents the kernel from inadvertently
	  accessing user-space memory.  There is a small performance cost
	  and kernel size increase if this is enabled.

	  If unsure, say Y.

endmenu

menu "Kernel type"

choice
	prompt "Kernel code model"
	default 64BIT

config 32BIT
	bool "32-bit kernel"
	depends on CPU_SUPPORTS_32BIT_KERNEL
	help
	  Select this option to build a 32-bit kernel.

config 64BIT
	bool "64-bit kernel"
	depends on CPU_SUPPORTS_64BIT_KERNEL
	help
	  Select this option to build a 64-bit kernel.

endchoice

source "mm/Kconfig"

source "kernel/Kconfig.preempt"

source "kernel/Kconfig.hz"

endmenu

menu "Bus support"

config PCI
	bool "PCI support"
	select PCI_MSI
	help
	  This feature enables support for PCI bus system. If you say Y
	  here, the kernel will include drivers and infrastructure code
	  to support PCI bus devices.

config PCI_DOMAINS
	def_bool PCI

config PCI_DOMAINS_GENERIC
	def_bool PCI

config PCI_SYSCALL
	def_bool PCI

source "drivers/pci/Kconfig"

endmenu

source "init/Kconfig"

source "kernel/Kconfig.freezer"

menu "Executable file formats"

source "fs/Kconfig.binfmt"

endmenu

menu "Power management options"

source kernel/power/Kconfig

endmenu

source "net/Kconfig"

source "drivers/Kconfig"

source "fs/Kconfig"

menu "Kernel hacking"

config CMDLINE_BOOL
	bool "Built-in kernel command line"
	default n
	help
	  For most platforms, it is firmware or second stage bootloader
	  that by default specifies the kernel command line options.
	  However, it might be necessary or advantageous to either override
	  the default kernel command line or add a few extra options to it.
	  For such cases, this option allows hardcoding command line options
	  directly into the kernel.

	  For that, choose 'Y' here and fill in the extra boot parameters
	  in CONFIG_CMDLINE.

	  The built-in options will be concatenated to the default command
	  line if CMDLINE_OVERRIDE is set to 'N'. Otherwise, the default
	  command line will be ignored and replaced by the built-in string.

config CMDLINE
	string "Built-in kernel command string"
	depends on CMDLINE_BOOL
	default ""
	help
	  Supply command-line options at build time by entering them here.

config CMDLINE_OVERRIDE
	bool "Built-in command line overrides bootloader arguments"
	default n
	depends on CMDLINE_BOOL
	help
	  Set this option to 'Y' to have the kernel ignore the bootloader
	  or firmware command line.  Instead, the built-in command line
	  will be used exclusively.

config EARLY_PRINTK
	bool "Early printk"
	default n
	help
	  This option enables special console drivers which allow the kernel
	  to print messages very early in the bootup process.

	  This is useful for kernel debugging when your machine crashes very
	  early before the console code is initialized. For normal operation
	  it is not recommended because it looks ugly and doesn't cooperate
	  with klogd/syslogd or the X server. You should normally N here,
	  unless you want to debug such a crash.


source "lib/Kconfig.debug"

config CMDLINE_BOOL
	bool
endmenu

source "security/Kconfig"

source "crypto/Kconfig"

source "lib/Kconfig"

