diff options
-rw-r--r-- | arch/arm/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/core.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/ct-ca9x4.c | 212 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/include/mach/ct-ca9x4.h | 47 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/include/mach/hardware.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/include/mach/irqs.h | 6 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/include/mach/motherboard.h | 88 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/platsmp.c | 42 | ||||
-rw-r--r-- | arch/arm/mach-vexpress/v2m.c | 374 | ||||
-rw-r--r-- | arch/arm/plat-versatile/Kconfig | 2 | ||||
-rw-r--r-- | drivers/clk/versatile/Makefile | 1 | ||||
-rw-r--r-- | drivers/clk/versatile/clk-vexpress-osc.c | 7 | ||||
-rw-r--r-- | drivers/clk/versatile/clk-vexpress.c | 86 | ||||
-rw-r--r-- | drivers/misc/vexpress-syscfg.c | 60 | ||||
-rw-r--r-- | include/linux/vexpress.h | 19 |
17 files changed, 17 insertions, 943 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 89c4b5ccc68d..6c6fdb8a36e1 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -350,6 +350,7 @@ config ARCH_REALVIEW | |||
350 | select ICST | 350 | select ICST |
351 | select NEED_MACH_MEMORY_H | 351 | select NEED_MACH_MEMORY_H |
352 | select PLAT_VERSATILE | 352 | select PLAT_VERSATILE |
353 | select PLAT_VERSATILE_SCHED_CLOCK | ||
353 | help | 354 | help |
354 | This enables support for ARM Ltd RealView boards. | 355 | This enables support for ARM Ltd RealView boards. |
355 | 356 | ||
@@ -365,6 +366,7 @@ config ARCH_VERSATILE | |||
365 | select ICST | 366 | select ICST |
366 | select PLAT_VERSATILE | 367 | select PLAT_VERSATILE |
367 | select PLAT_VERSATILE_CLOCK | 368 | select PLAT_VERSATILE_CLOCK |
369 | select PLAT_VERSATILE_SCHED_CLOCK | ||
368 | select VERSATILE_FPGA_IRQ | 370 | select VERSATILE_FPGA_IRQ |
369 | help | 371 | help |
370 | This enables support for ARM Ltd Versatile board. | 372 | This enables support for ARM Ltd Versatile board. |
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig index b2cfba16c4e8..9a96bab12ef3 100644 --- a/arch/arm/mach-vexpress/Kconfig +++ b/arch/arm/mach-vexpress/Kconfig | |||
@@ -49,9 +49,6 @@ config ARCH_VEXPRESS_CORTEX_A5_A9_ERRATA | |||
49 | build a working kernel, you must also enable relevant core | 49 | build a working kernel, you must also enable relevant core |
50 | tile support or Flattened Device Tree based support options. | 50 | tile support or Flattened Device Tree based support options. |
51 | 51 | ||
52 | config ARCH_VEXPRESS_CA9X4 | ||
53 | bool "Versatile Express Cortex-A9x4 tile" | ||
54 | |||
55 | config ARCH_VEXPRESS_DCSCB | 52 | config ARCH_VEXPRESS_DCSCB |
56 | bool "Dual Cluster System Control Block (DCSCB) support" | 53 | bool "Dual Cluster System Control Block (DCSCB) support" |
57 | depends on MCPM | 54 | depends on MCPM |
diff --git a/arch/arm/mach-vexpress/Makefile b/arch/arm/mach-vexpress/Makefile index fc649bc09d0c..f5c1006dd6a1 100644 --- a/arch/arm/mach-vexpress/Makefile +++ b/arch/arm/mach-vexpress/Makefile | |||
@@ -1,11 +1,10 @@ | |||
1 | # | 1 | # |
2 | # Makefile for the linux kernel. | 2 | # Makefile for the linux kernel. |
3 | # | 3 | # |
4 | ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \ | 4 | ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := \ |
5 | -I$(srctree)/arch/arm/plat-versatile/include | 5 | -I$(srctree)/arch/arm/plat-versatile/include |
6 | 6 | ||
7 | obj-y := v2m.o | 7 | obj-y := v2m.o |
8 | obj-$(CONFIG_ARCH_VEXPRESS_CA9X4) += ct-ca9x4.o | ||
9 | obj-$(CONFIG_ARCH_VEXPRESS_DCSCB) += dcscb.o dcscb_setup.o | 8 | obj-$(CONFIG_ARCH_VEXPRESS_DCSCB) += dcscb.o dcscb_setup.o |
10 | CFLAGS_dcscb.o += -march=armv7-a | 9 | CFLAGS_dcscb.o += -march=armv7-a |
11 | CFLAGS_REMOVE_dcscb.o = -pg | 10 | CFLAGS_REMOVE_dcscb.o = -pg |
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h index 152fad91b3ae..2a11d3ac8c68 100644 --- a/arch/arm/mach-vexpress/core.h +++ b/arch/arm/mach-vexpress/core.h | |||
@@ -1,12 +1,5 @@ | |||
1 | /* 2MB large area for motherboard's peripherals static mapping */ | ||
2 | #define V2M_PERIPH 0xf8000000 | ||
3 | |||
4 | /* Tile's peripherals static mappings should start here */ | ||
5 | #define V2T_PERIPH 0xf8200000 | ||
6 | |||
7 | bool vexpress_smp_init_ops(void); | 1 | bool vexpress_smp_init_ops(void); |
8 | 2 | ||
9 | extern struct smp_operations vexpress_smp_ops; | ||
10 | extern struct smp_operations vexpress_smp_dt_ops; | 3 | extern struct smp_operations vexpress_smp_dt_ops; |
11 | 4 | ||
12 | extern void vexpress_cpu_die(unsigned int cpu); | 5 | extern void vexpress_cpu_die(unsigned int cpu); |
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c deleted file mode 100644 index 27bea049380a..000000000000 --- a/arch/arm/mach-vexpress/ct-ca9x4.c +++ /dev/null | |||
@@ -1,212 +0,0 @@ | |||
1 | /* | ||
2 | * Versatile Express Core Tile Cortex A9x4 Support | ||
3 | */ | ||
4 | #include <linux/init.h> | ||
5 | #include <linux/gfp.h> | ||
6 | #include <linux/device.h> | ||
7 | #include <linux/dma-mapping.h> | ||
8 | #include <linux/platform_device.h> | ||
9 | #include <linux/amba/bus.h> | ||
10 | #include <linux/amba/clcd.h> | ||
11 | #include <linux/platform_data/video-clcd-versatile.h> | ||
12 | #include <linux/clkdev.h> | ||
13 | #include <linux/vexpress.h> | ||
14 | #include <linux/irqchip/arm-gic.h> | ||
15 | |||
16 | #include <asm/hardware/arm_timer.h> | ||
17 | #include <asm/hardware/cache-l2x0.h> | ||
18 | #include <asm/smp_scu.h> | ||
19 | #include <asm/smp_twd.h> | ||
20 | |||
21 | #include <mach/ct-ca9x4.h> | ||
22 | |||
23 | #include <asm/hardware/timer-sp.h> | ||
24 | |||
25 | #include <asm/mach/map.h> | ||
26 | #include <asm/mach/time.h> | ||
27 | |||
28 | #include "core.h" | ||
29 | |||
30 | #include <mach/motherboard.h> | ||
31 | #include <mach/irqs.h> | ||
32 | |||
33 | static struct map_desc ct_ca9x4_io_desc[] __initdata = { | ||
34 | { | ||
35 | .virtual = V2T_PERIPH, | ||
36 | .pfn = __phys_to_pfn(CT_CA9X4_MPIC), | ||
37 | .length = SZ_8K, | ||
38 | .type = MT_DEVICE, | ||
39 | }, | ||
40 | }; | ||
41 | |||
42 | static void __init ct_ca9x4_map_io(void) | ||
43 | { | ||
44 | iotable_init(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc)); | ||
45 | } | ||
46 | |||
47 | static void __init ca9x4_l2_init(void) | ||
48 | { | ||
49 | #ifdef CONFIG_CACHE_L2X0 | ||
50 | void __iomem *l2x0_base = ioremap(CT_CA9X4_L2CC, SZ_4K); | ||
51 | |||
52 | if (l2x0_base) { | ||
53 | /* set RAM latencies to 1 cycle for this core tile. */ | ||
54 | writel(0, l2x0_base + L310_TAG_LATENCY_CTRL); | ||
55 | writel(0, l2x0_base + L310_DATA_LATENCY_CTRL); | ||
56 | |||
57 | l2x0_init(l2x0_base, 0x00400000, 0xfe0fffff); | ||
58 | } else { | ||
59 | pr_err("L2C: unable to map L2 cache controller\n"); | ||
60 | } | ||
61 | #endif | ||
62 | } | ||
63 | |||
64 | #ifdef CONFIG_HAVE_ARM_TWD | ||
65 | static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, A9_MPCORE_TWD, IRQ_LOCALTIMER); | ||
66 | |||
67 | static void __init ca9x4_twd_init(void) | ||
68 | { | ||
69 | int err = twd_local_timer_register(&twd_local_timer); | ||
70 | if (err) | ||
71 | pr_err("twd_local_timer_register failed %d\n", err); | ||
72 | } | ||
73 | #else | ||
74 | #define ca9x4_twd_init() do {} while(0) | ||
75 | #endif | ||
76 | |||
77 | static void __init ct_ca9x4_init_irq(void) | ||
78 | { | ||
79 | gic_init(0, 29, ioremap(A9_MPCORE_GIC_DIST, SZ_4K), | ||
80 | ioremap(A9_MPCORE_GIC_CPU, SZ_256)); | ||
81 | ca9x4_twd_init(); | ||
82 | ca9x4_l2_init(); | ||
83 | } | ||
84 | |||
85 | static int ct_ca9x4_clcd_setup(struct clcd_fb *fb) | ||
86 | { | ||
87 | unsigned long framesize = 1024 * 768 * 2; | ||
88 | |||
89 | fb->panel = versatile_clcd_get_panel("XVGA"); | ||
90 | if (!fb->panel) | ||
91 | return -EINVAL; | ||
92 | |||
93 | return versatile_clcd_setup_dma(fb, framesize); | ||
94 | } | ||
95 | |||
96 | static struct clcd_board ct_ca9x4_clcd_data = { | ||
97 | .name = "CT-CA9X4", | ||
98 | .caps = CLCD_CAP_5551 | CLCD_CAP_565, | ||
99 | .check = clcdfb_check, | ||
100 | .decode = clcdfb_decode, | ||
101 | .setup = ct_ca9x4_clcd_setup, | ||
102 | .mmap = versatile_clcd_mmap_dma, | ||
103 | .remove = versatile_clcd_remove_dma, | ||
104 | }; | ||
105 | |||
106 | static AMBA_AHB_DEVICE(clcd, "ct:clcd", 0, CT_CA9X4_CLCDC, IRQ_CT_CA9X4_CLCDC, &ct_ca9x4_clcd_data); | ||
107 | static AMBA_APB_DEVICE(dmc, "ct:dmc", 0, CT_CA9X4_DMC, IRQ_CT_CA9X4_DMC, NULL); | ||
108 | static AMBA_APB_DEVICE(smc, "ct:smc", 0, CT_CA9X4_SMC, IRQ_CT_CA9X4_SMC, NULL); | ||
109 | static AMBA_APB_DEVICE(gpio, "ct:gpio", 0, CT_CA9X4_GPIO, IRQ_CT_CA9X4_GPIO, NULL); | ||
110 | |||
111 | static struct amba_device *ct_ca9x4_amba_devs[] __initdata = { | ||
112 | &clcd_device, | ||
113 | &dmc_device, | ||
114 | &smc_device, | ||
115 | &gpio_device, | ||
116 | }; | ||
117 | |||
118 | static struct resource pmu_resources[] = { | ||
119 | [0] = { | ||
120 | .start = IRQ_CT_CA9X4_PMU_CPU0, | ||
121 | .end = IRQ_CT_CA9X4_PMU_CPU0, | ||
122 | .flags = IORESOURCE_IRQ, | ||
123 | }, | ||
124 | [1] = { | ||
125 | .start = IRQ_CT_CA9X4_PMU_CPU1, | ||
126 | .end = IRQ_CT_CA9X4_PMU_CPU1, | ||
127 | .flags = IORESOURCE_IRQ, | ||
128 | }, | ||
129 | [2] = { | ||
130 | .start = IRQ_CT_CA9X4_PMU_CPU2, | ||
131 | .end = IRQ_CT_CA9X4_PMU_CPU2, | ||
132 | .flags = IORESOURCE_IRQ, | ||
133 | }, | ||
134 | [3] = { | ||
135 | .start = IRQ_CT_CA9X4_PMU_CPU3, | ||
136 | .end = IRQ_CT_CA9X4_PMU_CPU3, | ||
137 | .flags = IORESOURCE_IRQ, | ||
138 | }, | ||
139 | }; | ||
140 | |||
141 | static struct platform_device pmu_device = { | ||
142 | .name = "arm-pmu", | ||
143 | .id = -1, | ||
144 | .num_resources = ARRAY_SIZE(pmu_resources), | ||
145 | .resource = pmu_resources, | ||
146 | }; | ||
147 | |||
148 | static struct clk_lookup osc1_lookup = { | ||
149 | .dev_id = "ct:clcd", | ||
150 | }; | ||
151 | |||
152 | static struct platform_device osc1_device = { | ||
153 | .name = "vexpress-osc", | ||
154 | .id = 1, | ||
155 | .num_resources = 1, | ||
156 | .resource = (struct resource []) { | ||
157 | VEXPRESS_RES_FUNC(0xf, 1), | ||
158 | }, | ||
159 | .dev.platform_data = &osc1_lookup, | ||
160 | }; | ||
161 | |||
162 | static void __init ct_ca9x4_init(void) | ||
163 | { | ||
164 | int i; | ||
165 | |||
166 | for (i = 0; i < ARRAY_SIZE(ct_ca9x4_amba_devs); i++) | ||
167 | amba_device_register(ct_ca9x4_amba_devs[i], &iomem_resource); | ||
168 | |||
169 | platform_device_register(&pmu_device); | ||
170 | vexpress_syscfg_device_register(&osc1_device); | ||
171 | } | ||
172 | |||
173 | #ifdef CONFIG_SMP | ||
174 | static void *ct_ca9x4_scu_base __initdata; | ||
175 | |||
176 | static void __init ct_ca9x4_init_cpu_map(void) | ||
177 | { | ||
178 | int i, ncores; | ||
179 | |||
180 | ct_ca9x4_scu_base = ioremap(A9_MPCORE_SCU, SZ_128); | ||
181 | if (WARN_ON(!ct_ca9x4_scu_base)) | ||
182 | return; | ||
183 | |||
184 | ncores = scu_get_core_count(ct_ca9x4_scu_base); | ||
185 | |||
186 | if (ncores > nr_cpu_ids) { | ||
187 | pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", | ||
188 | ncores, nr_cpu_ids); | ||
189 | ncores = nr_cpu_ids; | ||
190 | } | ||
191 | |||
192 | for (i = 0; i < ncores; ++i) | ||
193 | set_cpu_possible(i, true); | ||
194 | } | ||
195 | |||
196 | static void __init ct_ca9x4_smp_enable(unsigned int max_cpus) | ||
197 | { | ||
198 | scu_enable(ct_ca9x4_scu_base); | ||
199 | } | ||
200 | #endif | ||
201 | |||
202 | struct ct_desc ct_ca9x4_desc __initdata = { | ||
203 | .id = V2M_CT_ID_CA9, | ||
204 | .name = "CA9x4", | ||
205 | .map_io = ct_ca9x4_map_io, | ||
206 | .init_irq = ct_ca9x4_init_irq, | ||
207 | .init_tile = ct_ca9x4_init, | ||
208 | #ifdef CONFIG_SMP | ||
209 | .init_cpu_map = ct_ca9x4_init_cpu_map, | ||
210 | .smp_enable = ct_ca9x4_smp_enable, | ||
211 | #endif | ||
212 | }; | ||
diff --git a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h deleted file mode 100644 index 84acf8439d4b..000000000000 --- a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | #ifndef __MACH_CT_CA9X4_H | ||
2 | #define __MACH_CT_CA9X4_H | ||
3 | |||
4 | /* | ||
5 | * Physical base addresses | ||
6 | */ | ||
7 | #define CT_CA9X4_CLCDC (0x10020000) | ||
8 | #define CT_CA9X4_AXIRAM (0x10060000) | ||
9 | #define CT_CA9X4_DMC (0x100e0000) | ||
10 | #define CT_CA9X4_SMC (0x100e1000) | ||
11 | #define CT_CA9X4_SCC (0x100e2000) | ||
12 | #define CT_CA9X4_SP804_TIMER (0x100e4000) | ||
13 | #define CT_CA9X4_SP805_WDT (0x100e5000) | ||
14 | #define CT_CA9X4_TZPC (0x100e6000) | ||
15 | #define CT_CA9X4_GPIO (0x100e8000) | ||
16 | #define CT_CA9X4_FASTAXI (0x100e9000) | ||
17 | #define CT_CA9X4_SLOWAXI (0x100ea000) | ||
18 | #define CT_CA9X4_TZASC (0x100ec000) | ||
19 | #define CT_CA9X4_CORESIGHT (0x10200000) | ||
20 | #define CT_CA9X4_MPIC (0x1e000000) | ||
21 | #define CT_CA9X4_SYSTIMER (0x1e004000) | ||
22 | #define CT_CA9X4_SYSWDT (0x1e007000) | ||
23 | #define CT_CA9X4_L2CC (0x1e00a000) | ||
24 | |||
25 | #define A9_MPCORE_SCU (CT_CA9X4_MPIC + 0x0000) | ||
26 | #define A9_MPCORE_GIC_CPU (CT_CA9X4_MPIC + 0x0100) | ||
27 | #define A9_MPCORE_GIT (CT_CA9X4_MPIC + 0x0200) | ||
28 | #define A9_MPCORE_TWD (CT_CA9X4_MPIC + 0x0600) | ||
29 | #define A9_MPCORE_GIC_DIST (CT_CA9X4_MPIC + 0x1000) | ||
30 | |||
31 | /* | ||
32 | * Interrupts. Those in {} are for AMBA devices | ||
33 | */ | ||
34 | #define IRQ_CT_CA9X4_CLCDC { 76 } | ||
35 | #define IRQ_CT_CA9X4_DMC { 0 } | ||
36 | #define IRQ_CT_CA9X4_SMC { 77, 78 } | ||
37 | #define IRQ_CT_CA9X4_TIMER0 80 | ||
38 | #define IRQ_CT_CA9X4_TIMER1 81 | ||
39 | #define IRQ_CT_CA9X4_GPIO { 82 } | ||
40 | #define IRQ_CT_CA9X4_PMU_CPU0 92 | ||
41 | #define IRQ_CT_CA9X4_PMU_CPU1 93 | ||
42 | #define IRQ_CT_CA9X4_PMU_CPU2 94 | ||
43 | #define IRQ_CT_CA9X4_PMU_CPU3 95 | ||
44 | |||
45 | extern struct ct_desc ct_ca9x4_desc; | ||
46 | |||
47 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/hardware.h b/arch/arm/mach-vexpress/include/mach/hardware.h deleted file mode 100644 index 40a8c178f10d..000000000000 --- a/arch/arm/mach-vexpress/include/mach/hardware.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | /* empty */ | ||
diff --git a/arch/arm/mach-vexpress/include/mach/irqs.h b/arch/arm/mach-vexpress/include/mach/irqs.h deleted file mode 100644 index f8f7f782eb55..000000000000 --- a/arch/arm/mach-vexpress/include/mach/irqs.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #define IRQ_LOCALTIMER 29 | ||
2 | #define IRQ_LOCALWDOG 30 | ||
3 | |||
4 | #ifndef CONFIG_SPARSE_IRQ | ||
5 | #define NR_IRQS 256 | ||
6 | #endif | ||
diff --git a/arch/arm/mach-vexpress/include/mach/motherboard.h b/arch/arm/mach-vexpress/include/mach/motherboard.h deleted file mode 100644 index 68abc8b72781..000000000000 --- a/arch/arm/mach-vexpress/include/mach/motherboard.h +++ /dev/null | |||
@@ -1,88 +0,0 @@ | |||
1 | #ifndef __MACH_MOTHERBOARD_H | ||
2 | #define __MACH_MOTHERBOARD_H | ||
3 | |||
4 | /* | ||
5 | * Physical addresses, offset from V2M_PA_CS0-3 | ||
6 | */ | ||
7 | #define V2M_NOR0 (V2M_PA_CS0) | ||
8 | #define V2M_NOR1 (V2M_PA_CS1) | ||
9 | #define V2M_SRAM (V2M_PA_CS2) | ||
10 | #define V2M_VIDEO_SRAM (V2M_PA_CS3 + 0x00000000) | ||
11 | #define V2M_LAN9118 (V2M_PA_CS3 + 0x02000000) | ||
12 | #define V2M_ISP1761 (V2M_PA_CS3 + 0x03000000) | ||
13 | |||
14 | /* | ||
15 | * Physical addresses, offset from V2M_PA_CS7 | ||
16 | */ | ||
17 | #define V2M_SYSREGS (V2M_PA_CS7 + 0x00000000) | ||
18 | #define V2M_SYSCTL (V2M_PA_CS7 + 0x00001000) | ||
19 | #define V2M_SERIAL_BUS_PCI (V2M_PA_CS7 + 0x00002000) | ||
20 | |||
21 | #define V2M_AACI (V2M_PA_CS7 + 0x00004000) | ||
22 | #define V2M_MMCI (V2M_PA_CS7 + 0x00005000) | ||
23 | #define V2M_KMI0 (V2M_PA_CS7 + 0x00006000) | ||
24 | #define V2M_KMI1 (V2M_PA_CS7 + 0x00007000) | ||
25 | |||
26 | #define V2M_UART0 (V2M_PA_CS7 + 0x00009000) | ||
27 | #define V2M_UART1 (V2M_PA_CS7 + 0x0000a000) | ||
28 | #define V2M_UART2 (V2M_PA_CS7 + 0x0000b000) | ||
29 | #define V2M_UART3 (V2M_PA_CS7 + 0x0000c000) | ||
30 | |||
31 | #define V2M_WDT (V2M_PA_CS7 + 0x0000f000) | ||
32 | |||
33 | #define V2M_TIMER01 (V2M_PA_CS7 + 0x00011000) | ||
34 | #define V2M_TIMER23 (V2M_PA_CS7 + 0x00012000) | ||
35 | |||
36 | #define V2M_SERIAL_BUS_DVI (V2M_PA_CS7 + 0x00016000) | ||
37 | #define V2M_RTC (V2M_PA_CS7 + 0x00017000) | ||
38 | |||
39 | #define V2M_CF (V2M_PA_CS7 + 0x0001a000) | ||
40 | #define V2M_CLCD (V2M_PA_CS7 + 0x0001f000) | ||
41 | |||
42 | |||
43 | /* | ||
44 | * Interrupts. Those in {} are for AMBA devices | ||
45 | */ | ||
46 | #define IRQ_V2M_WDT { (32 + 0) } | ||
47 | #define IRQ_V2M_TIMER0 (32 + 2) | ||
48 | #define IRQ_V2M_TIMER1 (32 + 2) | ||
49 | #define IRQ_V2M_TIMER2 (32 + 3) | ||
50 | #define IRQ_V2M_TIMER3 (32 + 3) | ||
51 | #define IRQ_V2M_RTC { (32 + 4) } | ||
52 | #define IRQ_V2M_UART0 { (32 + 5) } | ||
53 | #define IRQ_V2M_UART1 { (32 + 6) } | ||
54 | #define IRQ_V2M_UART2 { (32 + 7) } | ||
55 | #define IRQ_V2M_UART3 { (32 + 8) } | ||
56 | #define IRQ_V2M_MMCI { (32 + 9), (32 + 10) } | ||
57 | #define IRQ_V2M_AACI { (32 + 11) } | ||
58 | #define IRQ_V2M_KMI0 { (32 + 12) } | ||
59 | #define IRQ_V2M_KMI1 { (32 + 13) } | ||
60 | #define IRQ_V2M_CLCD { (32 + 14) } | ||
61 | #define IRQ_V2M_LAN9118 (32 + 15) | ||
62 | #define IRQ_V2M_ISP1761 (32 + 16) | ||
63 | #define IRQ_V2M_PCIE (32 + 17) | ||
64 | |||
65 | |||
66 | /* | ||
67 | * Core tile IDs | ||
68 | */ | ||
69 | #define V2M_CT_ID_CA9 0x0c000191 | ||
70 | #define V2M_CT_ID_UNSUPPORTED 0xff000191 | ||
71 | #define V2M_CT_ID_MASK 0xff000fff | ||
72 | |||
73 | struct ct_desc { | ||
74 | u32 id; | ||
75 | const char *name; | ||
76 | void (*map_io)(void); | ||
77 | void (*init_early)(void); | ||
78 | void (*init_irq)(void); | ||
79 | void (*init_tile)(void); | ||
80 | #ifdef CONFIG_SMP | ||
81 | void (*init_cpu_map)(void); | ||
82 | void (*smp_enable)(unsigned int); | ||
83 | #endif | ||
84 | }; | ||
85 | |||
86 | extern struct ct_desc *ct_desc; | ||
87 | |||
88 | #endif | ||
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c index a1f3804fd5a5..83188cf1875d 100644 --- a/arch/arm/mach-vexpress/platsmp.c +++ b/arch/arm/mach-vexpress/platsmp.c | |||
@@ -19,48 +19,10 @@ | |||
19 | #include <asm/smp_scu.h> | 19 | #include <asm/smp_scu.h> |
20 | #include <asm/mach/map.h> | 20 | #include <asm/mach/map.h> |
21 | 21 | ||
22 | #include <mach/motherboard.h> | ||
23 | |||
24 | #include <plat/platsmp.h> | 22 | #include <plat/platsmp.h> |
25 | 23 | ||
26 | #include "core.h" | 24 | #include "core.h" |
27 | 25 | ||
28 | /* | ||
29 | * Initialise the CPU possible map early - this describes the CPUs | ||
30 | * which may be present or become present in the system. | ||
31 | */ | ||
32 | static void __init vexpress_smp_init_cpus(void) | ||
33 | { | ||
34 | ct_desc->init_cpu_map(); | ||
35 | } | ||
36 | |||
37 | static void __init vexpress_smp_prepare_cpus(unsigned int max_cpus) | ||
38 | { | ||
39 | /* | ||
40 | * Initialise the present map, which describes the set of CPUs | ||
41 | * actually populated at the present time. | ||
42 | */ | ||
43 | ct_desc->smp_enable(max_cpus); | ||
44 | |||
45 | /* | ||
46 | * Write the address of secondary startup into the | ||
47 | * system-wide flags register. The boot monitor waits | ||
48 | * until it receives a soft interrupt, and then the | ||
49 | * secondary CPU branches to this address. | ||
50 | */ | ||
51 | vexpress_flags_set(virt_to_phys(versatile_secondary_startup)); | ||
52 | } | ||
53 | |||
54 | struct smp_operations __initdata vexpress_smp_ops = { | ||
55 | .smp_init_cpus = vexpress_smp_init_cpus, | ||
56 | .smp_prepare_cpus = vexpress_smp_prepare_cpus, | ||
57 | .smp_secondary_init = versatile_secondary_init, | ||
58 | .smp_boot_secondary = versatile_boot_secondary, | ||
59 | #ifdef CONFIG_HOTPLUG_CPU | ||
60 | .cpu_die = vexpress_cpu_die, | ||
61 | #endif | ||
62 | }; | ||
63 | |||
64 | bool __init vexpress_smp_init_ops(void) | 26 | bool __init vexpress_smp_init_ops(void) |
65 | { | 27 | { |
66 | #ifdef CONFIG_MCPM | 28 | #ifdef CONFIG_MCPM |
@@ -79,8 +41,6 @@ bool __init vexpress_smp_init_ops(void) | |||
79 | return false; | 41 | return false; |
80 | } | 42 | } |
81 | 43 | ||
82 | #if defined(CONFIG_OF) | ||
83 | |||
84 | static const struct of_device_id vexpress_smp_dt_scu_match[] __initconst = { | 44 | static const struct of_device_id vexpress_smp_dt_scu_match[] __initconst = { |
85 | { .compatible = "arm,cortex-a5-scu", }, | 45 | { .compatible = "arm,cortex-a5-scu", }, |
86 | { .compatible = "arm,cortex-a9-scu", }, | 46 | { .compatible = "arm,cortex-a9-scu", }, |
@@ -112,5 +72,3 @@ struct smp_operations __initdata vexpress_smp_dt_ops = { | |||
112 | .cpu_die = vexpress_cpu_die, | 72 | .cpu_die = vexpress_cpu_die, |
113 | #endif | 73 | #endif |
114 | }; | 74 | }; |
115 | |||
116 | #endif | ||
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index 6ff681a24ba7..a0400f4cca89 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c | |||
@@ -1,380 +1,7 @@ | |||
1 | /* | ||
2 | * Versatile Express V2M Motherboard Support | ||
3 | */ | ||
4 | #include <linux/device.h> | ||
5 | #include <linux/amba/bus.h> | ||
6 | #include <linux/amba/mmci.h> | ||
7 | #include <linux/io.h> | ||
8 | #include <linux/smp.h> | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/of_address.h> | ||
11 | #include <linux/of_fdt.h> | ||
12 | #include <linux/of_irq.h> | ||
13 | #include <linux/of_platform.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | #include <linux/ata_platform.h> | ||
16 | #include <linux/smsc911x.h> | ||
17 | #include <linux/spinlock.h> | ||
18 | #include <linux/usb/isp1760.h> | ||
19 | #include <linux/mtd/physmap.h> | ||
20 | #include <linux/regulator/fixed.h> | ||
21 | #include <linux/regulator/machine.h> | ||
22 | #include <linux/vexpress.h> | ||
23 | #include <linux/clkdev.h> | ||
24 | |||
25 | #include <asm/mach-types.h> | ||
26 | #include <asm/sizes.h> | ||
27 | #include <asm/mach/arch.h> | 1 | #include <asm/mach/arch.h> |
28 | #include <asm/mach/map.h> | ||
29 | #include <asm/mach/time.h> | ||
30 | #include <asm/hardware/arm_timer.h> | ||
31 | #include <asm/hardware/cache-l2x0.h> | ||
32 | #include <asm/hardware/timer-sp.h> | ||
33 | |||
34 | #include <mach/ct-ca9x4.h> | ||
35 | #include <mach/motherboard.h> | ||
36 | |||
37 | #include <plat/sched_clock.h> | ||
38 | #include <plat/platsmp.h> | ||
39 | 2 | ||
40 | #include "core.h" | 3 | #include "core.h" |
41 | 4 | ||
42 | #define V2M_PA_CS0 0x40000000 | ||
43 | #define V2M_PA_CS1 0x44000000 | ||
44 | #define V2M_PA_CS2 0x48000000 | ||
45 | #define V2M_PA_CS3 0x4c000000 | ||
46 | #define V2M_PA_CS7 0x10000000 | ||
47 | |||
48 | static struct map_desc v2m_io_desc[] __initdata = { | ||
49 | { | ||
50 | .virtual = V2M_PERIPH, | ||
51 | .pfn = __phys_to_pfn(V2M_PA_CS7), | ||
52 | .length = SZ_128K, | ||
53 | .type = MT_DEVICE, | ||
54 | }, | ||
55 | }; | ||
56 | |||
57 | static void __init v2m_sp804_init(void __iomem *base, unsigned int irq) | ||
58 | { | ||
59 | if (WARN_ON(!base || irq == NO_IRQ)) | ||
60 | return; | ||
61 | |||
62 | sp804_clocksource_init(base + TIMER_2_BASE, "v2m-timer1"); | ||
63 | sp804_clockevents_init(base + TIMER_1_BASE, irq, "v2m-timer0"); | ||
64 | } | ||
65 | |||
66 | |||
67 | static struct resource v2m_pcie_i2c_resource = { | ||
68 | .start = V2M_SERIAL_BUS_PCI, | ||
69 | .end = V2M_SERIAL_BUS_PCI + SZ_4K - 1, | ||
70 | .flags = IORESOURCE_MEM, | ||
71 | }; | ||
72 | |||
73 | static struct platform_device v2m_pcie_i2c_device = { | ||
74 | .name = "versatile-i2c", | ||
75 | .id = 0, | ||
76 | .num_resources = 1, | ||
77 | .resource = &v2m_pcie_i2c_resource, | ||
78 | }; | ||
79 | |||
80 | static struct resource v2m_ddc_i2c_resource = { | ||
81 | .start = V2M_SERIAL_BUS_DVI, | ||
82 | .end = V2M_SERIAL_BUS_DVI + SZ_4K - 1, | ||
83 | .flags = IORESOURCE_MEM, | ||
84 | }; | ||
85 | |||
86 | static struct platform_device v2m_ddc_i2c_device = { | ||
87 | .name = "versatile-i2c", | ||
88 | .id = 1, | ||
89 | .num_resources = 1, | ||
90 | .resource = &v2m_ddc_i2c_resource, | ||
91 | }; | ||
92 | |||
93 | static struct resource v2m_eth_resources[] = { | ||
94 | { | ||
95 | .start = V2M_LAN9118, | ||
96 | .end = V2M_LAN9118 + SZ_64K - 1, | ||
97 | .flags = IORESOURCE_MEM, | ||
98 | }, { | ||
99 | .start = IRQ_V2M_LAN9118, | ||
100 | .end = IRQ_V2M_LAN9118, | ||
101 | .flags = IORESOURCE_IRQ, | ||
102 | }, | ||
103 | }; | ||
104 | |||
105 | static struct smsc911x_platform_config v2m_eth_config = { | ||
106 | .flags = SMSC911X_USE_32BIT, | ||
107 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, | ||
108 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, | ||
109 | .phy_interface = PHY_INTERFACE_MODE_MII, | ||
110 | }; | ||
111 | |||
112 | static struct platform_device v2m_eth_device = { | ||
113 | .name = "smsc911x", | ||
114 | .id = -1, | ||
115 | .resource = v2m_eth_resources, | ||
116 | .num_resources = ARRAY_SIZE(v2m_eth_resources), | ||
117 | .dev.platform_data = &v2m_eth_config, | ||
118 | }; | ||
119 | |||
120 | static struct regulator_consumer_supply v2m_eth_supplies[] = { | ||
121 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | ||
122 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | ||
123 | }; | ||
124 | |||
125 | static struct resource v2m_usb_resources[] = { | ||
126 | { | ||
127 | .start = V2M_ISP1761, | ||
128 | .end = V2M_ISP1761 + SZ_128K - 1, | ||
129 | .flags = IORESOURCE_MEM, | ||
130 | }, { | ||
131 | .start = IRQ_V2M_ISP1761, | ||
132 | .end = IRQ_V2M_ISP1761, | ||
133 | .flags = IORESOURCE_IRQ, | ||
134 | }, | ||
135 | }; | ||
136 | |||
137 | static struct isp1760_platform_data v2m_usb_config = { | ||
138 | .is_isp1761 = true, | ||
139 | .bus_width_16 = false, | ||
140 | .port1_otg = true, | ||
141 | .analog_oc = false, | ||
142 | .dack_polarity_high = false, | ||
143 | .dreq_polarity_high = false, | ||
144 | }; | ||
145 | |||
146 | static struct platform_device v2m_usb_device = { | ||
147 | .name = "isp1760", | ||
148 | .id = -1, | ||
149 | .resource = v2m_usb_resources, | ||
150 | .num_resources = ARRAY_SIZE(v2m_usb_resources), | ||
151 | .dev.platform_data = &v2m_usb_config, | ||
152 | }; | ||
153 | |||
154 | static struct physmap_flash_data v2m_flash_data = { | ||
155 | .width = 4, | ||
156 | }; | ||
157 | |||
158 | static struct resource v2m_flash_resources[] = { | ||
159 | { | ||
160 | .start = V2M_NOR0, | ||
161 | .end = V2M_NOR0 + SZ_64M - 1, | ||
162 | .flags = IORESOURCE_MEM, | ||
163 | }, { | ||
164 | .start = V2M_NOR1, | ||
165 | .end = V2M_NOR1 + SZ_64M - 1, | ||
166 | .flags = IORESOURCE_MEM, | ||
167 | }, | ||
168 | }; | ||
169 | |||
170 | static struct platform_device v2m_flash_device = { | ||
171 | .name = "physmap-flash", | ||
172 | .id = -1, | ||
173 | .resource = v2m_flash_resources, | ||
174 | .num_resources = ARRAY_SIZE(v2m_flash_resources), | ||
175 | .dev.platform_data = &v2m_flash_data, | ||
176 | }; | ||
177 | |||
178 | static struct pata_platform_info v2m_pata_data = { | ||
179 | .ioport_shift = 2, | ||
180 | }; | ||
181 | |||
182 | static struct resource v2m_pata_resources[] = { | ||
183 | { | ||
184 | .start = V2M_CF, | ||
185 | .end = V2M_CF + 0xff, | ||
186 | .flags = IORESOURCE_MEM, | ||
187 | }, { | ||
188 | .start = V2M_CF + 0x100, | ||
189 | .end = V2M_CF + SZ_4K - 1, | ||
190 | .flags = IORESOURCE_MEM, | ||
191 | }, | ||
192 | }; | ||
193 | |||
194 | static struct platform_device v2m_cf_device = { | ||
195 | .name = "pata_platform", | ||
196 | .id = -1, | ||
197 | .resource = v2m_pata_resources, | ||
198 | .num_resources = ARRAY_SIZE(v2m_pata_resources), | ||
199 | .dev.platform_data = &v2m_pata_data, | ||
200 | }; | ||
201 | |||
202 | static struct mmci_platform_data v2m_mmci_data = { | ||
203 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | ||
204 | .status = vexpress_get_mci_cardin, | ||
205 | .gpio_cd = -1, | ||
206 | .gpio_wp = -1, | ||
207 | }; | ||
208 | |||
209 | static struct resource v2m_sysreg_resources[] = { | ||
210 | { | ||
211 | .start = V2M_SYSREGS, | ||
212 | .end = V2M_SYSREGS + 0xfff, | ||
213 | .flags = IORESOURCE_MEM, | ||
214 | }, | ||
215 | }; | ||
216 | |||
217 | static struct platform_device v2m_sysreg_device = { | ||
218 | .name = "vexpress-sysreg", | ||
219 | .id = -1, | ||
220 | .resource = v2m_sysreg_resources, | ||
221 | .num_resources = ARRAY_SIZE(v2m_sysreg_resources), | ||
222 | }; | ||
223 | |||
224 | static struct platform_device v2m_muxfpga_device = { | ||
225 | .name = "vexpress-muxfpga", | ||
226 | .id = 0, | ||
227 | .num_resources = 1, | ||
228 | .resource = (struct resource []) { | ||
229 | VEXPRESS_RES_FUNC(0, 7), | ||
230 | } | ||
231 | }; | ||
232 | |||
233 | static struct platform_device v2m_shutdown_device = { | ||
234 | .name = "vexpress-shutdown", | ||
235 | .id = 0, | ||
236 | .num_resources = 1, | ||
237 | .resource = (struct resource []) { | ||
238 | VEXPRESS_RES_FUNC(0, 8), | ||
239 | } | ||
240 | }; | ||
241 | |||
242 | static struct platform_device v2m_reboot_device = { | ||
243 | .name = "vexpress-reboot", | ||
244 | .id = 0, | ||
245 | .num_resources = 1, | ||
246 | .resource = (struct resource []) { | ||
247 | VEXPRESS_RES_FUNC(0, 9), | ||
248 | } | ||
249 | }; | ||
250 | |||
251 | static struct platform_device v2m_dvimode_device = { | ||
252 | .name = "vexpress-dvimode", | ||
253 | .id = 0, | ||
254 | .num_resources = 1, | ||
255 | .resource = (struct resource []) { | ||
256 | VEXPRESS_RES_FUNC(0, 11), | ||
257 | } | ||
258 | }; | ||
259 | |||
260 | static AMBA_APB_DEVICE(aaci, "mb:aaci", 0, V2M_AACI, IRQ_V2M_AACI, NULL); | ||
261 | static AMBA_APB_DEVICE(mmci, "mb:mmci", 0, V2M_MMCI, IRQ_V2M_MMCI, &v2m_mmci_data); | ||
262 | static AMBA_APB_DEVICE(kmi0, "mb:kmi0", 0, V2M_KMI0, IRQ_V2M_KMI0, NULL); | ||
263 | static AMBA_APB_DEVICE(kmi1, "mb:kmi1", 0, V2M_KMI1, IRQ_V2M_KMI1, NULL); | ||
264 | static AMBA_APB_DEVICE(uart0, "mb:uart0", 0, V2M_UART0, IRQ_V2M_UART0, NULL); | ||
265 | static AMBA_APB_DEVICE(uart1, "mb:uart1", 0, V2M_UART1, IRQ_V2M_UART1, NULL); | ||
266 | static AMBA_APB_DEVICE(uart2, "mb:uart2", 0, V2M_UART2, IRQ_V2M_UART2, NULL); | ||
267 | static AMBA_APB_DEVICE(uart3, "mb:uart3", 0, V2M_UART3, IRQ_V2M_UART3, NULL); | ||
268 | static AMBA_APB_DEVICE(wdt, "mb:wdt", 0, V2M_WDT, IRQ_V2M_WDT, NULL); | ||
269 | static AMBA_APB_DEVICE(rtc, "mb:rtc", 0, V2M_RTC, IRQ_V2M_RTC, NULL); | ||
270 | |||
271 | static struct amba_device *v2m_amba_devs[] __initdata = { | ||
272 | &aaci_device, | ||
273 | &mmci_device, | ||
274 | &kmi0_device, | ||
275 | &kmi1_device, | ||
276 | &uart0_device, | ||
277 | &uart1_device, | ||
278 | &uart2_device, | ||
279 | &uart3_device, | ||
280 | &wdt_device, | ||
281 | &rtc_device, | ||
282 | }; | ||
283 | |||
284 | static void __init v2m_timer_init(void) | ||
285 | { | ||
286 | vexpress_clk_init(ioremap(V2M_SYSCTL, SZ_4K)); | ||
287 | v2m_sp804_init(ioremap(V2M_TIMER01, SZ_4K), IRQ_V2M_TIMER0); | ||
288 | } | ||
289 | |||
290 | static void __init v2m_init_early(void) | ||
291 | { | ||
292 | if (ct_desc->init_early) | ||
293 | ct_desc->init_early(); | ||
294 | versatile_sched_clock_init(vexpress_get_24mhz_clock_base(), 24000000); | ||
295 | } | ||
296 | |||
297 | struct ct_desc *ct_desc; | ||
298 | |||
299 | static struct ct_desc *ct_descs[] __initdata = { | ||
300 | #ifdef CONFIG_ARCH_VEXPRESS_CA9X4 | ||
301 | &ct_ca9x4_desc, | ||
302 | #endif | ||
303 | }; | ||
304 | |||
305 | static void __init v2m_populate_ct_desc(void) | ||
306 | { | ||
307 | int i; | ||
308 | u32 current_tile_id; | ||
309 | |||
310 | ct_desc = NULL; | ||
311 | current_tile_id = vexpress_get_procid(VEXPRESS_SITE_MASTER) | ||
312 | & V2M_CT_ID_MASK; | ||
313 | |||
314 | for (i = 0; i < ARRAY_SIZE(ct_descs) && !ct_desc; ++i) | ||
315 | if (ct_descs[i]->id == current_tile_id) | ||
316 | ct_desc = ct_descs[i]; | ||
317 | |||
318 | if (!ct_desc) | ||
319 | panic("vexpress: this kernel does not support core tile ID 0x%08x when booting via ATAGs.\n" | ||
320 | "You may need a device tree blob or a different kernel to boot on this board.\n", | ||
321 | current_tile_id); | ||
322 | } | ||
323 | |||
324 | static void __init v2m_map_io(void) | ||
325 | { | ||
326 | iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc)); | ||
327 | vexpress_sysreg_early_init(ioremap(V2M_SYSREGS, SZ_4K)); | ||
328 | v2m_populate_ct_desc(); | ||
329 | ct_desc->map_io(); | ||
330 | } | ||
331 | |||
332 | static void __init v2m_init_irq(void) | ||
333 | { | ||
334 | ct_desc->init_irq(); | ||
335 | } | ||
336 | |||
337 | static void __init v2m_init(void) | ||
338 | { | ||
339 | int i; | ||
340 | |||
341 | regulator_register_fixed(0, v2m_eth_supplies, | ||
342 | ARRAY_SIZE(v2m_eth_supplies)); | ||
343 | |||
344 | platform_device_register(&v2m_sysreg_device); | ||
345 | platform_device_register(&v2m_pcie_i2c_device); | ||
346 | platform_device_register(&v2m_ddc_i2c_device); | ||
347 | platform_device_register(&v2m_flash_device); | ||
348 | platform_device_register(&v2m_cf_device); | ||
349 | platform_device_register(&v2m_eth_device); | ||
350 | platform_device_register(&v2m_usb_device); | ||
351 | |||
352 | for (i = 0; i < ARRAY_SIZE(v2m_amba_devs); i++) | ||
353 | amba_device_register(v2m_amba_devs[i], &iomem_resource); | ||
354 | |||
355 | vexpress_syscfg_device_register(&v2m_muxfpga_device); | ||
356 | vexpress_syscfg_device_register(&v2m_shutdown_device); | ||
357 | vexpress_syscfg_device_register(&v2m_reboot_device); | ||
358 | vexpress_syscfg_device_register(&v2m_dvimode_device); | ||
359 | |||
360 | ct_desc->init_tile(); | ||
361 | } | ||
362 | |||
363 | MACHINE_START(VEXPRESS, "ARM-Versatile Express") | ||
364 | .atag_offset = 0x100, | ||
365 | .smp = smp_ops(vexpress_smp_ops), | ||
366 | .map_io = v2m_map_io, | ||
367 | .init_early = v2m_init_early, | ||
368 | .init_irq = v2m_init_irq, | ||
369 | .init_time = v2m_timer_init, | ||
370 | .init_machine = v2m_init, | ||
371 | MACHINE_END | ||
372 | |||
373 | static void __init v2m_dt_init(void) | ||
374 | { | ||
375 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
376 | } | ||
377 | |||
378 | static const char * const v2m_dt_match[] __initconst = { | 5 | static const char * const v2m_dt_match[] __initconst = { |
379 | "arm,vexpress", | 6 | "arm,vexpress", |
380 | NULL, | 7 | NULL, |
@@ -386,5 +13,4 @@ DT_MACHINE_START(VEXPRESS_DT, "ARM-Versatile Express") | |||
386 | .l2c_aux_mask = 0xfe0fffff, | 13 | .l2c_aux_mask = 0xfe0fffff, |
387 | .smp = smp_ops(vexpress_smp_dt_ops), | 14 | .smp = smp_ops(vexpress_smp_dt_ops), |
388 | .smp_init = smp_init_ops(vexpress_smp_init_ops), | 15 | .smp_init = smp_init_ops(vexpress_smp_init_ops), |
389 | .init_machine = v2m_dt_init, | ||
390 | MACHINE_END | 16 | MACHINE_END |
diff --git a/arch/arm/plat-versatile/Kconfig b/arch/arm/plat-versatile/Kconfig index a301ca2c7d00..49b8ef91584a 100644 --- a/arch/arm/plat-versatile/Kconfig +++ b/arch/arm/plat-versatile/Kconfig | |||
@@ -4,6 +4,6 @@ config PLAT_VERSATILE_CLOCK | |||
4 | bool | 4 | bool |
5 | 5 | ||
6 | config PLAT_VERSATILE_SCHED_CLOCK | 6 | config PLAT_VERSATILE_SCHED_CLOCK |
7 | def_bool y | 7 | bool |
8 | 8 | ||
9 | endif | 9 | endif |
diff --git a/drivers/clk/versatile/Makefile b/drivers/clk/versatile/Makefile index 162e519cb0f9..8ff03744fe98 100644 --- a/drivers/clk/versatile/Makefile +++ b/drivers/clk/versatile/Makefile | |||
@@ -2,6 +2,5 @@ | |||
2 | obj-$(CONFIG_ICST) += clk-icst.o clk-versatile.o | 2 | obj-$(CONFIG_ICST) += clk-icst.o clk-versatile.o |
3 | obj-$(CONFIG_INTEGRATOR_IMPD1) += clk-impd1.o | 3 | obj-$(CONFIG_INTEGRATOR_IMPD1) += clk-impd1.o |
4 | obj-$(CONFIG_ARCH_REALVIEW) += clk-realview.o | 4 | obj-$(CONFIG_ARCH_REALVIEW) += clk-realview.o |
5 | obj-$(CONFIG_ARCH_VEXPRESS) += clk-vexpress.o | ||
6 | obj-$(CONFIG_CLK_SP810) += clk-sp810.o | 5 | obj-$(CONFIG_CLK_SP810) += clk-sp810.o |
7 | obj-$(CONFIG_CLK_VEXPRESS_OSC) += clk-vexpress-osc.o | 6 | obj-$(CONFIG_CLK_VEXPRESS_OSC) += clk-vexpress-osc.o |
diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c index 529a59c0fbfa..765f1e0eeeb2 100644 --- a/drivers/clk/versatile/clk-vexpress-osc.c +++ b/drivers/clk/versatile/clk-vexpress-osc.c | |||
@@ -70,7 +70,6 @@ static struct clk_ops vexpress_osc_ops = { | |||
70 | 70 | ||
71 | static int vexpress_osc_probe(struct platform_device *pdev) | 71 | static int vexpress_osc_probe(struct platform_device *pdev) |
72 | { | 72 | { |
73 | struct clk_lookup *cl = pdev->dev.platform_data; /* Non-DT lookup */ | ||
74 | struct clk_init_data init; | 73 | struct clk_init_data init; |
75 | struct vexpress_osc *osc; | 74 | struct vexpress_osc *osc; |
76 | struct clk *clk; | 75 | struct clk *clk; |
@@ -106,12 +105,6 @@ static int vexpress_osc_probe(struct platform_device *pdev) | |||
106 | 105 | ||
107 | of_clk_add_provider(pdev->dev.of_node, of_clk_src_simple_get, clk); | 106 | of_clk_add_provider(pdev->dev.of_node, of_clk_src_simple_get, clk); |
108 | 107 | ||
109 | /* Only happens for non-DT cases */ | ||
110 | if (cl) { | ||
111 | cl->clk = clk; | ||
112 | clkdev_add(cl); | ||
113 | } | ||
114 | |||
115 | dev_dbg(&pdev->dev, "Registered clock '%s'\n", init.name); | 108 | dev_dbg(&pdev->dev, "Registered clock '%s'\n", init.name); |
116 | 109 | ||
117 | return 0; | 110 | return 0; |
diff --git a/drivers/clk/versatile/clk-vexpress.c b/drivers/clk/versatile/clk-vexpress.c deleted file mode 100644 index 2d5e1b4820e0..000000000000 --- a/drivers/clk/versatile/clk-vexpress.c +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License version 2 as | ||
4 | * published by the Free Software Foundation. | ||
5 | * | ||
6 | * This program is distributed in the hope that it will be useful, | ||
7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
9 | * GNU General Public License for more details. | ||
10 | * | ||
11 | * Copyright (C) 2012 ARM Limited | ||
12 | */ | ||
13 | |||
14 | #include <linux/amba/sp810.h> | ||
15 | #include <linux/clkdev.h> | ||
16 | #include <linux/clk-provider.h> | ||
17 | #include <linux/err.h> | ||
18 | #include <linux/vexpress.h> | ||
19 | |||
20 | static struct clk *vexpress_sp810_timerclken[4]; | ||
21 | static DEFINE_SPINLOCK(vexpress_sp810_lock); | ||
22 | |||
23 | static void __init vexpress_sp810_init(void __iomem *base) | ||
24 | { | ||
25 | int i; | ||
26 | |||
27 | if (WARN_ON(!base)) | ||
28 | return; | ||
29 | |||
30 | for (i = 0; i < ARRAY_SIZE(vexpress_sp810_timerclken); i++) { | ||
31 | char name[12]; | ||
32 | const char *parents[] = { | ||
33 | "v2m:refclk32khz", /* REFCLK */ | ||
34 | "v2m:refclk1mhz" /* TIMCLK */ | ||
35 | }; | ||
36 | |||
37 | snprintf(name, ARRAY_SIZE(name), "timerclken%d", i); | ||
38 | |||
39 | vexpress_sp810_timerclken[i] = clk_register_mux(NULL, name, | ||
40 | parents, 2, CLK_SET_RATE_NO_REPARENT, | ||
41 | base + SCCTRL, SCCTRL_TIMERENnSEL_SHIFT(i), 1, | ||
42 | 0, &vexpress_sp810_lock); | ||
43 | |||
44 | if (WARN_ON(IS_ERR(vexpress_sp810_timerclken[i]))) | ||
45 | break; | ||
46 | } | ||
47 | } | ||
48 | |||
49 | |||
50 | static const char * const vexpress_clk_24mhz_periphs[] __initconst = { | ||
51 | "mb:uart0", "mb:uart1", "mb:uart2", "mb:uart3", | ||
52 | "mb:mmci", "mb:kmi0", "mb:kmi1" | ||
53 | }; | ||
54 | |||
55 | void __init vexpress_clk_init(void __iomem *sp810_base) | ||
56 | { | ||
57 | struct clk *clk; | ||
58 | int i; | ||
59 | |||
60 | clk = clk_register_fixed_rate(NULL, "dummy_apb_pclk", NULL, | ||
61 | CLK_IS_ROOT, 0); | ||
62 | WARN_ON(clk_register_clkdev(clk, "apb_pclk", NULL)); | ||
63 | |||
64 | clk = clk_register_fixed_rate(NULL, "v2m:clk_24mhz", NULL, | ||
65 | CLK_IS_ROOT, 24000000); | ||
66 | for (i = 0; i < ARRAY_SIZE(vexpress_clk_24mhz_periphs); i++) | ||
67 | WARN_ON(clk_register_clkdev(clk, NULL, | ||
68 | vexpress_clk_24mhz_periphs[i])); | ||
69 | |||
70 | clk = clk_register_fixed_rate(NULL, "v2m:refclk32khz", NULL, | ||
71 | CLK_IS_ROOT, 32768); | ||
72 | WARN_ON(clk_register_clkdev(clk, NULL, "v2m:wdt")); | ||
73 | |||
74 | clk = clk_register_fixed_rate(NULL, "v2m:refclk1mhz", NULL, | ||
75 | CLK_IS_ROOT, 1000000); | ||
76 | |||
77 | vexpress_sp810_init(sp810_base); | ||
78 | |||
79 | for (i = 0; i < ARRAY_SIZE(vexpress_sp810_timerclken); i++) | ||
80 | WARN_ON(clk_set_parent(vexpress_sp810_timerclken[i], clk)); | ||
81 | |||
82 | WARN_ON(clk_register_clkdev(vexpress_sp810_timerclken[0], | ||
83 | "v2m-timer0", "sp804")); | ||
84 | WARN_ON(clk_register_clkdev(vexpress_sp810_timerclken[1], | ||
85 | "v2m-timer1", "sp804")); | ||
86 | } | ||
diff --git a/drivers/misc/vexpress-syscfg.c b/drivers/misc/vexpress-syscfg.c index b3a812384a6f..c344483fa7d6 100644 --- a/drivers/misc/vexpress-syscfg.c +++ b/drivers/misc/vexpress-syscfg.c | |||
@@ -145,7 +145,7 @@ static struct regmap_config vexpress_syscfg_regmap_config = { | |||
145 | static struct regmap *vexpress_syscfg_regmap_init(struct device *dev, | 145 | static struct regmap *vexpress_syscfg_regmap_init(struct device *dev, |
146 | void *context) | 146 | void *context) |
147 | { | 147 | { |
148 | struct platform_device *pdev = to_platform_device(dev); | 148 | int err; |
149 | struct vexpress_syscfg *syscfg = context; | 149 | struct vexpress_syscfg *syscfg = context; |
150 | struct vexpress_syscfg_func *func; | 150 | struct vexpress_syscfg_func *func; |
151 | struct property *prop; | 151 | struct property *prop; |
@@ -155,32 +155,18 @@ static struct regmap *vexpress_syscfg_regmap_init(struct device *dev, | |||
155 | u32 site, position, dcc; | 155 | u32 site, position, dcc; |
156 | int i; | 156 | int i; |
157 | 157 | ||
158 | if (dev->of_node) { | 158 | err = vexpress_config_get_topo(dev->of_node, &site, |
159 | int err = vexpress_config_get_topo(dev->of_node, &site, | ||
160 | &position, &dcc); | 159 | &position, &dcc); |
160 | if (err) | ||
161 | return ERR_PTR(err); | ||
161 | 162 | ||
162 | if (err) | 163 | prop = of_find_property(dev->of_node, |
163 | return ERR_PTR(err); | 164 | "arm,vexpress-sysreg,func", NULL); |
164 | 165 | if (!prop) | |
165 | prop = of_find_property(dev->of_node, | 166 | return ERR_PTR(-EINVAL); |
166 | "arm,vexpress-sysreg,func", NULL); | 167 | |
167 | if (!prop) | 168 | num = prop->length / sizeof(u32) / 2; |
168 | return ERR_PTR(-EINVAL); | 169 | val = prop->value; |
169 | |||
170 | num = prop->length / sizeof(u32) / 2; | ||
171 | val = prop->value; | ||
172 | } else { | ||
173 | if (pdev->num_resources != 1 || | ||
174 | pdev->resource[0].flags != IORESOURCE_BUS) | ||
175 | return ERR_PTR(-EFAULT); | ||
176 | |||
177 | site = pdev->resource[0].start; | ||
178 | if (site == VEXPRESS_SITE_MASTER) | ||
179 | site = vexpress_config_get_master(); | ||
180 | position = 0; | ||
181 | dcc = 0; | ||
182 | num = 1; | ||
183 | } | ||
184 | 170 | ||
185 | /* | 171 | /* |
186 | * "arm,vexpress-energy" function used to be described | 172 | * "arm,vexpress-energy" function used to be described |
@@ -207,13 +193,8 @@ static struct regmap *vexpress_syscfg_regmap_init(struct device *dev, | |||
207 | for (i = 0; i < num; i++) { | 193 | for (i = 0; i < num; i++) { |
208 | u32 function, device; | 194 | u32 function, device; |
209 | 195 | ||
210 | if (dev->of_node) { | 196 | function = be32_to_cpup(val++); |
211 | function = be32_to_cpup(val++); | 197 | device = be32_to_cpup(val++); |
212 | device = be32_to_cpup(val++); | ||
213 | } else { | ||
214 | function = pdev->resource[0].end; | ||
215 | device = pdev->id; | ||
216 | } | ||
217 | 198 | ||
218 | dev_dbg(dev, "func %p: %u/%u/%u/%u/%u\n", | 199 | dev_dbg(dev, "func %p: %u/%u/%u/%u/%u\n", |
219 | func, site, position, dcc, | 200 | func, site, position, dcc, |
@@ -265,17 +246,6 @@ static struct vexpress_config_bridge_ops vexpress_syscfg_bridge_ops = { | |||
265 | }; | 246 | }; |
266 | 247 | ||
267 | 248 | ||
268 | /* Non-DT hack, to be gone... */ | ||
269 | static struct device *vexpress_syscfg_bridge; | ||
270 | |||
271 | int vexpress_syscfg_device_register(struct platform_device *pdev) | ||
272 | { | ||
273 | pdev->dev.parent = vexpress_syscfg_bridge; | ||
274 | |||
275 | return platform_device_register(pdev); | ||
276 | } | ||
277 | |||
278 | |||
279 | static int vexpress_syscfg_probe(struct platform_device *pdev) | 249 | static int vexpress_syscfg_probe(struct platform_device *pdev) |
280 | { | 250 | { |
281 | struct vexpress_syscfg *syscfg; | 251 | struct vexpress_syscfg *syscfg; |
@@ -303,10 +273,6 @@ static int vexpress_syscfg_probe(struct platform_device *pdev) | |||
303 | if (IS_ERR(bridge)) | 273 | if (IS_ERR(bridge)) |
304 | return PTR_ERR(bridge); | 274 | return PTR_ERR(bridge); |
305 | 275 | ||
306 | /* Non-DT case */ | ||
307 | if (!pdev->dev.of_node) | ||
308 | vexpress_syscfg_bridge = bridge; | ||
309 | |||
310 | return 0; | 276 | return 0; |
311 | } | 277 | } |
312 | 278 | ||
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h index a4c9547aae64..f8e76e08ebe4 100644 --- a/include/linux/vexpress.h +++ b/include/linux/vexpress.h | |||
@@ -15,8 +15,6 @@ | |||
15 | #define _LINUX_VEXPRESS_H | 15 | #define _LINUX_VEXPRESS_H |
16 | 16 | ||
17 | #include <linux/device.h> | 17 | #include <linux/device.h> |
18 | #include <linux/platform_device.h> | ||
19 | #include <linux/reboot.h> | ||
20 | #include <linux/regmap.h> | 18 | #include <linux/regmap.h> |
21 | 19 | ||
22 | #define VEXPRESS_SITE_MB 0 | 20 | #define VEXPRESS_SITE_MB 0 |
@@ -24,13 +22,6 @@ | |||
24 | #define VEXPRESS_SITE_DB2 2 | 22 | #define VEXPRESS_SITE_DB2 2 |
25 | #define VEXPRESS_SITE_MASTER 0xf | 23 | #define VEXPRESS_SITE_MASTER 0xf |
26 | 24 | ||
27 | #define VEXPRESS_RES_FUNC(_site, _func) \ | ||
28 | { \ | ||
29 | .start = (_site), \ | ||
30 | .end = (_func), \ | ||
31 | .flags = IORESOURCE_BUS, \ | ||
32 | } | ||
33 | |||
34 | /* Config infrastructure */ | 25 | /* Config infrastructure */ |
35 | 26 | ||
36 | void vexpress_config_set_master(u32 site); | 27 | void vexpress_config_set_master(u32 site); |
@@ -58,16 +49,6 @@ struct regmap *devm_regmap_init_vexpress_config(struct device *dev); | |||
58 | 49 | ||
59 | /* Platform control */ | 50 | /* Platform control */ |
60 | 51 | ||
61 | unsigned int vexpress_get_mci_cardin(struct device *dev); | ||
62 | u32 vexpress_get_procid(int site); | ||
63 | void *vexpress_get_24mhz_clock_base(void); | ||
64 | void vexpress_flags_set(u32 data); | 52 | void vexpress_flags_set(u32 data); |
65 | 53 | ||
66 | void vexpress_sysreg_early_init(void __iomem *base); | ||
67 | int vexpress_syscfg_device_register(struct platform_device *pdev); | ||
68 | |||
69 | /* Clocks */ | ||
70 | |||
71 | void vexpress_clk_init(void __iomem *sp810_base); | ||
72 | |||
73 | #endif | 54 | #endif |