diff options
author | Barry Song <Baohua.Song@csr.com> | 2012-12-20 06:37:32 -0500 |
---|---|---|
committer | Barry Song <Barry.Song@csr.com> | 2013-01-22 06:53:27 -0500 |
commit | 4898de3d15d8ba34aa7a1b0f753a476d52ebdf92 (patch) | |
tree | e2606fb82bab7bcbe0503404ecd67fd0d3d47427 /arch/arm/mach-prima2/headsmp.S | |
parent | f2a94192d953990c5c928f52dd4122a67f93b980 (diff) |
ARM: PRIMA2: add new SiRFmarco SMP SoC infrastructures
this patch adds tick timer, smp entries and generic DT machine
for SiRFmarco dual-core SMP chips.
with the added marco, we change the defconfig, using the same
defconfig, we get a zImage which can work on both prima2 and
marco.
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Diffstat (limited to 'arch/arm/mach-prima2/headsmp.S')
-rw-r--r-- | arch/arm/mach-prima2/headsmp.S | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/arch/arm/mach-prima2/headsmp.S b/arch/arm/mach-prima2/headsmp.S new file mode 100644 index 000000000000..6ec19d51a271 --- /dev/null +++ b/arch/arm/mach-prima2/headsmp.S | |||
@@ -0,0 +1,79 @@ | |||
1 | /* | ||
2 | * Entry of the second core for CSR Marco dual-core SMP SoCs | ||
3 | * | ||
4 | * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company. | ||
5 | * | ||
6 | * Licensed under GPLv2 or later. | ||
7 | */ | ||
8 | |||
9 | #include <linux/linkage.h> | ||
10 | #include <linux/init.h> | ||
11 | |||
12 | __INIT | ||
13 | /* | ||
14 | * Cold boot and hardware reset show different behaviour, | ||
15 | * system will be always panic if we warm-reset the board | ||
16 | * Here we invalidate L1 of CPU1 to make sure there isn't | ||
17 | * uninitialized data written into memory later | ||
18 | */ | ||
19 | ENTRY(v7_invalidate_l1) | ||
20 | mov r0, #0 | ||
21 | mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache | ||
22 | mcr p15, 2, r0, c0, c0, 0 | ||
23 | mrc p15, 1, r0, c0, c0, 0 | ||
24 | |||
25 | ldr r1, =0x7fff | ||
26 | and r2, r1, r0, lsr #13 | ||
27 | |||
28 | ldr r1, =0x3ff | ||
29 | |||
30 | and r3, r1, r0, lsr #3 @ NumWays - 1 | ||
31 | add r2, r2, #1 @ NumSets | ||
32 | |||
33 | and r0, r0, #0x7 | ||
34 | add r0, r0, #4 @ SetShift | ||
35 | |||
36 | clz r1, r3 @ WayShift | ||
37 | add r4, r3, #1 @ NumWays | ||
38 | 1: sub r2, r2, #1 @ NumSets-- | ||
39 | mov r3, r4 @ Temp = NumWays | ||
40 | 2: subs r3, r3, #1 @ Temp-- | ||
41 | mov r5, r3, lsl r1 | ||
42 | mov r6, r2, lsl r0 | ||
43 | orr r5, r5, r6 @ Reg = (Temp<<WayShift)|(NumSets<<SetShift) | ||
44 | mcr p15, 0, r5, c7, c6, 2 | ||
45 | bgt 2b | ||
46 | cmp r2, #0 | ||
47 | bgt 1b | ||
48 | dsb | ||
49 | isb | ||
50 | mov pc, lr | ||
51 | ENDPROC(v7_invalidate_l1) | ||
52 | |||
53 | /* | ||
54 | * SIRFSOC specific entry point for secondary CPUs. This provides | ||
55 | * a "holding pen" into which all secondary cores are held until we're | ||
56 | * ready for them to initialise. | ||
57 | */ | ||
58 | ENTRY(sirfsoc_secondary_startup) | ||
59 | bl v7_invalidate_l1 | ||
60 | mrc p15, 0, r0, c0, c0, 5 | ||
61 | and r0, r0, #15 | ||
62 | adr r4, 1f | ||
63 | ldmia r4, {r5, r6} | ||
64 | sub r4, r4, r5 | ||
65 | add r6, r6, r4 | ||
66 | pen: ldr r7, [r6] | ||
67 | cmp r7, r0 | ||
68 | bne pen | ||
69 | |||
70 | /* | ||
71 | * we've been released from the holding pen: secondary_stack | ||
72 | * should now contain the SVC stack for this core | ||
73 | */ | ||
74 | b secondary_startup | ||
75 | ENDPROC(sirfsoc_secondary_startup) | ||
76 | |||
77 | .align | ||
78 | 1: .long . | ||
79 | .long pen_release | ||