diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2014-07-01 11:23:06 -0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2014-07-01 13:02:26 -0400 |
commit | 0e2be4c1121ae3dc2771c4d9b99d4c39ea9577d8 (patch) | |
tree | 3648fb3916e21b7d0fbb677d58dc20f2a63f99ef /arch/arm/mach-mvebu | |
parent | 6509dc74c9f55ffaa558738b96c4da8b98d39571 (diff) |
ARM: mvebu: fix SMP boot for Armada 38x and Armada 375 Z1 in big endian
The SMP boot on Armada 38x and Armada 375 Z1 is currently broken in
big-endian configurations, and this commit fixes it for both
platforms.
For Armada 375 Z1, the problem was in the
armada_375_smp_cpu1_enable_code part of the code that gets copied to
the Crypto SRAM as a work-around for an issue of the Z1 stepping. This
piece of code was not switching the CPU core to big-endian, and not
endian-swapping the value read from the Resume Address register (the
value is stored little-endian). Due to the introduction of the
conditional 'rev r1, r1' instruction, the offset between the 'ldr r0,
[pc, #4]' instruction and the value it was looking is different
between LE and BE configurations. To solve this, we instead use one
'adr' instruction followed by one 'ldr'.
For Armada 38x, the problem was simply that the CPU core was not
switched to big endian in the secondary CPU startup function.
This change was tested in LE and BE configurations on Armada 385,
Armada 375 Z1 and Armada 375 A0.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1404228186-21203-1-git-send-email-thomas.petazzoni@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch/arm/mach-mvebu')
-rw-r--r-- | arch/arm/mach-mvebu/headsmp-a9.S | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/mach-mvebu/headsmp-a9.S b/arch/arm/mach-mvebu/headsmp-a9.S index 5925366bc03c..da5bb292b91c 100644 --- a/arch/arm/mach-mvebu/headsmp-a9.S +++ b/arch/arm/mach-mvebu/headsmp-a9.S | |||
@@ -15,6 +15,8 @@ | |||
15 | #include <linux/linkage.h> | 15 | #include <linux/linkage.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | 17 | ||
18 | #include <asm/assembler.h> | ||
19 | |||
18 | __CPUINIT | 20 | __CPUINIT |
19 | #define CPU_RESUME_ADDR_REG 0xf10182d4 | 21 | #define CPU_RESUME_ADDR_REG 0xf10182d4 |
20 | 22 | ||
@@ -22,13 +24,18 @@ | |||
22 | .global armada_375_smp_cpu1_enable_code_end | 24 | .global armada_375_smp_cpu1_enable_code_end |
23 | 25 | ||
24 | armada_375_smp_cpu1_enable_code_start: | 26 | armada_375_smp_cpu1_enable_code_start: |
25 | ldr r0, [pc, #4] | 27 | ARM_BE8(setend be) |
28 | adr r0, 1f | ||
29 | ldr r0, [r0] | ||
26 | ldr r1, [r0] | 30 | ldr r1, [r0] |
31 | ARM_BE8(rev r1, r1) | ||
27 | mov pc, r1 | 32 | mov pc, r1 |
33 | 1: | ||
28 | .word CPU_RESUME_ADDR_REG | 34 | .word CPU_RESUME_ADDR_REG |
29 | armada_375_smp_cpu1_enable_code_end: | 35 | armada_375_smp_cpu1_enable_code_end: |
30 | 36 | ||
31 | ENTRY(mvebu_cortex_a9_secondary_startup) | 37 | ENTRY(mvebu_cortex_a9_secondary_startup) |
38 | ARM_BE8(setend be) | ||
32 | bl v7_invalidate_l1 | 39 | bl v7_invalidate_l1 |
33 | b secondary_startup | 40 | b secondary_startup |
34 | ENDPROC(mvebu_cortex_a9_secondary_startup) | 41 | ENDPROC(mvebu_cortex_a9_secondary_startup) |