summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@mailbox.org>2025-01-12 23:47:45 +0100
committerMarek Vasut <marek.vasut+renesas@mailbox.org>2025-01-18 09:29:17 +0100
commit74d12f1b0edddb571b5541d8c3b0801037d73a7e (patch)
treea6dba6b4fef45e1f7dc454b34414a8efca16c4da
parentc11dc783fb4418393dd08d39ee01debfc2dea4d4 (diff)
arm64: renesas: Rewrite u-boot-elf.srec base address if PIE for R-Car Gen3
The flash_writer tool and previous recovery tools require the SREC load address to be 0x5000_0000 . The PIE U-Boot build sets the address to 0x0 instead, so override the address back to make u-boot-elf.srec compatible with the recovery tools. Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
-rw-r--r--Makefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 0500eb6e0a7..c7318950f33 100644
--- a/Makefile
+++ b/Makefile
@@ -1286,6 +1286,15 @@ u-boot.hex u-boot.srec: u-boot FORCE
OBJCOPYFLAGS_u-boot-elf.srec := $(OBJCOPYFLAGS_u-boot.srec)
+ifeq ($(CONFIG_POSITION_INDEPENDENT)$(CONFIG_RCAR_GEN3),yy)
+# The flash_writer tool and previous recovery tools
+# require the SREC load address to be 0x5000_0000 .
+# The PIE U-Boot build sets the address to 0x0, so
+# override the address back to make u-boot-elf.srec
+# compatible with the recovery tools.
+OBJCOPYFLAGS_u-boot-elf.srec += --change-addresses=0x50000000
+endif
+
u-boot-elf.srec: u-boot.elf FORCE
$(call if_changed,objcopy)