diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-11-13 07:48:02 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-11-13 07:48:02 -0500 |
commit | 97b129be91bc978a205db24241840b95cfa28325 (patch) | |
tree | c9a431561f738d39a1a2c6dbed94af838f7d3b35 /arch | |
parent | 9e0c6b1f47b7cd8e2ce542575573d7c235759ff9 (diff) | |
parent | 94091c6b9498116abe3035137d8c3e707528efd0 (diff) |
Merge branch 'soc4' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc2
Its a little embarrassing, but they all fix problems introduced
in previous pull-requests for 3.8 that have been merged.
* The three Revert patches back-out secondary CPU initialisation
changes from Bastian Hecht which he as advised me are incorrect
and break secondary CPU initialisation.
* The clkfwk patch from Morimoto-san resolves a build warning.
* 'soc4' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
sh: clkfwk: fixup unsed variable warning
Revert "ARM: shmobile: r8a7779: Replace modify_scu_cpu_psr with scu_power_mode"
Revert "ARM: shmobile: sh73a0: Replace modify_scu_cpu_psr with scu_power_mode"
Revert "ARM: shmobile: emev2: Replace modify_scu_cpu_psr with scu_power_mode"
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-shmobile/smp-emev2.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/smp-r8a7779.c | 25 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/smp-sh73a0.c | 23 |
3 files changed, 63 insertions, 7 deletions
diff --git a/arch/arm/mach-shmobile/smp-emev2.c b/arch/arm/mach-shmobile/smp-emev2.c index 535426c306b..f6745628628 100644 --- a/arch/arm/mach-shmobile/smp-emev2.c +++ b/arch/arm/mach-shmobile/smp-emev2.c | |||
@@ -32,8 +32,24 @@ | |||
32 | 32 | ||
33 | #define EMEV2_SCU_BASE 0x1e000000 | 33 | #define EMEV2_SCU_BASE 0x1e000000 |
34 | 34 | ||
35 | static DEFINE_SPINLOCK(scu_lock); | ||
35 | static void __iomem *scu_base; | 36 | static void __iomem *scu_base; |
36 | 37 | ||
38 | static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) | ||
39 | { | ||
40 | unsigned long tmp; | ||
41 | |||
42 | /* we assume this code is running on a different cpu | ||
43 | * than the one that is changing coherency setting */ | ||
44 | spin_lock(&scu_lock); | ||
45 | tmp = readl(scu_base + 8); | ||
46 | tmp &= ~clr; | ||
47 | tmp |= set; | ||
48 | writel(tmp, scu_base + 8); | ||
49 | spin_unlock(&scu_lock); | ||
50 | |||
51 | } | ||
52 | |||
37 | static unsigned int __init emev2_get_core_count(void) | 53 | static unsigned int __init emev2_get_core_count(void) |
38 | { | 54 | { |
39 | if (!scu_base) { | 55 | if (!scu_base) { |
@@ -79,7 +95,7 @@ static int __cpuinit emev2_boot_secondary(unsigned int cpu, struct task_struct * | |||
79 | cpu = cpu_logical_map(cpu); | 95 | cpu = cpu_logical_map(cpu); |
80 | 96 | ||
81 | /* enable cache coherency */ | 97 | /* enable cache coherency */ |
82 | scu_power_mode(scu_base, 0); | 98 | modify_scu_cpu_psr(0, 3 << (cpu * 8)); |
83 | 99 | ||
84 | /* Tell ROM loader about our vector (in headsmp.S) */ | 100 | /* Tell ROM loader about our vector (in headsmp.S) */ |
85 | emev2_set_boot_vector(__pa(shmobile_secondary_vector)); | 101 | emev2_set_boot_vector(__pa(shmobile_secondary_vector)); |
@@ -90,10 +106,12 @@ static int __cpuinit emev2_boot_secondary(unsigned int cpu, struct task_struct * | |||
90 | 106 | ||
91 | static void __init emev2_smp_prepare_cpus(unsigned int max_cpus) | 107 | static void __init emev2_smp_prepare_cpus(unsigned int max_cpus) |
92 | { | 108 | { |
109 | int cpu = cpu_logical_map(0); | ||
110 | |||
93 | scu_enable(scu_base); | 111 | scu_enable(scu_base); |
94 | 112 | ||
95 | /* enable cache coherency on CPU0 */ | 113 | /* enable cache coherency on CPU0 */ |
96 | scu_power_mode(scu_base, 0); | 114 | modify_scu_cpu_psr(0, 3 << (cpu * 8)); |
97 | } | 115 | } |
98 | 116 | ||
99 | static void __init emev2_smp_init_cpus(void) | 117 | static void __init emev2_smp_init_cpus(void) |
diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c index 9def0f22bf2..2ce6af9a6a3 100644 --- a/arch/arm/mach-shmobile/smp-r8a7779.c +++ b/arch/arm/mach-shmobile/smp-r8a7779.c | |||
@@ -61,6 +61,9 @@ static void __iomem *scu_base_addr(void) | |||
61 | return (void __iomem *)0xf0000000; | 61 | return (void __iomem *)0xf0000000; |
62 | } | 62 | } |
63 | 63 | ||
64 | static DEFINE_SPINLOCK(scu_lock); | ||
65 | static unsigned long tmp; | ||
66 | |||
64 | #ifdef CONFIG_HAVE_ARM_TWD | 67 | #ifdef CONFIG_HAVE_ARM_TWD |
65 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); | 68 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); |
66 | 69 | ||
@@ -70,6 +73,20 @@ void __init r8a7779_register_twd(void) | |||
70 | } | 73 | } |
71 | #endif | 74 | #endif |
72 | 75 | ||
76 | static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) | ||
77 | { | ||
78 | void __iomem *scu_base = scu_base_addr(); | ||
79 | |||
80 | spin_lock(&scu_lock); | ||
81 | tmp = __raw_readl(scu_base + 8); | ||
82 | tmp &= ~clr; | ||
83 | tmp |= set; | ||
84 | spin_unlock(&scu_lock); | ||
85 | |||
86 | /* disable cache coherency after releasing the lock */ | ||
87 | __raw_writel(tmp, scu_base + 8); | ||
88 | } | ||
89 | |||
73 | static unsigned int __init r8a7779_get_core_count(void) | 90 | static unsigned int __init r8a7779_get_core_count(void) |
74 | { | 91 | { |
75 | void __iomem *scu_base = scu_base_addr(); | 92 | void __iomem *scu_base = scu_base_addr(); |
@@ -85,7 +102,7 @@ static int r8a7779_platform_cpu_kill(unsigned int cpu) | |||
85 | cpu = cpu_logical_map(cpu); | 102 | cpu = cpu_logical_map(cpu); |
86 | 103 | ||
87 | /* disable cache coherency */ | 104 | /* disable cache coherency */ |
88 | scu_power_mode(scu_base_addr(), 3); | 105 | modify_scu_cpu_psr(3 << (cpu * 8), 0); |
89 | 106 | ||
90 | if (cpu < ARRAY_SIZE(r8a7779_ch_cpu)) | 107 | if (cpu < ARRAY_SIZE(r8a7779_ch_cpu)) |
91 | ch = r8a7779_ch_cpu[cpu]; | 108 | ch = r8a7779_ch_cpu[cpu]; |
@@ -128,7 +145,7 @@ static int __cpuinit r8a7779_boot_secondary(unsigned int cpu, struct task_struct | |||
128 | cpu = cpu_logical_map(cpu); | 145 | cpu = cpu_logical_map(cpu); |
129 | 146 | ||
130 | /* enable cache coherency */ | 147 | /* enable cache coherency */ |
131 | scu_power_mode(scu_base_addr(), 0); | 148 | modify_scu_cpu_psr(0, 3 << (cpu * 8)); |
132 | 149 | ||
133 | if (cpu < ARRAY_SIZE(r8a7779_ch_cpu)) | 150 | if (cpu < ARRAY_SIZE(r8a7779_ch_cpu)) |
134 | ch = r8a7779_ch_cpu[cpu]; | 151 | ch = r8a7779_ch_cpu[cpu]; |
@@ -141,13 +158,15 @@ static int __cpuinit r8a7779_boot_secondary(unsigned int cpu, struct task_struct | |||
141 | 158 | ||
142 | static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus) | 159 | static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus) |
143 | { | 160 | { |
161 | int cpu = cpu_logical_map(0); | ||
162 | |||
144 | scu_enable(scu_base_addr()); | 163 | scu_enable(scu_base_addr()); |
145 | 164 | ||
146 | /* Map the reset vector (in headsmp.S) */ | 165 | /* Map the reset vector (in headsmp.S) */ |
147 | __raw_writel(__pa(shmobile_secondary_vector), AVECR); | 166 | __raw_writel(__pa(shmobile_secondary_vector), AVECR); |
148 | 167 | ||
149 | /* enable cache coherency on CPU0 */ | 168 | /* enable cache coherency on CPU0 */ |
150 | scu_power_mode(scu_base_addr(), 0); | 169 | modify_scu_cpu_psr(0, 3 << (cpu * 8)); |
151 | 170 | ||
152 | r8a7779_pm_init(); | 171 | r8a7779_pm_init(); |
153 | 172 | ||
diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c index 96ddb97babb..624f00f70ab 100644 --- a/arch/arm/mach-shmobile/smp-sh73a0.c +++ b/arch/arm/mach-shmobile/smp-sh73a0.c | |||
@@ -41,6 +41,9 @@ static void __iomem *scu_base_addr(void) | |||
41 | return (void __iomem *)0xf0000000; | 41 | return (void __iomem *)0xf0000000; |
42 | } | 42 | } |
43 | 43 | ||
44 | static DEFINE_SPINLOCK(scu_lock); | ||
45 | static unsigned long tmp; | ||
46 | |||
44 | #ifdef CONFIG_HAVE_ARM_TWD | 47 | #ifdef CONFIG_HAVE_ARM_TWD |
45 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); | 48 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); |
46 | void __init sh73a0_register_twd(void) | 49 | void __init sh73a0_register_twd(void) |
@@ -49,6 +52,20 @@ void __init sh73a0_register_twd(void) | |||
49 | } | 52 | } |
50 | #endif | 53 | #endif |
51 | 54 | ||
55 | static void modify_scu_cpu_psr(unsigned long set, unsigned long clr) | ||
56 | { | ||
57 | void __iomem *scu_base = scu_base_addr(); | ||
58 | |||
59 | spin_lock(&scu_lock); | ||
60 | tmp = __raw_readl(scu_base + 8); | ||
61 | tmp &= ~clr; | ||
62 | tmp |= set; | ||
63 | spin_unlock(&scu_lock); | ||
64 | |||
65 | /* disable cache coherency after releasing the lock */ | ||
66 | __raw_writel(tmp, scu_base + 8); | ||
67 | } | ||
68 | |||
52 | static unsigned int __init sh73a0_get_core_count(void) | 69 | static unsigned int __init sh73a0_get_core_count(void) |
53 | { | 70 | { |
54 | void __iomem *scu_base = scu_base_addr(); | 71 | void __iomem *scu_base = scu_base_addr(); |
@@ -66,7 +83,7 @@ static int __cpuinit sh73a0_boot_secondary(unsigned int cpu, struct task_struct | |||
66 | cpu = cpu_logical_map(cpu); | 83 | cpu = cpu_logical_map(cpu); |
67 | 84 | ||
68 | /* enable cache coherency */ | 85 | /* enable cache coherency */ |
69 | scu_power_mode(scu_base_addr(), 0); | 86 | modify_scu_cpu_psr(0, 3 << (cpu * 8)); |
70 | 87 | ||
71 | if (((__raw_readl(PSTR) >> (4 * cpu)) & 3) == 3) | 88 | if (((__raw_readl(PSTR) >> (4 * cpu)) & 3) == 3) |
72 | __raw_writel(1 << cpu, WUPCR); /* wake up */ | 89 | __raw_writel(1 << cpu, WUPCR); /* wake up */ |
@@ -78,6 +95,8 @@ static int __cpuinit sh73a0_boot_secondary(unsigned int cpu, struct task_struct | |||
78 | 95 | ||
79 | static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus) | 96 | static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus) |
80 | { | 97 | { |
98 | int cpu = cpu_logical_map(0); | ||
99 | |||
81 | scu_enable(scu_base_addr()); | 100 | scu_enable(scu_base_addr()); |
82 | 101 | ||
83 | /* Map the reset vector (in headsmp.S) */ | 102 | /* Map the reset vector (in headsmp.S) */ |
@@ -85,7 +104,7 @@ static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus) | |||
85 | __raw_writel(__pa(shmobile_secondary_vector), SBAR); | 104 | __raw_writel(__pa(shmobile_secondary_vector), SBAR); |
86 | 105 | ||
87 | /* enable cache coherency on CPU0 */ | 106 | /* enable cache coherency on CPU0 */ |
88 | scu_power_mode(scu_base_addr(), 0); | 107 | modify_scu_cpu_psr(0, 3 << (cpu * 8)); |
89 | } | 108 | } |
90 | 109 | ||
91 | static void __init sh73a0_smp_init_cpus(void) | 110 | static void __init sh73a0_smp_init_cpus(void) |