aboutsummaryrefslogtreecommitdiff
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 14:26:49 -0500
commit4a1c014e435f5e4157d4f99903f3025cea2b418a (patch)
tree62665584dbffc0361ec397c14d318f73f07fea93
parentfa321a67bfa23e777506df8911ef05cca85d67a8 (diff)
downloadu-boot-WIP/2021-11-18-regression-fixes.zip
u-boot-WIP/2021-11-18-regression-fixes.tar.gz
u-boot-WIP/2021-11-18-regression-fixes.tar.bz2
arm64: Add missing GD_FLG_SKIP_RELOC handlingWIP/2021-11-18-regression-fixes
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>
-rw-r--r--arch/arm/lib/crt0_64.S4
-rw-r--r--lib/asm-offsets.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/lib/crt0_64.S b/arch/arm/lib/crt0_64.S
index 680e674..28c8356 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 */
diff --git a/lib/asm-offsets.c b/lib/asm-offsets.c
index c691066..0808cd4 100644
--- a/lib/asm-offsets.c
+++ b/lib/asm-offsets.c
@@ -29,6 +29,9 @@ int main(void)
DEFINE(GD_SIZE, sizeof(struct global_data));
DEFINE(GD_BD, offsetof(struct global_data, bd));
+
+ DEFINE(GD_FLAGS, offsetof(struct global_data, flags));
+
#if CONFIG_VAL(SYS_MALLOC_F_LEN)
DEFINE(GD_MALLOC_BASE, offsetof(struct global_data, malloc_base));
#endif