Skip to contentSkip to conversation

ARMv8: get new GD address from gd->new_gd directly

PATCH New zijun_hu 3 participants 3 messages Sep 22, 2017 – Oct 9, 2017

Subsystems (2)
lore
Share & tools
lore

zijun_hu

author
#0 lore raw

PATCH 1/1 ARMv8: get new GD address from gd->new_gd directly

From: zijun_hu <[email protected]>

the new GD address is calculated via board data BD currently it require the new GD area locates below BD tightly, so a strict constraint is imposed on memory layout which maybe make special platform unpleasant.

fix it by getting new GD address from gd->new_gd directly.

---
 arch/arm/lib/crt0_64.S | 3 +--
 lib/asm-offsets.c      | 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/lib/crt0_64.S +1 -2
index 62fad45..9c46c93 100644
@@ -95,8 +95,7 @@ ENTRY(_main)
  */
 	ldr	x0, [x18, #GD_START_ADDR_SP]	/* x0 <- gd->start_addr_sp */
 	bic	sp, x0, #0xf	/* 16-byte alignment for ABI compliance */
-	ldr	x18, [x18, #GD_BD]		/* x18 <- gd->bd */
-	sub	x18, x18, #GD_SIZE		/* new GD is below bd */
+	ldr	x18, [x18, #GD_NEW_GD]		/* x18 <- gd->new_gd */
 
 	adr	lr, relocation_return
 	ldr	x9, [x18, #GD_RELOC_OFF]	/* x9 <- gd->reloc_off */
lib/asm-offsets.c +2 -0
index b04f7c6..f4f1bb8 100644
@@ -38,5 +38,7 @@ int main(void)
 
 	DEFINE(GD_START_ADDR_SP, offsetof(struct global_data, start_addr_sp));
 
+	DEFINE(GD_NEW_GD, offsetof(struct global_data, new_gd));
+
 	return 0;
 }
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 ARMv8: get new GD address from gd->new_gd directly

Quoted 7 lines · zijun_hu

From: zijun_hu <[email protected]>

the new GD address is calculated via board data BD currently it require the new GD area locates below BD tightly, so a strict constraint is imposed on memory layout which maybe make special platform unpleasant.

Quoted 7 lines

fix it by getting new GD address from gd->new_gd directly.

---
 arch/arm/lib/crt0_64.S | 3 +--
 lib/asm-offsets.c      | 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)
#2 lore raw

PATCH 1/1 ARMv8: get new GD address from gd->new_gd directly

In reply to zijun_hu
Quoted 11 lines · zijun_hu

From: zijun_hu <[email protected]>

the new GD address is calculated via board data BD currently it require the new GD area locates below BD tightly, so a strict constraint is imposed on memory layout which maybe make special platform unpleasant.

fix it by getting new GD address from gd->new_gd directly.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171009/d4027d34/attachment.sig>