Introduce a genimage template for booting SPL + u-boot.img U-Boot
binaries.
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
--- /dev/null
+# 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"
+ }
+}
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)"
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}"