rockchip: make_fit_args: support make u-boot.itb command

The command pass board dtb as arg1.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ie96ad09665698904978caca82ec38843930ed09e
This commit is contained in:
Joseph Chen 2020-10-16 16:01:40 +08:00 committed by Jianhong Chen
parent 45dfd9925e
commit a9c93f9d80
2 changed files with 33 additions and 37 deletions

View File

@ -23,48 +23,44 @@ function help()
echo " -c [comp] ==> <string> COMPRESSION set compression: \"none\", \"gzip\"" echo " -c [comp] ==> <string> COMPRESSION set compression: \"none\", \"gzip\""
echo " -m [offset] ==> <hex> MCU_LOAD_ADDR set mcu.bin offset address" echo " -m [offset] ==> <hex> MCU_LOAD_ADDR set mcu.bin offset address"
echo " -t [offset] ==> <hex> TEE_LOAD_ADDR set tee.bin offset address" echo " -t [offset] ==> <hex> TEE_LOAD_ADDR set tee.bin offset address"
echo " -u ==> - UBOOT_LOAD_ADDR auto get CONFIG_SYS_TEXT_BASE address"
echo echo
} }
if [ -z $1 ]; then if [ $# -eq 1 ]; then
help # default
exit TEE_OFFSET=0x08400000
else
# args
while [ $# -gt 0 ]; do
case $1 in
--help|-help|help|--h|-h)
help
exit
;;
-c)
COMPRESSION=$2
shift 2
;;
-m)
MCU_OFFSET=$2
shift 2
;;
-t)
TEE_OFFSET=$2
shift 2
;;
*)
echo "Invalid arg: $1"
help
exit 1
;;
esac
done
fi fi
# args
while [ $# -gt 0 ]; do
case $1 in
--help|-help|help|--h|-h)
help
exit
;;
-c)
COMPRESSION=$2
shift 2
;;
-m)
MCU_OFFSET=$2
shift 2
;;
-t)
TEE_OFFSET=$2
shift 2
;;
-u)
UBOOT_LOAD_ADDR=`sed -n "/CONFIG_SYS_TEXT_BASE=/s/CONFIG_SYS_TEXT_BASE=//p" ${srctree}/include/autoconf.mk|tr -d '\r'`
shift 1
;;
*)
echo "Invalid arg: $1"
help
exit 1
;;
esac
done
# Base # Base
DARM_BASE=`sed -n "/CONFIG_SYS_SDRAM_BASE=/s/CONFIG_SYS_SDRAM_BASE=//p" ${srctree}/include/autoconf.mk|tr -d '\r'` DARM_BASE=`sed -n "/CONFIG_SYS_SDRAM_BASE=/s/CONFIG_SYS_SDRAM_BASE=//p" ${srctree}/include/autoconf.mk|tr -d '\r'`
UBOOT_LOAD_ADDR=`sed -n "/CONFIG_SYS_TEXT_BASE=/s/CONFIG_SYS_TEXT_BASE=//p" ${srctree}/include/autoconf.mk|tr -d '\r'`
# tee # tee
if [ ! -z "${TEE_OFFSET}" ]; then if [ ! -z "${TEE_OFFSET}" ]; then

View File

@ -634,9 +634,9 @@ function pack_uboot_itb_image()
else else
SPL_FIT_GENERATOR=`sed -n "/CONFIG_SPL_FIT_GENERATOR=/s/CONFIG_SPL_FIT_GENERATOR=//p" .config | tr -d '""'` SPL_FIT_GENERATOR=`sed -n "/CONFIG_SPL_FIT_GENERATOR=/s/CONFIG_SPL_FIT_GENERATOR=//p" .config | tr -d '""'`
if [ ! -z ${MCU_OFFSET} ]; then if [ ! -z ${MCU_OFFSET} ]; then
${SPL_FIT_GENERATOR} -u -t ${TEE_OFFSET} -c ${COMPRESSION} -m ${MCU_OFFSET} > u-boot.its ${SPL_FIT_GENERATOR} -t ${TEE_OFFSET} -c ${COMPRESSION} -m ${MCU_OFFSET} > u-boot.its
else else
${SPL_FIT_GENERATOR} -u -t ${TEE_OFFSET} -c ${COMPRESSION} > u-boot.its ${SPL_FIT_GENERATOR} -t ${TEE_OFFSET} -c ${COMPRESSION} > u-boot.its
fi fi
fi fi