aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2013-08-26 16:58:22 +0000
committerOtavio Salvador <otavio@ossystems.com.br>2013-08-29 16:14:22 -0300
commit7df4140504776e2dea575f4d39a47df2adad72ff (patch)
tree5e2b2fc95e7c22a1731ffc43b6cbb8c5387e6dda
parent14edbd802b9b6d2181d8b10e14acc8debc708a36 (diff)
downloadmeta-fsl-arm-7df4140504776e2dea575f4d39a47df2adad72ff.tar.gz
meta-fsl-arm-7df4140504776e2dea575f4d39a47df2adad72ff.tar.bz2
meta-fsl-arm-7df4140504776e2dea575f4d39a47df2adad72ff.zip
image_types_fsl: mxs: Add support for a barebox bootstream
Change-Id: Ibe7afdd6e4c2f5db73b42cf6b39df9756bdb9fb8 Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
-rw-r--r--classes/image_types_fsl.bbclass22
1 files changed, 22 insertions, 0 deletions
diff --git a/classes/image_types_fsl.bbclass b/classes/image_types_fsl.bbclass
index 1868c41..6f63402 100644
--- a/classes/image_types_fsl.bbclass
+++ b/classes/image_types_fsl.bbclass
@@ -36,6 +36,16 @@ IMAGE_CMD_linux.sb () {
rm -f $kernel_bin-dtb
}
+# IMX Bootlets barebox bootstream
+IMAGE_DEPENDS_barebox.mxsboot-sdcard = "elftosb-native u-boot-mxsboot-native imx-bootlets barebox"
+IMAGE_CMD_barebox.mxsboot-sdcard () {
+ barebox_bd_file=imx-bootlets-barebox_ivt.bd-${MACHINE}
+
+ # Ensure the files are generated
+ rm -f ${IMAGE_NAME}.barebox.sb ${IMAGE_NAME}.barebox.mxsboot-sdcard
+ elftosb -f mx28 -z -c $barebox_bd_file -o ${IMAGE_NAME}.barebox.sb
+ mxsboot sd ${IMAGE_NAME}.barebox.sb ${IMAGE_NAME}.barebox.mxsboot-sdcard
+}
# U-Boot mxsboot generation to SD-Card
UBOOT_SUFFIX_SDCARD_mxs ?= "mxsboot-sdcard"
@@ -49,6 +59,9 @@ BOOTDD_VOLUME_ID ?= "Boot ${MACHINE}"
# Boot partition size [in KiB]
BOOT_SPACE ?= "8192"
+# Barebox environment size [in KiB]
+BAREBOX_ENV_SPACE ?= "512"
+
# Set alignment to 4MB [in KiB]
IMAGE_ROOTFS_ALIGNMENT = "4096"
@@ -238,6 +251,15 @@ generate_mxs_sdcard () {
dd if=${WORKDIR}/boot.img of=${SDCARD} conv=notrunc seek=2 bs=$(expr 1024 \* 1024)
;;
+ barebox)
+ # BAREBOX_ENV_SPACE is taken on BOOT_SPACE_ALIGNED but it doesn't really matter as long as the rootfs is aligned
+ parted -s ${SDCARD} unit KiB mkpart primary 1024 $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED} - ${BAREBOX_ENV_SPACE})
+ parted -s ${SDCARD} unit KiB mkpart primary $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED} - ${BAREBOX_ENV_SPACE}) $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED})
+ parted -s ${SDCARD} unit KiB mkpart primary $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED}) $(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED} \+ $ROOTFS_SIZE)
+
+ dd if=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.barebox.mxsboot-sdcard of=${SDCARD} conv=notrunc seek=1 bs=$(expr 1024 \* 1024)
+ dd if=${DEPLOY_DIR_IMAGE}/bareboxenv-${MACHINE}.bin of=${SDCARD} conv=notrunc seek=$(expr ${IMAGE_ROOTFS_ALIGNMENT} \+ ${BOOT_SPACE_ALIGNED} - ${BAREBOX_ENV_SPACE}) bs=1024
+ ;;
*)
bberror "Unkown IMAGE_BOOTLOADER value"
exit 1