]> code.ossystems Code Review - meta-freescale.git/commitdiff
image_types_fsl.bbclass: generates mxs' u-boot bootstream binaries
authorOtavio Salvador <otavio@ossystems.com.br>
Tue, 20 Mar 2012 21:11:40 +0000 (21:11 +0000)
committerOtavio Salvador <otavio@ossystems.com.br>
Mon, 30 Apr 2012 14:28:36 +0000 (11:28 -0300)
The mxs SoC family requires use of a bootstream in bootloader but at
this moment only SDCard format is supported. The image for use is
'u-boot.mxsboot-sdcard' and this is also the file extension of the
generated file beside of regular u-boot binary.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
meta-fsl-arm/classes/image_types_fsl.bbclass

index a43e4c6b873719ed16f12ff954c8c39570cdc197..d9e292c69cd48674fd3597078b9d9448b63aaa2e 100644 (file)
@@ -5,6 +5,18 @@ IMAGE_BOOTLOADER ?= "u-boot"
 # Handle u-boot suffixes
 UBOOT_SUFFIX ?= "bin"
 UBOOT_PADDING ?= "0"
+UBOOT_SUFFIX_SDCARD ?= "${UBOOT_SUFFIX}"
+
+#
+# Handles i.MX mxs bootstream generation
+#
+
+IMAGE_FSTYPES_mxs =+ "uboot.mxsboot-sdcard"
+
+UBOOT_SUFFIX_SDCARD_mxs ?= "mxsboot-sdcard"
+IMAGE_DEPENDS_uboot.mxsboot-sdcard = "u-boot-mxsboot-native u-boot"
+IMAGE_CMD_uboot.mxsboot-sdcard = "mxsboot sd ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.${UBOOT_SUFFIX} \
+                                             ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.${UBOOT_SUFFIX_SDCARD}"
 
 #
 # Create an image that can by written onto a SD card using dd.
@@ -50,9 +62,15 @@ IMAGE_CMD_sdcard () {
        parted -s ${SDCARD} mkpart primary ${BOOT_SPACE} 100%
        parted ${SDCARD} print
 
+       # Change partition type for mxs processor family
+       if [ "${SOC_FAMILY}" = "mxs" ]; then
+               bbnote "Setting partition type to 0x53 as required for mxs' SoC family."
+               sed -i 's,.,\x53,450' ${SDCARD}
+       fi
+
        case "${IMAGE_BOOTLOADER}" in
                u-boot)
-               dd if=${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.${UBOOT_SUFFIX} of=${SDCARD} conv=notrunc seek=2 skip=${UBOOT_PADDING} bs=512
+               dd if=${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.${UBOOT_SUFFIX_SDCARD} of=${SDCARD} conv=notrunc seek=2 skip=${UBOOT_PADDING} bs=512
                ;;
                barebox)
                dd if=${DEPLOY_DIR_IMAGE}/barebox-${MACHINE}.bin of=${SDCARD} conv=notrunc seek=1 skip=1 bs=512