config HAS_CAAM
	bool

config IMX_CONFIG
	string

config IMX_OPTEE
	bool "Support OP-TEE"
	help
	 Enable support for OP-TEE

config ROM_UNIFIED_SECTIONS
	bool

config SYSCOUNTER_TIMER
	bool

config GPT_TIMER
	bool

config FSL_CAAM_KB
	bool

config IMX_RDC
	bool "i.MX Resource domain controller driver"
	depends on ARCH_MX6 || ARCH_MX7
	help
	  i.MX Resource domain controller is used to assign masters
	  and peripherals to differet domains. This can be used to
	  isolate resources.

config IMX_BOOTAUX
	bool "Support boot auxiliary core"
	depends on ARCH_MX7 || ARCH_MX6 || ARCH_VF610 || ARCH_IMX8 || ARCH_IMX8M
	help
	  bootaux [addr] to boot auxiliary core.

config IMX_MODULE_FUSE
	bool "i.MX Module Fuse"
	depends on ARCH_MX6
	help
	  i.MX module fuse to runtime disable some driver, including
	  Linux OS device node.

config IMX_VSERVICE_SHARED_BUFFER
	hex "Define the buffer address used for virtual service"
	depends on IMX_VSERVICE
	help
	  IMX virtual service will use this buffer for exchanging data with remote core.

config IMX_VSERVICE_SHARED_BUFFER_SIZE
	hex "Define the size of buffer address used for virtual service"
	default 0x400000
	depends on IMX_VSERVICE
	help
	  The buffer size for IMX virtual service needs enough large to fit all possible message.

config IMX_VSERVICE
	bool
    select MISC
    select IMX_M4_MU
	help
	  This enables imx virtual service provides framework for imx virtual driver working.

config USE_IMXIMG_PLUGIN
	bool "Use imximage plugin code"
	depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX7ULP
	help
	  i.MX6/7 supports DCD and Plugin. Enable this configuration
	  to use Plugin, otherwise DCD will be used.

