#@TYPE: Machine
#@NAME: NXP i.MX6UL Evaluation Kit
#@SOC: i.MX6UL
#@DESCRIPTION: Machine configuration for NXP i.MX6UL EVK
#@MAINTAINER: Alexandru Palalau <ioan-alexandru.palalau@nxp.com>

MACHINEOVERRIDES =. "mx6ul:"

include conf/machine/include/imx-base.inc
include conf/machine/include/arm/armv7a/tune-cortexa7.inc

MACHINE_FEATURES += "wifi bluetooth bcm4339 bcm43455 nxp8987-sdio"

KERNEL_DEVICETREE = " \
    imx6ul-14x14-evk-btwifi.dtb \
    imx6ul-14x14-evk-btwifi-sdio3_0.dtb \
    imx6ul-14x14-evk-csi.dtb \
    imx6ul-14x14-evk.dtb \
    imx6ul-14x14-evk-ecspi.dtb \
    imx6ul-14x14-evk-ecspi-slave.dtb \
    imx6ul-14x14-evk-emmc.dtb \
    imx6ul-14x14-evk-gpmi-weim.dtb \
"
KERNEL_DEVICETREE:use-mainline-bsp = "imx6ul-14x14-evk.dtb"

### u-boot-fslc settings ###

SPL_BINARY:pn-u-boot-fslc = "SPL"
UBOOT_SUFFIX:pn-u-boot-fslc = "img"

### u-boot-imx settings ###

# The u-boot-imx does not provide SPL support
SPL_BINARY:pn-u-boot-imx = ""
UBOOT_MAKE_TARGET:pn-u-boot-imx = "u-boot.imx"
UBOOT_MAKE_TARGET:pn-u-boot-imx-mfgtool = "u-boot.imx"
UBOOT_SUFFIX:pn-u-boot-imx = "imx"
UBOOT_SUFFIX:pn-u-boot-imx-mfgtool = "imx"

WKS_FILE = " \
    ${@bb.utils.contains('IMX_DEFAULT_BOOTLOADER', \
                         'u-boot-fslc', 'imx-uboot-spl-bootpart.wks.in', \
                                        'imx-uboot-bootpart.wks.in', d)}"

UBOOT_CONFIG ??= " \
    sd \
    ${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'sd-optee', '', d)} \
"
UBOOT_CONFIG[sd]       = "mx6ul_14x14_evk_config,sdcard"
UBOOT_CONFIG[sd-optee] = "mx6ul_14x14_evk_optee_config,sdcard"
UBOOT_CONFIG[emmc]     = "mx6ul_14x14_evk_emmc_config,sdcard"
UBOOT_CONFIG[qspi1]    = "mx6ul_14x14_evk_qspi1_config"
UBOOT_CONFIG[mfgtool]  = "mx6ul_14x14_evk_config"

OPTEE_BIN_EXT = "6ulevk"
