From 1ae57fa3fdb362b7143855a1daa0a42c2b296cc7 Mon Sep 17 00:00:00 2001 From: Yu Chien Peter Lin Date: Fri, 4 Nov 2022 12:58:07 +0800 Subject: [PATCH] u-boot: ae350-ax45mp: Add patch for fdt start address alignment If start address ($a1) is not 8-byte aligned, the system will hang in fw_platform_init where OpenSBI starts to parse fdt, thus need this patch to adjust the address in SPL. Signed-off-by: Yu Chien Peter Lin --- ...-tree-blob-address-at-8-byte-boundar.patch | 38 +++++++++++++++++++ recipes-bsp/u-boot/u-boot_%.bbappend | 1 + 2 files changed, 39 insertions(+) create mode 100644 recipes-bsp/u-boot/files/ae350-ax45mp/0002-spl-Align-device-tree-blob-address-at-8-byte-boundar.patch diff --git a/recipes-bsp/u-boot/files/ae350-ax45mp/0002-spl-Align-device-tree-blob-address-at-8-byte-boundar.patch b/recipes-bsp/u-boot/files/ae350-ax45mp/0002-spl-Align-device-tree-blob-address-at-8-byte-boundar.patch new file mode 100644 index 0000000..4c32d69 --- /dev/null +++ b/recipes-bsp/u-boot/files/ae350-ax45mp/0002-spl-Align-device-tree-blob-address-at-8-byte-boundar.patch @@ -0,0 +1,38 @@ +From 933ad8a59f7fd9b2088badc3e97167d750a40b5a Mon Sep 17 00:00:00 2001 +From: Bin Meng +Date: Mon, 12 Jul 2021 11:52:31 +0800 +Subject: [PATCH] spl: Align device tree blob address at 8-byte boundary + +Since libfdt v1.6.1, a new requirement on the device tree address via: + + commit 5e735860c478 ("libfdt: Check for 8-byte address alignment in fdt_ro_probe_()") + +must be met that the device tree must be loaded in to memory at an +8-byte aligned address. + +Upstream-Status: Pending +Signed-off-by: Bin Meng +--- + common/spl/spl_fit.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c +index a35be529..a76ad14a 100644 +--- a/common/spl/spl_fit.c ++++ b/common/spl/spl_fit.c +@@ -382,6 +382,12 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image, + */ + image_info.load_addr = spl_image->load_addr + spl_image->size; + ++ /* ++ * Since libfdt v1.6.1, the device tree must be loaded in to memory ++ * at an 8-byte aligned address. ++ */ ++ image_info.load_addr = roundup(image_info.load_addr, 8); ++ + /* Figure out which device tree the board wants to use */ + node = spl_fit_get_image_node(ctx, FIT_FDT_PROP, index++); + if (node < 0) { +-- +2.34.1 + diff --git a/recipes-bsp/u-boot/u-boot_%.bbappend b/recipes-bsp/u-boot/u-boot_%.bbappend index 87c4ec0..81e198d 100644 --- a/recipes-bsp/u-boot/u-boot_%.bbappend +++ b/recipes-bsp/u-boot/u-boot_%.bbappend @@ -10,6 +10,7 @@ DEPENDS:append = " u-boot-tools-native" SRC_URI:append:ae350-ax45mp = " \ file://0001-mmc-ftsdc010_mci-Support-DTS-of-ftsdc010-driver-for-.patch \ + file://0002-spl-Align-device-tree-blob-address-at-8-byte-boundar.patch \ file://mmc-support.cfg \ file://opensbi-options.cfg \ file://display-info.cfg \