config IMX_HAB
	bool "Support i.MX HAB features"
	depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX5 || ARCH_MX7ULP || ARCH_IMX8M
	select FSL_CAAM if HAS_CAAM
	imply CMD_DEKBLOB if HAS_CAAM
	imply CMD_PROVISION_KEY if HAS_CAAM
	help
	  This option enables the support for secure boot (HAB).
	  See doc/imx/habv4/* for more details.

config IMX_SPL_FIT_FDT_SIGNATURE
	bool "Enable to verify signature of FIT FDT"
	depends on IMX_HAB
	depends on ARCH_IMX8M
	help
	  Enable SPL to verify signature of FIT FDT during FIT loading.
	  This needs additional signing to FIT FDT part.

config CSF_SIZE
	hex "Maximum size for Command Sequence File (CSF) binary"
	depends on IMX_HAB
	default 0x2000 if ARCH_IMX8M
	default 0x2060
	help
	  Define the maximum size for Command Sequence File (CSF) binary
	  this information is used to define the image boot data.

config CMD_BMODE
	bool "Support the 'bmode' command"
	default y
	depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX5
	help
	  This enables the 'bmode' (bootmode) command for forcing
	  a boot from specific media.

	  This is useful for forcing the ROM's usb downloader to
	  activate upon a watchdog reset which is nice when iterating
	  on U-Boot.  Using the reset button or running bmode normal
	  will set it back to normal.  This command currently
	  supports i.MX53 and i.MX6.

config CMD_DEKBLOB
	bool "Support the 'dek_blob' command"
	select IMX_CAAM_DEK_ENCAP if ARCH_MX6 || ARCH_MX7 || ARCH_MX7ULP
	select IMX_OPTEE_DEK_ENCAP if ARCH_IMX8M
	select IMX_SECO_DEK_ENCAP if ARCH_IMX8
	help
	  This enables the 'dek_blob' command which is used with the
	  Freescale secure boot mechanism. This command encapsulates and
	  creates a blob of data. See also CMD_BLOB and doc/imx/habv4/* for
	  more information.

config IMX_CAAM_DEK_ENCAP
	bool "Support the DEK blob encapsulation with CAAM U-Boot driver"
	help
	  This enables the DEK blob encapsulation with the U-Boot CAAM driver.
	  This option is only available on imx6, imx7 and imx7ulp.

config IMX_OPTEE_DEK_ENCAP
	select TEE
	select OPTEE
	bool "Support the DEK blob encapsulation with OP-TEE"
	help
	  This enabled the DEK blob encapsulation with OP-TEE. The communication
	  with OP-TEE is done through a SMC call and OP-TEE shared memory. This
	  option is available on imx8mm.

config IMX_SECO_DEK_ENCAP
	bool "Support the DEK blob encapsulation with SECO"
	help
	  This enabled the DEK blob encapsulation with the SECO API. This option
	  is only available on imx8.

config CMD_PRIBLOB
	bool "Support the set_priblob_bitfield command"
	depends on HAS_CAAM && IMX_HAB
	help
	  This option enables the priblob command which can be used
		to set the priblob setting to 0x3.

config CMD_HDMIDETECT
	bool "Support the 'hdmidet' command"
	help
	  This enables the 'hdmidet' command which detects if an HDMI monitor
	  is connected.

config CMD_NANDBCB
	bool "i.MX6 NAND Boot Control Block(BCB) command"
	depends on MTD_RAW_NAND && CMD_MTDPARTS
	select BCH if MX6UL || MX6ULL
	default y if ((ARCH_MX6 || ARCH_MX7 || ARCH_IMX8M || ARCH_IMX8) && NAND_MXS)
	help
	  Unlike normal 'nand write/erase' commands, this command update
	  Boot Control Block(BCB) for i.MX6 platform NAND IP's.

	  This is similar to kobs-ng, which is used in Linux as separate
	  rootfs package.

config CMD_QSPIHDR
	bool "Q(F)SPI Boot Config Header command"
	depends on DM_SPI_FLASH
	default y
	help
	  Boot from Q(F)SPI need a boot config header, this command can
	  help to check if header already exists or add one if not.

config FSL_MFGPROT
	bool "Support the 'mfgprot' command"
	depends on IMX_HAB || AHAB_BOOT
	select IMX_CAAM_MFG_PROT if (ARCH_MX7 || ARCH_IMX8M)
	select IMX_SECO_MFG_PROT if ARCH_IMX8
	help
	  This option enables the manufacturing protection command
	  which can be used has a protection feature for Manufacturing
	  process. With this tool is possible to authenticate the
	  chip to the OEM's server.

config IMX_CAAM_MFG_PROT
	bool "Support the manufacturing protection with CAAM U-Boot driver"
	help
	  This enables the manufacturing protection feature with the U-Boot
	  CAAM driver. This option is only available on iMX7D/S.

config IMX_SECO_MFG_PROT
	bool "Support the manufacturing protection with SECO API"
	help
	  This enables the manufacturing protection feature with the SECO API.
	  This option is only available on iMX8/8x series.

config DBG_MONITOR
	bool "Enable the AXI debug monitor"
	depends on ARCH_MX6 || ARCH_MX7
	help
	  This option enables the debug monitor which prints out last
	  failed AXI access info when system reboot is caused by AXI
	  access failure.

config NXP_BOARD_REVISION
	bool "Read NXP board revision from fuses"
	depends on ARCH_MX6 || ARCH_MX7
	help
	  NXP boards based on i.MX6/7 contain the board revision information
	  stored in the fuses. Select this option if you want to be able to
	  retrieve the board revision information.

config FLASH_MCUFIRMWARE_SUPPORT
	bool "Enable mcu firmware flash support"
	depends on ARCH_MX7ULP || ARCH_IMX8M
	help
	  This enables the mcu firmware flash support for some SOCs.

config DDRMC_VF610_CALIBRATION
	bool "Enable DDRMC (DDR3) on-chip calibration"
	depends on ARCH_VF610
	help
	  Vybrid (vf610) SoC provides some on-chip facility to tune the DDR3
	  memory parameters. Select this option if you want to calculate them
	  at boot time.
	  NOTE:
	  NXP does NOT recommend to perform this calibration at each boot. One
	  shall perform it on a new PCB and then use those values to program
	  the ddrmc_cr_setting on relevant board file.

config SPL_IMX_ROMAPI_LOADADDR
	hex "Default load address to load image through ROM API"
	depends on IMX8MN || IMX8MP || IMX8ULP

config IMX_DCD_ADDR
	hex "DCD Blocks location on the image"
	default 0x00910000 if !ARCH_MX7ULP
	default 0x2f010000 if ARCH_MX7ULP
	help
	  Indicates where the Device Configuration Data, a binary table used by
	  the ROM code to configure the device at early boot stage, is located.
	  This information is shared with the user via mkimage -l just so the
	  image can be signed.

config SPL_LOAD_IMX_CONTAINER
	bool "Enable SPL loading U-Boot as a i.MX Container image"
	depends on SPL
	help
	  This is to let SPL could load i.MX Container image

config IMX_CONTAINER_CFG
	string "i.MX Container config file"
	depends on SPL
	help
	  This is to specific the cfg file for generating container
	  image which will be loaded by SPL.

config ANDROID_SUPPORT
	bool "Standard Android features support"
	default n
	select FSL_FASTBOOT
	select FASTBOOT_LOCK
	select BCB_SUPPORT
	select ANDROID_RECOVERY
	select SUPPORT_RAW_INITRD
	select LIBAVB
	select AVB_SUPPORT
	imply IMX_SPL_FIT_FDT_SIGNATURE

config ANDROID_AUTO_SUPPORT
	bool "Android Automotive features support"
	default n
	select FSL_FASTBOOT
	select FASTBOOT_LOCK
	select BCB_SUPPORT
	select ANDROID_RECOVERY
	select SUPPORT_RAW_INITRD
	select LIBAVB
	select AVB_SUPPORT

config ANDROID_THINGS_SUPPORT
	bool "Android Things features support"
	default n
	select FSL_FASTBOOT
	select FASTBOOT_LOCK
	select BCB_SUPPORT
	select ANDROID_RECOVERY
	select SUPPORT_RAW_INITRD
	select LIBAVB
	select AVB_SUPPORT

config AT_AUTHENTICATE_UNLOCK
	bool "Enable authenticate unlock for Android Things devices"
	depends on ANDROID_THINGS_SUPPORT

config ANDROID_AB_SUPPORT
	bool "Android A/B slots support"
	depends on ANDROID_SUPPORT || ANDROID_AUTO_SUPPORT || ANDROID_THINGS_SUPPORT
	default n
	select SYSTEM_RAMDISK_SUPPORT

config SYSTEM_RAMDISK_SUPPORT
	bool "Support build ramdisk in system image"
	default n

menu "TRUSTY OS Support"

config IMX_TRUSTY_OS
	bool "Support Trusty OS related feature"
	select SYS_ARM_CACHE_WRITEALLOC
	select CMD_MMC_RPMB
	select SUPPORT_EMMC_RPMB
	select SPL_SUPPORT_EMMC_RPMB

config TRUSTY_UNLOCK_PERMISSION
	bool "Support unlock permission protection in trusty"
	default y
	depends on IMX_TRUSTY_OS

config LOAD_KEY_FROM_RPMB
	bool "Support load AVB public key from RPMB storage"
	default y
	depends on IMX_TRUSTY_OS

config ID_ATTESTATION
	bool "Support device ID attestation"
	default y
	depends on IMX_TRUSTY_OS

config ATTESTATION_ID_BRAND
	string "brand name"
	depends on IMX_TRUSTY_OS && ID_ATTESTATION
	default ""

config ATTESTATION_ID_DEVICE
	string "device name"
	depends on IMX_TRUSTY_OS && ID_ATTESTATION
	default ""

config ATTESTATION_ID_PRODUCT
	string "product name"
	depends on IMX_TRUSTY_OS && ID_ATTESTATION
	default ""

config ATTESTATION_ID_IMEI
	string "IMEI id"
	depends on IMX_TRUSTY_OS && ID_ATTESTATION
	default ""

config ATTESTATION_ID_MEID
	string "MEID id"
	depends on IMX_TRUSTY_OS && ID_ATTESTATION
	default ""

config ATTESTATION_ID_MANUFACTURER
	string "manufacture name"
	depends on IMX_TRUSTY_OS && ID_ATTESTATION
	default ""

config ATTESTATION_ID_MODEL
	string "model name"
	depends on IMX_TRUSTY_OS && ID_ATTESTATION
	default ""

config GENERATE_MPPUBK
	bool "Enable manufacturing production public key extraction"
	default y
	depends on IMX_TRUSTY_OS

config SECURE_UNLOCK
	bool "Enable secure unlock for Android devices, it can only be enabled on HAB closed board"
	depends on IMX_TRUSTY_OS

endmenu

config APPEND_BOOTARGS
	bool "Append bootargs support"

config DUAL_BOOTLOADER
	bool "Enable dual bootloader support"
	select SPL_MMC_SUPPORT
	select SPL_MMC_WRITE
	help
	  Enable A/B bootloader select in SPL.

config ANDROID_DYNAMIC_PARTITION
	bool "Support to boot up Android with system image in logical partitions"

config VIRTUAL_AB_SUPPORT
	bool "Support virtual AB update"
	select ANDROID_DYNAMIC_PARTITION

config BOOTLOADER_MENU
	bool "Enable bootloader menu for android device"
	help
	bootloader menu feature for android device.

config CMD_PROVISION_KEY
	bool "Support to provision a encrypted key as black blob"
	depends on IMX8MM || IMX8MN
	select IMX_CAAM_MFG_PROT
	help
	  reads manufacturing protection public key(MPPUBK).
	  derive PKEK = sha256(MPPUBK).
	  read encrypted key and decrypt it using PKEK.
	  generate black blob of decrypted key, add 20 bytes TAG to black blob.
