From a3b23e5cb897c513b0be05b29b1dc89c415ed904 Mon Sep 17 00:00:00 2001 From: Anibal Limon Date: Tue, 29 Jul 2025 15:06:22 +0000 Subject: [PATCH] recipes-bsp: u-boot drop rpi always set fdt_addr patch It is already applied on upstream, see u-boot rev, 564d99d0723e338792df6897dc7407df2cf6196d Fixes: ERROR: u-boot-1_2025.07-r0 do_patch: Applying patch '0001-rpi-always-set-fdt_addr-with-firmware-provided-FDT-address.patch' on target directory '/workspaces/ls/linux-distro/build-ls-rpi4/tmp/work/ls_rpi4-limonsoftware-linux/u-boot/2025.07/sources/u-boot-2025.07' CmdError('quilt --quiltrc /workspaces/ls/linux-distro/build-ls-rpi4/tmp/work/ls_rpi4-limonsoftware-linux/u-boot/2025.07/recipe-sysroot-native/etc/quiltrc push', 0, 'stdout: Applying patch 0001-rpi-always-set-fdt_addr-with-firmware-provided-FDT-address.patch patching file board/raspberrypi/rpi/rpi.c Hunk #1 FAILED at 318. 1 out of 1 hunk FAILED -- rejects in file board/raspberrypi/rpi/rpi.c patch unexpectedly ends in middle of line Patch 0001-rpi-always-set-fdt_addr-with-firmware-provided-FDT-address.patch can be reverse-applied Signed-off-by: Anibal Limon Signed-off-by: Martin Jansa --- ...r-with-firmware-provided-FDT-address.patch | 52 ------------------- recipes-bsp/u-boot/u-boot_%.bbappend | 1 - 2 files changed, 53 deletions(-) delete mode 100644 recipes-bsp/u-boot/files/0001-rpi-always-set-fdt_addr-with-firmware-provided-FDT-address.patch diff --git a/recipes-bsp/u-boot/files/0001-rpi-always-set-fdt_addr-with-firmware-provided-FDT-address.patch b/recipes-bsp/u-boot/files/0001-rpi-always-set-fdt_addr-with-firmware-provided-FDT-address.patch deleted file mode 100644 index 9ea8f85..0000000 --- a/recipes-bsp/u-boot/files/0001-rpi-always-set-fdt_addr-with-firmware-provided-FDT-address.patch +++ /dev/null @@ -1,52 +0,0 @@ -From: Mauro Salvini -To: u-boot@lists.denx.de -Subject: [PATCH] rpi: always set fdt_addr with firmware-provided FDT address -Date: Wed, 12 May 2021 14:39:45 +0200 [thread overview] -Message-ID: <20210512123945.25649-1-m.salvini@koansoftware.com> (raw) - -Raspberry firmware prepares the FDT blob in memory at an address -that depends on both the memory size and the blob size [1]. -After commit ade243a211d6 ("rpi: passthrough of the firmware provided FDT -blob") this FDT is passed to kernel through fdt_addr environment variable, -handled in set_fdt_addr() function in board file. - -When u-boot environment is persistently saved, if a change happens -in loaded FDT (e.g. for a new overlay applied), firmware produces a FDT -address different from the saved one, but u-boot still use the saved -one because set_fdt_addr() function does not overwrite the fdt_addr -variable. So, for example, if there is a script that uses fdt commands for -e.g. manipulate the bootargs, boot hangs with error - -libfdt fdt_check_header(): FDT_ERR_BADMAGIC - -Removing the fdt_addr variable in saved environment allows to boot. - -With this patch set_fdt_addr() function always overwrite fdt_addr value. - -[1] https://www.raspberrypi.org/forums//viewtopic.php?f=107&t=134018 - -Signed-off-by: Mauro Salvini -Cc: C?dric Schieli -Cc: Matthias Brugger ---- -Upstream-Status: Pending - - board/raspberrypi/rpi/rpi.c | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c -index df52a4689f..611013471e 100644 ---- a/board/raspberrypi/rpi/rpi.c -+++ b/board/raspberrypi/rpi/rpi.c -@@ -318,9 +318,6 @@ static void set_fdtfile(void) - */ - static void set_fdt_addr(void) - { -- if (env_get("fdt_addr")) -- return; -- - if (fdt_magic(fw_dtb_pointer) != FDT_MAGIC) - return; - --- -2.17.1 \ No newline at end of file diff --git a/recipes-bsp/u-boot/u-boot_%.bbappend b/recipes-bsp/u-boot/u-boot_%.bbappend index 5dcd940..ccb1d8d 100644 --- a/recipes-bsp/u-boot/u-boot_%.bbappend +++ b/recipes-bsp/u-boot/u-boot_%.bbappend @@ -4,7 +4,6 @@ SRC_URI:append:rpi = " \ file://fw_env.config \ " -SRC_URI:append:rpi = " file://0001-rpi-always-set-fdt_addr-with-firmware-provided-FDT-address.patch" SRC_URI:append:raspberrypi4 = " file://maxsize.cfg" DEPENDS:append:rpi = " u-boot-default-script"