From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Date: Wed, 1 Mar 2017 02:25:25 +0000 Subject: [U-Boot] [PATCH 13/17] sunxi: A64: Pine64: introduce FIT generator script In-Reply-To: <1488335129-12363-1-git-send-email-andre.przywara@arm.com> References: <1488335129-12363-1-git-send-email-andre.przywara@arm.com> Message-ID: <1488335129-12363-14-git-send-email-andre.przywara@arm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Now that the Makefile can call a generator script to build a more advanced FIT image, let's use this feature to address the needs of Allwinner A64 boards. The (DTB stripped) U-Boot binary and the ATF are static, but we allow an arbitrary number of supported device trees to be passed. The script enters both a DT entry in the /images node and the respective subnode in /configurations to support all listed DTBs. This requires to copy the ARM Trusted Firmware build (bl31.bin) into the U-Boot source directory (or to create a symlink to it). Signed-off-by: Andre Przywara --- board/sunxi/mksunxi_fit_atf.sh | 73 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100755 board/sunxi/mksunxi_fit_atf.sh diff --git a/board/sunxi/mksunxi_fit_atf.sh b/board/sunxi/mksunxi_fit_atf.sh new file mode 100755 index 0000000..afa22e8 --- /dev/null +++ b/board/sunxi/mksunxi_fit_atf.sh @@ -0,0 +1,73 @@ +#!/bin/sh +# +# script to generate FIT image source for 64-bit sunxi boards with +# ARM Trusted Firmware and multiple device trees (given on the command line) +# +# usage: $0 [ [; + + images { + uboot at 1 { + description = "U-Boot (64-bit)"; + data = /incbin/("u-boot-nodtb.bin"); + type = "standalone"; + arch = "arm64"; + compression = "none"; + load = <0x4a000000>; + }; + atf at 1 { + description = "ARM Trusted Firmware"; + data = /incbin/("bl31.bin"); + type = "firmware"; + arch = "arm64"; + compression = "none"; + load = <0x44000>; + entry = <0x44000>; + }; +__HEADER_EOF + +cnt=1 +for dtname in $* +do + cat << __FDT_IMAGE_EOF + fdt@$cnt { + description = "$(basename $dtname .dtb)"; + data = /incbin/("$dtname"); + type = "flat_dt"; + compression = "none"; + }; +__FDT_IMAGE_EOF + cnt=$((cnt+1)) +done + +cat << __CONF_HEADER_EOF + }; + configurations { + default = "config at 1"; + +__CONF_HEADER_EOF + +cnt=1 +for dtname in $* +do + cat << __CONF_SECTION_EOF + config@$cnt { + description = "$(basename $dtname .dtb)"; + firmware = "uboot at 1"; + loadables = "atf@1"; + fdt = "fdt@$cnt"; + }; +__CONF_SECTION_EOF + cnt=$((cnt+1)) +done + +cat << __ITS_EOF + }; +}; +__ITS_EOF -- 2.8.2