#@TYPE: Machine
#@NAME: Variscite i.MX6Q/DL VAR-SOM-MX6
#@SOC: i.MX6Q/DL
#@DESCRIPTION: Machine configuration for Variscite i.MX6Q/DL VAR-SOM-MX6
#@MAINTAINER: Fabio Berton <fabio.berton@ossystems.com.br>

MACHINEOVERRIDES =. "mx6q:mx6dl:"

DEFAULTTUNE ?= "cortexa9thf-neon"
require conf/machine/include/imx-base.inc
require conf/machine/include/arm/armv7a/tune-cortexa9.inc

PREFERRED_PROVIDER_virtual/kernel = "linux-variscite"
PREFERRED_PROVIDER_virtual/kernel:use-mainline-bsp ??= "linux-fslc"

KERNEL_DEVICETREE = " \
    imx6dl-var-som-cap.dtb \
    imx6dl-var-som-res.dtb \
    imx6dl-var-som-vsc.dtb \
    imx6dl-var-som-solo-cap.dtb \
    imx6dl-var-som-solo-res.dtb \
    imx6dl-var-som-solo-vsc.dtb \
    imx6q-var-som-cap.dtb \
    imx6q-var-som-res.dtb \
    imx6q-var-som-vsc.dtb \
"

KERNEL_DEVICETREE:use-mainline-bsp = " \
    imx6q-var-som-vsc.dtb \
"

KERNEL_IMAGETYPE = "uImage"

UBOOT_SPL_BUILD = "yes"
UBOOT_MAKE_TARGET = "all"
UBOOT_SUFFIX = "img"
WKS_FILE = "imx-uboot-spl-bootpart.wks.in"

PREFERRED_PROVIDER_virtual/bootloader = "u-boot-variscite"
PREFERRED_PROVIDER_u-boot = "u-boot-variscite"
UBOOT_ENTRYPOINT:use-mainline-bsp = "0x10008000"

UBOOT_CONFIG ??= "nand sd"
UBOOT_CONFIG[sd] = "mx6var_som_sd_config,sdcard"
UBOOT_CONFIG[nand] = "mx6var_som_nand_config,ubifs"

SPL_BINARY = "SPL"

## NAND 512MB
UBI_ROOT_FS_NAME = "[rootfs]"
UBI_VOLNAME  = "rootfs"
MKUBIFS_ARGS = " -m 2048 -e 124KiB -c 3965 -F "
UBINIZE_ARGS = " -m 2048 -p 128KiB -s 2048 -O 2048 "

SERIAL_CONSOLES = "115200;ttymxc0"

USE_VT = "0"

MACHINE_FIRMWARE:append = " linux-firmware-wl12xx linux-firmware-wl18xx ti-18xx-wlconf"

MACHINE_FEATURES += " pci bluetooth touchscreen wifi"
