aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-loki/common.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/arm/mach-loki/common.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'arch/arm/mach-loki/common.c')
-rw-r--r--arch/arm/mach-loki/common.c199
1 files changed, 25 insertions, 174 deletions
diff --git a/arch/arm/mach-loki/common.c b/arch/arm/mach-loki/common.c
index 818f19d7ab1f..5f02664db812 100644
--- a/arch/arm/mach-loki/common.c
+++ b/arch/arm/mach-loki/common.c
@@ -13,14 +13,16 @@
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/serial_8250.h> 14#include <linux/serial_8250.h>
15#include <linux/mbus.h> 15#include <linux/mbus.h>
16#include <linux/mv643xx_eth.h> 16#include <linux/dma-mapping.h>
17#include <asm/page.h> 17#include <asm/page.h>
18#include <asm/timex.h> 18#include <asm/timex.h>
19#include <asm/mach/map.h> 19#include <asm/mach/map.h>
20#include <asm/mach/time.h> 20#include <asm/mach/time.h>
21#include <mach/bridge-regs.h>
21#include <mach/loki.h> 22#include <mach/loki.h>
22#include <plat/orion_nand.h> 23#include <plat/orion_nand.h>
23#include <plat/time.h> 24#include <plat/time.h>
25#include <plat/common.h>
24#include "common.h" 26#include "common.h"
25 27
26/***************************************************************************** 28/*****************************************************************************
@@ -42,116 +44,28 @@ void __init loki_map_io(void)
42 44
43 45
44/***************************************************************************** 46/*****************************************************************************
45 * GE0 47 * GE00
46 ****************************************************************************/ 48 ****************************************************************************/
47struct mv643xx_eth_shared_platform_data loki_ge0_shared_data = {
48 .t_clk = LOKI_TCLK,
49 .dram = &loki_mbus_dram_info,
50};
51
52static struct resource loki_ge0_shared_resources[] = {
53 {
54 .name = "ge0 base",
55 .start = GE0_PHYS_BASE + 0x2000,
56 .end = GE0_PHYS_BASE + 0x3fff,
57 .flags = IORESOURCE_MEM,
58 },
59};
60
61static struct platform_device loki_ge0_shared = {
62 .name = MV643XX_ETH_SHARED_NAME,
63 .id = 0,
64 .dev = {
65 .platform_data = &loki_ge0_shared_data,
66 },
67 .num_resources = 1,
68 .resource = loki_ge0_shared_resources,
69};
70
71static struct resource loki_ge0_resources[] = {
72 {
73 .name = "ge0 irq",
74 .start = IRQ_LOKI_GBE_A_INT,
75 .end = IRQ_LOKI_GBE_A_INT,
76 .flags = IORESOURCE_IRQ,
77 },
78};
79
80static struct platform_device loki_ge0 = {
81 .name = MV643XX_ETH_NAME,
82 .id = 0,
83 .num_resources = 1,
84 .resource = loki_ge0_resources,
85 .dev = {
86 .coherent_dma_mask = 0xffffffff,
87 },
88};
89
90void __init loki_ge0_init(struct mv643xx_eth_platform_data *eth_data) 49void __init loki_ge0_init(struct mv643xx_eth_platform_data *eth_data)
91{ 50{
92 eth_data->shared = &loki_ge0_shared;
93 loki_ge0.dev.platform_data = eth_data;
94
95 writel(0x00079220, GE0_VIRT_BASE + 0x20b0); 51 writel(0x00079220, GE0_VIRT_BASE + 0x20b0);
96 platform_device_register(&loki_ge0_shared); 52
97 platform_device_register(&loki_ge0); 53 orion_ge00_init(eth_data, &loki_mbus_dram_info,
54 GE0_PHYS_BASE, IRQ_LOKI_GBE_A_INT,
55 0, LOKI_TCLK);
98} 56}
99 57
100 58
101/***************************************************************************** 59/*****************************************************************************
102 * GE1 60 * GE01
103 ****************************************************************************/ 61 ****************************************************************************/
104struct mv643xx_eth_shared_platform_data loki_ge1_shared_data = {
105 .t_clk = LOKI_TCLK,
106 .dram = &loki_mbus_dram_info,
107};
108
109static struct resource loki_ge1_shared_resources[] = {
110 {
111 .name = "ge1 base",
112 .start = GE1_PHYS_BASE + 0x2000,
113 .end = GE1_PHYS_BASE + 0x3fff,
114 .flags = IORESOURCE_MEM,
115 },
116};
117
118static struct platform_device loki_ge1_shared = {
119 .name = MV643XX_ETH_SHARED_NAME,
120 .id = 1,
121 .dev = {
122 .platform_data = &loki_ge1_shared_data,
123 },
124 .num_resources = 1,
125 .resource = loki_ge1_shared_resources,
126};
127
128static struct resource loki_ge1_resources[] = {
129 {
130 .name = "ge1 irq",
131 .start = IRQ_LOKI_GBE_B_INT,
132 .end = IRQ_LOKI_GBE_B_INT,
133 .flags = IORESOURCE_IRQ,
134 },
135};
136
137static struct platform_device loki_ge1 = {
138 .name = MV643XX_ETH_NAME,
139 .id = 1,
140 .num_resources = 1,
141 .resource = loki_ge1_resources,
142 .dev = {
143 .coherent_dma_mask = 0xffffffff,
144 },
145};
146
147void __init loki_ge1_init(struct mv643xx_eth_platform_data *eth_data) 62void __init loki_ge1_init(struct mv643xx_eth_platform_data *eth_data)
148{ 63{
149 eth_data->shared = &loki_ge1_shared;
150 loki_ge1.dev.platform_data = eth_data;
151
152 writel(0x00079220, GE1_VIRT_BASE + 0x20b0); 64 writel(0x00079220, GE1_VIRT_BASE + 0x20b0);
153 platform_device_register(&loki_ge1_shared); 65
154 platform_device_register(&loki_ge1); 66 orion_ge01_init(eth_data, &loki_mbus_dram_info,
67 GE1_PHYS_BASE, IRQ_LOKI_GBE_B_INT,
68 0, LOKI_TCLK);
155} 69}
156 70
157 71
@@ -186,7 +100,7 @@ static struct platform_device loki_sas = {
186 .name = "mvsas", 100 .name = "mvsas",
187 .id = 0, 101 .id = 0,
188 .dev = { 102 .dev = {
189 .coherent_dma_mask = 0xffffffff, 103 .coherent_dma_mask = DMA_BIT_MASK(32),
190 }, 104 },
191 .num_resources = ARRAY_SIZE(loki_sas_resources), 105 .num_resources = ARRAY_SIZE(loki_sas_resources),
192 .resource = loki_sas_resources, 106 .resource = loki_sas_resources,
@@ -202,97 +116,34 @@ void __init loki_sas_init(void)
202/***************************************************************************** 116/*****************************************************************************
203 * UART0 117 * UART0
204 ****************************************************************************/ 118 ****************************************************************************/
205static struct plat_serial8250_port loki_uart0_data[] = {
206 {
207 .mapbase = UART0_PHYS_BASE,
208 .membase = (char *)UART0_VIRT_BASE,
209 .irq = IRQ_LOKI_UART0,
210 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
211 .iotype = UPIO_MEM,
212 .regshift = 2,
213 .uartclk = LOKI_TCLK,
214 }, {
215 },
216};
217
218static struct resource loki_uart0_resources[] = {
219 {
220 .start = UART0_PHYS_BASE,
221 .end = UART0_PHYS_BASE + 0xff,
222 .flags = IORESOURCE_MEM,
223 }, {
224 .start = IRQ_LOKI_UART0,
225 .end = IRQ_LOKI_UART0,
226 .flags = IORESOURCE_IRQ,
227 },
228};
229
230static struct platform_device loki_uart0 = {
231 .name = "serial8250",
232 .id = 0,
233 .dev = {
234 .platform_data = loki_uart0_data,
235 },
236 .resource = loki_uart0_resources,
237 .num_resources = ARRAY_SIZE(loki_uart0_resources),
238};
239
240void __init loki_uart0_init(void) 119void __init loki_uart0_init(void)
241{ 120{
242 platform_device_register(&loki_uart0); 121 orion_uart0_init(UART0_VIRT_BASE, UART0_PHYS_BASE,
122 IRQ_LOKI_UART0, LOKI_TCLK);
243} 123}
244 124
245
246/***************************************************************************** 125/*****************************************************************************
247 * UART1 126 * UART1
248 ****************************************************************************/ 127 ****************************************************************************/
249static struct plat_serial8250_port loki_uart1_data[] = {
250 {
251 .mapbase = UART1_PHYS_BASE,
252 .membase = (char *)UART1_VIRT_BASE,
253 .irq = IRQ_LOKI_UART1,
254 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
255 .iotype = UPIO_MEM,
256 .regshift = 2,
257 .uartclk = LOKI_TCLK,
258 }, {
259 },
260};
261
262static struct resource loki_uart1_resources[] = {
263 {
264 .start = UART1_PHYS_BASE,
265 .end = UART1_PHYS_BASE + 0xff,
266 .flags = IORESOURCE_MEM,
267 }, {
268 .start = IRQ_LOKI_UART1,
269 .end = IRQ_LOKI_UART1,
270 .flags = IORESOURCE_IRQ,
271 },
272};
273
274static struct platform_device loki_uart1 = {
275 .name = "serial8250",
276 .id = 1,
277 .dev = {
278 .platform_data = loki_uart1_data,
279 },
280 .resource = loki_uart1_resources,
281 .num_resources = ARRAY_SIZE(loki_uart1_resources),
282};
283
284void __init loki_uart1_init(void) 128void __init loki_uart1_init(void)
285{ 129{
286 platform_device_register(&loki_uart1); 130 orion_uart1_init(UART1_VIRT_BASE, UART1_PHYS_BASE,
131 IRQ_LOKI_UART1, LOKI_TCLK);
287} 132}
288 133
289 134
290/***************************************************************************** 135/*****************************************************************************
291 * Time handling 136 * Time handling
292 ****************************************************************************/ 137 ****************************************************************************/
138void __init loki_init_early(void)
139{
140 orion_time_set_base(TIMER_VIRT_BASE);
141}
142
293static void loki_timer_init(void) 143static void loki_timer_init(void)
294{ 144{
295 orion_time_init(IRQ_LOKI_BRIDGE, LOKI_TCLK); 145 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
146 IRQ_LOKI_BRIDGE, LOKI_TCLK);
296} 147}
297 148
298struct sys_timer loki_timer = { 149struct sys_timer loki_timer = {