Skip to contentSkip to conversation

arm: initialize gd for AArch64

PATCH New Stephen Warren 3 participants 3 messages Jan 14, 2016 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: initialize gd for AArch64

From: Stephen Warren <[email protected]>

Commit adc421e4cee8 "arm: move gd handling outside of C code" removed the call to arch_setup_gd() on ARM and replaced it with assembly code in crt0.S. However, AArch64 uses a different startup file, and the same change was not made to it. This leaves gd uninitialized on AArch64, which typically leads to hangs or crashes. This change fixes that.

Fixes adc421e4cee8 ("arm: move gd handling outside of C code")
---
 arch/arm/lib/crt0_64.S | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/lib/crt0_64.S +2 -0
index b4fc76060970..cad22c7b41fe 100644
@@ -78,6 +78,8 @@ ENTRY(_main)
 	mov	x0, sp
 	bl	board_init_f_alloc_reserve
 	mov	sp, x0
+	/* set up gd here, outside any C code */
+	mov	x18, x0
 	bl	board_init_f_init_reserve
 
 	mov	x0, #0
Signature · 1 line
2.7.0
#1 lore raw

PATCH 1/1 arm: initialize gd for AArch64

Quoted 10 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Commit adc421e4cee8 "arm: move gd handling outside of C code" removed the call to arch_setup_gd() on ARM and replaced it with assembly code in crt0.S. However, AArch64 uses a different startup file, and the same change was not made to it. This leaves gd uninitialized on AArch64, which typically leads to hangs or crashes. This change fixes that.

Fixes adc421e4cee8 ("arm: move gd handling outside of C code")

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: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160114/efc12e69/attachment.sig>
#2 lore raw

PATCH 1/1 arm: initialize gd for AArch64

In reply to Stephen Warren
Quoted 8 lines · Stephen Warren

From: Stephen Warren <[email protected]>

Commit adc421e4cee8 "arm: move gd handling outside of C code" removed the call to arch_setup_gd() on ARM and replaced it with assembly code in crt0.S. However, AArch64 uses a different startup file, and the same change was not made to it. This leaves gd uninitialized on AArch64, which typically leads to hangs or crashes. This change fixes that.

Quoted 5 lines
Fixes adc421e4cee8 ("arm: move gd handling outside of C code")
---
 arch/arm/lib/crt0_64.S | 2 ++
 1 file changed, 2 insertions(+)