efi_loader: do not set invalid screen mode
[oweals/u-boot.git] / board / sunxi / mksunxi_fit_atf.sh
1 #!/bin/sh
2 #
3 # script to generate FIT image source for 64-bit sunxi boards with
4 # ARM Trusted Firmware and multiple device trees (given on the command line)
5 #
6 # usage: $0 <dt_name> [<dt_name> [<dt_name] ...]
7
8 [ -z "$BL31" ] && BL31="bl31.bin"
9
10 if [ ! -f $BL31 ]; then
11         echo "WARNING: BL31 file $BL31 NOT found, resulting binary is non-functional" >&2
12         echo "Please read the section on ARM Trusted Firmware (ATF) in board/sunxi/README.sunxi64" >&2
13         BL31=/dev/null
14 fi
15
16 if grep -q "^CONFIG_MACH_SUN50I_H6=y" .config; then
17         BL31_ADDR=0x104000
18 else
19         BL31_ADDR=0x44000
20 fi
21
22 cat << __HEADER_EOF
23 /dts-v1/;
24
25 / {
26         description = "Configuration to load ATF before U-Boot";
27         #address-cells = <1>;
28
29         images {
30                 uboot {
31                         description = "U-Boot (64-bit)";
32                         data = /incbin/("u-boot-nodtb.bin");
33                         type = "standalone";
34                         arch = "arm64";
35                         compression = "none";
36                         load = <0x4a000000>;
37                 };
38                 atf {
39                         description = "ARM Trusted Firmware";
40                         data = /incbin/("$BL31");
41                         type = "firmware";
42                         arch = "arm64";
43                         compression = "none";
44                         load = <$BL31_ADDR>;
45                         entry = <$BL31_ADDR>;
46                 };
47 __HEADER_EOF
48
49 cnt=1
50 for dtname in $*
51 do
52         cat << __FDT_IMAGE_EOF
53                 fdt_$cnt {
54                         description = "$(basename $dtname .dtb)";
55                         data = /incbin/("$dtname");
56                         type = "flat_dt";
57                         compression = "none";
58                 };
59 __FDT_IMAGE_EOF
60         cnt=$((cnt+1))
61 done
62
63 cat << __CONF_HEADER_EOF
64         };
65         configurations {
66                 default = "config_1";
67
68 __CONF_HEADER_EOF
69
70 cnt=1
71 for dtname in $*
72 do
73         cat << __CONF_SECTION_EOF
74                 config_$cnt {
75                         description = "$(basename $dtname .dtb)";
76                         firmware = "uboot";
77                         loadables = "atf";
78                         fdt = "fdt_$cnt";
79                 };
80 __CONF_SECTION_EOF
81         cnt=$((cnt+1))
82 done
83
84 cat << __ITS_EOF
85         };
86 };
87 __ITS_EOF