Skip to contentSkip to conversation

arm: Tegra2: Fix ELDK42 gcc failure with inline asm stack pointer load

PATCH Superseded Tom Warren 2 participants 3 messages Feb 17, 2012 – Feb 24, 2012

Subsystems (2)
lore
Share & tools
lore

Tom Warren

author
#0 lore raw

PATCH v2 1/1 arm: Tegra2: Fix ELDK42 gcc failure with inline asm stack pointer load

The 4.2.2 gcc in the ELDK42 release doesn't like the direct SP load using a constant in tegra2_start. Change it to use a load thru another reg using mov sp, %0 : : "r"(CONST).

Tested on my Seaboard T20-A03, U-Boot loads and runs OK. Also compiled all tegra2 builds with both gcc 4.2.2 and 4.4.1 OK.

---
V2: Change 4 mov/orr's to single mov sp as per Marek Vasut

 arch/arm/cpu/armv7/tegra2/ap20.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/cpu/armv7/tegra2/ap20.c +5 -5
index 4c44bb3..f0450f4 100644
@@ -298,11 +298,11 @@ void tegra2_start(void)
 		writel(0xC0, &pmt->pmt_cfg_ctl);
 
 		/*
-		* If we are ARM7 - give it a different stack. We are about to
-		* start up the A9 which will want to use this one.
-		*/
-		asm volatile("ldr	sp, =%c0\n"
-			: : "i"(AVP_EARLY_BOOT_STACK_LIMIT));
+		 * If we are ARM7 - give it a different stack. We are about to
+		 * start up the A9 which will want to use this one.
+		 */
+		asm volatile("mov	sp, %0\n"
+			: : "r"(AVP_EARLY_BOOT_STACK_LIMIT));
 
 		start_cpu((u32)_start);
 		halt_avp();
Signature · 1 line
1.7.7.1
author
#1 lore raw

PATCH v2 1/1 arm: Tegra2: Fix ELDK42 gcc failure with inline asm stack pointer load

Quoted 33 lines · Tom Warren

The 4.2.2 gcc in the ELDK42 release doesn't like the direct SP load using a constant in tegra2_start. Change it to use a load thru another reg using mov sp, %0 : : "r"(CONST).

Tested on my Seaboard T20-A03, U-Boot loads and runs OK. Also compiled all tegra2 builds with both gcc 4.2.2 and 4.4.1 OK.

---
V2: Change 4 mov/orr's to single mov sp as per Marek Vasut

?arch/arm/cpu/armv7/tegra2/ap20.c | ? 10 +++++----- ?1 files changed, 5 insertions(+), 5 deletions(-)

arch/arm/cpu/armv7/tegra2/ap20.c +0 -0
index 4c44bb3..f0450f4 100644
@@ -298,11 +298,11 @@ void tegra2_start(void)
 ? ? ? ? ? ? ? ?writel(0xC0, &pmt->pmt_cfg_ctl);
 

? ? ? ? ? ? ? ?/*
- ? ? ? ? ? ? ? * If we are ARM7 - give it a different stack. We are about to
- ? ? ? ? ? ? ? * start up the A9 which will want to use this one.
- ? ? ? ? ? ? ? */
- ? ? ? ? ? ? ? asm volatile("ldr ? ? ? sp, =%c0\n"
- ? ? ? ? ? ? ? ? ? ? ? : : "i"(AVP_EARLY_BOOT_STACK_LIMIT));
+ ? ? ? ? ? ? ? ?* If we are ARM7 - give it a different stack. We are about to
+ ? ? ? ? ? ? ? ?* start up the A9 which will want to use this one.
+ ? ? ? ? ? ? ? ?*/
+ ? ? ? ? ? ? ? asm volatile("mov ? ? ? sp, %0\n"
+ ? ? ? ? ? ? ? ? ? ? ? : : "r"(AVP_EARLY_BOOT_STACK_LIMIT));

Quoted 5 lines

? ? ? ? ? ? ? ?start_cpu((u32)_start);
? ? ? ? ? ? ? ?halt_avp();
--
1.7.7.1

Ack? Nak? Can I get some love here?

Albert/Wolfgang - did anyone try this to ensure that it really fixes the 6 Tegra2 failures?

Tom

#2 lore raw

PATCH v2 1/1 arm: Tegra2: Fix ELDK42 gcc failure with inline asm stack pointer load

Quoted 9 lines · Tom Warren
Quoted 8 lines · Tom Warren

The 4.2.2 gcc in the ELDK42 release doesn't like the direct SP load using a constant in tegra2_start. Change it to use a load thru another reg using mov sp, %0 : : "r"(CONST).

Tested on my Seaboard T20-A03, U-Boot loads and runs OK. Also compiled all tegra2 builds with both gcc 4.2.2 and 4.4.1 OK.

Tested on gcc 4.6, sorry I don't have the compiler that fails.

Quoted 41 lines
Quoted 25 lines

---
V2: Change 4 mov/orr's to single mov sp as per Marek Vasut

?arch/arm/cpu/armv7/tegra2/ap20.c | ? 10 +++++----- ?1 files changed, 5 insertions(+), 5 deletions(-)

arch/arm/cpu/armv7/tegra2/ap20.c +0 -0
index 4c44bb3..f0450f4 100644
@@ -298,11 +298,11 @@ void tegra2_start(void)
 ? ? ? ? ? ? ? ?writel(0xC0, &pmt->pmt_cfg_ctl);
 

? ? ? ? ? ? ? ?/*
- ? ? ? ? ? ? ? * If we are ARM7 - give it a different stack. We are about to
- ? ? ? ? ? ? ? * start up the A9 which will want to use this one.
- ? ? ? ? ? ? ? */
- ? ? ? ? ? ? ? asm volatile("ldr ? ? ? sp, =%c0\n"
- ? ? ? ? ? ? ? ? ? ? ? : : "i"(AVP_EARLY_BOOT_STACK_LIMIT));
+ ? ? ? ? ? ? ? ?* If we are ARM7 - give it a different stack. We are about to
+ ? ? ? ? ? ? ? ?* start up the A9 which will want to use this one.
+ ? ? ? ? ? ? ? ?*/
+ ? ? ? ? ? ? ? asm volatile("mov ? ? ? sp, %0\n"
+ ? ? ? ? ? ? ? ? ? ? ? : : "r"(AVP_EARLY_BOOT_STACK_LIMIT));

Quoted 5 lines

? ? ? ? ? ? ? ?start_cpu((u32)_start);
? ? ? ? ? ? ? ?halt_avp();
--
1.7.7.1

Ack? Nak? Can I get some love here?

Albert/Wolfgang - did anyone try this to ensure that it really fixes the 6 Tegra2 failures?

Tom
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot