aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mv78xx0/common.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-05-23 14:28:04 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-05-23 14:28:04 -0400
commit9a55d9752d8abfc62f1ab05ccc790d22a0c8e7c0 (patch)
tree894bb6a3fb409c6ac5f0374f5a1f656918bc35cd /arch/arm/mach-mv78xx0/common.c
parentec19628d72cff8f80220b7cedba089074ac6a599 (diff)
parentdc7ad3b3d5f1cd0a0d16c05dd3ad3898979d261e (diff)
Merge branch 'devel-stable' into for-linus
Conflicts: arch/arm/Kconfig arch/arm/mach-ns9xxx/include/mach/uncompress.h
Diffstat (limited to 'arch/arm/mach-mv78xx0/common.c')
-rw-r--r--arch/arm/mach-mv78xx0/common.c570
1 files changed, 33 insertions, 537 deletions
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c
index 44fb4e55be0d..23d3980ef59d 100644
--- a/arch/arm/mach-mv78xx0/common.c
+++ b/arch/arm/mach-mv78xx0/common.c
@@ -13,8 +13,6 @@
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>
17#include <linux/mv643xx_i2c.h>
18#include <linux/ata_platform.h> 16#include <linux/ata_platform.h>
19#include <linux/ethtool.h> 17#include <linux/ethtool.h>
20#include <asm/mach/map.h> 18#include <asm/mach/map.h>
@@ -22,11 +20,12 @@
22#include <mach/mv78xx0.h> 20#include <mach/mv78xx0.h>
23#include <mach/bridge-regs.h> 21#include <mach/bridge-regs.h>
24#include <plat/cache-feroceon-l2.h> 22#include <plat/cache-feroceon-l2.h>
25#include <plat/ehci-orion.h>
26#include <plat/orion_nand.h> 23#include <plat/orion_nand.h>
27#include <plat/time.h> 24#include <plat/time.h>
25#include <plat/common.h>
28#include "common.h" 26#include "common.h"
29 27
28static int get_tclk(void);
30 29
31/***************************************************************************** 30/*****************************************************************************
32 * Common bits 31 * Common bits
@@ -168,285 +167,62 @@ void __init mv78xx0_map_io(void)
168/***************************************************************************** 167/*****************************************************************************
169 * EHCI 168 * EHCI
170 ****************************************************************************/ 169 ****************************************************************************/
171static struct orion_ehci_data mv78xx0_ehci_data = {
172 .dram = &mv78xx0_mbus_dram_info,
173 .phy_version = EHCI_PHY_NA,
174};
175
176static u64 ehci_dmamask = 0xffffffffUL;
177
178
179/*****************************************************************************
180 * EHCI0
181 ****************************************************************************/
182static struct resource mv78xx0_ehci0_resources[] = {
183 {
184 .start = USB0_PHYS_BASE,
185 .end = USB0_PHYS_BASE + 0x0fff,
186 .flags = IORESOURCE_MEM,
187 }, {
188 .start = IRQ_MV78XX0_USB_0,
189 .end = IRQ_MV78XX0_USB_0,
190 .flags = IORESOURCE_IRQ,
191 },
192};
193
194static struct platform_device mv78xx0_ehci0 = {
195 .name = "orion-ehci",
196 .id = 0,
197 .dev = {
198 .dma_mask = &ehci_dmamask,
199 .coherent_dma_mask = 0xffffffff,
200 .platform_data = &mv78xx0_ehci_data,
201 },
202 .resource = mv78xx0_ehci0_resources,
203 .num_resources = ARRAY_SIZE(mv78xx0_ehci0_resources),
204};
205
206void __init mv78xx0_ehci0_init(void) 170void __init mv78xx0_ehci0_init(void)
207{ 171{
208 platform_device_register(&mv78xx0_ehci0); 172 orion_ehci_init(&mv78xx0_mbus_dram_info,
173 USB0_PHYS_BASE, IRQ_MV78XX0_USB_0);
209} 174}
210 175
211 176
212/***************************************************************************** 177/*****************************************************************************
213 * EHCI1 178 * EHCI1
214 ****************************************************************************/ 179 ****************************************************************************/
215static struct resource mv78xx0_ehci1_resources[] = {
216 {
217 .start = USB1_PHYS_BASE,
218 .end = USB1_PHYS_BASE + 0x0fff,
219 .flags = IORESOURCE_MEM,
220 }, {
221 .start = IRQ_MV78XX0_USB_1,
222 .end = IRQ_MV78XX0_USB_1,
223 .flags = IORESOURCE_IRQ,
224 },
225};
226
227static struct platform_device mv78xx0_ehci1 = {
228 .name = "orion-ehci",
229 .id = 1,
230 .dev = {
231 .dma_mask = &ehci_dmamask,
232 .coherent_dma_mask = 0xffffffff,
233 .platform_data = &mv78xx0_ehci_data,
234 },
235 .resource = mv78xx0_ehci1_resources,
236 .num_resources = ARRAY_SIZE(mv78xx0_ehci1_resources),
237};
238
239void __init mv78xx0_ehci1_init(void) 180void __init mv78xx0_ehci1_init(void)
240{ 181{
241 platform_device_register(&mv78xx0_ehci1); 182 orion_ehci_1_init(&mv78xx0_mbus_dram_info,
183 USB1_PHYS_BASE, IRQ_MV78XX0_USB_1);
242} 184}
243 185
244 186
245/***************************************************************************** 187/*****************************************************************************
246 * EHCI2 188 * EHCI2
247 ****************************************************************************/ 189 ****************************************************************************/
248static struct resource mv78xx0_ehci2_resources[] = {
249 {
250 .start = USB2_PHYS_BASE,
251 .end = USB2_PHYS_BASE + 0x0fff,
252 .flags = IORESOURCE_MEM,
253 }, {
254 .start = IRQ_MV78XX0_USB_2,
255 .end = IRQ_MV78XX0_USB_2,
256 .flags = IORESOURCE_IRQ,
257 },
258};
259
260static struct platform_device mv78xx0_ehci2 = {
261 .name = "orion-ehci",
262 .id = 2,
263 .dev = {
264 .dma_mask = &ehci_dmamask,
265 .coherent_dma_mask = 0xffffffff,
266 .platform_data = &mv78xx0_ehci_data,
267 },
268 .resource = mv78xx0_ehci2_resources,
269 .num_resources = ARRAY_SIZE(mv78xx0_ehci2_resources),
270};
271
272void __init mv78xx0_ehci2_init(void) 190void __init mv78xx0_ehci2_init(void)
273{ 191{
274 platform_device_register(&mv78xx0_ehci2); 192 orion_ehci_2_init(&mv78xx0_mbus_dram_info,
193 USB2_PHYS_BASE, IRQ_MV78XX0_USB_2);
275} 194}
276 195
277 196
278/***************************************************************************** 197/*****************************************************************************
279 * GE00 198 * GE00
280 ****************************************************************************/ 199 ****************************************************************************/
281struct mv643xx_eth_shared_platform_data mv78xx0_ge00_shared_data = {
282 .t_clk = 0,
283 .dram = &mv78xx0_mbus_dram_info,
284};
285
286static struct resource mv78xx0_ge00_shared_resources[] = {
287 {
288 .name = "ge00 base",
289 .start = GE00_PHYS_BASE + 0x2000,
290 .end = GE00_PHYS_BASE + 0x3fff,
291 .flags = IORESOURCE_MEM,
292 }, {
293 .name = "ge err irq",
294 .start = IRQ_MV78XX0_GE_ERR,
295 .end = IRQ_MV78XX0_GE_ERR,
296 .flags = IORESOURCE_IRQ,
297 },
298};
299
300static struct platform_device mv78xx0_ge00_shared = {
301 .name = MV643XX_ETH_SHARED_NAME,
302 .id = 0,
303 .dev = {
304 .platform_data = &mv78xx0_ge00_shared_data,
305 },
306 .num_resources = ARRAY_SIZE(mv78xx0_ge00_shared_resources),
307 .resource = mv78xx0_ge00_shared_resources,
308};
309
310static struct resource mv78xx0_ge00_resources[] = {
311 {
312 .name = "ge00 irq",
313 .start = IRQ_MV78XX0_GE00_SUM,
314 .end = IRQ_MV78XX0_GE00_SUM,
315 .flags = IORESOURCE_IRQ,
316 },
317};
318
319static struct platform_device mv78xx0_ge00 = {
320 .name = MV643XX_ETH_NAME,
321 .id = 0,
322 .num_resources = 1,
323 .resource = mv78xx0_ge00_resources,
324 .dev = {
325 .coherent_dma_mask = 0xffffffff,
326 },
327};
328
329void __init mv78xx0_ge00_init(struct mv643xx_eth_platform_data *eth_data) 200void __init mv78xx0_ge00_init(struct mv643xx_eth_platform_data *eth_data)
330{ 201{
331 eth_data->shared = &mv78xx0_ge00_shared; 202 orion_ge00_init(eth_data, &mv78xx0_mbus_dram_info,
332 mv78xx0_ge00.dev.platform_data = eth_data; 203 GE00_PHYS_BASE, IRQ_MV78XX0_GE00_SUM,
333 204 IRQ_MV78XX0_GE_ERR, get_tclk());
334 platform_device_register(&mv78xx0_ge00_shared);
335 platform_device_register(&mv78xx0_ge00);
336} 205}
337 206
338 207
339/***************************************************************************** 208/*****************************************************************************
340 * GE01 209 * GE01
341 ****************************************************************************/ 210 ****************************************************************************/
342struct mv643xx_eth_shared_platform_data mv78xx0_ge01_shared_data = {
343 .t_clk = 0,
344 .dram = &mv78xx0_mbus_dram_info,
345 .shared_smi = &mv78xx0_ge00_shared,
346};
347
348static struct resource mv78xx0_ge01_shared_resources[] = {
349 {
350 .name = "ge01 base",
351 .start = GE01_PHYS_BASE + 0x2000,
352 .end = GE01_PHYS_BASE + 0x3fff,
353 .flags = IORESOURCE_MEM,
354 },
355};
356
357static struct platform_device mv78xx0_ge01_shared = {
358 .name = MV643XX_ETH_SHARED_NAME,
359 .id = 1,
360 .dev = {
361 .platform_data = &mv78xx0_ge01_shared_data,
362 },
363 .num_resources = 1,
364 .resource = mv78xx0_ge01_shared_resources,
365};
366
367static struct resource mv78xx0_ge01_resources[] = {
368 {
369 .name = "ge01 irq",
370 .start = IRQ_MV78XX0_GE01_SUM,
371 .end = IRQ_MV78XX0_GE01_SUM,
372 .flags = IORESOURCE_IRQ,
373 },
374};
375
376static struct platform_device mv78xx0_ge01 = {
377 .name = MV643XX_ETH_NAME,
378 .id = 1,
379 .num_resources = 1,
380 .resource = mv78xx0_ge01_resources,
381 .dev = {
382 .coherent_dma_mask = 0xffffffff,
383 },
384};
385
386void __init mv78xx0_ge01_init(struct mv643xx_eth_platform_data *eth_data) 211void __init mv78xx0_ge01_init(struct mv643xx_eth_platform_data *eth_data)
387{ 212{
388 eth_data->shared = &mv78xx0_ge01_shared; 213 orion_ge01_init(eth_data, &mv78xx0_mbus_dram_info,
389 mv78xx0_ge01.dev.platform_data = eth_data; 214 GE01_PHYS_BASE, IRQ_MV78XX0_GE01_SUM,
390 215 NO_IRQ, get_tclk());
391 platform_device_register(&mv78xx0_ge01_shared);
392 platform_device_register(&mv78xx0_ge01);
393} 216}
394 217
395 218
396/***************************************************************************** 219/*****************************************************************************
397 * GE10 220 * GE10
398 ****************************************************************************/ 221 ****************************************************************************/
399struct mv643xx_eth_shared_platform_data mv78xx0_ge10_shared_data = {
400 .t_clk = 0,
401 .dram = &mv78xx0_mbus_dram_info,
402 .shared_smi = &mv78xx0_ge00_shared,
403};
404
405static struct resource mv78xx0_ge10_shared_resources[] = {
406 {
407 .name = "ge10 base",
408 .start = GE10_PHYS_BASE + 0x2000,
409 .end = GE10_PHYS_BASE + 0x3fff,
410 .flags = IORESOURCE_MEM,
411 },
412};
413
414static struct platform_device mv78xx0_ge10_shared = {
415 .name = MV643XX_ETH_SHARED_NAME,
416 .id = 2,
417 .dev = {
418 .platform_data = &mv78xx0_ge10_shared_data,
419 },
420 .num_resources = 1,
421 .resource = mv78xx0_ge10_shared_resources,
422};
423
424static struct resource mv78xx0_ge10_resources[] = {
425 {
426 .name = "ge10 irq",
427 .start = IRQ_MV78XX0_GE10_SUM,
428 .end = IRQ_MV78XX0_GE10_SUM,
429 .flags = IORESOURCE_IRQ,
430 },
431};
432
433static struct platform_device mv78xx0_ge10 = {
434 .name = MV643XX_ETH_NAME,
435 .id = 2,
436 .num_resources = 1,
437 .resource = mv78xx0_ge10_resources,
438 .dev = {
439 .coherent_dma_mask = 0xffffffff,
440 },
441};
442
443void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data) 222void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data)
444{ 223{
445 u32 dev, rev; 224 u32 dev, rev;
446 225
447 eth_data->shared = &mv78xx0_ge10_shared;
448 mv78xx0_ge10.dev.platform_data = eth_data;
449
450 /* 226 /*
451 * On the Z0, ge10 and ge11 are internally connected back 227 * On the Z0, ge10 and ge11 are internally connected back
452 * to back, and not brought out. 228 * to back, and not brought out.
@@ -458,65 +234,19 @@ void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data)
458 eth_data->duplex = DUPLEX_FULL; 234 eth_data->duplex = DUPLEX_FULL;
459 } 235 }
460 236
461 platform_device_register(&mv78xx0_ge10_shared); 237 orion_ge10_init(eth_data, &mv78xx0_mbus_dram_info,
462 platform_device_register(&mv78xx0_ge10); 238 GE10_PHYS_BASE, IRQ_MV78XX0_GE10_SUM,
239 NO_IRQ, get_tclk());
463} 240}
464 241
465 242
466/***************************************************************************** 243/*****************************************************************************
467 * GE11 244 * GE11
468 ****************************************************************************/ 245 ****************************************************************************/
469struct mv643xx_eth_shared_platform_data mv78xx0_ge11_shared_data = {
470 .t_clk = 0,
471 .dram = &mv78xx0_mbus_dram_info,
472 .shared_smi = &mv78xx0_ge00_shared,
473};
474
475static struct resource mv78xx0_ge11_shared_resources[] = {
476 {
477 .name = "ge11 base",
478 .start = GE11_PHYS_BASE + 0x2000,
479 .end = GE11_PHYS_BASE + 0x3fff,
480 .flags = IORESOURCE_MEM,
481 },
482};
483
484static struct platform_device mv78xx0_ge11_shared = {
485 .name = MV643XX_ETH_SHARED_NAME,
486 .id = 3,
487 .dev = {
488 .platform_data = &mv78xx0_ge11_shared_data,
489 },
490 .num_resources = 1,
491 .resource = mv78xx0_ge11_shared_resources,
492};
493
494static struct resource mv78xx0_ge11_resources[] = {
495 {
496 .name = "ge11 irq",
497 .start = IRQ_MV78XX0_GE11_SUM,
498 .end = IRQ_MV78XX0_GE11_SUM,
499 .flags = IORESOURCE_IRQ,
500 },
501};
502
503static struct platform_device mv78xx0_ge11 = {
504 .name = MV643XX_ETH_NAME,
505 .id = 3,
506 .num_resources = 1,
507 .resource = mv78xx0_ge11_resources,
508 .dev = {
509 .coherent_dma_mask = 0xffffffff,
510 },
511};
512
513void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data) 246void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data)
514{ 247{
515 u32 dev, rev; 248 u32 dev, rev;
516 249
517 eth_data->shared = &mv78xx0_ge11_shared;
518 mv78xx0_ge11.dev.platform_data = eth_data;
519
520 /* 250 /*
521 * On the Z0, ge10 and ge11 are internally connected back 251 * On the Z0, ge10 and ge11 are internally connected back
522 * to back, and not brought out. 252 * to back, and not brought out.
@@ -528,293 +258,68 @@ void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data)
528 eth_data->duplex = DUPLEX_FULL; 258 eth_data->duplex = DUPLEX_FULL;
529 } 259 }
530 260
531 platform_device_register(&mv78xx0_ge11_shared); 261 orion_ge11_init(eth_data, &mv78xx0_mbus_dram_info,
532 platform_device_register(&mv78xx0_ge11); 262 GE11_PHYS_BASE, IRQ_MV78XX0_GE11_SUM,
263 NO_IRQ, get_tclk());
533} 264}
534 265
535/***************************************************************************** 266/*****************************************************************************
536 * I2C bus 0 267 * I2C
537 ****************************************************************************/
538
539static struct mv64xxx_i2c_pdata mv78xx0_i2c_0_pdata = {
540 .freq_m = 8, /* assumes 166 MHz TCLK */
541 .freq_n = 3,
542 .timeout = 1000, /* Default timeout of 1 second */
543};
544
545static struct resource mv78xx0_i2c_0_resources[] = {
546 {
547 .start = I2C_0_PHYS_BASE,
548 .end = I2C_0_PHYS_BASE + 0x1f,
549 .flags = IORESOURCE_MEM,
550 }, {
551 .start = IRQ_MV78XX0_I2C_0,
552 .end = IRQ_MV78XX0_I2C_0,
553 .flags = IORESOURCE_IRQ,
554 },
555};
556
557
558static struct platform_device mv78xx0_i2c_0 = {
559 .name = MV64XXX_I2C_CTLR_NAME,
560 .id = 0,
561 .num_resources = ARRAY_SIZE(mv78xx0_i2c_0_resources),
562 .resource = mv78xx0_i2c_0_resources,
563 .dev = {
564 .platform_data = &mv78xx0_i2c_0_pdata,
565 },
566};
567
568/*****************************************************************************
569 * I2C bus 1
570 ****************************************************************************/ 268 ****************************************************************************/
571
572static struct mv64xxx_i2c_pdata mv78xx0_i2c_1_pdata = {
573 .freq_m = 8, /* assumes 166 MHz TCLK */
574 .freq_n = 3,
575 .timeout = 1000, /* Default timeout of 1 second */
576};
577
578static struct resource mv78xx0_i2c_1_resources[] = {
579 {
580 .start = I2C_1_PHYS_BASE,
581 .end = I2C_1_PHYS_BASE + 0x1f,
582 .flags = IORESOURCE_MEM,
583 }, {
584 .start = IRQ_MV78XX0_I2C_1,
585 .end = IRQ_MV78XX0_I2C_1,
586 .flags = IORESOURCE_IRQ,
587 },
588};
589
590
591static struct platform_device mv78xx0_i2c_1 = {
592 .name = MV64XXX_I2C_CTLR_NAME,
593 .id = 1,
594 .num_resources = ARRAY_SIZE(mv78xx0_i2c_1_resources),
595 .resource = mv78xx0_i2c_1_resources,
596 .dev = {
597 .platform_data = &mv78xx0_i2c_1_pdata,
598 },
599};
600
601void __init mv78xx0_i2c_init(void) 269void __init mv78xx0_i2c_init(void)
602{ 270{
603 platform_device_register(&mv78xx0_i2c_0); 271 orion_i2c_init(I2C_0_PHYS_BASE, IRQ_MV78XX0_I2C_0, 8);
604 platform_device_register(&mv78xx0_i2c_1); 272 orion_i2c_1_init(I2C_1_PHYS_BASE, IRQ_MV78XX0_I2C_1, 8);
605} 273}
606 274
607/***************************************************************************** 275/*****************************************************************************
608 * SATA 276 * SATA
609 ****************************************************************************/ 277 ****************************************************************************/
610static struct resource mv78xx0_sata_resources[] = {
611 {
612 .name = "sata base",
613 .start = SATA_PHYS_BASE,
614 .end = SATA_PHYS_BASE + 0x5000 - 1,
615 .flags = IORESOURCE_MEM,
616 }, {
617 .name = "sata irq",
618 .start = IRQ_MV78XX0_SATA,
619 .end = IRQ_MV78XX0_SATA,
620 .flags = IORESOURCE_IRQ,
621 },
622};
623
624static struct platform_device mv78xx0_sata = {
625 .name = "sata_mv",
626 .id = 0,
627 .dev = {
628 .coherent_dma_mask = 0xffffffff,
629 },
630 .num_resources = ARRAY_SIZE(mv78xx0_sata_resources),
631 .resource = mv78xx0_sata_resources,
632};
633
634void __init mv78xx0_sata_init(struct mv_sata_platform_data *sata_data) 278void __init mv78xx0_sata_init(struct mv_sata_platform_data *sata_data)
635{ 279{
636 sata_data->dram = &mv78xx0_mbus_dram_info; 280 orion_sata_init(sata_data, &mv78xx0_mbus_dram_info,
637 mv78xx0_sata.dev.platform_data = sata_data; 281 SATA_PHYS_BASE, IRQ_MV78XX0_SATA);
638 platform_device_register(&mv78xx0_sata);
639} 282}
640 283
641 284
642/***************************************************************************** 285/*****************************************************************************
643 * UART0 286 * UART0
644 ****************************************************************************/ 287 ****************************************************************************/
645static struct plat_serial8250_port mv78xx0_uart0_data[] = {
646 {
647 .mapbase = UART0_PHYS_BASE,
648 .membase = (char *)UART0_VIRT_BASE,
649 .irq = IRQ_MV78XX0_UART_0,
650 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
651 .iotype = UPIO_MEM,
652 .regshift = 2,
653 .uartclk = 0,
654 }, {
655 },
656};
657
658static struct resource mv78xx0_uart0_resources[] = {
659 {
660 .start = UART0_PHYS_BASE,
661 .end = UART0_PHYS_BASE + 0xff,
662 .flags = IORESOURCE_MEM,
663 }, {
664 .start = IRQ_MV78XX0_UART_0,
665 .end = IRQ_MV78XX0_UART_0,
666 .flags = IORESOURCE_IRQ,
667 },
668};
669
670static struct platform_device mv78xx0_uart0 = {
671 .name = "serial8250",
672 .id = 0,
673 .dev = {
674 .platform_data = mv78xx0_uart0_data,
675 },
676 .resource = mv78xx0_uart0_resources,
677 .num_resources = ARRAY_SIZE(mv78xx0_uart0_resources),
678};
679
680void __init mv78xx0_uart0_init(void) 288void __init mv78xx0_uart0_init(void)
681{ 289{
682 platform_device_register(&mv78xx0_uart0); 290 orion_uart0_init(UART0_VIRT_BASE, UART0_PHYS_BASE,
291 IRQ_MV78XX0_UART_0, get_tclk());
683} 292}
684 293
685 294
686/***************************************************************************** 295/*****************************************************************************
687 * UART1 296 * UART1
688 ****************************************************************************/ 297 ****************************************************************************/
689static struct plat_serial8250_port mv78xx0_uart1_data[] = {
690 {
691 .mapbase = UART1_PHYS_BASE,
692 .membase = (char *)UART1_VIRT_BASE,
693 .irq = IRQ_MV78XX0_UART_1,
694 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
695 .iotype = UPIO_MEM,
696 .regshift = 2,
697 .uartclk = 0,
698 }, {
699 },
700};
701
702static struct resource mv78xx0_uart1_resources[] = {
703 {
704 .start = UART1_PHYS_BASE,
705 .end = UART1_PHYS_BASE + 0xff,
706 .flags = IORESOURCE_MEM,
707 }, {
708 .start = IRQ_MV78XX0_UART_1,
709 .end = IRQ_MV78XX0_UART_1,
710 .flags = IORESOURCE_IRQ,
711 },
712};
713
714static struct platform_device mv78xx0_uart1 = {
715 .name = "serial8250",
716 .id = 1,
717 .dev = {
718 .platform_data = mv78xx0_uart1_data,
719 },
720 .resource = mv78xx0_uart1_resources,
721 .num_resources = ARRAY_SIZE(mv78xx0_uart1_resources),
722};
723
724void __init mv78xx0_uart1_init(void) 298void __init mv78xx0_uart1_init(void)
725{ 299{
726 platform_device_register(&mv78xx0_uart1); 300 orion_uart1_init(UART1_VIRT_BASE, UART1_PHYS_BASE,
301 IRQ_MV78XX0_UART_1, get_tclk());
727} 302}
728 303
729 304
730/***************************************************************************** 305/*****************************************************************************
731 * UART2 306 * UART2
732 ****************************************************************************/ 307 ****************************************************************************/
733static struct plat_serial8250_port mv78xx0_uart2_data[] = {
734 {
735 .mapbase = UART2_PHYS_BASE,
736 .membase = (char *)UART2_VIRT_BASE,
737 .irq = IRQ_MV78XX0_UART_2,
738 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
739 .iotype = UPIO_MEM,
740 .regshift = 2,
741 .uartclk = 0,
742 }, {
743 },
744};
745
746static struct resource mv78xx0_uart2_resources[] = {
747 {
748 .start = UART2_PHYS_BASE,
749 .end = UART2_PHYS_BASE + 0xff,
750 .flags = IORESOURCE_MEM,
751 }, {
752 .start = IRQ_MV78XX0_UART_2,
753 .end = IRQ_MV78XX0_UART_2,
754 .flags = IORESOURCE_IRQ,
755 },
756};
757
758static struct platform_device mv78xx0_uart2 = {
759 .name = "serial8250",
760 .id = 2,
761 .dev = {
762 .platform_data = mv78xx0_uart2_data,
763 },
764 .resource = mv78xx0_uart2_resources,
765 .num_resources = ARRAY_SIZE(mv78xx0_uart2_resources),
766};
767
768void __init mv78xx0_uart2_init(void) 308void __init mv78xx0_uart2_init(void)
769{ 309{
770 platform_device_register(&mv78xx0_uart2); 310 orion_uart2_init(UART2_VIRT_BASE, UART2_PHYS_BASE,
311 IRQ_MV78XX0_UART_2, get_tclk());
771} 312}
772 313
773
774/***************************************************************************** 314/*****************************************************************************
775 * UART3 315 * UART3
776 ****************************************************************************/ 316 ****************************************************************************/
777static struct plat_serial8250_port mv78xx0_uart3_data[] = {
778 {
779 .mapbase = UART3_PHYS_BASE,
780 .membase = (char *)UART3_VIRT_BASE,
781 .irq = IRQ_MV78XX0_UART_3,
782 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
783 .iotype = UPIO_MEM,
784 .regshift = 2,
785 .uartclk = 0,
786 }, {
787 },
788};
789
790static struct resource mv78xx0_uart3_resources[] = {
791 {
792 .start = UART3_PHYS_BASE,
793 .end = UART3_PHYS_BASE + 0xff,
794 .flags = IORESOURCE_MEM,
795 }, {
796 .start = IRQ_MV78XX0_UART_3,
797 .end = IRQ_MV78XX0_UART_3,
798 .flags = IORESOURCE_IRQ,
799 },
800};
801
802static struct platform_device mv78xx0_uart3 = {
803 .name = "serial8250",
804 .id = 3,
805 .dev = {
806 .platform_data = mv78xx0_uart3_data,
807 },
808 .resource = mv78xx0_uart3_resources,
809 .num_resources = ARRAY_SIZE(mv78xx0_uart3_resources),
810};
811
812void __init mv78xx0_uart3_init(void) 317void __init mv78xx0_uart3_init(void)
813{ 318{
814 platform_device_register(&mv78xx0_uart3); 319 orion_uart3_init(UART3_VIRT_BASE, UART3_PHYS_BASE,
320 IRQ_MV78XX0_UART_3, get_tclk());
815} 321}
816 322
817
818/***************************************************************************** 323/*****************************************************************************
819 * Time handling 324 * Time handling
820 ****************************************************************************/ 325 ****************************************************************************/
@@ -895,13 +400,4 @@ void __init mv78xx0_init(void)
895#ifdef CONFIG_CACHE_FEROCEON_L2 400#ifdef CONFIG_CACHE_FEROCEON_L2
896 feroceon_l2_init(is_l2_writethrough()); 401 feroceon_l2_init(is_l2_writethrough());
897#endif 402#endif
898
899 mv78xx0_ge00_shared_data.t_clk = tclk;
900 mv78xx0_ge01_shared_data.t_clk = tclk;
901 mv78xx0_ge10_shared_data.t_clk = tclk;
902 mv78xx0_ge11_shared_data.t_clk = tclk;
903 mv78xx0_uart0_data[0].uartclk = tclk;
904 mv78xx0_uart1_data[0].uartclk = tclk;
905 mv78xx0_uart2_data[0].uartclk = tclk;
906 mv78xx0_uart3_data[0].uartclk = tclk;
907} 403}