# SPDX-License-Identifier: GPL-2.0-only
if "$(USE_HM_KERNEL)" = "true"
menuconfig LIBLINUX
	bool "Enable liblinux support"
	depends on ARM || ARM64
	default y
	select LIBLINUX_PREEMPT
	select TRACEPOINTS
	select VENDOR_HOOKS
	select OF_DYNAMIC
	select NO_HZ_IDLE
	select HIGH_RES_TIMERS
	select PREEMPT_COUNT
	# only enable crypto for arm64-le
	select CRYPTO if ARM64 && !CPU_BIG_ENDIAN
	select ARCH_DMA_ADDR_T_64BIT if ARM
	select ARCH_WANT_OPTIONAL_GPIOLIB if ARM
	select ARM_AMBA if ARM
	select NEED_PER_CPU_KM
	select IOMMU_API if ARM64
	select PINCTRL if ARM64
	select REGMAP_I2C if ARM64
	select ARM64_MODULE_PLTS if ARM64 && MODULES
	select ARCH_HAS_STRICT_MODULE_RWX
	select MODULE_UNLOAD
	select SAMPLES
	select HAVE_LIVEPATCH_WO_FTRACE
	select THREAD_INFO_IN_TASK
	select GENERIC_CPU_AUTOPROBE
	select DMA_OPS
	select POSIX_TIMERS
	select SET_FS

if LIBLINUX

config LIBLINUX_DMA_CMA
	def_bool n

config LIBLINUX_NATIVE_KASAN
	bool "Enable liblinux native kasan"
	default n
	depends on KASAN

config LIBLINUX_SYSFS_BLACKLIST
	bool "set sysfs blacklist"
	default n
	depends on SYSFS && !RESCTRL && !MPAM && !CGROUPS

config LIBLINUX_KMAP_BITS
	int "Kernel mapping size"
	default 36 if 64BIT && KASAN
	default 27
	help
	  This option allows you to set the maximum physical memory support
	  by liblinux, 128MB for default.

config LIBLINUX_MODULES_RSVD_BITS
	int "Reserved modules size"
	default 27 if ARM64
	default 25 if ARM

config HIGHMEM
	def_bool n

config LIBLINUX_RSVD_HIGHMEM
	bool "Reserved highmem for acceleration"
	default n
	depends on HIGHMEM

config HISI_ANDROID
	bool "Enable hisi android modifies"
	default n

config LIBLINUX_MODULE_HACK
	bool "Enable module load hack"
	default n
	depends on ARM

config ALTERNATIVE_HEADER
	bool "Enable alternative linux header"
	default n

config LIBLINUX_PREEMPT
	bool "Enable preempt support"
	default n

config LIBLINUX_NET_STACK
	bool "Enable net stack support"
	default n

config LDK_FS_MM_CACHE
	bool "Enable ldk-fs pagecache support"
	default n

config LIBLINUX_STOP_MACHINE
	bool "Enable stop_machine support"
	default n

config LIBLINUX_PLAT_HAVE_IDLE_TIME
	bool "Liblinux support idle time"
	default n

config LIBLINUX_USE_NATIVE_MUTEX
	bool "Liblinux use Linux native mutex"
	default n

config LIBLINUX_USE_PAL_MUTEX
	def_bool y if !LIBLINUX_USE_NATIVE_MUTEX

config LIBLINUX_HAVE_SUSPEND
	bool "Liblinux support suspend"
	default n

config LIBLINUX_MM_DEBUG
	bool "Liblinux mm debug"
	default n

config LIBLINUX_EXTRACT_KALLSYMS
	bool "Extract kallsyms core data to module instead of builtin"
	depends on KALLSYMS_BASE_RELATIVE && MODULES
	default n

config LIBLINUX_HOTPLUG
	bool "Enable cpu hotplug"
	default n

config LIBLINUX_ASYNC_SYSFS
	bool "Enable asynchronous creation of sysfs nodes"
	default n

config LIBLINUX_TTY_CTRL_SYS_PAUSE
	bool "Enable crtl-x to trigger system pause"
	default n

config LIBLINUX_TTY_CTRL_TRIGGER_SNAPSHOT
	bool "Enable ctrl-t to trigger snapshot"
	default n

config LIBLINUX_TTY_CTRL_PORT
	string "Default tty control port"
	depends on LIBLINUX_TTY_CTRL_TRIGGER_SNAPSHOT || LIBLINUX_TTY_CTRL_SYS_PAUSE
	default "ttyS0"
	help
	  The ctrl-x and ctrl-t functions can only be enabled in the specified tty

