# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.

config ADK_KERNEL_EXPERIMENTAL
	bool
	default y

config ADK_KERNEL_STAGING
	bool

config ADK_KERNEL_CGROUP_CPUACCT
	bool

config ADK_KERNEL_CGROUP_DEVICE
	bool

config ADK_KERNEL_CGROUP_SCHED
	bool

config ADK_KERNEL_CGROUPS
	bool

config ADK_KERNEL_NAMESPACES
	bool

config ADK_KERNEL_FHANDLE
	bool

config ADK_KERNEL_AUDIT
	bool

config ADK_KERNEL_RESET_CONTROLLER
        bool

config ADK_KERNEL_BLK_DEV_INITRD
	bool

config ADK_KERNEL_BLK_DEV_RAM
	bool

config ADK_KERNEL_NETWORK_FILESYSTEMS
	bool

config ADK_KERNEL_IP_PNP
	bool

config ADK_KERNEL_IP_PNP_DHCP
	bool

config ADK_KERNEL_ROOT_NFS
	bool

config ADK_KERNEL_NFS_COMMON
	bool

config ADK_KERNEL_64BIT
	bool
	default y if ADK_LINUX_64

# ARM specific
config ADK_KERNEL_AEABI
	bool
	default y if ADK_TARGET_ARCH_ARM

config ADK_KERNEL_ARM_THUMB
	bool

config ADK_KERNEL_THUMB2_KERNEL
	bool

# endianess
config ADK_KERNEL_CPU_BIG_ENDIAN
	bool
	default y if ADK_TARGET_BIG_ENDIAN

config ADK_KERNEL_CPU_LITTLE_ENDIAN
	bool
	default y if ADK_TARGET_LITTLE_ENDIAN

menu "Kernel options"

config ADK_KERNEL_MODULE_UNLOAD
	bool "Module unloading"

config ADK_KERNEL_HOTPLUG
	bool

config ADK_KERNEL_DEVTMPFS
	bool

config ADK_KERNEL_DEVTMPFS_MOUNT
	bool
	select ADK_KERNEL_HOTPLUG

config ADK_KERNEL_UEVENT_HELPER
	bool
	depends on ADK_RUNTIME_DEV_MDEV
	default y if ADK_RUNTIME_DEV_MDEV

config ADK_KERNEL_UEVENT_HELPER_PATH
	string
	default "/sbin/mdev"
	depends on ADK_RUNTIME_DEV_MDEV

config ADK_KERNEL_BINFMT_ELF
	bool
	default y if ADK_TARGET_BINFMT_ELF

config ADK_KERNEL_BINFMT_ELF_FDPIC
	bool
	default y if ADK_TARGET_BINFMT_FDPIC

config ADK_KERNEL_BINFMT_FLAT
	bool
	default y if ADK_TARGET_BINFMT_FLAT

config ADK_KERNEL_BINFMT_SHARED_FLAT
	bool
	default y if ADK_TARGET_BINFMT_FLAT_SHARED

config ADK_KERNEL_MMU
	bool

config ADK_KERNEL_VFP
	bool
	default y if ADK_TARGET_CPU_WITH_FPU_VFP

config ADK_KERNEL_VFPv3
	bool
	select ADK_KERNEL_VFP
	default y if ADK_TARGET_CPU_WITH_FPU_VFPV3 || ADK_TARGET_CPU_WITH_FPU_VFPV4

config ADK_KERNEL_NEON
	bool
	default y if ADK_TARGET_ARCH_ARM_WITH_NEON

config ADK_KERNEL_KERNEL_MODE_NEON
	bool
	default y if ADK_TARGET_ARCH_ARM_WITH_NEON

config ADK_KERNEL_PATCH_REALTIME
	bool
	
choice
prompt "preemptive mode"

config ADK_KERNEL_PREEMPT_NONE
	bool "No Forced Preemption (Server)"
	help
	  No Forced Preemption (Server)

config ADK_KERNEL_PREEMPT_VOLUNTARY
	bool "Voluntary Kernel Preemption (Desktop)"
	select ADK_KERNEL_HIGH_RES_TIMERS
	help
	  Voluntary Kernel Preemption (Desktop)

