#@TYPE: Machine
#@NAME: NXP i.MX 8MNUL EVK with DDR3L
#@SOC: i.MX8MN
#@DESCRIPTION: Machine configuration for NXP i.MX 8M Nano UltraLite Evaluation Kit with DDR3L
#@MAINTAINER: Jun Zhu <junzhu@nxp.com>

MACHINEOVERRIDES =. "imx-boot-container:mx8mnul:"

require conf/machine/include/imx-base.inc
require conf/machine/include/arm/armv8a/tune-cortexa53.inc

MACHINE_FEATURES += "wifi bluetooth bcm43455 bcm4356"

# NXP BSP can consume proprietary jailhouse and Broadcom drivers
# OP-TEE is also applicable to NXP BSP, mainline BSP seems not to have
# a full support for it yet.
MACHINE_FEATURES:append:use-nxp-bsp = " optee jailhouse bcm4359"

KERNEL_DEVICETREE_BASENAME = "imx8mn-ddr3l-evk"
KERNEL_DEVICETREE = " \
    freescale/${KERNEL_DEVICETREE_BASENAME}.dtb \
"
KERNEL_DEVICETREE:append:use-nxp-bsp = " \
    freescale/${KERNEL_DEVICETREE_BASENAME}-ak5558.dtb \
    freescale/${KERNEL_DEVICETREE_BASENAME}-rpmsg.dtb \
"

UBOOT_DTB_NAME = "${KERNEL_DEVICETREE_BASENAME}.dtb"

IMX_DEFAULT_BOOTLOADER = "u-boot-imx"
IMX_DEFAULT_KERNEL = "linux-imx"

UBOOT_SUFFIX = "bin"

UBOOT_CONFIG ??= "sd"
UBOOT_CONFIG_BASENAME      = "imx8mn_ddr3l_evk"
UBOOT_CONFIG[sd]   = "${UBOOT_CONFIG_BASENAME}_config,sdcard"
UBOOT_CONFIG[fspi] = "${UBOOT_CONFIG_BASENAME}_defconfig"

SPL_BINARY = "spl/u-boot-spl.bin"

ATF_PLATFORM = "imx8mn"

# Set DDR FIRMWARE
DDR_FIRMWARE_VERSION = "201810"
DDR_FIRMWARE_NAME = " \
    ddr3_dmem_1d_${DDR_FIRMWARE_VERSION}.bin \
    ddr3_imem_1d_${DDR_FIRMWARE_VERSION}.bin \
"

# Set imx-mkimage boot target
IMXBOOT_TARGETS_BASENAME = "flash_ddr3l_evk"
IMXBOOT_TARGETS = " \
    ${@bb.utils.contains('UBOOT_CONFIG', 'fspi', '${IMXBOOT_TARGETS_BASENAME}_flexspi', \
                                                 '${IMXBOOT_TARGETS_BASENAME}', d)}"

IMX_BOOT_SOC_TARGET = "iMX8MN"

SERIAL_CONSOLES = "115200;ttymxc1"

IMAGE_BOOTLOADER = "imx-boot"

BOOT_SPACE = "65536"
LOADADDR = ""
UBOOT_MAKE_TARGET = "all"
UBOOT_MAKE_TARGET:pn-u-boot-imx = ""
IMX_BOOT_SEEK = "32"

OPTEE_BIN_EXT = "8mnul"
