diff options
author | Zhiwu Song <Zhiwu.Song@csr.com> | 2014-12-25 03:34:20 -0500 |
---|---|---|
committer | Barry Song <Baohua.Song@csr.com> | 2015-01-20 06:56:48 -0500 |
commit | a7ae982f36389f0b83536d1c5d8f3437bd604d5d (patch) | |
tree | acaa81e42f2417bead95738b435d099b25ae7bb4 | |
parent | 3c7d21b4b8553aa85d824d77db6e309e496399b3 (diff) |
ARM: sirf: move platsmp to support Atlas7 SoC
This patch breaks Marco SMP support, but Marco project has been dropped.
So it corrects cpu1 jump/flag address for Atlas7 and removes scu related
logic as scu doesn't expose in cortex-a7.
Signed-off-by: Zhiwu Song <Zhiwu.Song@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/arm/mach-prima2/common.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-prima2/platsmp.c | 52 |
2 files changed, 13 insertions, 40 deletions
diff --git a/arch/arm/mach-prima2/common.c b/arch/arm/mach-prima2/common.c index bc53cc45fd67..a20b8d4db9ed 100644 --- a/arch/arm/mach-prima2/common.c +++ b/arch/arm/mach-prima2/common.c | |||
@@ -23,7 +23,6 @@ static void __init sirfsoc_init_late(void) | |||
23 | static __init void sirfsoc_map_io(void) | 23 | static __init void sirfsoc_map_io(void) |
24 | { | 24 | { |
25 | sirfsoc_map_lluart(); | 25 | sirfsoc_map_lluart(); |
26 | sirfsoc_map_scu(); | ||
27 | } | 26 | } |
28 | 27 | ||
29 | #ifdef CONFIG_ARCH_ATLAS6 | 28 | #ifdef CONFIG_ARCH_ATLAS6 |
diff --git a/arch/arm/mach-prima2/platsmp.c b/arch/arm/mach-prima2/platsmp.c index 335c12e92262..fc2b03c81e5f 100644 --- a/arch/arm/mach-prima2/platsmp.c +++ b/arch/arm/mach-prima2/platsmp.c | |||
@@ -20,30 +20,10 @@ | |||
20 | 20 | ||
21 | #include "common.h" | 21 | #include "common.h" |
22 | 22 | ||
23 | static void __iomem *scu_base; | 23 | static void __iomem *clk_base; |
24 | static void __iomem *rsc_base; | ||
25 | 24 | ||
26 | static DEFINE_SPINLOCK(boot_lock); | 25 | static DEFINE_SPINLOCK(boot_lock); |
27 | 26 | ||
28 | static struct map_desc scu_io_desc __initdata = { | ||
29 | .length = SZ_4K, | ||
30 | .type = MT_DEVICE, | ||
31 | }; | ||
32 | |||
33 | void __init sirfsoc_map_scu(void) | ||
34 | { | ||
35 | unsigned long base; | ||
36 | |||
37 | /* Get SCU base */ | ||
38 | asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (base)); | ||
39 | |||
40 | scu_io_desc.virtual = SIRFSOC_VA(base); | ||
41 | scu_io_desc.pfn = __phys_to_pfn(base); | ||
42 | iotable_init(&scu_io_desc, 1); | ||
43 | |||
44 | scu_base = (void __iomem *)SIRFSOC_VA(base); | ||
45 | } | ||
46 | |||
47 | static void sirfsoc_secondary_init(unsigned int cpu) | 27 | static void sirfsoc_secondary_init(unsigned int cpu) |
48 | { | 28 | { |
49 | /* | 29 | /* |
@@ -60,8 +40,8 @@ static void sirfsoc_secondary_init(unsigned int cpu) | |||
60 | spin_unlock(&boot_lock); | 40 | spin_unlock(&boot_lock); |
61 | } | 41 | } |
62 | 42 | ||
63 | static struct of_device_id rsc_ids[] = { | 43 | static struct of_device_id clk_ids[] = { |
64 | { .compatible = "sirf,marco-rsc" }, | 44 | { .compatible = "sirf,atlas7-clkc" }, |
65 | {}, | 45 | {}, |
66 | }; | 46 | }; |
67 | 47 | ||
@@ -70,27 +50,27 @@ static int sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
70 | unsigned long timeout; | 50 | unsigned long timeout; |
71 | struct device_node *np; | 51 | struct device_node *np; |
72 | 52 | ||
73 | np = of_find_matching_node(NULL, rsc_ids); | 53 | np = of_find_matching_node(NULL, clk_ids); |
74 | if (!np) | 54 | if (!np) |
75 | return -ENODEV; | 55 | return -ENODEV; |
76 | 56 | ||
77 | rsc_base = of_iomap(np, 0); | 57 | clk_base = of_iomap(np, 0); |
78 | if (!rsc_base) | 58 | if (!clk_base) |
79 | return -ENOMEM; | 59 | return -ENOMEM; |
80 | 60 | ||
81 | /* | 61 | /* |
82 | * write the address of secondary startup into the sram register | 62 | * write the address of secondary startup into the clkc register |
83 | * at offset 0x2C, then write the magic number 0x3CAF5D62 to the | 63 | * at offset 0x2bC, then write the magic number 0x3CAF5D62 to the |
84 | * RSC register at offset 0x28, which is what boot rom code is | 64 | * clkc register at offset 0x2b8, which is what boot rom code is |
85 | * waiting for. This would wake up the secondary core from WFE | 65 | * waiting for. This would wake up the secondary core from WFE |
86 | */ | 66 | */ |
87 | #define SIRFSOC_CPU1_JUMPADDR_OFFSET 0x2C | 67 | #define SIRFSOC_CPU1_JUMPADDR_OFFSET 0x2bc |
88 | __raw_writel(virt_to_phys(sirfsoc_secondary_startup), | 68 | __raw_writel(virt_to_phys(sirfsoc_secondary_startup), |
89 | rsc_base + SIRFSOC_CPU1_JUMPADDR_OFFSET); | 69 | clk_base + SIRFSOC_CPU1_JUMPADDR_OFFSET); |
90 | 70 | ||
91 | #define SIRFSOC_CPU1_WAKEMAGIC_OFFSET 0x28 | 71 | #define SIRFSOC_CPU1_WAKEMAGIC_OFFSET 0x2b8 |
92 | __raw_writel(0x3CAF5D62, | 72 | __raw_writel(0x3CAF5D62, |
93 | rsc_base + SIRFSOC_CPU1_WAKEMAGIC_OFFSET); | 73 | clk_base + SIRFSOC_CPU1_WAKEMAGIC_OFFSET); |
94 | 74 | ||
95 | /* make sure write buffer is drained */ | 75 | /* make sure write buffer is drained */ |
96 | mb(); | 76 | mb(); |
@@ -132,13 +112,7 @@ static int sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
132 | return pen_release != -1 ? -ENOSYS : 0; | 112 | return pen_release != -1 ? -ENOSYS : 0; |
133 | } | 113 | } |
134 | 114 | ||
135 | static void __init sirfsoc_smp_prepare_cpus(unsigned int max_cpus) | ||
136 | { | ||
137 | scu_enable(scu_base); | ||
138 | } | ||
139 | |||
140 | struct smp_operations sirfsoc_smp_ops __initdata = { | 115 | struct smp_operations sirfsoc_smp_ops __initdata = { |
141 | .smp_prepare_cpus = sirfsoc_smp_prepare_cpus, | ||
142 | .smp_secondary_init = sirfsoc_secondary_init, | 116 | .smp_secondary_init = sirfsoc_secondary_init, |
143 | .smp_boot_secondary = sirfsoc_boot_secondary, | 117 | .smp_boot_secondary = sirfsoc_boot_secondary, |
144 | #ifdef CONFIG_HOTPLUG_CPU | 118 | #ifdef CONFIG_HOTPLUG_CPU |