Patchwork [meta-fsl-arm] image_types_fsl.bbclass: Add U-Boot SPL support

login
register
mail settings
Submitter dv
Date Jan. 24, 2014, 4:49 p.m.
Message ID <1390582175-4753-1-git-send-email-dv@pseudoterminal.org>
Download mbox | patch
Permalink /patch/65767/
State Accepted
Delegated to: Otavio Salvador
Headers show

Comments

dv - Jan. 24, 2014, 4:49 p.m.
If the SPL_BINARY value is not empty, then the class will use
an alternative code path for copying U-Boot on the SD card.
u-boot.img is used (not .imx), and the SPL binary is prepended.
With empty SPL_BINARY values, the behavior is just like before.

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
---
 classes/image_types_fsl.bbclass | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/classes/image_types_fsl.bbclass b/classes/image_types_fsl.bbclass
index 7fd6a29..443abf7 100644
--- a/classes/image_types_fsl.bbclass
+++ b/classes/image_types_fsl.bbclass
@@ -115,7 +115,12 @@  generate_imx_sdcard () {
 		exit 1
 		;;
 		u-boot)
-		dd if=${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.${UBOOT_SUFFIX_SDCARD} of=${SDCARD} conv=notrunc seek=2 skip=${UBOOT_PADDING} bs=512
+		if [ -n "${SPL_BINARY}" ]; then
+			dd if=${DEPLOY_DIR_IMAGE}/${SPL_BINARY} of=${SDCARD} conv=notrunc seek=2 bs=512
+			dd if=${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.${UBOOT_SUFFIX_SDCARD} of=${SDCARD} conv=notrunc seek=42 bs=1K
+		else
+			dd if=${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.${UBOOT_SUFFIX_SDCARD} of=${SDCARD} conv=notrunc seek=2 skip=${UBOOT_PADDING} bs=512
+		fi
 		;;
 		barebox)
 		dd if=${DEPLOY_DIR_IMAGE}/barebox-${MACHINE}.bin of=${SDCARD} conv=notrunc seek=1 skip=1 bs=512