aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-14 17:38:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-14 17:38:28 -0500
commit6a57d104c8cb5b6adad6784b4ce6e2f7f9961a3a (patch)
treec3ff93b006d7483ccee09799d215b03b1bbc3f1b /arch/arm/mach-shmobile
parentcebfa85eb86d92bf85d3b041c6b044184517a988 (diff)
parentc91321e8ff338a88a9272dcd938f085955cd5846 (diff)
Merge tag 'soc2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM Soc updates, take 2, from Olof Johansson: "This is the second batch of SoC updates for the 3.8 merge window, containing parts that had dependencies on earlier branches such that we couldn't include them with the first branch. These are general updates for Samsung Exynos, Renesas/shmobile and a topic branch that adds SMP support to Altera's socfpga platform." Fix up conflicts mostly as per Olof. * tag 'soc2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: ARM: EXYNOS: Clock settings for SATA and SATA PHY ARM: EXYNOS: Add ARM down clock support ARM: EXYNOS: Fix i2c suspend/resume for legacy controller ARM: EXYNOS: Add aliases for i2c controller ARM: EXYNOS: Setup legacy i2c controller interrupts 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" ARM: highbank: use common debug_ll_io_init ARM: shmobile: sh7372: sh7372_fsiXck_clk become non-global ARM: shmobile: sh7372: remove fsidivx clock ARM: socfpga: mark secondary_trampoline as cpuinit socfpga: map uart into virtual address space so that early_printk() works ARM: socfpga: fix build break for allyesconfig ARM: socfpga: Enable SMP for socfpga ARM: EXYNOS: Add dp clock support for EXYNOS5 ARM: SAMSUNG: call clk_get_rate for debugfs rate files ARM: SAMSUNG: add clock_tree debugfs file in clock
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/clock-sh7372.c20
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh7372.h2
-rw-r--r--arch/arm/mach-shmobile/smp-emev2.c22
-rw-r--r--arch/arm/mach-shmobile/smp-r8a7779.c25
-rw-r--r--arch/arm/mach-shmobile/smp-sh73a0.c23
5 files changed, 73 insertions, 19 deletions
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
index 4d57e342537b..3ca6757b129a 100644
--- a/arch/arm/mach-shmobile/clock-sh7372.c
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -295,10 +295,10 @@ struct clk sh7372_pllc2_clk = {
295}; 295};
296 296
297/* External input clock (pin name: FSIACK/FSIBCK ) */ 297/* External input clock (pin name: FSIACK/FSIBCK ) */
298struct clk sh7372_fsiack_clk = { 298static struct clk fsiack_clk = {
299}; 299};
300 300
301struct clk sh7372_fsibck_clk = { 301static struct clk fsibck_clk = {
302}; 302};
303 303
304static struct clk *main_clks[] = { 304static struct clk *main_clks[] = {
@@ -314,8 +314,8 @@ static struct clk *main_clks[] = {
314 &pllc1_clk, 314 &pllc1_clk,
315 &pllc1_div2_clk, 315 &pllc1_div2_clk,
316 &sh7372_pllc2_clk, 316 &sh7372_pllc2_clk,
317 &sh7372_fsiack_clk, 317 &fsiack_clk,
318 &sh7372_fsibck_clk, 318 &fsibck_clk,
319}; 319};
320 320
321static void div4_kick(struct clk *clk) 321static void div4_kick(struct clk *clk)
@@ -399,14 +399,14 @@ static struct clk *hdmi_parent[] = {
399static struct clk *fsiackcr_parent[] = { 399static struct clk *fsiackcr_parent[] = {
400 [0] = &pllc1_div2_clk, 400 [0] = &pllc1_div2_clk,
401 [1] = &sh7372_pllc2_clk, 401 [1] = &sh7372_pllc2_clk,
402 [2] = &sh7372_fsiack_clk, /* external input for FSI A */ 402 [2] = &fsiack_clk, /* external input for FSI A */
403 [3] = NULL, /* setting prohibited */ 403 [3] = NULL, /* setting prohibited */
404}; 404};
405 405
406static struct clk *fsibckcr_parent[] = { 406static struct clk *fsibckcr_parent[] = {
407 [0] = &pllc1_div2_clk, 407 [0] = &pllc1_div2_clk,
408 [1] = &sh7372_pllc2_clk, 408 [1] = &sh7372_pllc2_clk,
409 [2] = &sh7372_fsibck_clk, /* external input for FSI B */ 409 [2] = &fsibck_clk, /* external input for FSI B */
410 [3] = NULL, /* setting prohibited */ 410 [3] = NULL, /* setting prohibited */
411}; 411};
412 412
@@ -507,8 +507,8 @@ static struct clk_lookup lookups[] = {
507 CLKDEV_CON_ID("pllc1_clk", &pllc1_clk), 507 CLKDEV_CON_ID("pllc1_clk", &pllc1_clk),
508 CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk), 508 CLKDEV_CON_ID("pllc1_div2_clk", &pllc1_div2_clk),
509 CLKDEV_CON_ID("pllc2_clk", &sh7372_pllc2_clk), 509 CLKDEV_CON_ID("pllc2_clk", &sh7372_pllc2_clk),
510 CLKDEV_CON_ID("fsidiva", &fsidivs[FSIDIV_A]), 510 CLKDEV_CON_ID("fsiack", &fsiack_clk),
511 CLKDEV_CON_ID("fsidivb", &fsidivs[FSIDIV_B]), 511 CLKDEV_CON_ID("fsibck", &fsibck_clk),
512 512
513 /* DIV4 clocks */ 513 /* DIV4 clocks */
514 CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]), 514 CLKDEV_CON_ID("i_clk", &div4_clks[DIV4_I]),
@@ -606,8 +606,8 @@ static struct clk_lookup lookups[] = {
606 CLKDEV_ICK_ID("spu2", "sh_fsi2", &mstp_clks[MSTP223]), 606 CLKDEV_ICK_ID("spu2", "sh_fsi2", &mstp_clks[MSTP223]),
607 CLKDEV_ICK_ID("diva", "sh_fsi2", &fsidivs[FSIDIV_A]), 607 CLKDEV_ICK_ID("diva", "sh_fsi2", &fsidivs[FSIDIV_A]),
608 CLKDEV_ICK_ID("divb", "sh_fsi2", &fsidivs[FSIDIV_B]), 608 CLKDEV_ICK_ID("divb", "sh_fsi2", &fsidivs[FSIDIV_B]),
609 CLKDEV_ICK_ID("xcka", "sh_fsi2", &sh7372_fsiack_clk), 609 CLKDEV_ICK_ID("xcka", "sh_fsi2", &fsiack_clk),
610 CLKDEV_ICK_ID("xckb", "sh_fsi2", &sh7372_fsibck_clk), 610 CLKDEV_ICK_ID("xckb", "sh_fsi2", &fsibck_clk),
611}; 611};
612 612
613void __init sh7372_clock_init(void) 613void __init sh7372_clock_init(void)
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h
index 26cd1016fad8..b582facc1cf6 100644
--- a/arch/arm/mach-shmobile/include/mach/sh7372.h
+++ b/arch/arm/mach-shmobile/include/mach/sh7372.h
@@ -477,8 +477,6 @@ extern struct clk sh7372_extal2_clk;
477extern struct clk sh7372_dv_clki_clk; 477extern struct clk sh7372_dv_clki_clk;
478extern struct clk sh7372_dv_clki_div2_clk; 478extern struct clk sh7372_dv_clki_div2_clk;
479extern struct clk sh7372_pllc2_clk; 479extern struct clk sh7372_pllc2_clk;
480extern struct clk sh7372_fsiack_clk;
481extern struct clk sh7372_fsibck_clk;
482 480
483extern void sh7372_intcs_suspend(void); 481extern void sh7372_intcs_suspend(void);
484extern void sh7372_intcs_resume(void); 482extern void sh7372_intcs_resume(void);
diff --git a/arch/arm/mach-shmobile/smp-emev2.c b/arch/arm/mach-shmobile/smp-emev2.c
index 535426c306bd..f67456286280 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
35static DEFINE_SPINLOCK(scu_lock);
35static void __iomem *scu_base; 36static void __iomem *scu_base;
36 37
38static 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
37static unsigned int __init emev2_get_core_count(void) 53static 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
91static void __init emev2_smp_prepare_cpus(unsigned int max_cpus) 107static 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
99static void __init emev2_smp_init_cpus(void) 117static 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 9def0f22bf22..2ce6af9a6a37 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
64static DEFINE_SPINLOCK(scu_lock);
65static unsigned long tmp;
66
64#ifdef CONFIG_HAVE_ARM_TWD 67#ifdef CONFIG_HAVE_ARM_TWD
65static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); 68static 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
76static 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
73static unsigned int __init r8a7779_get_core_count(void) 90static 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
142static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus) 159static 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 96ddb97babbe..624f00f70abf 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
44static DEFINE_SPINLOCK(scu_lock);
45static unsigned long tmp;
46
44#ifdef CONFIG_HAVE_ARM_TWD 47#ifdef CONFIG_HAVE_ARM_TWD
45static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29); 48static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, 0xf0000600, 29);
46void __init sh73a0_register_twd(void) 49void __init sh73a0_register_twd(void)
@@ -49,6 +52,20 @@ void __init sh73a0_register_twd(void)
49} 52}
50#endif 53#endif
51 54
55static 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
52static unsigned int __init sh73a0_get_core_count(void) 69static 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
79static void __init sh73a0_smp_prepare_cpus(unsigned int max_cpus) 96static 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
91static void __init sh73a0_smp_init_cpus(void) 110static void __init sh73a0_smp_init_cpus(void)