aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-vexpress/ct-ca9x4.c
diff options
context:
space:
mode:
authorPawel Moll <pawel.moll@arm.com>2012-01-25 10:37:29 -0500
committerPawel Moll <pawel.moll@arm.com>2012-02-23 10:09:42 -0500
commit98ed4ceb93ba22268f35ebcbb7de0cb1c7e70231 (patch)
tree4d9433a8e99ad43c3be377a6e44e54ef5d9a1ec4 /arch/arm/mach-vexpress/ct-ca9x4.c
parentb01543dfe67bb1d191998e90d20534dc354de059 (diff)
ARM: vexpress: Get rid of MMIO_P2V
This patch gets rid of the MMIO_P2V and __MMIO_P2V macros, defining constant virtual base for motherboard and tile peripherals instead. Additionally, in preparation for the new motherboard memory map, the motherboard peripherals are using base pointers calculated in runtime, instead of compile-time calculated values. Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Diffstat (limited to 'arch/arm/mach-vexpress/ct-ca9x4.c')
-rw-r--r--arch/arm/mach-vexpress/ct-ca9x4.c58
1 files changed, 19 insertions, 39 deletions
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index b1e87c184e54..a2f7d5d3ca40 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -30,57 +30,29 @@
30 30
31#include <plat/clcd.h> 31#include <plat/clcd.h>
32 32
33#define V2M_PA_CS7 0x10000000
34
35static struct map_desc ct_ca9x4_io_desc[] __initdata = { 33static struct map_desc ct_ca9x4_io_desc[] __initdata = {
36 { 34 {
37 .virtual = __MMIO_P2V(CT_CA9X4_MPIC), 35 .virtual = V2T_PERIPH,
38 .pfn = __phys_to_pfn(CT_CA9X4_MPIC), 36 .pfn = __phys_to_pfn(CT_CA9X4_MPIC),
39 .length = SZ_16K, 37 .length = SZ_8K,
40 .type = MT_DEVICE, 38 .type = MT_DEVICE,
41 }, {
42 .virtual = __MMIO_P2V(CT_CA9X4_SP804_TIMER),
43 .pfn = __phys_to_pfn(CT_CA9X4_SP804_TIMER),
44 .length = SZ_4K,
45 .type = MT_DEVICE,
46 }, {
47 .virtual = __MMIO_P2V(CT_CA9X4_L2CC),
48 .pfn = __phys_to_pfn(CT_CA9X4_L2CC),
49 .length = SZ_4K,
50 .type = MT_DEVICE,
51 }, 39 },
52}; 40};
53 41
54static void __init ct_ca9x4_map_io(void) 42static void __init ct_ca9x4_map_io(void)
55{ 43{
44 iotable_init(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
56#ifdef CONFIG_LOCAL_TIMERS 45#ifdef CONFIG_LOCAL_TIMERS
57 twd_base = MMIO_P2V(A9_MPCORE_TWD); 46 twd_base = ioremap(A9_MPCORE_TWD, SZ_32);
58#endif 47#endif
59 iotable_init(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
60} 48}
61 49
62static void __init ct_ca9x4_init_irq(void) 50static void __init ct_ca9x4_init_irq(void)
63{ 51{
64 gic_init(0, 29, MMIO_P2V(A9_MPCORE_GIC_DIST), 52 gic_init(0, 29, ioremap(A9_MPCORE_GIC_DIST, SZ_4K),
65 MMIO_P2V(A9_MPCORE_GIC_CPU)); 53 ioremap(A9_MPCORE_GIC_CPU, SZ_256));
66}
67
68#if 0
69static void __init ct_ca9x4_timer_init(void)
70{
71 writel(0, MMIO_P2V(CT_CA9X4_TIMER0) + TIMER_CTRL);
72 writel(0, MMIO_P2V(CT_CA9X4_TIMER1) + TIMER_CTRL);
73
74 sp804_clocksource_init(MMIO_P2V(CT_CA9X4_TIMER1), "ct-timer1");
75 sp804_clockevents_init(MMIO_P2V(CT_CA9X4_TIMER0), IRQ_CT_CA9X4_TIMER0,
76 "ct-timer0");
77} 54}
78 55
79static struct sys_timer ct_ca9x4_timer = {
80 .init = ct_ca9x4_timer_init,
81};
82#endif
83
84static void ct_ca9x4_clcd_enable(struct clcd_fb *fb) 56static void ct_ca9x4_clcd_enable(struct clcd_fb *fb)
85{ 57{
86 v2m_cfg_write(SYS_CFG_MUXFPGA | SYS_CFG_SITE_DB1, 0); 58 v2m_cfg_write(SYS_CFG_MUXFPGA | SYS_CFG_SITE_DB1, 0);
@@ -201,7 +173,7 @@ static void __init ct_ca9x4_init(void)
201 int i; 173 int i;
202 174
203#ifdef CONFIG_CACHE_L2X0 175#ifdef CONFIG_CACHE_L2X0
204 void __iomem *l2x0_base = MMIO_P2V(CT_CA9X4_L2CC); 176 void __iomem *l2x0_base = ioremap(CT_CA9X4_L2CC, SZ_4K);
205 177
206 /* set RAM latencies to 1 cycle for this core tile. */ 178 /* set RAM latencies to 1 cycle for this core tile. */
207 writel(0, l2x0_base + L2X0_TAG_LATENCY_CTRL); 179 writel(0, l2x0_base + L2X0_TAG_LATENCY_CTRL);
@@ -217,9 +189,17 @@ static void __init ct_ca9x4_init(void)
217} 189}
218 190
219#ifdef CONFIG_SMP 191#ifdef CONFIG_SMP
192static void *ct_ca9x4_scu_base __initdata;
193
220static void __init ct_ca9x4_init_cpu_map(void) 194static void __init ct_ca9x4_init_cpu_map(void)
221{ 195{
222 int i, ncores = scu_get_core_count(MMIO_P2V(A9_MPCORE_SCU)); 196 int i, ncores;
197
198 ct_ca9x4_scu_base = ioremap(A9_MPCORE_SCU, SZ_128);
199 if (WARN_ON(!ct_ca9x4_scu_base))
200 return;
201
202 ncores = scu_get_core_count(ct_ca9x4_scu_base);
223 203
224 if (ncores > nr_cpu_ids) { 204 if (ncores > nr_cpu_ids) {
225 pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", 205 pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
@@ -235,7 +215,7 @@ static void __init ct_ca9x4_init_cpu_map(void)
235 215
236static void __init ct_ca9x4_smp_enable(unsigned int max_cpus) 216static void __init ct_ca9x4_smp_enable(unsigned int max_cpus)
237{ 217{
238 scu_enable(MMIO_P2V(A9_MPCORE_SCU)); 218 scu_enable(ct_ca9x4_scu_base);
239} 219}
240#endif 220#endif
241 221