Patchwork [meta-fsl-ppc,dylan,16/30] u-boot: simplify the compile steps

login
register
mail settings
Submitter Ting Liu
Date Jan. 7, 2014, 1:09 p.m.
Message ID <1389100192-19057-17-git-send-email-b28495@freescale.com>
Download mbox | patch
Permalink /patch/64265/
State Accepted
Headers show

Comments

Ting Liu - Jan. 7, 2014, 1:09 p.m.
From: Ting Liu <b28495@freescale.com>

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

Patch

diff --git a/recipes-bsp/u-boot/u-boot_git.bb b/recipes-bsp/u-boot/u-boot_git.bb
index f11b517..1621da4 100644
--- a/recipes-bsp/u-boot/u-boot_git.bb
+++ b/recipes-bsp/u-boot/u-boot_git.bb
@@ -75,26 +75,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
 }