From d4888b46bf3fd312e5c44f7f3e9022c55642e699 Mon Sep 17 00:00:00 2001 From: Ting Liu Date: Tue, 29 Oct 2013 16:58:23 +0800 Subject: u-boot: simplify the compile steps Signed-off-by: Ting Liu --- recipes-bsp/u-boot/u-boot_git.bb | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'recipes-bsp/u-boot') diff --git a/recipes-bsp/u-boot/u-boot_git.bb b/recipes-bsp/u-boot/u-boot_git.bb index f4f2dca..bfd2d79 100644 --- a/recipes-bsp/u-boot/u-boot_git.bb +++ b/recipes-bsp/u-boot/u-boot_git.bb @@ -77,26 +77,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 } -- cgit v1.2.3-54-g00ecf