make.sh: support pack mcu by parameters

Parameters: mcu address offset and enable status.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Id388bf0d94182a55781248a51d26de32ee03e7be
This commit is contained in:
Joseph Chen 2020-04-15 14:48:48 +08:00 committed by Jianhong Chen
parent a515b6d27e
commit 851015326d
1 changed files with 8 additions and 6 deletions

14
make.sh
View File

@ -509,7 +509,6 @@ function pack_uboot_itb_image()
else
tos_image=`sed -n "/TOS=/s/TOS=//p" $ini |tr -d '\r'`
tosta_image=`sed -n "/TOSTA=/s/TOSTA=//p" $ini |tr -d '\r'`
mcu_image=`sed -n "/MCU=/s/MCU=//p" $ini |tr -d '\r'`
if [ $tosta_image ]; then
cp ${RKBIN}/${tosta_image} tee.bin
elif [ $tos_image ]; then
@ -519,21 +518,24 @@ function pack_uboot_itb_image()
exit 1
fi
if [ $mcu_image ]; then
cp ${RKBIN}/${mcu_image} mcu.bin
fi
tee_offset=`sed -n "/ADDR=/s/ADDR=//p" $ini |tr -d '\r'`
if [ "$tee_offset" = "" ]; then
tee_offset=0x8400000
fi
mcu_enabled=`awk -F"," '/MCU=/ { printf $3 }' $ini | tr -d ' '`
if [ "$mcu_enabled" = "enabled" ]; then
mcu_image=`awk -F"," '/MCU=/ { printf $1 }' $ini | tr -d ' ' | cut -c 5-`
mcu_offset=`awk -F"," '/MCU=/ { printf $2 }' $ini | tr -d ' '`
cp ${RKBIN}/${mcu_image} mcu.bin
fi
SPL_FIT_SOURCE=`sed -n "/CONFIG_SPL_FIT_SOURCE=/s/CONFIG_SPL_FIT_SOURCE=//p" .config | tr -d '""'`
if [ ! -z $SPL_FIT_SOURCE ]; then
cp $SPL_FIT_SOURCE u-boot.its
else
SPL_FIT_GENERATOR=`sed -n "/CONFIG_SPL_FIT_GENERATOR=/s/CONFIG_SPL_FIT_GENERATOR=//p" .config | tr -d '""'`
$SPL_FIT_GENERATOR $tee_offset > u-boot.its
$SPL_FIT_GENERATOR $tee_offset $mcu_offset > u-boot.its
fi
./tools/mkimage -f u-boot.its -E u-boot.itb
echo "pack u-boot.itb okay! Input: $ini"