Skip to contentSkip to conversation

imx: Introduce an SPL genimage template

PATCH RESEND New Fabio Estevam 2 participants 5 messages Sep 16, 2017 – Sep 25, 2017 Arm i.MX and Layerscape

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH RESEND 1/2 imx: Introduce an SPL genimage template

From: Fabio Estevam <[email protected]>

Introduce a genimage template for booting SPL + u-boot.img U-Boot binaries.

---
 .../freescale/common/imx/genimage.cfg.template_spl | 46 ++++++++++++++++++++++
 board/freescale/common/imx/post-image.sh           | 11 +++++-
 2 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 board/freescale/common/imx/genimage.cfg.template_spl
board/freescale/common/imx/genimage.cfg.template_spl new file +46 -0
new file mode 100644
index 0000000..b9e247d
@@ -0,0 +1,46 @@
+# Minimal SD card image for the Freescale boards Template for SPL Boot
+#
+# We mimic the .sdcard Freescale's image format:
+# * the SD card must have 1 kB free space at the beginning,
+# * U-Boot is dumped as is,
+# * a FAT partition at offset 8MB is containing zImage/uImage and DTB files
+# * a single root filesystem partition is required (ext2, ext3 or ext4)
+#
+
+image boot.vfat {
+  vfat {
+    files = {
+      %FILES%
+    }
+  }
+  size = 16M
+}
+
+image sdcard.img {
+  hdimage {
+  }
+
+  partition spl {
+    in-partition-table = "no"
+    image = "SPL"
+    offset = 1024
+  }
+
+  partition u-boot-img {
+    in-partition-table = "no"
+    image = "u-boot.img"
+    offset = 69K
+  }
+
+  partition boot {
+    partition-type = 0xC
+    bootable = "true"
+    image = "boot.vfat"
+    offset = 8M
+  }
+
+  partition rootfs {
+    partition-type = 0x83
+    image = "rootfs.ext2"
+  }
+}
board/freescale/common/imx/post-image.sh +10 -1
index 9e4da82..b239743 100755
@@ -28,6 +28,15 @@ linux_image()
 	fi
 }
 
