diff options
Diffstat (limited to 'tools/k3_fit_atf.sh')
-rwxr-xr-x | tools/k3_fit_atf.sh | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/tools/k3_fit_atf.sh b/tools/k3_fit_atf.sh index 4e9f69c087..3a476ced98 100755 --- a/tools/k3_fit_atf.sh +++ b/tools/k3_fit_atf.sh @@ -5,7 +5,7 @@ # ATF, OPTEE, SPL and multiple device trees (given on the command line). # Inspired from board/sunxi/mksunxi_fit_atf.sh # -# usage: $0 <dt_name> [<dt_name> [<dt_name] ...] +# usage: $0 <atf_load_addr> <dt_name> [<dt_name> [<dt_name] ...] [ -z "$ATF" ] && ATF="bl31.bin" @@ -21,6 +21,13 @@ if [ ! -f $TEE ]; then TEE=/dev/null fi +[ -z "$DM" ] && DM="dm.bin" + +if [ ! -e $DM ]; then + echo "WARNING DM file $DM NOT found, resulting might be non-functional" >&2 + DM=/dev/null +fi + if [ ! -z "$IS_HS" ]; then HS_APPEND=_HS fi @@ -40,8 +47,8 @@ cat << __HEADER_EOF arch = "arm64"; compression = "none"; os = "arm-trusted-firmware"; - load = <0x70000000>; - entry = <0x70000000>; + load = <$1>; + entry = <$1>; }; tee { description = "OPTEE"; @@ -53,6 +60,16 @@ cat << __HEADER_EOF load = <0x9e800000>; entry = <0x9e800000>; }; + dm { + description = "DM binary"; + data = /incbin/("$DM"); + type = "firmware"; + arch = "arm32"; + compression = "none"; + os = "DM"; + load = <0xa0000000>; + entry = <0xa0000000>; + }; spl { description = "SPL (64-bit)"; data = /incbin/("spl/u-boot-spl-nodtb.bin$HS_APPEND"); @@ -65,6 +82,9 @@ cat << __HEADER_EOF }; __HEADER_EOF +# shift through ATF load address in the command line arguments +shift + for dtname in $* do cat << __FDT_IMAGE_EOF @@ -91,7 +111,7 @@ do $(basename $dtname) { description = "$(basename $dtname .dtb)"; firmware = "atf"; - loadables = "tee", "spl"; + loadables = "tee", "dm", "spl"; fdt = "$(basename $dtname)"; }; __CONF_SECTION_EOF |