# SPDX-License-Identifier: GPL-2.0
menuconfig MEDIATEK_SOLUTION
	bool "MediaTek Properitary Configuration"
	select FW_LOADER_USER_HELPER_FALLBACK
	select I2C
	help
	  Check this to enable MediaTek properity configuration.

if MEDIATEK_SOLUTION
config MTK_PLATFORM
	string "MTK platform name"

config ARCH_MTK_PROJECT
	string "MTK project name"

config FPGA_EARLY_PORTING
	bool "MTK FPGA EARLY PORTING"
	help
	  Used for FPGA early porting to separate code segments between FPGA
	  platform and non-FPGA platform

config MTK_LM_MODE
	bool "MTK Large Memory mode"
	select ARM_LPAE if !ARM64
	select ARCH_PHYS_ADDR_T_64BIT
	select ARCH_DMA_ADDR_T_64BIT
	help
	  Large Memory mode for supporting more than 4GB DRAM access
	  It should only be enabled if hardware can support
	  more than 4GB DRAM mapping.
	  If you are not sure about this, set n

config DMAUSER_PAGES
	bool "allocate highuser movable pages from dma zone"
	depends on MTK_LM_MODE && !MTK_MEMORY_LOWPOWER
	help
	  An internal debug kernel config for testing large memory mode.
	  To test if kernel drivers are fully compatible to large
	  memorys, we replace all GFP_HIGHUSER_MOVABLE/GFP_USER pages by
	  DMA (<= 4GB) pages. It makes all drivers have more chances
	  to allocate >= 4GB physical memory.
config MTK_DTBO_FEATURE
	bool "Support Device Tree Overlay"
	default y
	select BUILD_ARM_DTB_OVERLAY_IMAGE if !ARM64
	select BUILD_ARM64_DTB_OVERLAY_IMAGE if ARM64
	help
	  This allows a central DTB and overlays it dynamically.
	  An overlay can add nodes to the tree and make changes to properties
	  in the existing tree.
	  If you are not sure about this, set y

config MTK_AB_OTA_UPDATER
	bool "Support Android A/B system updates"
	default n
	help
	  MediaTek A/B system updates support.
	  Partitions which need OTA update have both A and B partition.
	  Y means this kernel enabled OTA A/B system updates feature.
	  If you are not sure about this, set n

config MTK_ENG_BUILD
	bool "flag for MTK eng/usr build verification"
	default n
	help
	  Y means this kernel version is engineering mode and has more debugging
	  features built-in. This option is supposed to specifiy engineering or
	  user load for this build.
	  If you are not sure about this, set n

config EXTREME_LOW_RAM
	bool "Support the device with memory smaller than 512M"
	default n
	help
	  This config decide if device memory < 512M
	  For 512M device, it has many low mem shrinking mechanism
	  Normal project will disable it first
	  If you are not sure about this, do not set it to y

config MTK_LDVT
	bool "LDVT"
	help
	  Support LDVT or not

config MTK_BOUNCING_CHECK
	bool "Enable bouncing buffer check"
	default n
	help
	  In order to avoid misusing the DMA_MASK, an auto-check detection
	  is hooked in kernel to check whether the DMA_MASK value is correct.
	  This config can only be enabled for platforms which support Large DRAM.
	  Must not be enabled for those platforms which only support 4GB DRAM.

endif
menu "Storage"
source "drivers/misc/mediatek/pidmap/Kconfig"
endmenu # Storage

menu "Power, PMIC, Battery & Low Power"
source "drivers/misc/mediatek/clkbuf/Kconfig"
source "drivers/misc/mediatek/slbc/Kconfig"
source "drivers/misc/mediatek/cm_mgr/Kconfig"
source "drivers/misc/mediatek/mcupm/Kconfig"
source "drivers/misc/mediatek/dvfsrc/Kconfig"
source "drivers/misc/mediatek/dcm/Kconfig"
source "drivers/misc/mediatek/qos/Kconfig"
source "drivers/misc/mediatek/srclken_rc/Kconfig"
source "drivers/misc/mediatek/lpm/Kconfig"
source "drivers/misc/mediatek/power_throttling/Kconfig"
source "drivers/misc/mediatek/cpufreq_v1/Kconfig"
source "drivers/misc/mediatek/eemgpu/Kconfig"
source "drivers/misc/mediatek/leakage_table/Kconfig"
source "drivers/misc/mediatek/mdpm/Kconfig"
source "drivers/misc/mediatek/pbm/Kconfig"
source "drivers/misc/mediatek/chip/Kconfig"
endmenu # Power

menu "SSPM"
source "drivers/misc/mediatek/sspm/Kconfig"
endmenu # SSPM

menu "MultiMedia, Display, Camera"
source "drivers/misc/mediatek/iommu/Kconfig"
source "drivers/misc/mediatek/cameraisp/Kconfig"
source "drivers/misc/mediatek/cmdq/Kconfig"
source "drivers/misc/mediatek/mtk-interconnect/Kconfig"
source "drivers/misc/mediatek/mdp/Kconfig"
source "drivers/misc/mediatek/mmp/Kconfig"
source "drivers/misc/mediatek/lens/Kconfig"
source "drivers/misc/mediatek/flashlight/Kconfig"
source "drivers/misc/mediatek/imgsensor/Kconfig"
source "drivers/misc/mediatek/cam_cal/Kconfig"
source "drivers/misc/mediatek/cam_timesync/Kconfig"
source "drivers/misc/mediatek/camera_mem/Kconfig"
source "drivers/misc/mediatek/vow/Kconfig"
source "drivers/misc/mediatek/ccu/src/Kconfig"
endmenu # MultiMedia, Display, Camera

menu "Security"

