Skip to contentSkip to conversation

freescale: Add a standard genimage script for MX23/MX28

PATCH New Fabio Estevam 2 participants 4 messages Nov 6, 2016 Arm i.MX and Layerscape

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/2 freescale: Add a standard genimage script for MX23/MX28

Add a standard genimage script for the MXS processors (MX23 and MX28).

Based on the common scripts for the other imx devices:
board/freescale/common/genimage.cfg.template board/freescale/common/post-image.sh

This makes it easier to add new MX23/MX28 boards configurations into Buildroot.

---
 board/freescale/common/mxs/genimage.cfg.template | 39 +++++++++++++++++
 board/freescale/common/mxs/post-image.sh         | 54 ++++++++++++++++++++++++
 2 files changed, 93 insertions(+)
 create mode 100644 board/freescale/common/mxs/genimage.cfg.template
 create mode 100755 board/freescale/common/mxs/post-image.sh
board/freescale/common/mxs/genimage.cfg.template new file +39 -0
new file mode 100644
index 0000000..91031ab
@@ -0,0 +1,39 @@
+# Minimal SD card image for the Freescale MX23/MX28 Template
+#
+# We mimic the .sdcard Freescale's MX23/MX28 image format:
+# * u-boot.sb is placed at offset 1M,
+# * a FAT partition at offset 16 MB 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 u-boot {
+		partition-type = 0x53
+		image = "u-boot.sd"
+		offset = 1M
+		size = 16M
+	}
+
+	partition kernel {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext2"
+	}
+}
board/freescale/common/mxs/post-image.sh new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
2.7.4
author reviewer
#1 lore raw

PATCH 2/2 configs/imx28evk: Use the common mxs genimage script

Use the common mxs genimage script instead of a custom one.

---
 board/freescale/imx28evk/genimage.cfg  | 29 -----------------------------
 board/freescale/imx28evk/post-image.sh | 14 --------------
 configs/freescale_imx28evk_defconfig   |  2 +-
 3 files changed, 1 insertion(+), 44 deletions(-)
 delete mode 100644 board/freescale/imx28evk/genimage.cfg
 delete mode 100755 board/freescale/imx28evk/post-image.sh
board/freescale/imx28evk/genimage.cfg deleted +0 -29
deleted file mode 100644
index 4df432f..0000000
@@ -1,29 +0,0 @@
-image kernel.vfat {
-	vfat {
-		files = {
-		"zImage", "imx28-evk.dtb"
-		}
-	}
-	size = 16M
-}
-
-image sdcard.img {
-	hdimage {
-	}
-	partition boot {
-		partition-type = 0x53
-		image = "u-boot.sd"
-		offset = 1M
-		size = 16M
-	}
-
-	partition kernel {
-		partition-type = 0xC
-		image = "kernel.vfat"
-	}
-
-	partition rootfs {
-		partition-type = 0x83
-		image = "rootfs.ext2"
-	}
-}
board/freescale/imx28evk/post-image.sh deleted +0 -14
deleted file mode 100755
index b4ac460..0000000
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-
-BOARD_DIR="$(dirname $0)"
-GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage \
-  --rootpath "${TARGET_DIR}" \
-  --tmppath "${GENIMAGE_TMP}" \
-  --inputpath "${BINARIES_DIR}" \
-  --outputpath "${BINARIES_DIR}" \
-  --config "${GENIMAGE_CFG}"
configs/freescale_imx28evk_defconfig +1 -1
index 790c338..08d5bd9 100644
@@ -31,4 +31,4 @@ BR2_TARGET_ROOTFS_EXT4=y
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/imx28evk/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/mxs/post-image.sh"
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/2 freescale: Add a standard genimage script for MX23/MX28

In reply to Fabio Estevam

Hello,

Quoted 9 lines · Fabio Estevam

Add a standard genimage script for the MXS processors (MX23 and MX28).

Based on the common scripts for the other imx devices:
board/freescale/common/genimage.cfg.template board/freescale/common/post-image.sh

This makes it easier to add new MX23/MX28 boards configurations into Buildroot.

Quoted 7 lines
---
 board/freescale/common/mxs/genimage.cfg.template | 39 +++++++++++++++++
 board/freescale/common/mxs/post-image.sh         | 54 ++++++++++++++++++++++++
 2 files changed, 93 insertions(+)
 create mode 100644 board/freescale/common/mxs/genimage.cfg.template
 create mode 100755 board/freescale/common/mxs/post-image.sh

I've applied both to next. However, we now have this a bit weird hierarchy:

board/freescale/common/
??? genimage.cfg.template
??? mxs
??? ??? genimage.cfg.template
??? ??? post-image.sh
??? post-image.sh

Perhaps we should move the i.MX genimage.cfg.template and post-image.sh in an imx/ sub-directory? This means adjusting all the defconfig, but it can be done mechanically.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
author reviewer
#3 lore raw

PATCH 1/2 freescale: Add a standard genimage script for MX23/MX28

Hi Thomas,

Quoted 10 lines · Thomas Petazzoni

I've applied both to next. However, we now have this a bit weird hierarchy:

board/freescale/common/
??? genimage.cfg.template
??? mxs
? ??? genimage.cfg.template
? ??? post-image.sh
??? post-image.sh

Quoted 3 lines

Perhaps we should move the i.MX genimage.cfg.template and post-image.sh in an imx/ sub-directory? This means adjusting all the defconfig, but it can be done mechanically.

Yes, I will prepare a patch that implements this proposal, thanks.