[meta-freescale] [meta-fsl-ppc][dora][PATCH 17/31] u-boot: simplify the compile steps

b28495 at freescale.com b28495 at freescale.com
Wed Jan 15 01:41:22 PST 2014


From: Ting Liu <b28495 at freescale.com>

Signed-off-by: Ting Liu <b28495 at freescale.com>
---
 recipes-bsp/u-boot/u-boot_git.bb |   31 ++++++++++++++-----------------
 1 file changed, 14 insertions(+), 17 deletions(-)

diff --git a/recipes-bsp/u-boot/u-boot_git.bb b/recipes-bsp/u-boot/u-boot_git.bb
index 92c7d1a..d74ea67 100644
--- a/recipes-bsp/u-boot/u-boot_git.bb
+++ b/recipes-bsp/u-boot/u-boot_git.bb
@@ -76,26 +76,23 @@ do_compile () {
             *)      UBOOT_TARGET="";;
         esac
 
+        # deal with sd/spi/nand image
+        UBOOT_SOURCE=u-boot
         if [ "x${UBOOT_TARGET}" != "x" ]; then
-            if [ "${UBOOT_TARGET}" = "u-boot-sd" ]; then
-                cp ${S}/${board}/u-boot.bin  ${S}/${board}/${UBOOT_TARGET}.bin
-            elif [ "${UBOOT_TARGET}" = "u-boot-nand" ];then
-                if [ "${DEFAULTTUNE}" = "ppce500v2" ];then
-                    if echo $board |egrep -q "(P1010RDB|P1020RDB|P1021RDB|P1024RDB|P2020RDB|P1022DS|P1025RDB|BSC9131)";then
-                        cp ${S}/${board}/u-boot-with-spl.bin ${S}/${board}/${UBOOT_TARGET}.bin
-                    fi
-                else
-                    cp ${S}/${board}/u-boot.bin  ${S}/${board}/${UBOOT_TARGET}.bin
-                fi
-            else
-                if [ -n "${BOOTFORMAT_CONFIG}" ];then
-                    ${STAGING_BINDIR_NATIVE}/boot_format \
-                    ${STAGING_DATADIR_NATIVE}/boot_format/${BOOTFORMAT_CONFIG} \
-                    ${S}/${board}/u-boot.bin -spi ${S}/${board}/${UBOOT_TARGET}.bin
-                else
-                    cp ${S}/${board}/u-boot.bin  ${S}/${board}/${UBOOT_TARGET}.bin
+            # some boards' nand image was named as u-boot-with-spl
+            if [ "${UBOOT_TARGET}" = "u-boot-nand" ];then
+                if echo $board |egrep -q "(P1010RDB|P1020RDB|P1021RDB|P1024RDB|P2020RDB|P1022DS|P1025RDB|BSC913)";then
+                    UBOOT_SOURCE=u-boot-with-spl
                 fi
             fi
+            cp ${S}/${board}/${UBOOT_SOURCE}.bin  ${S}/${board}/${UBOOT_TARGET}.bin
+
+            # use boot-format to regenerate spi image if BOOTFORMAT_CONFIG is not empty
+            if [ "${UBOOT_TARGET}" = "u-boot-spi" ] && [ -n "${BOOTFORMAT_CONFIG}" ];then
+                ${STAGING_BINDIR_NATIVE}/boot_format \
+                ${STAGING_DATADIR_NATIVE}/boot_format/${BOOTFORMAT_CONFIG} \
+                ${S}/${board}/${UBOOT_SOURCE}.bin -spi ${S}/${board}/${UBOOT_TARGET}.bin
+            fi
         fi
     done
 }
-- 
1.7.9.7




More information about the meta-freescale mailing list