From dc15bdc2edc653afafa92ba5c63153a869cc85b0 Mon Sep 17 00:00:00 2001
From: Robert Nelson <robertcnelson@gmail.com>
Date: Thu, 6 Dec 2018 11:02:57 -0600
Subject: [PATCH] add inital support for imx8mq-evk

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
---
 tools/hwpack/imx8mq-evk.conf | 30 ++++++++++++++++++++++++++++++
 tools/setup_sdcard.sh        | 13 ++++++++++---
 2 files changed, 40 insertions(+), 3 deletions(-)
 create mode 100644 tools/hwpack/imx8mq-evk.conf

diff --git a/tools/hwpack/imx8mq-evk.conf b/tools/hwpack/imx8mq-evk.conf
new file mode 100644
index 000000000..f1258085d
--- /dev/null
+++ b/tools/hwpack/imx8mq-evk.conf
@@ -0,0 +1,30 @@
+#!/bin/bash
+#        --dtb imx8mq-evk (NXP i.MX8QXP EVK board:supported)
+
+#Bootloader:
+conf_board="imx8mqevk_buildroot"
+conf_bl_http="https://rcn-ee.com/repos/bootloader/latest"
+conf_bl_listfile="bootloader-ng"
+
+#Bootloader Partition:
+bootloader_location="dd_uboot_boot"
+uboot_name="u-boot.imx8"
+dd_uboot_count=""
+dd_uboot_seek="33"
+dd_uboot_conf=""
+dd_uboot_bs="1k"
+unset spl_name
+boot_name="u-boot.imx8"
+
+enable_fat_partition="enable"
+conf_boot_fstype="fat"
+conf_boot_startmb="8"
+conf_boot_endmb="32"
+sfdisk_fstype="0xc"
+
+#Kernel:
+conf_kernel=
+dtb="fsl-imx8mq-evk.dtb"
+usbnet_mem=
+SERIAL="ttymxc0"
+
diff --git a/tools/setup_sdcard.sh b/tools/setup_sdcard.sh
index c441ab612..5574456e1 100755
--- a/tools/setup_sdcard.sh
+++ b/tools/setup_sdcard.sh
@@ -684,8 +684,15 @@ create_partitions () {
 		fi
 		dd_uboot_boot
 		bootloader_installed=1
-		sfdisk_single_partition_layout
-		media_rootfs_partition=1
+		if [ "x${enable_fat_partition}" = "xenable" ] ; then
+			conf_boot_endmb=${conf_boot_endmb:-"96"}
+			conf_boot_fstype=${conf_boot_fstype:-"fat"}
+			sfdisk_fstype=${sfdisk_fstype:-"0xE"}
+			sfdisk_partition_layout
+		else
+			sfdisk_single_partition_layout
+			media_rootfs_partition=1
+		fi
 		;;
 	dd_spl_uboot_boot)
 		echo "Using dd to place bootloader on drive"
@@ -1737,7 +1744,7 @@ process_dtb_conf () {
 
 	case "${conf_boot_fstype}" in
 	fat)
-		sfdisk_fstype="0xE"
+		sfdisk_fstype=${sfdisk_fstype:-"0xE"}
 		;;
 	ext2|ext3|ext4|btrfs)
 		sfdisk_fstype="L"
-- 
GitLab