diff options
| author | Otavio Salvador <otavio@ossystems.com.br> | 2012-06-16 13:53:11 -0300 |
|---|---|---|
| committer | Otavio Salvador <otavio@ossystems.com.br> | 2012-07-10 14:34:20 -0300 |
| commit | bd88940c2ab1569984a054e12b17906cbe94224a (patch) | |
| tree | a6cc1060ee59f769bb9a436b5dbc5823b47772d1 /meta-fsl-arm/classes | |
| parent | 634f5164a984c0318a5df35644affa649db02694 (diff) | |
| download | meta-freescale-bd88940c2ab1569984a054e12b17906cbe94224a.tar.gz | |
image_types_fsl.bbclass: add support to use Device Tree for Linux kernel
To support new kernel, which use Device Tree for description of
hardware and machine, the image generation needs to be reworked.
U-Boot supports it out of box, so it just need to be available for
reading while the imx-bootlets we need to append the dtb file on the
very end of the zImage file.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'meta-fsl-arm/classes')
| -rw-r--r-- | meta-fsl-arm/classes/image_types_fsl.bbclass | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/meta-fsl-arm/classes/image_types_fsl.bbclass b/meta-fsl-arm/classes/image_types_fsl.bbclass index e9e327950..324d4467d 100644 --- a/meta-fsl-arm/classes/image_types_fsl.bbclass +++ b/meta-fsl-arm/classes/image_types_fsl.bbclass | |||
| @@ -13,8 +13,29 @@ UBOOT_SUFFIX_SDCARD ?= "${UBOOT_SUFFIX}" | |||
| 13 | 13 | ||
| 14 | # IMX Bootlets Linux bootstream | 14 | # IMX Bootlets Linux bootstream |
| 15 | IMAGE_DEPENDS_linux.sb = "elftosb-native imx-bootlets virtual/kernel" | 15 | IMAGE_DEPENDS_linux.sb = "elftosb-native imx-bootlets virtual/kernel" |
| 16 | IMAGE_CMD_linux.sb = "(cd ${DEPLOY_DIR_IMAGE} ; elftosb -z -c imx-bootlets-linux.bd-${MACHINE} \ | 16 | IMAGE_LINK_NAME_linux.sb = "" |
| 17 | -o ${IMAGE_NAME}.linux.sb)" | 17 | IMAGE_CMD_linux.sb () { |
| 18 | kernel_bin="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.bin`" | ||
| 19 | kernel_dtb="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.dtb`" | ||
| 20 | linux_bd_file=imx-bootlets-linux.bd-${MACHINE} | ||
| 21 | if [ `basename $kernel_bin .bin` = `basename $kernel_dtb .dtb` ]; then | ||
| 22 | # When using device tree we build a zImage with the dtb | ||
| 23 | # appended on the end of the image | ||
| 24 | linux_bd_file=imx-bootlets-linux.bd-dtb-${MACHINE} | ||
| 25 | cat $kernel_bin $kernel_dtb \ | ||
| 26 | > $kernel_bin-dtb | ||
| 27 | rm -f ${KERNEL_IMAGETYPE}-${MACHINE}.bin-dtb | ||
| 28 | ln -s $kernel_bin-dtb ${KERNEL_IMAGETYPE}-${MACHINE}.bin-dtb | ||
| 29 | fi | ||
| 30 | |||
| 31 | # Ensure the file is generated | ||
| 32 | rm -f ${IMAGE_NAME}.linux.sb | ||
| 33 | elftosb -z -c $linux_bd_file -o ${IMAGE_NAME}.linux.sb | ||
| 34 | |||
| 35 | # Remove the appended file as it is only used here | ||
| 36 | rm -f $kernel_bin-dtb | ||
| 37 | } | ||
| 38 | |||
| 18 | 39 | ||
| 19 | # U-Boot mxsboot generation to SD-Card | 40 | # U-Boot mxsboot generation to SD-Card |
| 20 | UBOOT_SUFFIX_SDCARD_mxs ?= "mxsboot-sdcard" | 41 | UBOOT_SUFFIX_SDCARD_mxs ?= "mxsboot-sdcard" |
| @@ -84,6 +105,13 @@ generate_imx_sdcard () { | |||
| 84 | | awk '/ 2 / { print substr($4, 1, length($4 -1)) / 1024 }') | 105 | | awk '/ 2 / { print substr($4, 1, length($4 -1)) / 1024 }') |
| 85 | mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS | 106 | mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS |
| 86 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/uImage-${MACHINE}.bin ::/uImage | 107 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/uImage-${MACHINE}.bin ::/uImage |
| 108 | if [ -e "${KERNEL_IMAGETYPE}-${MACHINE}.dtb" ]; then | ||
| 109 | kernel_bin="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.bin`" | ||
| 110 | kernel_dtb="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.dtb`" | ||
| 111 | if [ `basename $kernel_bin .bin` = `basename $kernel_dtb .dtb` ]; then | ||
| 112 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.dtb ::/machine.dtb | ||
| 113 | fi | ||
| 114 | fi | ||
| 87 | 115 | ||
| 88 | dd if=${WORKDIR}/boot.img of=${SDCARD} conv=notrunc seek=1 bs=1M | 116 | dd if=${WORKDIR}/boot.img of=${SDCARD} conv=notrunc seek=1 bs=1M |
| 89 | dd if=${SDCARD_ROOTFS} of=${SDCARD} conv=notrunc seek=1 bs=${BOOT_SPACE} | 117 | dd if=${SDCARD_ROOTFS} of=${SDCARD} conv=notrunc seek=1 bs=${BOOT_SPACE} |
| @@ -134,6 +162,13 @@ generate_mxs_sdcard () { | |||
| 134 | 162 | ||
| 135 | mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS | 163 | mkfs.vfat -n "${BOOTDD_VOLUME_ID}" -S 512 -C ${WORKDIR}/boot.img $BOOT_BLOCKS |
| 136 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/uImage-${MACHINE}.bin ::/uImage | 164 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/uImage-${MACHINE}.bin ::/uImage |
| 165 | if [ -e "${KERNEL_IMAGETYPE}-${MACHINE}.dtb" ]; then | ||
| 166 | kernel_bin="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.bin`" | ||
| 167 | kernel_dtb="`readlink ${KERNEL_IMAGETYPE}-${MACHINE}.dtb`" | ||
| 168 | if [ `basename $kernel_bin .bin` = `basename $kernel_dtb .dtb` ]; then | ||
| 169 | mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.dtb ::/machine.dtb | ||
| 170 | fi | ||
| 171 | fi | ||
| 137 | 172 | ||
| 138 | dd if=${WORKDIR}/boot.img of=${SDCARD} conv=notrunc seek=2 bs=1MiB | 173 | dd if=${WORKDIR}/boot.img of=${SDCARD} conv=notrunc seek=2 bs=1MiB |
| 139 | ;; | 174 | ;; |
