#@TYPE: Machine
#@NAME: Kontron N63XX/N64XX SoM based boards
#@SOC: i.MX6UL/i.MX6ULL
#@DESCRIPTION: Machine configuration for Kontron N63XX/N64XX SoM based boards
#@MAINTAINER: Frieder Schrempf <frieder.schrempf@kontron.de>

MACHINEOVERRIDES =. "mx6ul:"

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

IMX_DEFAULT_BSP = "mainline"

PREFERRED_PROVIDER_virtual/kernel ?= "linux-kontron"
PREFERRED_PROVIDER_u-boot ?= "u-boot-kontron"
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-kontron"

KERNEL_CLASSES ?= " kernel-fitimage "
KERNEL_IMAGETYPES ?= "fitImage"
KERNEL_DEVICETREE = " \
	imx6ul-kontron-n6310-s.dtb \
	imx6ul-kontron-n6310-s-43.dtb \
	imx6ul-kontron-n6311-s.dtb \
	imx6ull-kontron-n6411-s.dtb \
"


SERIAL_CONSOLES = "115200;ttymxc3"

UBOOT_CONFIG = "kontron-mx6ul"
UBOOT_CONFIG[kontron-mx6ul] = "kontron_mx6ul_defconfig"

SPL_BINARY = "SPL"
UBOOT_ENTRYPOINT = "0x81000000"
UBOOT_MAKE_TARGET = "u-boot.img SPL"
UBOOT_SUFFIX = "img"

UBOOT_EXTLINUX ?= "1"
UBOOT_EXTLINUX_LABELS ?= "default"
UBOOT_EXTLINUX_KERNEL_IMAGE ?= "../fitImage"
UBOOT_EXTLINUX_FDTDIR ?= ""
UBOOT_EXTLINUX_KERNEL_ARGS ?= "rootwait"
UBOOT_EXTLINUX_TIMEOUT = "8"
UBOOT_EXTLINUX_LABELS = "kontron-n6310-s kontron-n6311-s kontron-n6310-s-43 kontron-n6411-s"
UBOOT_EXTLINUX_KERNEL_IMAGE_kontron-n6310-s = "../fitImage#conf@imx6ul-kontron-n6310-s.dtb"
UBOOT_EXTLINUX_KERNEL_IMAGE_kontron-n6311-s = "../fitImage#conf@imx6ul-kontron-n6311-s.dtb"
UBOOT_EXTLINUX_KERNEL_IMAGE_kontron-n6310-s-43 = "../fitImage#conf@imx6ul-kontron-n6310-s-43.dtb"
UBOOT_EXTLINUX_KERNEL_IMAGE_kontron-n6411-s = "../fitImage#conf@imx6ull-kontron-n6411-s.dtb"
UBOOT_EXTLINUX_MENU_DESCRIPTION_kontron-n6310-s = "Kontron N6310 S"
UBOOT_EXTLINUX_MENU_DESCRIPTION_kontron-n6311-s = "Kontron N6311 S"
UBOOT_EXTLINUX_MENU_DESCRIPTION_kontron-n6310-s-43 = "Kontron N6310 S 43"
UBOOT_EXTLINUX_MENU_DESCRIPTION_kontron-n6411-s = "Kontron N6411 S"
UBOOT_EXTLINUX_CONSOLE = "console=ttymxc3,115200"
UBOOT_EXTLINUX_ROOT = "root=/dev/mmcblk0p2"

MACHINE_FEATURES = "usbhost vfat serial ext2 rtc usbgadget"
IMAGE_BOOT_FILES = " \
    extlinux.conf;extlinux/extlinux.conf \
    fitImage \
"

WKS_FILES ?= "imx-uboot-spl-bootpart.wks.in"
