aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2015-01-21 17:29:06 -0500
committerOlof Johansson <olof@lixom.net>2015-01-21 17:29:06 -0500
commitc1cd7adb3844d7e2e47533e485cc8bebb6725419 (patch)
treed1b6051e6b046c87880ff99ad0c379b944c3bd55
parent0766c17fb97b1d11abed452b923a7460e8b64dce (diff)
parent4cba058526a7563603ab18f06e298633dd69fc77 (diff)
Merge tag 'new-atlas7mach-for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/baohua/linux into next/soc
Merge "CSR new atlas7 machine, and delete old marco machine for 3.20" from Barry Song: drop CSR Marco machine and add Atlas7 new machine This is the init support for CSR Atlas7 new SoC. Old Marco has never shipped to customers and been dropped. * tag 'new-atlas7mach-for-3.20' of git://git.kernel.org/pub/scm/linux/kernel/git/baohua/linux: ARM: sirf: add Atlas7 machine support ARM: sirf: move to debug_ll_io_init and drop map_io ARM: sirf: move platsmp to support Atlas7 SoC ARM: sirf: drop Marco machine ARM: sirf: drop Marco support in reset controller module Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--arch/arm/mach-prima2/Kconfig22
-rw-r--r--arch/arm/mach-prima2/Makefile1
-rw-r--r--arch/arm/mach-prima2/common.c22
-rw-r--r--arch/arm/mach-prima2/lluart.c33
-rw-r--r--arch/arm/mach-prima2/platsmp.c52
-rw-r--r--arch/arm/mach-prima2/rstc.c41
-rw-r--r--arch/arm/mach-prima2/rtciobrg.c1
7 files changed, 42 insertions, 130 deletions
diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
index 042f693ef423..a219dc310d5d 100644
--- a/arch/arm/mach-prima2/Kconfig
+++ b/arch/arm/mach-prima2/Kconfig
@@ -11,7 +11,7 @@ menuconfig ARCH_SIRF
11 11
12if ARCH_SIRF 12if ARCH_SIRF
13 13
14comment "CSR SiRF atlas6/primaII/Marco/Polo Specific Features" 14comment "CSR SiRF atlas6/primaII/Atlas7 Specific Features"
15 15
16config ARCH_ATLAS6 16config ARCH_ATLAS6
17 bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform" 17 bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform"
@@ -20,6 +20,17 @@ config ARCH_ATLAS6
20 help 20 help
21 Support for CSR SiRFSoC ARM Cortex A9 Platform 21 Support for CSR SiRFSoC ARM Cortex A9 Platform
22 22
23config ARCH_ATLAS7
24 bool "CSR SiRFSoC ATLAS7 ARM Cortex A7 Platform"
25 default y
26 select ARM_GIC
27 select CPU_V7
28 select HAVE_ARM_SCU if SMP
29 select HAVE_SMP
30 select SMP_ON_UP if SMP
31 help
32 Support for CSR SiRFSoC ARM Cortex A7 Platform
33
23config ARCH_PRIMA2 34config ARCH_PRIMA2
24 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform" 35 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
25 default y 36 default y
@@ -28,15 +39,6 @@ config ARCH_PRIMA2
28 help 39 help
29 Support for CSR SiRFSoC ARM Cortex A9 Platform 40 Support for CSR SiRFSoC ARM Cortex A9 Platform
30 41
31config ARCH_MARCO
32 bool "CSR SiRFSoC MARCO ARM Cortex A9 Platform"
33 default y
34 select ARM_GIC
35 select HAVE_ARM_SCU if SMP
36 select SMP_ON_UP if SMP
37 help
38 Support for CSR SiRFSoC ARM Cortex A9 Platform
39
40config SIRF_IRQ 42config SIRF_IRQ
41 bool 43 bool
42 44
diff --git a/arch/arm/mach-prima2/Makefile b/arch/arm/mach-prima2/Makefile
index 8846e7d87ea5..d7d02b043449 100644
--- a/arch/arm/mach-prima2/Makefile
+++ b/arch/arm/mach-prima2/Makefile
@@ -1,7 +1,6 @@
1obj-y += rstc.o 1obj-y += rstc.o
2obj-y += common.o 2obj-y += common.o
3obj-y += rtciobrg.o 3obj-y += rtciobrg.o
4obj-$(CONFIG_DEBUG_LL) += lluart.o
5obj-$(CONFIG_SUSPEND) += pm.o sleep.o 4obj-$(CONFIG_SUSPEND) += pm.o sleep.o
6obj-$(CONFIG_SMP) += platsmp.o headsmp.o 5obj-$(CONFIG_SMP) += platsmp.o headsmp.o
7obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 6obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
diff --git a/arch/arm/mach-prima2/common.c b/arch/arm/mach-prima2/common.c
index a860ea27e8ae..0c819bb88418 100644
--- a/arch/arm/mach-prima2/common.c
+++ b/arch/arm/mach-prima2/common.c
@@ -20,12 +20,6 @@ static void __init sirfsoc_init_late(void)
20 sirfsoc_pm_init(); 20 sirfsoc_pm_init();
21} 21}
22 22
23static __init void sirfsoc_map_io(void)
24{
25 sirfsoc_map_lluart();
26 sirfsoc_map_scu();
27}
28
29#ifdef CONFIG_ARCH_ATLAS6 23#ifdef CONFIG_ARCH_ATLAS6
30static const char *atlas6_dt_match[] __initconst = { 24static const char *atlas6_dt_match[] __initconst = {
31 "sirf,atlas6", 25 "sirf,atlas6",
@@ -36,7 +30,6 @@ DT_MACHINE_START(ATLAS6_DT, "Generic ATLAS6 (Flattened Device Tree)")
36 /* Maintainer: Barry Song <baohua.song@csr.com> */ 30 /* Maintainer: Barry Song <baohua.song@csr.com> */
37 .l2c_aux_val = 0, 31 .l2c_aux_val = 0,
38 .l2c_aux_mask = ~0, 32 .l2c_aux_mask = ~0,
39 .map_io = sirfsoc_map_io,
40 .init_late = sirfsoc_init_late, 33 .init_late = sirfsoc_init_late,
41 .dt_compat = atlas6_dt_match, 34 .dt_compat = atlas6_dt_match,
42MACHINE_END 35MACHINE_END
@@ -52,26 +45,21 @@ DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)")
52 /* Maintainer: Barry Song <baohua.song@csr.com> */ 45 /* Maintainer: Barry Song <baohua.song@csr.com> */
53 .l2c_aux_val = 0, 46 .l2c_aux_val = 0,
54 .l2c_aux_mask = ~0, 47 .l2c_aux_mask = ~0,
55 .map_io = sirfsoc_map_io,
56 .dma_zone_size = SZ_256M, 48 .dma_zone_size = SZ_256M,
57 .init_late = sirfsoc_init_late, 49 .init_late = sirfsoc_init_late,
58 .dt_compat = prima2_dt_match, 50 .dt_compat = prima2_dt_match,
59MACHINE_END 51MACHINE_END
60#endif 52#endif
61 53
62#ifdef CONFIG_ARCH_MARCO 54#ifdef CONFIG_ARCH_ATLAS7
63static const char *marco_dt_match[] __initconst = { 55static const char *atlas7_dt_match[] __initdata = {
64 "sirf,marco", 56 "sirf,atlas7",
65 NULL 57 NULL
66}; 58};
67 59
68DT_MACHINE_START(MARCO_DT, "Generic MARCO (Flattened Device Tree)") 60DT_MACHINE_START(ATLAS7_DT, "Generic ATLAS7 (Flattened Device Tree)")
69 /* Maintainer: Barry Song <baohua.song@csr.com> */ 61 /* Maintainer: Barry Song <baohua.song@csr.com> */
70 .l2c_aux_val = 0,
71 .l2c_aux_mask = ~0,
72 .smp = smp_ops(sirfsoc_smp_ops), 62 .smp = smp_ops(sirfsoc_smp_ops),
73 .map_io = sirfsoc_map_io, 63 .dt_compat = atlas7_dt_match,
74 .init_late = sirfsoc_init_late,
75 .dt_compat = marco_dt_match,
76MACHINE_END 64MACHINE_END
77#endif 65#endif
diff --git a/arch/arm/mach-prima2/lluart.c b/arch/arm/mach-prima2/lluart.c
deleted file mode 100644
index 20453c14bfd3..000000000000
--- a/arch/arm/mach-prima2/lluart.c
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * Static memory mapping for DEBUG_LL
3 *
4 * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9#include <linux/kernel.h>
10#include <asm/page.h>
11#include <asm/mach/map.h>
12#include "common.h"
13
14#if defined(CONFIG_DEBUG_SIRFPRIMA2_UART1)
15#define SIRFSOC_UART1_PA_BASE 0xb0060000
16#else
17#define SIRFSOC_UART1_PA_BASE 0
18#endif
19
20#define SIRFSOC_UART1_VA_BASE SIRFSOC_VA(0x060000)
21#define SIRFSOC_UART1_SIZE SZ_4K
22
23void __init sirfsoc_map_lluart(void)
24{
25 struct map_desc sirfsoc_lluart_map = {
26 .virtual = SIRFSOC_UART1_VA_BASE,
27 .pfn = __phys_to_pfn(SIRFSOC_UART1_PA_BASE),
28 .length = SIRFSOC_UART1_SIZE,
29 .type = MT_DEVICE,
30 };
31
32 iotable_init(&sirfsoc_lluart_map, 1);
33}
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
23static void __iomem *scu_base; 23static void __iomem *clk_base;
24static void __iomem *rsc_base;
25 24
26static DEFINE_SPINLOCK(boot_lock); 25static DEFINE_SPINLOCK(boot_lock);
27 26
28static struct map_desc scu_io_desc __initdata = {
29 .length = SZ_4K,
30 .type = MT_DEVICE,
31};
32
33void __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
47static void sirfsoc_secondary_init(unsigned int cpu) 27static 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
63static struct of_device_id rsc_ids[] = { 43static 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
135static void __init sirfsoc_smp_prepare_cpus(unsigned int max_cpus)
136{
137 scu_enable(scu_base);
138}
139
140struct smp_operations sirfsoc_smp_ops __initdata = { 115struct 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
diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c
index e1f1f86f6a95..7c251eb11d01 100644
--- a/arch/arm/mach-prima2/rstc.c
+++ b/arch/arm/mach-prima2/rstc.c
@@ -34,36 +34,20 @@ static int sirfsoc_reset_module(struct reset_controller_dev *rcdev,
34 34
35 mutex_lock(&rstc_lock); 35 mutex_lock(&rstc_lock);
36 36
37 if (of_device_is_compatible(rcdev->of_node, "sirf,prima2-rstc")) { 37 /*
38 /* 38 * Writing 1 to this bit resets corresponding block.
39 * Writing 1 to this bit resets corresponding block. 39 * Writing 0 to this bit de-asserts reset signal of the
40 * Writing 0 to this bit de-asserts reset signal of the 40 * corresponding block. datasheet doesn't require explicit
41 * corresponding block. datasheet doesn't require explicit 41 * delay between the set and clear of reset bit. it could
42 * delay between the set and clear of reset bit. it could 42 * be shorter if tests pass.
43 * be shorter if tests pass. 43 */
44 */ 44 writel(readl(sirfsoc_rstc_base +
45 writel(readl(sirfsoc_rstc_base +
46 (reset_bit / 32) * 4) | (1 << reset_bit), 45 (reset_bit / 32) * 4) | (1 << reset_bit),
47 sirfsoc_rstc_base + (reset_bit / 32) * 4); 46 sirfsoc_rstc_base + (reset_bit / 32) * 4);
48 msleep(20); 47 msleep(20);
49 writel(readl(sirfsoc_rstc_base + 48 writel(readl(sirfsoc_rstc_base +
50 (reset_bit / 32) * 4) & ~(1 << reset_bit), 49 (reset_bit / 32) * 4) & ~(1 << reset_bit),
51 sirfsoc_rstc_base + (reset_bit / 32) * 4); 50 sirfsoc_rstc_base + (reset_bit / 32) * 4);
52 } else {
53 /*
54 * For MARCO and POLO
55 * Writing 1 to SET register resets corresponding block.
56 * Writing 1 to CLEAR register de-asserts reset signal of the
57 * corresponding block.
58 * datasheet doesn't require explicit delay between the set and
59 * clear of reset bit. it could be shorter if tests pass.
60 */
61 writel(1 << reset_bit,
62 sirfsoc_rstc_base + (reset_bit / 32) * 8);
63 msleep(20);
64 writel(1 << reset_bit,
65 sirfsoc_rstc_base + (reset_bit / 32) * 8 + 4);
66 }
67 51
68 mutex_unlock(&rstc_lock); 52 mutex_unlock(&rstc_lock);
69 53
@@ -106,7 +90,6 @@ static int sirfsoc_rstc_probe(struct platform_device *pdev)
106 90
107static const struct of_device_id rstc_ids[] = { 91static const struct of_device_id rstc_ids[] = {
108 { .compatible = "sirf,prima2-rstc" }, 92 { .compatible = "sirf,prima2-rstc" },
109 { .compatible = "sirf,marco-rstc" },
110 {}, 93 {},
111}; 94};
112 95
diff --git a/arch/arm/mach-prima2/rtciobrg.c b/arch/arm/mach-prima2/rtciobrg.c
index 70a0b475062b..8f66d8f7ca75 100644
--- a/arch/arm/mach-prima2/rtciobrg.c
+++ b/arch/arm/mach-prima2/rtciobrg.c
@@ -104,7 +104,6 @@ EXPORT_SYMBOL_GPL(sirfsoc_rtc_iobrg_writel);
104 104
105static const struct of_device_id rtciobrg_ids[] = { 105static const struct of_device_id rtciobrg_ids[] = {
106 { .compatible = "sirf,prima2-rtciobg" }, 106 { .compatible = "sirf,prima2-rtciobg" },
107 { .compatible = "sirf,marco-rtciobg" },
108 {} 107 {}
109}; 108};
110 109