Skip to contentSkip to conversation

arm: socfpga: fix build break for allyesconfig

PATCH New dinguyen at altera.com 4 participants 8 messages Oct 26, 2012 – Oct 27, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: socfpga: fix build break for allyesconfig

From: Dinh Nguyen <[email protected]>

Add check for armv7 in headsmp.S.

---
 arch/arm/mach-socfpga/headsmp.S |    2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-socfpga/headsmp.S +2 -0
index 17d6eaf..9031a3c 100644
@@ -15,8 +15,10 @@
 #define CPU1_START_ADDR 	        0xffd08010
 
 ENTRY(secondary_trampoline)
+#if __LINUX_ARM_ARCH__ >= 7
 	movw	r0, #:lower16:CPU1_START_ADDR
 	movt  r0, #:upper16:CPU1_START_ADDR
+#endif
 
 	ldr	r1, [r0]
 	bx	r1
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 arm: socfpga: fix build break for allyesconfig

arch/arm/mach-socfpga/headsmp.S line 21

Quoted 5 lines · dinguyen at altera.com

ENTRY(secondary_trampoline)

arch/arm/mach-socfpga/headsmp.S +2 -0
+#if __LINUX_ARM_ARCH__ >= 7
        movw    r0, #:lower16:CPU1_START_ADDR
        movt  r0, #:upper16:CPU1_START_ADDR
+#endif

I don't think this is the right fix, because it will break running on SMP socfpga machines if you enable both socfpga and picoxcell in a multiplatform configuration.

Arnd

#2 lore raw

PATCH 1/1 arm: socfpga: fix build break for allyesconfig

In reply to dinguyen at altera.com
Quoted 14 lines · dinguyen at altera.com

From: Dinh Nguyen <[email protected]>

Add check for armv7 in headsmp.S.

---
 arch/arm/mach-socfpga/headsmp.S |    2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-socfpga/headsmp.S +0 -0
index 17d6eaf..9031a3c 100644

arch/arm/mach-socfpga/headsmp.S line 21

Quoted 7 lines
arch/arm/mach-socfpga/headsmp.S +2 -0
@@ -15,8 +15,10 @@
 #define CPU1_START_ADDR 	        0xffd08010
 
 ENTRY(secondary_trampoline)
+#if __LINUX_ARM_ARCH__ >= 7
 	movw	r0, #:lower16:CPU1_START_ADDR
 	movt  r0, #:upper16:CPU1_START_ADDR
+#endif

If you do that, then it effectively means you don't need these instructions and you might as well just delete them... but looking at the following one:

arch/arm/mach-socfpga/headsmp.S line 23

Quoted 1 line
arch/arm/mach-socfpga/headsmp.S +0 -0
 	ldr	r1, [r0]

it's clear that you do need it. So you need to find a different solution. If the above assembly file can only run on ARMv7, consider putting

.march armv7

or similar before it.

#3 lore raw

PATCH 1/1 arm: socfpga: fix build break for allyesconfig

Hi!

Quoted 15 lines

arch/arm/mach-socfpga/headsmp.S line 21

Quoted 11 lines

index 17d6eaf..9031a3c 100644

arch/arm/mach-socfpga/headsmp.S +2 -0
@@ -15,8 +15,10 @@
 #define CPU1_START_ADDR 	        0xffd08010
 
 ENTRY(secondary_trampoline)
+#if __LINUX_ARM_ARCH__ >= 7
 	movw	r0, #:lower16:CPU1_START_ADDR
 	movt  r0, #:upper16:CPU1_START_ADDR
+#endif

If you do that, then it effectively means you don't need these instructions and you might as well just delete them... but looking at the following one:

Quoted 8 lines

arch/arm/mach-socfpga/headsmp.S line 22

Quoted 1 line
arch/arm/mach-socfpga/headsmp.S +0 -0
 	ldr	r1, [r0]

it's clear that you do need it. So you need to find a different solution. If the above assembly file can only run on ARMv7, consider putting

.march armv7

or similar before it.

My version of gas does not seem to recognize .march