config ADK_KERNEL_PREEMPT__LL
	bool "Preemptible Kernel (Low-Latency Desktop)"
	select ADK_KERNEL_HIGH_RES_TIMERS
	help
	  Preemptible Kernel (Low-Latency Desktop)

config ADK_KERNEL_PREEMPT_RTB
	bool "Preemptible Kernel (Basic RealTime)"
	select ADK_KERNEL_HIGH_RES_TIMERS
	select ADK_KERNEL_PATCH_REALTIME
	depends on !ADK_KERNEL_OPROFILE
	depends on ADK_TARGET_KERNEL_VERSION_4_1 \
		|| ADK_TARGET_KERNEL_VERSION_4_4 \
		|| ADK_TARGET_KERNEL_VERSION_4_9
        help
	  Preemptible Kernel (Basic RT)

config ADK_KERNEL_PREEMPT_RT_FULL
	bool "Fully Preemptible Kernel (RealTime)"
	select ADK_KERNEL_HIGH_RES_TIMERS
	select ADK_KERNEL_PATCH_REALTIME
	depends on !ADK_KERNEL_OPROFILE
	depends on ADK_TARGET_KERNEL_VERSION_4_1 \
		|| ADK_TARGET_KERNEL_VERSION_4_4 \
		|| ADK_TARGET_KERNEL_VERSION_4_9
        help
	  Fully Preemptible Kernel (RealTime)
	  https://www.kernel.org/pub/linux/kernel/projects/rt/

endchoice

config ADK_KERNEL_HIGH_RES_TIMERS
	bool "Enable high resolution timers"

choice
prompt "tick configuration"

config ADK_KERNEL_NO_HZ_IDLE
	bool "no HZ IDLE, dynamic tick"

config ADK_KERNEL_NO_HZ_FULL
	bool "no HZ FULL, dynamic tick"

config ADK_KERNEL_HZ_PERIODIC
	bool "periodic tick"

endchoice

choice
prompt "HZ"
depends on ADK_KERNEL_HZ_PERIODIC

config ADK_KERNEL_HZ_100
	bool "100 HZ"

config ADK_KERNEL_HZ_500
	bool "500 HZ"

config ADK_KERNEL_HZ_1000
	bool "1000 HZ"

endchoice

config ADK_TARGET_NO_CMDLINE
	bool "Do not builtin any kernel cmdline"
	help
	  No kernel command line modifictaion is done.

config ADK_KERNEL_SMP
	bool "Enable symmetric multi processing"
	depends on ADK_TARGET_WITH_SMP
	default y if ADK_TARGET_WITH_SMP
	default n
	help
	  Enable symmetric multi processing support.

config ADK_KERNEL_HIGHMEM
	bool "Enable high memory"
	# produces broken kernel on bcm28xx
	depends on !ADK_TARGET_BOARD_BCM28XX
	default y if ADK_TARGET_SYSTEM_IBM_X40
	default y if ADK_TARGET_MODEL_CUBOX_I4PRO
	default y if ADK_TARGET_MODEL_CUBOX_I2ULTRA
	default y if ADK_TARGET_MODEL_CUBOX_I2EX
	default y if ADK_TARGET_SYSTEM_ASUS_P5BVM
	default y if ADK_TARGET_SYSTEM_PCENGINES_APU
	default n
	help
	  Enable high memory support.

config ADK_KERNEL_CC_OPTIMIZE_FOR_SIZE
	bool "Optimize for size"
	# does not boot in qemu-microblaze
	depends on !ADK_TARGET_ARCH_MICROBLAZE
	default y


choice
prompt "Page size"
depends on ADK_TARGET_ARCH_MIPS64
default ADK_KERNEL_PAGE_SIZE_16KB if ADK_TARGET_SYSTEM_LEMOTE_YEELONG
default ADK_KERNEL_PAGE_SIZE_4KB

config ADK_KERNEL_PAGE_SIZE_4KB
	bool "4kB"

config ADK_KERNEL_PAGE_SIZE_16KB
	bool "16kB"

config ADK_KERNEL_PAGE_SIZE_64KB
	bool "64kB"

endchoice

endmenu
