/*
 * Copyright 2017 NXP
 *
 * SPDX-License-Identifier:	GPL-2.0+
 */

#ifndef IMX8QM_MEK_ANDROID_AUTO_H
#define IMX8QM_MEK_ANDROID_AUTO_H

#define CONFIG_USBD_HS

#define CONFIG_BCB_SUPPORT
#define CONFIG_CMD_READ
#define CONFIG_USB_GADGET_VBUS_DRAW	2

#ifdef CONFIG_IMX_TRUSTY_OS
#define NS_ARCH_ARM64 1
#endif

#define CONFIG_SKIP_RESOURCE_CHECING
/* USB OTG controller configs */
#ifdef CONFIG_USB_EHCI_HCD
#ifndef CONFIG_MXC_USB_PORTSC
#define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
#endif
#endif

#define CONFIG_ANDROID_AB_SUPPORT
#define CONFIG_AVB_SUPPORT
#define CONFIG_SUPPORT_EMMC_RPMB
#define CONFIG_SYSTEM_RAMDISK_SUPPORT
#define CONFIG_AVB_FUSE_BANK_SIZEW 0
#define CONFIG_AVB_FUSE_BANK_START 0
#define CONFIG_AVB_FUSE_BANK_END 0
#define CONFIG_FASTBOOT_LOCK
#define FSL_FASTBOOT_FB_DEV "mmc"

#define KEYSLOT_HWPARTITION_ID   2
#define KEYSLOT_BLKS             0x3FFF

#ifdef CONFIG_SYS_MALLOC_LEN
#undef CONFIG_SYS_MALLOC_LEN
#define CONFIG_SYS_MALLOC_LEN           (96 * SZ_1M)
#endif

#define CONFIG_USB_FUNCTION_FASTBOOT
#define CONFIG_CMD_FASTBOOT

#define CONFIG_ANDROID_BOOT_IMAGE
#define CONFIG_FASTBOOT_FLASH

#define CONFIG_FSL_FASTBOOT
#define CONFIG_FASTBOOT_USB_DEV 1
#define CONFIG_ANDROID_RECOVERY

#if defined CONFIG_SYS_BOOT_SATA
#define CONFIG_FASTBOOT_STORAGE_SATA
#define CONFIG_FASTBOOT_SATA_NO 0
#else
#define CONFIG_FASTBOOT_STORAGE_MMC
#endif

#define CONFIG_CMD_BOOTA
#define CONFIG_SUPPORT_RAW_INITRD
#define CONFIG_SERIAL_TAG

#undef CONFIG_EXTRA_ENV_SETTINGS
#undef CONFIG_BOOTCOMMAND

#define CONFIG_EXTRA_ENV_SETTINGS					\
	"splashpos=m,m\0"	  \
	"fdt_high=0xffffffffffffffff\0"	  \
	"initrd_high=0xffffffffffffffff\0" \

#define CONFIG_FASTBOOT_BUF_ADDR   0x98000000
#define CONFIG_FASTBOOT_BUF_SIZE   0x19000000

/* Undefine some macros to save boot time */
#undef CONFIG_FEC_MXC
#undef CONFIG_USB_HOST_ETHER
#undef CONFIG_ARCH_MISC_INIT
#undef CONFIG_SCSI
#undef CONFIG_SCSI_AHCI
#undef CONFIG_SCSI_AHCI_PLAT
#undef CONFIG_CMD_SCSI
#undef CONFIG_LIBATA
#undef CONFIG_SATA_IMX
#undef CONFIG_FSL_HSIO
#undef CONFIG_PCIE_IMX8X
#undef CONFIG_CMD_PCI
#undef CONFIG_PCI
#undef CONFIG_SYS_LONGHELP
#undef CONFIG_HUSH_PARSER
#undef CONFIG_AUTO_COMPLETE
#undef CONFIG_MII
#undef CONFIG_PHYLIB
#undef CONFIG_PHY_ATHEROS
#undef CONFIG_CMD_FUSE
#undef CONFIG_USB_FUNCTION_MASS_STORAGE

#if defined(CONFIG_XEN)
#include "imx8qm_mek_android_auto_xen.h"
#endif

#ifdef CONFIG_IMX_TRUSTY_OS
#define AVB_RPMB
#endif

#ifdef CONFIG_SPL_BUILD
#undef CONFIG_BLK
#endif

#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED

#endif /* IMX8QM_MEK_ANDROID_AUTO_H */
