2 # SPDX-License-Identifier: GPL-2.0+
4 # script to generate FIT image source for Xilinx ZynqMP boards with
5 # ARM Trusted Firmware and multiple device trees (given on the command line)
7 # usage: $0 <dt_name> [<dt_name> [<dt_name] ...]
9 BL33="u-boot-nodtb.bin"
10 [ -z "$BL31" ] && BL31="bl31.bin"
11 # Can be also done as ${CROSS_COMPILE}readelf -l bl31.elf | awk '/Entry point/ { print $3 }'
12 [ -z "$ATF_LOAD_ADDR" ] && ATF_LOAD_ADDR="0xfffea000"
14 if [ -z "$BL33_LOAD_ADDR" ];then
15 BL33_LOAD_ADDR=`awk '/CONFIG_SYS_TEXT_BASE/ { print $3 }' include/generated/autoconf.h`
18 DTB_LOAD_ADDR=`awk '/CONFIG_XILINX_OF_BOARD_DTB_ADDR/ { print $3 }' include/generated/autoconf.h`
19 if [ ! -z "$DTB_LOAD_ADDR" ]; then
20 DTB_LOAD="load = <$DTB_LOAD_ADDR>;"
26 DT=arch/arm/dts/${DEVICE_TREE}.dtb
31 if [ ! -f $BL31 ]; then
32 echo "WARNING: BL31 file $BL31 NOT found, U-Boot will run in EL3" >&2
37 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
42 description = "Configuration to load ATF before U-Boot";
46 description = "U-Boot (64-bit)";
47 data = /incbin/("$BL33");
52 load = <$BL33_LOAD_ADDR>;
53 entry = <$BL33_LOAD_ADDR>;
63 description = "ARM Trusted Firmware";
64 data = /incbin/("$BL31");
66 os = "arm-trusted-firmware";
69 load = <$ATF_LOAD_ADDR>;
70 entry = <$ATF_LOAD_ADDR>;
82 cat << __FDT_IMAGE_EOF
84 description = "$(basename $dtname .dtb)";
85 data = /incbin/("$dtname");
96 [ "x$(basename $dtname .dtb)" = "x${DEVICE_TREE}" ] && DEFAULT=$cnt
101 cat << __CONF_HEADER_EOF
104 default = "config_$DEFAULT";
111 if [ ! -f $BL31 ]; then
112 cat << __CONF_SECTION1_EOF
114 description = "$(basename $dtname .dtb)";
120 cat << __CONF_SECTION1_EOF
122 description = "$(basename $dtname .dtb)";