config LIBLINUX_KERNEL_MODE_SIMD
	bool "Enable simd NEON in kernel mode"
	default n
	select KERNEL_MODE_NEON if ARM || ARM64

config LIBLINUX_SUB_SHRINKER
	bool "enable liblinux sub shrinker"
	default n

config LIBLINUX_CDC
	bool "Enable CDC specific modifies"
	default n
	select LIBLINUX_USE_NATIVE_MUTEX
	select LIBLINUX_ASYNC_SYSFS
	select VENDOR_BUILD
	select LIBLINUX_PLAT_HAVE_IDLE_TIME
	select HISI_ANDROID
	select DMA_VIRTUAL_CHANNELS
	select GPIOLIB_IRQCHIP
	select CRYPTO_CBC
	select CRYPTO_SHA256
	select CRYPTO_AES
	select HWMON
	select REGMAP_MMIO
	select DAX
	select FS_DAX
	select FS_DAX_LIMITED
	select LIBLINUX_KERNEL_MODE_SIMD

config LIBLINUX_M536A
	bool "enable liblinux m536a"
	default n
	select LIBLINUX_CDC

config LIBLINUX_M536X
	bool "enable liblinux m536x"
	default n
	select LIBLINUX_CDC
	select HIGHMEM
	select LIBLINUX_RSVD_HIGHMEM

config LIBLINUX_CPRO
	bool "enable liblinux cpro"
	default n
	select LIBLINUX_CDC
	select HIGHMEM
	select LIBLINUX_RSVD_HIGHMEM

config LIBLINUX_IPQ6028
	bool "enable liblinux ipq6028"
	default n
	select LIBLINUX_USE_NATIVE_MUTEX
	select LIBLINUX_NET_STACK
	select REGMAP_MMIO
	select OF_RESERVED_MEM
	select ARCH_QCOM
	select PINCTRL_MSM
	select WIRELESS_EXT
	select PM_OPP
	select PCI_MSI_ARCH_FALLBACKS
	select WEXT_PRIV
	select WEXT_PROC
	select WEXT_SPY
	select COMPAT
	select HIBERNATE_CALLBACKS

config LIBLINUX_HI1156_MODULE
	tristate "hi1156 module"
	select PHYLINK
	select LIBLINUX_DMA_CMA

config LIBLINUX_HI1172
	bool "enable liblinux hi1172"
	default n
	select LIBLINUX_USE_NATIVE_MUTEX
	select LIBLINUX_NET_STACK
	select REGMAP_MMIO
	select OF_RESERVED_MEM
	select WIRELESS_EXT
	select PM_OPP
	select PCI_MSI_ARCH_FALLBACKS
	select WEXT_PRIV
	select WEXT_PROC
	select WEXT_SPY
	select COMPAT
	select HIBERNATE_CALLBACKS

config LIBLINUX_ANDROID
	tristate "Enable android support for liblinux"
	default n
	select HISI_ANDROID
	select ALTERNATIVE_HEADER
	select GPIOLIB_IRQCHIP
	select DMA_VIRTUAL_CHANNELS
	select WIRELESS_EXT
	select VIDEOBUF2_CORE
	select SOUND
	select SND
	select SND_TIMER
	select SND_PCM
	select SND_HWDEP
	select SND_JACK
	select SND_PCM_TIMER
	select SND_DRIVERS
	select SND_PCI
	select SND_SOC
	select SND_SOC_I2C_AND_SPI
	# extra crypto algorithms required by tzdriver
	select CRYPTO_CBC
	select CRYPTO_SHA256
	select CRYPTO_AES
	select HWMON
	select REGMAP_MMIO
	select THERMAL

config LIBLINUX_BOOTFDT
	def_bool y

config SUSPEND_FAIL_NOTIFIER
	def_bool n
	depends on PM

config SUSPEND_FAIL_ERROR_INJECT
	tristate "PSUSPEND notifier error injection module"
	depends on PM && NOTIFIER_ERROR_INJECTION
	select SUSPEND_FAIL_NOTIFIER
	default n

config LIBLINUX_EULER_VERSION
	bool "modify kernel version"
	default y

config LIBLINUX_MODULE_CERT_REVOCATE
	bool "liblinux module revocate"
	default n

source "arch/liblinux/Kconfig.extra"
endif
endif