+genimage_type()
+{
+	if grep -Eq "^BR2_TARGET_UBOOT_SPL=y$" ${BR2_CONFIG}; then
+		echo "genimage.cfg.template_spl"
+	else
+		echo "genimage.cfg.template"
+	fi
+}
+
 main()
 {
 	local FILES="$(dtb_list) $(linux_image)"
@@ -35,7 +44,7 @@ main()
 	local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
 
 	sed -e "s/%FILES%/${FILES}/" \
-		board/freescale/common/imx/genimage.cfg.template > ${GENIMAGE_CFG}
+		board/freescale/common/imx/$(genimage_type) > ${GENIMAGE_CFG}
 
 	rm -rf "${GENIMAGE_TMP}"
 
Signature · 1 line
2.7.4
author reviewer
#1 lore raw

PATCH RESEND 2/2 configs/imx6q-sabresd_defconfig: Switch to SPL boot

From: Fabio Estevam <[email protected]>

U-Boot 2017.07 has switched to SPL boot, which allows the same binary to boot on imx6dl, imx6q and imx6qp sabresd boards.

Switch to the SPL mechanism.

---
 configs/imx6q-sabresd_defconfig | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
configs/imx6q-sabresd_defconfig +6 -4
index b26dc2a..e010315 100644
@@ -22,10 +22,12 @@ BR2_TARGET_ROOTFS_EXT2_4=y
 
 # Bootloader
 BR2_TARGET_UBOOT=y
-BR2_TARGET_UBOOT_BOARDNAME="mx6qsabresd"
+BR2_TARGET_UBOOT_BOARDNAME="mx6sabresd"
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
-BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.05"
-BR2_TARGET_UBOOT_FORMAT_IMX=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.07"
+BR2_TARGET_UBOOT_FORMAT_IMG=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="SPL"
 
 # Kernel
 BR2_LINUX_KERNEL=y
@@ -33,4 +35,4 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.11.1"
 BR2_LINUX_KERNEL_DEFCONFIG="imx_v6_v7"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
-BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-sabresd"
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-sabresd imx6dl-sabresd imx6qp-sabresd"
Signature · 1 line
2.7.4
#2 lore raw

PATCH RESEND 2/2 configs/imx6q-sabresd_defconfig: Switch to SPL boot

Quoted 8 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

U-Boot 2017.07 has switched to SPL boot, which allows the same binary to boot on imx6dl, imx6q and imx6qp sabresd boards.

Switch to the SPL mechanism.

Applied both to master, thanks. However, as a follow-up patch, could you:

- rename this to imx6-sabresd_defconfig (since it now also supports DL and Q+);
- also swith the _qt5 config to SPL;
- maybe also merge board/freescale/imx6q-sabresd into board/freescale/imx6sabre, i.e. a single readme for all imx6sabre board that explains the difference between the Freescale and the upstream configs.

Also, could a Solo not be supported with the same defconfig?

Regards,
Arnout

Quoted 31 lines
---
 configs/imx6q-sabresd_defconfig | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
configs/imx6q-sabresd_defconfig +6 -4
index b26dc2a..e010315 100644
@@ -22,10 +22,12 @@ BR2_TARGET_ROOTFS_EXT2_4=y
 
 # Bootloader
 BR2_TARGET_UBOOT=y
-BR2_TARGET_UBOOT_BOARDNAME="mx6qsabresd"
+BR2_TARGET_UBOOT_BOARDNAME="mx6sabresd"
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
-BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.05"
-BR2_TARGET_UBOOT_FORMAT_IMX=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.07"
+BR2_TARGET_UBOOT_FORMAT_IMG=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="SPL"
 
 # Kernel
 BR2_LINUX_KERNEL=y
@@ -33,4 +35,4 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.11.1"
 BR2_LINUX_KERNEL_DEFCONFIG="imx_v6_v7"
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
-BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-sabresd"
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-sabresd imx6dl-sabresd imx6qp-sabresd"
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
author reviewer
#3 lore raw

PATCH RESEND 2/2 configs/imx6q-sabresd_defconfig: Switch to SPL boot

Hi Arnout,

Quoted 12 lines · Arnout Vandecappelle
Quoted 8 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

U-Boot 2017.07 has switched to SPL boot, which allows the same binary to boot on imx6dl, imx6q and imx6qp sabresd boards.

Switch to the SPL mechanism.

Quoted 7 lines

Applied both to master, thanks. However, as a follow-up patch, could you:

- rename this to imx6-sabresd_defconfig (since it now also supports DL and Q+);
- also swith the _qt5 config to SPL;
- maybe also merge board/freescale/imx6q-sabresd into board/freescale/imx6sabre, i.e. a single readme for all imx6sabre board that explains the difference between the Freescale and the upstream configs.

Yes, I had this in mind too. Will send it a follow-up patch soon.

Quoted 1 line

Also, could a Solo not be supported with the same defconfig?

Yes, in theory. However NXP does not produce a imx6solo sabresd board.

Thanks!

author reviewer
#4 lore raw

PATCH RESEND 2/2 configs/imx6q-sabresd_defconfig: Switch to SPL boot

In reply to Arnout Vandecappelle

Hi Arnout,

Quoted 4 lines · Arnout Vandecappelle

Applied both to master, thanks. However, as a follow-up patch, could you:

- rename this to imx6-sabresd_defconfig (since it now also supports DL and Q+);
- also swith the _qt5 config to SPL;

Just sent a series that addresses this topics.

Quoted 3 lines

- maybe also merge board/freescale/imx6q-sabresd into board/freescale/imx6sabre, i.e. a single readme for all imx6sabre board that explains the difference between the Freescale and the upstream configs.

This one is currently missing on my series, but I plan to do it on a next step.