diff --git a/AW64-add-spl-atf-support.patch b/AW64-add-spl-atf-support.patch deleted file mode 100644 index 8a5cbc6..0000000 --- a/AW64-add-spl-atf-support.patch +++ /dev/null @@ -1,194 +0,0 @@ -From patchwork Fri Mar 31 22:31:26 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [U-Boot,v3,14/19] sunxi: 64-bit SoCs: introduce FIT generator script -From: Andre Przywara -X-Patchwork-Id: 745831 -X-Patchwork-Delegate: jagannadh.teki@gmail.com -Message-Id: <1490999491-14899-15-git-send-email-andre.przywara@arm.com> -To: Maxime Ripard , - Jagan Teki , Simon Glass , - Tom Rini -Cc: Philipp Tomsich , - Michal Simek , u-boot@lists.denx.de, - Icenowy Zheng -Date: Fri, 31 Mar 2017 23:31:26 +0100 - -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 boards with 64-bit SoCs (A64 and H5). -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 -Reviewed-by: Simon Glass -Acked-by: Maxime Ripard ---- - 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@1 { -+ description = "U-Boot (64-bit)"; -+ data = /incbin/("u-boot-nodtb.bin"); -+ type = "standalone"; -+ arch = "arm64"; -+ compression = "none"; -+ load = <0x4a000000>; -+ }; -+ atf@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@1"; -+ -+__CONF_HEADER_EOF -+ -+cnt=1 -+for dtname in $* -+do -+ cat << __CONF_SECTION_EOF -+ config@$cnt { -+ description = "$(basename $dtname .dtb)"; -+ firmware = "uboot@1"; -+ loadables = "atf@1"; -+ fdt = "fdt@$cnt"; -+ }; -+__CONF_SECTION_EOF -+ cnt=$((cnt+1)) -+done -+ -+cat << __ITS_EOF -+ }; -+}; -+__ITS_EOF -From patchwork Fri Mar 31 22:31:28 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [U-Boot,v3,16/19] sunxi: enable automatic FIT build for 64-bit SoCs -From: Andre Przywara -X-Patchwork-Id: 745840 -X-Patchwork-Delegate: jagannadh.teki@gmail.com -Message-Id: <1490999491-14899-17-git-send-email-andre.przywara@arm.com> -To: Maxime Ripard , - Jagan Teki , Simon Glass , - Tom Rini -Cc: Philipp Tomsich , - Michal Simek , u-boot@lists.denx.de, - Icenowy Zheng -Date: Fri, 31 Mar 2017 23:31:28 +0100 - -The Allwinner SoCs with 64-bit cores use an ARM Trusted Firmware binary, -which needs to be loaded alongside U-Boot proper. -Set the respective Kconfig options to let them select this feature and -also automatically build the FIT image. - -Signed-off-by: Andre Przywara -Acked-by: Maxime Ripard ---- - Kconfig | 1 + - board/sunxi/Kconfig | 4 ++++ - include/configs/sunxi-common.h | 4 ++++ - 3 files changed, 9 insertions(+) - -diff --git a/Kconfig b/Kconfig -index 5c82788..ffea4c3 100644 ---- a/Kconfig -+++ b/Kconfig -@@ -252,6 +252,7 @@ config SPL_FIT_SOURCE - config SPL_FIT_GENERATOR - string ".its file generator script for U-Boot FIT image" - depends on SPL_FIT -+ default "board/sunxi/mksunxi_fit_atf.sh" if SPL_LOAD_FIT && ARCH_SUNXI - help - Specifies a (platform specific) script file to generate the FIT - source file used to build the U-Boot FIT image file. This gets -diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig -index 3e0e262..b629f3b 100644 ---- a/board/sunxi/Kconfig -+++ b/board/sunxi/Kconfig -@@ -145,12 +145,16 @@ config MACH_SUN50I - select SUNXI_GEN_SUN6I - select SUNXI_HIGH_SRAM - select SUPPORT_SPL -+ select FIT -+ select SPL_LOAD_FIT - - config MACH_SUN50I_H5 - bool "sun50i (Allwinner H5)" - select ARM64 - select MACH_SUNXI_H3_H5 - select SUNXI_HIGH_SRAM -+ select FIT -+ select SPL_LOAD_FIT - - endchoice - -diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h -index b7eb95e..1982063 100644 ---- a/include/configs/sunxi-common.h -+++ b/include/configs/sunxi-common.h -@@ -32,6 +32,10 @@ - # define CONFIG_MACH_TYPE_COMPAT_REV 1 - #endif - -+#ifdef CONFIG_ARM64 -+#define CONFIG_BUILD_TARGET "u-boot.itb" -+#endif -+ - /* Serial & console */ - #define CONFIG_SYS_NS16550_SERIAL - /* ns16550 reg in the low bits of cpu reg */ - diff --git a/fdt-fixes.patch b/fdt-fixes.patch deleted file mode 100644 index 8db6d27..0000000 --- a/fdt-fixes.patch +++ /dev/null @@ -1,171 +0,0 @@ -From 6a09f5e80038570b15f81fdb1e5bde897e01868a Mon Sep 17 00:00:00 2001 -From: Rob Clark -Date: Fri, 23 Jun 2017 15:36:33 -0400 -Subject: [PATCH] dm: core: also parse chosen node - -This is the node that would contain, for example, the framebuffer setup -by an earlier stage. - -Signed-off-by: Rob Clark ---- - arch/sandbox/dts/test.dts | 7 +++++++ - drivers/core/root.c | 12 ++++++++++++ - test/dm/bus.c | 2 +- - test/dm/test-fdt.c | 2 +- - 4 files changed, 21 insertions(+), 2 deletions(-) - -diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts -index e67d428eb2..3f9e788e6c 100644 ---- a/arch/sandbox/dts/test.dts -+++ b/arch/sandbox/dts/test.dts -@@ -478,6 +478,13 @@ - wdt0: wdt@0 { - compatible = "sandbox,wdt"; - }; -+ -+ chosen { -+ chosen-test { -+ compatible = "denx,u-boot-fdt-test"; -+ reg = <9 1>; -+ }; -+ }; - }; - - #include "sandbox_pmic.dtsi" -diff --git a/drivers/core/root.c b/drivers/core/root.c -index 976e2c4fdd..5a1c5994f6 100644 ---- a/drivers/core/root.c -+++ b/drivers/core/root.c -@@ -266,6 +266,18 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob, - for (offset = fdt_first_subnode(blob, offset); - offset > 0; - offset = fdt_next_subnode(blob, offset)) { -+ -+ /* "chosen" node isn't a device itself but may contain some: */ -+ if (!strcmp(fdt_get_name(blob, offset, NULL), "chosen")) { -+ pr_debug("parsing subnodes of \"chosen\"\n"); -+ -+ err = dm_scan_fdt_node(parent, blob, offset, -+ pre_reloc_only); -+ if (err && !ret) -+ ret = err; -+ continue; -+ } -+ - if (pre_reloc_only && - !dm_fdt_pre_reloc(blob, offset)) - continue; -diff --git a/test/dm/bus.c b/test/dm/bus.c -index 7006d4163d..1da398ae3a 100644 ---- a/test/dm/bus.c -+++ b/test/dm/bus.c -@@ -105,7 +105,7 @@ UCLASS_DRIVER(testbus) = { - /* Test that we can probe for children */ - static int dm_test_bus_children(struct unit_test_state *uts) - { -- int num_devices = 6; -+ int num_devices = 7; - struct udevice *bus; - struct uclass *uc; - -diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c -index dcc2ef8b65..920ccbf016 100644 ---- a/test/dm/test-fdt.c -+++ b/test/dm/test-fdt.c -@@ -167,7 +167,7 @@ int dm_check_devices(struct unit_test_state *uts, int num_devices) - /* Test that FDT-based binding works correctly */ - static int dm_test_fdt(struct unit_test_state *uts) - { -- const int num_devices = 6; -+ const int num_devices = 7; - struct udevice *dev; - struct uclass *uc; - int ret; - -From 310feda7f7f40afbb26a158183e16c2c46eea28a Mon Sep 17 00:00:00 2001 -From: Rob Clark -Date: Thu, 3 Aug 2017 09:52:14 -0400 -Subject: [PATCH] fdtdec: allow board to provide fdt for CONFIG_OF_SEPARATE - -Similar to CONFIG_OF_BOARD, but in this case the fdt is still built by -u-boot build. This allows the board to patch the fdt, etc. - -In the specific case of dragonboard 410c, we pass the u-boot generated -fdt to the previous stage of bootloader (by embedding it in the -u-boot.img that is loaded by lk/aboot), which patches the fdt and passes -it back to u-boot. - -Signed-off-by: Rob Clark ---- - include/fdtdec.h | 3 ++- - lib/fdtdec.c | 35 +++++++++++++++++++++++------------ - 2 files changed, 25 insertions(+), 13 deletions(-) - -diff --git a/include/fdtdec.h b/include/fdtdec.h -index 1ba02be8e1..c5acb8dae1 100644 ---- a/include/fdtdec.h -+++ b/include/fdtdec.h -@@ -988,7 +988,8 @@ int fdtdec_setup(void); - - /** - * Board-specific FDT initialization. Returns the address to a device tree blob. -- * Called when CONFIG_OF_BOARD is defined. -+ * Called when CONFIG_OF_BOARD is defined, or if CONFIG_OF_SEPARATE is defined -+ * and the board implements it. - */ - void *board_fdt_blob_setup(void); - -diff --git a/lib/fdtdec.c b/lib/fdtdec.c -index 45f3fe7baf..15bd9b2572 100644 ---- a/lib/fdtdec.c -+++ b/lib/fdtdec.c -@@ -1258,6 +1258,28 @@ static int uncompress_blob(const void *src, ulong sz_src, void **dstp) - # endif - #endif - -+#ifdef CONFIG_OF_SEPARATE -+/* -+ * For CONFIG_OF_SEPARATE, the board may optionally implement this to -+ * provide and/or fixup the fdt. -+ */ -+__weak void *board_fdt_blob_setup(void) -+{ -+ void *fdt_blob = NULL; -+#ifdef CONFIG_SPL_BUILD -+ /* FDT is at end of BSS unless it is in a different memory region */ -+ if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS)) -+ fdt_blob = (ulong *)&_image_binary_end; -+ else -+ fdt_blob = (ulong *)&__bss_end; -+#else -+ /* FDT is at end of image */ -+ fdt_blob = (ulong *)&_end; -+#endif -+ return fdt_blob; -+} -+#endif -+ - int fdtdec_setup(void) - { - #if CONFIG_IS_ENABLED(OF_CONTROL) -@@ -1267,18 +1289,7 @@ int fdtdec_setup(void) - # ifdef CONFIG_OF_EMBED - /* Get a pointer to the FDT */ - gd->fdt_blob = __dtb_dt_begin; --# elif defined CONFIG_OF_SEPARATE --# ifdef CONFIG_SPL_BUILD -- /* FDT is at end of BSS unless it is in a different memory region */ -- if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS)) -- gd->fdt_blob = (ulong *)&_image_binary_end; -- else -- gd->fdt_blob = (ulong *)&__bss_end; --# else -- /* FDT is at end of image */ -- gd->fdt_blob = (ulong *)&_end; --# endif --# elif defined(CONFIG_OF_BOARD) -+# elif defined(CONFIG_OF_SEPARATE) || defined(CONFIG_OF_BOARD) - /* Allow the board to override the fdt address. */ - gd->fdt_blob = board_fdt_blob_setup(); - # elif defined(CONFIG_OF_HOSTFILE) -