Skip to contentSkip to conversation

ARM: sunxi: fix build for THUMB2_KERNEL

PATCH New Kevin Hilman 1 participant 1 message Aug 11, 2015 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: sunxi: fix build for THUMB2_KERNEL

From: Arnd Bergmann <[email protected]>

Building an SMP kernel for the sunxi platform with THUMB2 instructions fails with this error at the moment:

headsmp.S:7: Error: Thumb encoding does not support an immediate here -- `msr cpsr_fsxc,#0xd3'

Since the generic secondary_startup function already does the same thing in a safe way, we can just drop the private sunxi implementation and jump straight to secondary_startup.

Cc Maxime Ripard <[email protected]>
Cc <[email protected]> # v3.14
(cherry picked from commit 1146b600044de64af0ef775025731eeef1fa2189)
---
 arch/arm/include/asm/smp.h    | 1 +
 arch/arm/mach-sunxi/Makefile  | 2 +-
 arch/arm/mach-sunxi/headsmp.S | 9 ---------
 arch/arm/mach-sunxi/platsmp.c | 2 +-
 4 files changed, 3 insertions(+), 11 deletions(-)
 delete mode 100644 arch/arm/mach-sunxi/headsmp.S
arch/arm/include/asm/smp.h +1 -0
index 22a3b9b5d4a1..4157aec4e307 100644
@@ -74,6 +74,7 @@ struct secondary_data {
 };
 extern struct secondary_data secondary_data;
 extern volatile int pen_release;
+extern void secondary_startup(void);
 
 extern int __cpu_disable(void);
 
arch/arm/mach-sunxi/Makefile +1 -1
index d9397202d6ec..27b168f121a1 100644
@@ -1,2 +1,2 @@
 obj-$(CONFIG_ARCH_SUNXI) += sunxi.o
-obj-$(CONFIG_SMP) += platsmp.o headsmp.o
+obj-$(CONFIG_SMP) += platsmp.o
arch/arm/mach-sunxi/headsmp.S deleted +0 -9
deleted file mode 100644
index a10d494fb37b..000000000000
@@ -1,9 +0,0 @@
-#include <linux/linkage.h>
-#include <linux/init.h>
-
-        .section ".text.head", "ax"
-
-ENTRY(sun6i_secondary_startup)
-	msr	cpsr_fsxc, #0xd3
-	b	secondary_startup
-ENDPROC(sun6i_secondary_startup)
arch/arm/mach-sunxi/platsmp.c +1 -1
index 7b141d8342a1..0c7dbce033cc 100644
@@ -82,7 +82,7 @@ static int sun6i_smp_boot_secondary(unsigned int cpu,
 	spin_lock(&cpu_lock);
 
 	/* Set CPU boot address */
-	writel(virt_to_phys(sun6i_secondary_startup),
+	writel(virt_to_phys(secondary_startup),
 	       cpucfg_membase + CPUCFG_PRIVATE0_REG);
 
 	/* Assert the CPU core in reset */
Signature · 1 line
2.4.5