( AS arch/arm/mach-socfpga/headsmp.o
arch/arm/mach-socfpga/headsmp.S: Assembler messages:
arch/arm/mach-socfpga/headsmp.S:17: Error: unknown pseudo-op: .march' arch/arm/mach-socfpga/headsmp.S:24: Error: selected processor does not support movw r0,#:lower16:(0xffd08000+0x10)' arch/arm/mach-socfpga/headsmp.S:25: Error: selected processor does not support `movt r0,#:upper16:(0xffd08000+0x10)'
)

This seems to do the trick:

Fix compilation with CPU_V6 option.

arch/arm/mach-socfpga/Makefile +2 -0
index a0fc372..6956e93 100644
@@ -4,3 +4,5 @@
 
 obj-y			:= socfpga.o
 obj-$(CONFIG_SMP)	+= headsmp.o platsmp.o hotplug.o
+
+AFLAGS_headsmp.o	:= -Wa,-march=armv7-a
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#4 lore raw

PATCH 1/1 arm: socfpga: fix build break for allyesconfig

Quoted 19 lines · Pavel Machek

Hi!

Quoted 17 lines

arch/arm/mach-socfpga/headsmp.S line 21

Quoted 11 lines

index 17d6eaf..9031a3c 100644

arch/arm/mach-socfpga/headsmp.S +2 -0
@@ -15,8 +15,10 @@
 #define CPU1_START_ADDR 	        0xffd08010
 
 ENTRY(secondary_trampoline)
+#if __LINUX_ARM_ARCH__ >= 7
 	movw	r0, #:lower16:CPU1_START_ADDR
 	movt  r0, #:upper16:CPU1_START_ADDR
+#endif

If you do that, then it effectively means you don't need these instructions and you might as well just delete them... but looking at the following one:

Quoted 1 line
arch/arm/mach-socfpga/headsmp.S +0 -0
 	ldr	r1, [r0]
Quoted 8 lines
Quoted 6 lines

it's clear that you do need it. So you need to find a different solution. If the above assembly file can only run on ARMv7, consider putting

.march armv7

or similar before it.

My version of gas does not seem to recognize .march

Ah, that's because it's .arch not .march. Please could you check with .arch instead. If proven successful we should move the existing AFLAGS_xxx.o Makefile stuff into the assembly files concerned.

#5 lore raw

PATCH 1/1 arm: socfpga: fix build break for allyesconfig

Hi!

Quoted 11 lines
Quoted 7 lines
Quoted 5 lines

If the above assembly file can only run on ARMv7, consider putting

.march armv7

or similar before it.

My version of gas does not seem to recognize .march

Ah, that's because it's .arch not .march. Please could you check with .arch instead. If proven successful we should move the existing AFLAGS_xxx.o Makefile stuff into the assembly files concerned.

.arch armv7

results in

arch/arm/mach-socfpga/headsmp.S:21: Error: attempt to use an ARM instruction on a Thumb-only processor -- `movw r0,#:lower16:(0xffd08000+0x10)'
...

Using .arch armv7-a indeed works and is a very nice solution.

arch/arm/mach-socfpga/headsmp.S +1 -0
@@ -11,6 +11,7 @@
 #include <linux/init.h>
 
 	__INIT
+	.arch	armv7-a
 
 #define HPS_SYSMGR_ADDRESS	0xffd08000
 #define CONFIG_SYSTEM_MANAGER	HPS_SYSMGR_ADDRESS
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#6 lore raw

PATCH 1/1 arm: socfpga: fix build break for allyesconfig

Quoted 13 lines · Pavel Machek

arch/arm/mach-socfpga/headsmp.S:21: Error: attempt to use an ARM instruction on a Thumb-only processor -- `movw r0,#:lower16:(0xffd08000+0x10)'
...

Using .arch armv7-a indeed works and is a very nice solution.

arch/arm/mach-socfpga/headsmp.S line 17

Quoted 7 lines
arch/arm/mach-socfpga/headsmp.S +1 -0
@@ -11,6 +11,7 @@
 #include <linux/init.h>
 
        __INIT
+       .arch   armv7-a
 
 #define HPS_SYSMGR_ADDRESS     0xffd08000
 #define CONFIG_SYSTEM_MANAGER  HPS_SYSMGR_ADDRESS

Thanks, applied with new commit message.

Arnd

#7 lore raw

PATCH 1/1 arm: socfpga: fix build break for allyesconfig

Quoted 15 lines · Arnd Bergmann
Quoted 14 lines · Pavel Machek

arch/arm/mach-socfpga/headsmp.S:21: Error: attempt to use an ARM instruction on a Thumb-only processor -- `movw r0,#:lower16:(0xffd08000+0x10)'
...

Using .arch armv7-a indeed works and is a very nice solution.

arch/arm/mach-socfpga/headsmp.S +0 -0
@@ -11,6 +11,7 @@
 #include <linux/init.h>
 
Quoted 8 lines

arch/arm/mach-socfpga/headsmp.S line 17

Quoted 6 lines
arch/arm/mach-socfpga/headsmp.S +1 -0
        __INIT
+       .arch   armv7-a
 
 #define HPS_SYSMGR_ADDRESS     0xffd08000
 #define CONFIG_SYSTEM_MANAGER  HPS_SYSMGR_ADDRESS

Thanks, applied with new commit message.

Thanks!
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html