2 # SPDX-License-Identifier: GPL-2.0+
4 # script to generate FIT image source for K3 Family boards with
5 # ATF, OPTEE, SPL and multiple device trees (given on the command line).
6 # Inspired from board/sunxi/mksunxi_fit_atf.sh
8 # usage: $0 <atf_load_addr> <dt_name> [<dt_name> [<dt_name] ...]
10 [ -z "$ATF" ] && ATF="bl31.bin"
12 if [ ! -f $ATF ]; then
13 echo "WARNING ATF file $ATF NOT found, resulting binary is non-functional" >&2
17 [ -z "$TEE" ] && TEE="bl32.bin"
19 if [ ! -f $TEE ]; then
20 echo "WARNING OPTEE file $TEE NOT found, resulting might be non-functional" >&2
24 [ -z "$DM" ] && DM="dm.bin"
27 echo "WARNING DM file $DM NOT found, resulting might be non-functional" >&2
31 if [ ! -z "$IS_HS" ]; then
39 description = "Configuration to load ATF and SPL";
44 description = "ARM Trusted Firmware";
45 data = /incbin/("$ATF");
49 os = "arm-trusted-firmware";
54 description = "OPTEE";
55 data = /incbin/("$TEE");
64 description = "DM binary";
65 data = /incbin/("$DM");
74 description = "SPL (64-bit)";
75 data = /incbin/("spl/u-boot-spl-nodtb.bin$HS_APPEND");
85 # shift through ATF load address in the command line arguments
90 cat << __FDT_IMAGE_EOF
92 description = "$(basename $dtname .dtb)";
93 data = /incbin/("$dtname$HS_APPEND");
101 cat << __CONF_HEADER_EOF
104 default = "$(basename $1)";
110 cat << __CONF_SECTION_EOF
111 $(basename $dtname) {
112 description = "$(basename $dtname .dtb)";
114 loadables = "tee", "dm", "spl";
115 fdt = "$(basename $dtname)";