#@TYPE: Machine
#@NAME: Boundary Devices Nitrogen6X
#@SOC: i.MX6 Q/DL
#@DESCRIPTION: Machine configuration for Boundary Devices Nitrogen6X
#@MAINTAINER: Chris Dimich <chris.dimich@boundarydevices.com>
#
# Note that this machine configuration also supports the SABRE Lite
# reference design and the Nitrogen6X-SOM.
#
# By default, this machine will build for the standard Quad-Core, 1GB
# option.
#
# To build U-Boot for other CPU or memory combinations, you can set
# the UBOOT_MACHINE variable in your local.conf according to the
# following table:
#
# Processor           Memory    Configuration
# --------------      ------    --------------------
# i.MX6Quad/Dual        1GB     nitrogen6q_config
# i.MX6Quad/Dual        2GB     nitrogen6q2g_config
# i.MX6Quad/Dual        4GB     nitrogen6_max_config
# i.MX6Dual-Lite        1GB     nitrogen6dl_config
# i.MX6Dual-Lite        2GB     nitrogen6dl2g_config
# i.MX6Solo           512MB     nitrogen6s_config
# i.MX6Solo             1GB     nitrogen6s1g_config
#
# See this blog post for details:
#    http://boundarydevices.com/u-boot-updates-for-i-mx6-single
#
#

MACHINEOVERRIDES =. "mx6q:mx6dl:"

IMX_DEFAULT_BSP ?= "nxp"

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

KERNEL_DEVICETREE = "imx6q-sabrelite.dtb \
                        imx6q-nitrogen6_max.dtb imx6qp-nitrogen6_max.dtb \
                        imx6q-nitrogen6x.dtb imx6dl-nitrogen6x.dtb \
                        imx6q-nitrogen6_som2.dtb imx6qp-nitrogen6_som2.dtb \
                        imx6dl-nitrogen6_vm.dtb imx6dl-nitrogen6_vm-magstripe.dtb \
"

# Not yet supported by Linux mainline
KERNEL_DEVICETREE:remove:use-mainline-bsp = "imx6dl-nitrogen6_vm.dtb imx6dl-nitrogen6_vm-magstripe.dtb"

KERNEL_IMAGETYPE = "zImage"

IMX_DEFAULT_BOOTLOADER = "u-boot-boundary"
UBOOT_SUFFIX = "imx"
UBOOT_BINARY = "u-boot-dtb.${UBOOT_SUFFIX}"
PREFERRED_PROVIDER_virtual/kernel ??= "linux-boundary"
PREFERRED_PROVIDER_virtual/kernel:use-mainline-bsp ??= "linux-fslc"

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

UBOOT_MACHINE ?= "nitrogen6q_defconfig"

SERIAL_CONSOLES = "115200;ttymxc1"

MACHINE_EXTRA_RRECOMMENDS += "linux-firmware-wl12xx"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS += " \
    kernel-image \
    kernel-devicetree \
"

MACHINE_FEATURES += " pci wifi bluetooth"
