summaryrefslogtreecommitdiff
path: root/arch/arm/lib
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@gmail.com>2021-11-13 18:34:59 +0100
committerTom Rini <trini@konsulko.com>2021-11-18 18:20:19 -0500
commitb1f3f982fa1cdcf08717a37e00adcb6fc3d89bf4 (patch)
tree750049c4c588dc1da71a290a4cdd5b0d44209a5f /arch/arm/lib
parentbd994c007ae232ade284c9c22c9150077961fe19 (diff)
arm64: Add missing GD_FLG_SKIP_RELOC handling
In case U-Boot enters relocation with GD_FLG_SKIP_RELOC, skip the relocation. The code still has to set up new_gd pointer and new stack pointer. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/crt0_64.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/lib/crt0_64.S b/arch/arm/lib/crt0_64.S
index 680e674fa3..28c8356aee 100644
--- a/arch/arm/lib/crt0_64.S
+++ b/arch/arm/lib/crt0_64.S
@@ -104,6 +104,10 @@ ENTRY(_main)
bic sp, x0, #0xf /* 16-byte alignment for ABI compliance */
ldr x18, [x18, #GD_NEW_GD] /* x18 <- gd->new_gd */
+ /* Skip relocation in case gd->gd_flags & GD_FLG_SKIP_RELOC */
+ ldr x0, [x18, #GD_FLAGS] /* x0 <- gd->flags */
+ tbnz x0, 11, relocation_return /* GD_FLG_SKIP_RELOC is bit 11 */
+
adr lr, relocation_return
#if CONFIG_POSITION_INDEPENDENT
/* Add in link-vs-runtime offset */