From patchwork Wed Jan 22 13:52:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 239931 List-Id: U-Boot discussion From: patrick.delaunay at st.com (Patrick Delaunay) Date: Wed, 22 Jan 2020 14:52:42 +0100 Subject: [PATCH v2 3/4] arm: set the relocated gd with gd->new_gd In-Reply-To: <20200122135243.17683-1-patrick.delaunay@st.com> References: <20200122135243.17683-1-patrick.delaunay@st.com> Message-ID: <20200122135243.17683-4-patrick.delaunay@st.com> Simplify the arm relocation behavior and get gd directly form new_gd, as it is already done in crt0_64.S: ldr x18, [x18, #GD_NEW_GD] /* x18 <- gd->new_gd */ This patch avoid assumption on new GD location (new GD is below bd - with #GD_SIZE offset). Signed-off-by: Patrick Delaunay Reviewed-by: Simon Glass --- Changes in v2: None arch/arm/lib/crt0.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S index fb6c37cf51..df9dd83e40 100644 --- a/arch/arm/lib/crt0.S +++ b/arch/arm/lib/crt0.S @@ -127,8 +127,7 @@ ENTRY(_main) ldr r0, [r9, #GD_START_ADDR_SP] /* sp = gd->start_addr_sp */ bic r0, r0, #7 /* 8-byte alignment for ABI compliance */ mov sp, r0 - ldr r9, [r9, #GD_BD] /* r9 = gd->bd */ - sub r9, r9, #GD_SIZE /* new GD is below bd */ + ldr r9, [r9, #GD_NEW_GD] /* r9 <- gd->new_gd */ adr lr, here ldr r0, [r9, #GD_RELOC_OFF] /* r0 = gd->reloc_off */