#@TYPE: Machine
#@NAME: ConnectCore 93 Development Kit
#@DESCRIPTION: Machine configuration for Digi's ConnectCore 93 DVK

DIGI_SOM = "ccimx93"
MACHINEOVERRIDES =. "mx93:${DIGI_FAMILY}:${DIGI_SOM}:"

require include/ccimx93.inc

# U-Boot configurations
UBOOT_CONFIG ??= "ccimx93-dvk"
UBOOT_CONFIG[ccimx93-dvk] = "ccimx93-dvk_defconfig"
UBOOT_DTB_NAME = "ccimx93-dvk.dtb"

BOOTLOADER_SEEK_USERDATA = "32"

KERNEL_DEVICETREE ?= " \
    digi/ccimx93-dvk.dtb \
    digi/_ov_board_dsi_display_ccimx93-dvk.dtbo \
    digi/_ov_board_enet2_ccimx93-dvk.dtbo \
    digi/_ov_board_lvds_ccimx93-dvk.dtbo \
    digi/_ov_board_mikroe-accel2-click_ccimx93-dvk.dtbo \
    digi/_ov_board_mikroe-gyro-click_ccimx93-dvk.dtbo \
    digi/_ov_som_bt_ccimx93.dtbo \
    digi/_ov_som_cpu_a0_ccimx93.dtbo \
    digi/_ov_som_mca_ccimx93.dtbo \
    digi/_ov_som_npu_ccimx93.dtbo \
    digi/_ov_som_wifi_ccimx93.dtbo \
"

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

# Machine firmware
MACHINE_FIRMWARE:append = " ${@oe.utils.conditional('HAVE_WIFI', '1', 'firmware-nxp-wifi-nxpiw612', '', d)}"

MACHINE_EXTRA_RRECOMMENDS += "${WIRELESS_MODULE}"

IMAGE_BOOT_FILES:append:use-nxp-bsp = " \
    imx93_m33_TCM_rpmsg_lite_pingpong_rtos_linux_remote.bin \
    imx93_m33_TCM_rpmsg_lite_str_echo_rtos.bin \
"
WKS_FILE_DEPENDS:append = " imx-m33-demos"

# XBee
XBEE_RESET_N_GPIO ?= "gpio2@19"
XBEE_SLEEP_RQ_GPIO ?= ""
XBEE_TTY ?= "ttyLP3"

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

# Boot artifacts to be copied from the deploy dir to the installer ZIP
BOOTABLE_ARTIFACTS = " \
    imx-boot-ccimx93-dvk.bin \
    imx-boot-ccimx93-dvk-A0.bin \
"

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