config MTK_IN_HOUSE_TEE_SUPPORT
	bool "Enable MTK In House TEE Support"
	help
	  Set to yes if MTK TEE is supported. If you don't know if it is
	  supported, set to no.

config MTEE_CMA_SECURE_MEMORY
	bool "MTEE using CMA for secure memory allocation"
	depends on OF
	depends on CMA
	depends on MTK_IN_HOUSE_TEE_SUPPORT
	help
	  Enable allocation secure memory from CMA to free the memory
	  back to Linux CMA when secure memory buffer was not used.

source "drivers/misc/mediatek/trusted_mem/Kconfig"
source "drivers/misc/mediatek/geniezone/Kconfig"
source "drivers/misc/mediatek/secure_efuse/Kconfig"
endmenu # Security

menu "APU"
source "drivers/misc/mediatek/apusys/Kconfig"
endmenu # APU

menu "Debug, log, trace"

config MTK_ATF_LOGGER
	tristate "atf logger kernel driver"
	depends on HAVE_ARM_SMCCC && ARCH_MEDIATEK && OF
	help
	  ARM Trusted Firmwear Logger which is designed by Mediatek.
	  The logger provide a /proc interface for reading from
	  user space. We can obtain live TF-A log through
	  atf logger driver

config MTK_MET
	tristate "MET FEATURE ENABLE"
	help
	  This selects the MET profile function for MET device.
	  If you want MET feature, say m here.
	  This is needed if support for MET devices is required.
	  If unsure, say N.

config MTK_MET_PLF
	string "MET PLATFORM"
	help
	  This config is set as platform name which met driver
	  used for.

source "drivers/misc/mediatek/blocktag/Kconfig"
source "drivers/misc/mediatek/mtprof/Kconfig"
source "drivers/misc/mediatek/locking/Kconfig"
source "drivers/misc/mediatek/mmstat/Kconfig"
source "drivers/misc/mediatek/aee/Kconfig"
source "drivers/misc/mediatek/sda/Kconfig"
source "drivers/misc/mediatek/systracker/Kconfig"
source "drivers/misc/mediatek/subpmic/Kconfig"
source "drivers/misc/mediatek/monitor_hang/Kconfig"
source "drivers/misc/mediatek/memblock/Kconfig"
source "drivers/misc/mediatek/log_store/Kconfig"
source "drivers/misc/mediatek/Kconfig.default"
endmenu # Debug

menu "Modem & Connectivity"
source "drivers/misc/mediatek/ccci_util/Kconfig"
source "drivers/misc/mediatek/ccmni/Kconfig"
source "drivers/misc/mediatek/eccci/Kconfig"
source "drivers/misc/mediatek/btif/Kconfig"
source "drivers/misc/mediatek/connectivity/Kconfig"
source "drivers/misc/mediatek/conn_md/Kconfig"
source "drivers/misc/mediatek/nfc/Kconfig"
source "drivers/misc/mediatek/memory-amms/Kconfig"
source "drivers/misc/mediatek/mddp/Kconfig"
endmenu # Modem

menu "Other Peripherals"
source "drivers/misc/mediatek/typec/Kconfig"
source "drivers/misc/mediatek/extcon/Kconfig"
source "drivers/misc/mediatek/adsp/Kconfig"
source "drivers/misc/mediatek/audio_ipi/Kconfig"
source "drivers/misc/mediatek/usb_mtp/Kconfig"
source "drivers/misc/mediatek/usb20/Kconfig"
source "drivers/misc/mediatek/sensor/Kconfig"
source "drivers/misc/mediatek/irrx/Kconfig"
endmenu # Other Peripheral

menu "Performance"
source "drivers/misc/mediatek/sched/Kconfig"
source "drivers/misc/mediatek/performance/Kconfig"
source "drivers/misc/mediatek/perf_common/Kconfig"
source "drivers/misc/mediatek/rps/Kconfig"
source "drivers/misc/mediatek/task_turbo/Kconfig"
endmenu # Performance

menu "SCP"
source "drivers/misc/mediatek/scp/Kconfig"
endmenu # SCP

menu "Config File"
config BUILD_CONFIG_FILE
	string "build config file"
	help
	  Specify the build.config file which record toolchain environment
	  Such as "build.config.mtk.aarch64"

config EXT_MODULES
	string "out-of-tree kernel modules"
	help
	  Specify out-of-tree kernel modules to build in order
	  The value must be kernel module repo list, such as
	  "vendor/mediatek/kernel_modules/connectivity/common vendor/mediatek/kernel_modules/connectivity/gps"
endmenu # Config

menu "Power, PMIC, Battery & Low Power related configs"
config MTK_BASE_POWER
	bool "MediaTek power management"
	select PM_OPP
	help
	  For MediaTek power management features, such as CPU idle,
	  CPU suspend, CPU DVFS, GPU DVFS,
	  Select if you want to enable MediaTek power
	  management feature.

source "drivers/misc/mediatek/base/power/Kconfig"

config MTK_PSCI
	bool "MediaTek PSCI boot method"
	depends on ARM64
	help
	  For MediaTek PSCI wrapper feature, such as cpu_init,
	  cpu_prepare, cpu_boot, cpu_disable, cpu_die, cpu_kill,
	  cpu_init_idle, cpu_suspend, select if you want to enable
	  PSCI boot method on MediaTek platform.

config MTK_FREQ_HOPPING
	bool "MediaTek FREQHOPPING SUPPORT"
	help
	  If you want to use MediaTek freqhopping, say Y here.If unsure, say N.
	  Please choose your desired freqhopping driver as well. E.g: MTK2712_FREQ_HOPPING=y
source "drivers/misc/mediatek/freqhopping/Kconfig"
endmenu  # Power

menu "Memasrc"
source "drivers/misc/mediatek/asrc/Kconfig"
endmenu  # memasrc
