#@TYPE: Machine
#@NAME: ConnectCore 6 QuadPlus Single Board Computer.
#@DESCRIPTION: Machine configuration for Digi's ConnectCore 6 QuadPlus SBC.

DIGI_SOM = "ccimx6qp"

# Include the machine configuration for Digi's ConnectCore 6 module.
include conf/machine/include/ccimx6.inc

# Wireless external module
WIRELESS_MODULE:append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'kernel-module-qualcomm', '', d)}"
HAS_WIFI_VIRTWLANS = "true"

# Wireless p2p interface
WLAN_P2P_DEVICE_NAME ?= "ccimx6qp-p2p"

MACHINE_FEATURES += "cryptochip"

# Firmware
MACHINE_FIRMWARE:append = " ${@oe.utils.conditional('HAVE_BT', '1', 'firmware-qualcomm-qca6564-bt', '', d)}"
MACHINE_FIRMWARE:append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'firmware-qualcomm-qca6564-wifi', '', d)}"

# U-Boot configurations
# Last one is the default (the one the symlinks point at)
UBOOT_CONFIG ??= "ccimx6qpsbc1GB ccimx6qpsbc2GB"
UBOOT_CONFIG[ccimx6qpsbc1GB] = "ccimx6qpsbc1GB_defconfig,,u-boot-dtb.${UBOOT_SUFFIX}"
UBOOT_CONFIG[ccimx6qpsbc2GB] = "ccimx6qpsbc2GB_defconfig,,u-boot-dtb.${UBOOT_SUFFIX}"

KERNEL_DEVICETREE ?= " \
    imx6qp-ccimx6qpsbc.dtb \
    imx6qp-ccimx6qpsbc-id160.dtb \
    imx6qp-ccimx6qpsbc-wb.dtb \
"

SERIAL_CONSOLES ?= "115200;ttymxc3"

# Bluetooth interface
BT_DEVICE_NAME ?= "cc6qp"

# Bluetooth tty
BT_TTY ?= "ttymxc1"

# XBee
XBEE_TTY ?= "ttymxc4"

# Image FS types
IMAGE_FSTYPES ?= '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", \
				       "boot.vfat tar.bz2 recovery.vfat squashfs", \
				       "boot.vfat ext4.gz sdcard.gz tar.bz2 recovery.vfat", d)}'

# Boot artifacts to be copied from the deploy dir to the installer ZIP
BOOTABLE_ARTIFACTS = " \
    u-boot-ccimx6qpsbc1GB.imx \
    u-boot-ccimx6qpsbc2GB.imx \
"

# Default overlayfs_etc mount point and type
OVERLAYFS_ETC_MOUNT_POINT ?= "/mnt/data"
OVERLAYFS_ETC_DEVICE ?= "/dev/mmcblk0p7"
OVERLAYFS_ETC_FSTYPE ?= "ext4"
