2 # SPDX-License-Identifier: GPL-2.0+
4 # script to generate FIT image source for i.MX8MQ 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 [ -z "$BL31" ] && BL31="bl31.bin"
10 [ -z "$TEE_LOAD_ADDR" ] && TEE_LOAD_ADDR="0xfe000000"
11 [ -z "$ATF_LOAD_ADDR" ] && ATF_LOAD_ADDR="0x00910000"
13 if [ ! -f $BL31 ]; then
14 echo "ERROR: BL31 file $BL31 NOT found" >&2
17 echo "$BL31 size: " >&2
18 ls -lct $BL31 | awk '{print $5}' >&2
23 if [ ! -f $BL32 ]; then
26 echo "Building with TEE support, make sure your $BL31 is compiled with spd. If you do not want tee, please delete $BL31" >&2
27 echo "$BL32 size: " >&2
28 ls -lct $BL32 | awk '{print $5}' >&2
31 BL33="u-boot-nodtb.bin"
33 if [ ! -f $BL33 ]; then
34 echo "ERROR: $BL33 file NOT found" >&2
37 echo "u-boot-nodtb.bin size: " >&2
38 ls -lct u-boot-nodtb.bin | awk '{print $5}' >&2
43 echo "$dtname size: " >&2
44 ls -lct $dtname | awk '{print $5}' >&2
52 description = "Configuration to load ATF before U-Boot";
56 description = "U-Boot (64-bit)";
57 data = /incbin/("$BL33");
64 description = "ARM Trusted Firmware";
65 data = /incbin/("$BL31");
69 load = <$ATF_LOAD_ADDR>;
70 entry = <$ATF_LOAD_ADDR>;
77 description = "TEE firmware";
78 data = /incbin/("$BL32");
82 load = <$TEE_LOAD_ADDR>;
83 entry = <$TEE_LOAD_ADDR>;
91 cat << __FDT_IMAGE_EOF
93 description = "$(basename $dtname .dtb)";
94 data = /incbin/("$dtname");
102 cat << __CONF_HEADER_EOF
105 default = "config@1";
112 if [ -f $BL32 ]; then
113 cat << __CONF_SECTION_EOF
115 description = "$(basename $dtname .dtb)";
116 firmware = "uboot@1";
117 loadables = "atf@1", "tee@1";
122 cat << __CONF_SECTION1_EOF
124 description = "$(basename $dtname .dtb)";
125 firmware = "uboot@1";