#@TYPE: Machine
#@NAME: Toradex Apalis iMX6Q/D
#@SOC: i.MX6Q
#@DESCRIPTION: Machine configuration for Toradex Apalis iMX6 SOM
#@MAINTAINER: Max Krummenacher <max.krummenacher@toradex.com>

MACHINEOVERRIDES =. "mx6q:"

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

PREFERRED_PROVIDER_virtual/kernel:use-nxp-bsp ??= "linux-toradex"
KBUILD_DEFCONFIG:use-nxp-bsp ?= "apalis_imx6_defconfig"
KERNEL_DEVICETREE += " \
    imx6q-apalis-eval.dtb imx6q-apalis-ixora.dtb \
    imx6q-apalis-ixora-v1.1.dtb \
"
KERNEL_DEVICETREE:append:use-nxp-bsp = " imx6q-apalis-ixora-v1.2.dtb"

KERNEL_IMAGETYPE = "zImage"
# The kernel lives in a seperate FAT partition, don't deploy it in /boot/
RRECOMMENDS:${KERNEL_PACKAGE_NAME}-base = ""

IMX_DEFAULT_BOOTLOADER = "u-boot-toradex"
PREFERRED_RPROVIDER_u-boot-default-script = "u-boot-script-toradex"

UBOOT_SUFFIX = "img"
SPL_BINARY = "SPL"
# The SPL configures the DDR RAM depending on the module it runs on. Thus there
# is no need to distingush between the different module types.
UBOOT_CONFIG ??= "spl"
UBOOT_CONFIG[spl] = "apalis_imx6_defconfig,,u-boot.img"
UBOOT_MAKE_TARGET = ""
UBOOT_ENTRYPOINT:use-mainline-bsp = "0x10008000"

IMAGE_FSTYPES += "tar.xz"
# wic support
IMAGE_BOOT_FILES:append = " boot.scr-${MACHINE};boot.scr"
WKS_FILE_DEPENDS:append = " u-boot-default-script"
WKS_FILE = "sdimage-bootpart.wks"

MACHINE_FEATURES += "screen usbgadget usbhost vfat ext2 alsa touchscreen wifi bluetooth 3g pci"
MACHINE_FIRMWARE:remove = "firmware-imx-epdc"
