spi-topcliff-pch: add recovery processing in case wait-event timeout
[zen-stable.git] / arch / arm / plat-orion / common.c
blob089899a7db724e7d5d09cc5d7bfa568e484a64a4
1 /*
2 * arch/arm/plat-orion/common.c
4 * Marvell Orion SoC common setup code used by multiple mach-/common.c
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <linux/dma-mapping.h>
15 #include <linux/serial_8250.h>
16 #include <linux/ata_platform.h>
17 #include <linux/mv643xx_eth.h>
18 #include <linux/mv643xx_i2c.h>
19 #include <net/dsa.h>
20 #include <linux/spi/orion_spi.h>
21 #include <plat/orion_wdt.h>
22 #include <plat/mv_xor.h>
23 #include <plat/ehci-orion.h>
25 /* Fill in the resources structure and link it into the platform
26 device structure. There is always a memory region, and nearly
27 always an interrupt.*/
28 static void fill_resources(struct platform_device *device,
29 struct resource *resources,
30 resource_size_t mapbase,
31 resource_size_t size,
32 unsigned int irq)
34 device->resource = resources;
35 device->num_resources = 1;
36 resources[0].flags = IORESOURCE_MEM;
37 resources[0].start = mapbase;
38 resources[0].end = mapbase + size;
40 if (irq != NO_IRQ) {
41 device->num_resources++;
42 resources[1].flags = IORESOURCE_IRQ;
43 resources[1].start = irq;
44 resources[1].end = irq;
48 /*****************************************************************************
49 * UART
50 ****************************************************************************/
51 static void __init uart_complete(
52 struct platform_device *orion_uart,
53 struct plat_serial8250_port *data,
54 struct resource *resources,
55 unsigned int membase,
56 resource_size_t mapbase,
57 unsigned int irq,
58 unsigned int uartclk)
60 data->mapbase = mapbase;
61 data->membase = (void __iomem *)membase;
62 data->irq = irq;
63 data->uartclk = uartclk;
64 orion_uart->dev.platform_data = data;
66 fill_resources(orion_uart, resources, mapbase, 0xff, irq);
67 platform_device_register(orion_uart);
70 /*****************************************************************************
71 * UART0
72 ****************************************************************************/
73 static struct plat_serial8250_port orion_uart0_data[] = {
75 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
76 .iotype = UPIO_MEM,
77 .regshift = 2,
78 }, {
82 static struct resource orion_uart0_resources[2];
84 static struct platform_device orion_uart0 = {
85 .name = "serial8250",
86 .id = PLAT8250_DEV_PLATFORM,
89 void __init orion_uart0_init(unsigned int membase,
90 resource_size_t mapbase,
91 unsigned int irq,
92 unsigned int uartclk)
94 uart_complete(&orion_uart0, orion_uart0_data, orion_uart0_resources,
95 membase, mapbase, irq, uartclk);
98 /*****************************************************************************
99 * UART1
100 ****************************************************************************/
101 static struct plat_serial8250_port orion_uart1_data[] = {
103 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
104 .iotype = UPIO_MEM,
105 .regshift = 2,
106 }, {
110 static struct resource orion_uart1_resources[2];
112 static struct platform_device orion_uart1 = {
113 .name = "serial8250",
114 .id = PLAT8250_DEV_PLATFORM1,
117 void __init orion_uart1_init(unsigned int membase,
118 resource_size_t mapbase,
119 unsigned int irq,
120 unsigned int uartclk)
122 uart_complete(&orion_uart1, orion_uart1_data, orion_uart1_resources,
123 membase, mapbase, irq, uartclk);
126 /*****************************************************************************
127 * UART2
128 ****************************************************************************/
129 static struct plat_serial8250_port orion_uart2_data[] = {
131 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
132 .iotype = UPIO_MEM,
133 .regshift = 2,
134 }, {
138 static struct resource orion_uart2_resources[2];
140 static struct platform_device orion_uart2 = {
141 .name = "serial8250",
142 .id = PLAT8250_DEV_PLATFORM2,
145 void __init orion_uart2_init(unsigned int membase,
146 resource_size_t mapbase,
147 unsigned int irq,
148 unsigned int uartclk)
150 uart_complete(&orion_uart2, orion_uart2_data, orion_uart2_resources,
151 membase, mapbase, irq, uartclk);
154 /*****************************************************************************
155 * UART3
156 ****************************************************************************/
157 static struct plat_serial8250_port orion_uart3_data[] = {
159 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
160 .iotype = UPIO_MEM,
161 .regshift = 2,
162 }, {
166 static struct resource orion_uart3_resources[2];
168 static struct platform_device orion_uart3 = {
169 .name = "serial8250",
170 .id = 3,
173 void __init orion_uart3_init(unsigned int membase,
174 resource_size_t mapbase,
175 unsigned int irq,
176 unsigned int uartclk)
178 uart_complete(&orion_uart3, orion_uart3_data, orion_uart3_resources,
179 membase, mapbase, irq, uartclk);
182 /*****************************************************************************
183 * SoC RTC
184 ****************************************************************************/
185 static struct resource orion_rtc_resource[2];
187 void __init orion_rtc_init(unsigned long mapbase,
188 unsigned long irq)
190 orion_rtc_resource[0].start = mapbase;
191 orion_rtc_resource[0].end = mapbase + SZ_32 - 1;
192 orion_rtc_resource[0].flags = IORESOURCE_MEM;
193 orion_rtc_resource[1].start = irq;
194 orion_rtc_resource[1].end = irq;
195 orion_rtc_resource[1].flags = IORESOURCE_IRQ;
197 platform_device_register_simple("rtc-mv", -1, orion_rtc_resource, 2);
200 /*****************************************************************************
201 * GE
202 ****************************************************************************/
203 static __init void ge_complete(
204 struct mv643xx_eth_shared_platform_data *orion_ge_shared_data,
205 int tclk,
206 struct resource *orion_ge_resource, unsigned long irq,
207 struct platform_device *orion_ge_shared,
208 struct mv643xx_eth_platform_data *eth_data,
209 struct platform_device *orion_ge)
211 orion_ge_shared_data->t_clk = tclk;
212 orion_ge_resource->start = irq;
213 orion_ge_resource->end = irq;
214 eth_data->shared = orion_ge_shared;
215 orion_ge->dev.platform_data = eth_data;
217 platform_device_register(orion_ge_shared);
218 platform_device_register(orion_ge);
221 /*****************************************************************************
222 * GE00
223 ****************************************************************************/
224 struct mv643xx_eth_shared_platform_data orion_ge00_shared_data;
226 static struct resource orion_ge00_shared_resources[] = {
228 .name = "ge00 base",
229 }, {
230 .name = "ge00 err irq",
234 static struct platform_device orion_ge00_shared = {
235 .name = MV643XX_ETH_SHARED_NAME,
236 .id = 0,
237 .dev = {
238 .platform_data = &orion_ge00_shared_data,
242 static struct resource orion_ge00_resources[] = {
244 .name = "ge00 irq",
245 .flags = IORESOURCE_IRQ,
249 static struct platform_device orion_ge00 = {
250 .name = MV643XX_ETH_NAME,
251 .id = 0,
252 .num_resources = 1,
253 .resource = orion_ge00_resources,
254 .dev = {
255 .coherent_dma_mask = DMA_BIT_MASK(32),
259 void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data,
260 unsigned long mapbase,
261 unsigned long irq,
262 unsigned long irq_err,
263 int tclk)
265 fill_resources(&orion_ge00_shared, orion_ge00_shared_resources,
266 mapbase + 0x2000, SZ_16K - 1, irq_err);
267 ge_complete(&orion_ge00_shared_data, tclk,
268 orion_ge00_resources, irq, &orion_ge00_shared,
269 eth_data, &orion_ge00);
272 /*****************************************************************************
273 * GE01
274 ****************************************************************************/
275 struct mv643xx_eth_shared_platform_data orion_ge01_shared_data = {
276 .shared_smi = &orion_ge00_shared,
279 static struct resource orion_ge01_shared_resources[] = {
281 .name = "ge01 base",
282 }, {
283 .name = "ge01 err irq",
287 static struct platform_device orion_ge01_shared = {
288 .name = MV643XX_ETH_SHARED_NAME,
289 .id = 1,
290 .dev = {
291 .platform_data = &orion_ge01_shared_data,
295 static struct resource orion_ge01_resources[] = {
297 .name = "ge01 irq",
298 .flags = IORESOURCE_IRQ,
302 static struct platform_device orion_ge01 = {
303 .name = MV643XX_ETH_NAME,
304 .id = 1,
305 .num_resources = 1,
306 .resource = orion_ge01_resources,
307 .dev = {
308 .coherent_dma_mask = DMA_BIT_MASK(32),
312 void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data,
313 unsigned long mapbase,
314 unsigned long irq,
315 unsigned long irq_err,
316 int tclk)
318 fill_resources(&orion_ge01_shared, orion_ge01_shared_resources,
319 mapbase + 0x2000, SZ_16K - 1, irq_err);
320 ge_complete(&orion_ge01_shared_data, tclk,
321 orion_ge01_resources, irq, &orion_ge01_shared,
322 eth_data, &orion_ge01);
325 /*****************************************************************************
326 * GE10
327 ****************************************************************************/
328 struct mv643xx_eth_shared_platform_data orion_ge10_shared_data = {
329 .shared_smi = &orion_ge00_shared,
332 static struct resource orion_ge10_shared_resources[] = {
334 .name = "ge10 base",
335 }, {
336 .name = "ge10 err irq",
340 static struct platform_device orion_ge10_shared = {
341 .name = MV643XX_ETH_SHARED_NAME,
342 .id = 1,
343 .dev = {
344 .platform_data = &orion_ge10_shared_data,
348 static struct resource orion_ge10_resources[] = {
350 .name = "ge10 irq",
351 .flags = IORESOURCE_IRQ,
355 static struct platform_device orion_ge10 = {
356 .name = MV643XX_ETH_NAME,
357 .id = 1,
358 .num_resources = 2,
359 .resource = orion_ge10_resources,
360 .dev = {
361 .coherent_dma_mask = DMA_BIT_MASK(32),
365 void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data,
366 unsigned long mapbase,
367 unsigned long irq,
368 unsigned long irq_err,
369 int tclk)
371 fill_resources(&orion_ge10_shared, orion_ge10_shared_resources,
372 mapbase + 0x2000, SZ_16K - 1, irq_err);
373 ge_complete(&orion_ge10_shared_data, tclk,
374 orion_ge10_resources, irq, &orion_ge10_shared,
375 eth_data, &orion_ge10);
378 /*****************************************************************************
379 * GE11
380 ****************************************************************************/
381 struct mv643xx_eth_shared_platform_data orion_ge11_shared_data = {
382 .shared_smi = &orion_ge00_shared,
385 static struct resource orion_ge11_shared_resources[] = {
387 .name = "ge11 base",
388 }, {
389 .name = "ge11 err irq",
393 static struct platform_device orion_ge11_shared = {
394 .name = MV643XX_ETH_SHARED_NAME,
395 .id = 1,
396 .dev = {
397 .platform_data = &orion_ge11_shared_data,
401 static struct resource orion_ge11_resources[] = {
403 .name = "ge11 irq",
404 .flags = IORESOURCE_IRQ,
408 static struct platform_device orion_ge11 = {
409 .name = MV643XX_ETH_NAME,
410 .id = 1,
411 .num_resources = 2,
412 .resource = orion_ge11_resources,
413 .dev = {
414 .coherent_dma_mask = DMA_BIT_MASK(32),
418 void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data,
419 unsigned long mapbase,
420 unsigned long irq,
421 unsigned long irq_err,
422 int tclk)
424 fill_resources(&orion_ge11_shared, orion_ge11_shared_resources,
425 mapbase + 0x2000, SZ_16K - 1, irq_err);
426 ge_complete(&orion_ge11_shared_data, tclk,
427 orion_ge11_resources, irq, &orion_ge11_shared,
428 eth_data, &orion_ge11);
431 /*****************************************************************************
432 * Ethernet switch
433 ****************************************************************************/
434 static struct resource orion_switch_resources[] = {
436 .start = 0,
437 .end = 0,
438 .flags = IORESOURCE_IRQ,
442 static struct platform_device orion_switch_device = {
443 .name = "dsa",
444 .id = 0,
445 .num_resources = 0,
446 .resource = orion_switch_resources,
449 void __init orion_ge00_switch_init(struct dsa_platform_data *d, int irq)
451 int i;
453 if (irq != NO_IRQ) {
454 orion_switch_resources[0].start = irq;
455 orion_switch_resources[0].end = irq;
456 orion_switch_device.num_resources = 1;
459 d->netdev = &orion_ge00.dev;
460 for (i = 0; i < d->nr_chips; i++)
461 d->chip[i].mii_bus = &orion_ge00_shared.dev;
462 orion_switch_device.dev.platform_data = d;
464 platform_device_register(&orion_switch_device);
467 /*****************************************************************************
468 * I2C
469 ****************************************************************************/
470 static struct mv64xxx_i2c_pdata orion_i2c_pdata = {
471 .freq_n = 3,
472 .timeout = 1000, /* Default timeout of 1 second */
475 static struct resource orion_i2c_resources[2];
477 static struct platform_device orion_i2c = {
478 .name = MV64XXX_I2C_CTLR_NAME,
479 .id = 0,
480 .dev = {
481 .platform_data = &orion_i2c_pdata,
485 static struct mv64xxx_i2c_pdata orion_i2c_1_pdata = {
486 .freq_n = 3,
487 .timeout = 1000, /* Default timeout of 1 second */
490 static struct resource orion_i2c_1_resources[2];
492 static struct platform_device orion_i2c_1 = {
493 .name = MV64XXX_I2C_CTLR_NAME,
494 .id = 1,
495 .dev = {
496 .platform_data = &orion_i2c_1_pdata,
500 void __init orion_i2c_init(unsigned long mapbase,
501 unsigned long irq,
502 unsigned long freq_m)
504 orion_i2c_pdata.freq_m = freq_m;
505 fill_resources(&orion_i2c, orion_i2c_resources, mapbase,
506 SZ_32 - 1, irq);
507 platform_device_register(&orion_i2c);
510 void __init orion_i2c_1_init(unsigned long mapbase,
511 unsigned long irq,
512 unsigned long freq_m)
514 orion_i2c_1_pdata.freq_m = freq_m;
515 fill_resources(&orion_i2c_1, orion_i2c_1_resources, mapbase,
516 SZ_32 - 1, irq);
517 platform_device_register(&orion_i2c_1);
520 /*****************************************************************************
521 * SPI
522 ****************************************************************************/
523 static struct orion_spi_info orion_spi_plat_data;
524 static struct resource orion_spi_resources;
526 static struct platform_device orion_spi = {
527 .name = "orion_spi",
528 .id = 0,
529 .dev = {
530 .platform_data = &orion_spi_plat_data,
534 static struct orion_spi_info orion_spi_1_plat_data;
535 static struct resource orion_spi_1_resources;
537 static struct platform_device orion_spi_1 = {
538 .name = "orion_spi",
539 .id = 1,
540 .dev = {
541 .platform_data = &orion_spi_1_plat_data,
545 /* Note: The SPI silicon core does have interrupts. However the
546 * current Linux software driver does not use interrupts. */
548 void __init orion_spi_init(unsigned long mapbase,
549 unsigned long tclk)
551 orion_spi_plat_data.tclk = tclk;
552 fill_resources(&orion_spi, &orion_spi_resources,
553 mapbase, SZ_512 - 1, NO_IRQ);
554 platform_device_register(&orion_spi);
557 void __init orion_spi_1_init(unsigned long mapbase,
558 unsigned long tclk)
560 orion_spi_1_plat_data.tclk = tclk;
561 fill_resources(&orion_spi_1, &orion_spi_1_resources,
562 mapbase, SZ_512 - 1, NO_IRQ);
563 platform_device_register(&orion_spi_1);
566 /*****************************************************************************
567 * Watchdog
568 ****************************************************************************/
569 static struct orion_wdt_platform_data orion_wdt_data;
571 static struct platform_device orion_wdt_device = {
572 .name = "orion_wdt",
573 .id = -1,
574 .dev = {
575 .platform_data = &orion_wdt_data,
577 .num_resources = 0,
580 void __init orion_wdt_init(unsigned long tclk)
582 orion_wdt_data.tclk = tclk;
583 platform_device_register(&orion_wdt_device);
586 /*****************************************************************************
587 * XOR
588 ****************************************************************************/
589 static u64 orion_xor_dmamask = DMA_BIT_MASK(32);
591 void __init orion_xor_init_channels(
592 struct mv_xor_platform_data *orion_xor0_data,
593 struct platform_device *orion_xor0_channel,
594 struct mv_xor_platform_data *orion_xor1_data,
595 struct platform_device *orion_xor1_channel)
598 * two engines can't do memset simultaneously, this limitation
599 * satisfied by removing memset support from one of the engines.
601 dma_cap_set(DMA_MEMCPY, orion_xor0_data->cap_mask);
602 dma_cap_set(DMA_XOR, orion_xor0_data->cap_mask);
603 platform_device_register(orion_xor0_channel);
605 dma_cap_set(DMA_MEMCPY, orion_xor1_data->cap_mask);
606 dma_cap_set(DMA_MEMSET, orion_xor1_data->cap_mask);
607 dma_cap_set(DMA_XOR, orion_xor1_data->cap_mask);
608 platform_device_register(orion_xor1_channel);
611 /*****************************************************************************
612 * XOR0
613 ****************************************************************************/
614 static struct resource orion_xor0_shared_resources[] = {
616 .name = "xor 0 low",
617 .flags = IORESOURCE_MEM,
618 }, {
619 .name = "xor 0 high",
620 .flags = IORESOURCE_MEM,
624 static struct platform_device orion_xor0_shared = {
625 .name = MV_XOR_SHARED_NAME,
626 .id = 0,
627 .num_resources = ARRAY_SIZE(orion_xor0_shared_resources),
628 .resource = orion_xor0_shared_resources,
631 static struct resource orion_xor00_resources[] = {
632 [0] = {
633 .flags = IORESOURCE_IRQ,
637 static struct mv_xor_platform_data orion_xor00_data = {
638 .shared = &orion_xor0_shared,
639 .hw_id = 0,
640 .pool_size = PAGE_SIZE,
643 static struct platform_device orion_xor00_channel = {
644 .name = MV_XOR_NAME,
645 .id = 0,
646 .num_resources = ARRAY_SIZE(orion_xor00_resources),
647 .resource = orion_xor00_resources,
648 .dev = {
649 .dma_mask = &orion_xor_dmamask,
650 .coherent_dma_mask = DMA_BIT_MASK(64),
651 .platform_data = &orion_xor00_data,
655 static struct resource orion_xor01_resources[] = {
656 [0] = {
657 .flags = IORESOURCE_IRQ,
661 static struct mv_xor_platform_data orion_xor01_data = {
662 .shared = &orion_xor0_shared,
663 .hw_id = 1,
664 .pool_size = PAGE_SIZE,
667 static struct platform_device orion_xor01_channel = {
668 .name = MV_XOR_NAME,
669 .id = 1,
670 .num_resources = ARRAY_SIZE(orion_xor01_resources),
671 .resource = orion_xor01_resources,
672 .dev = {
673 .dma_mask = &orion_xor_dmamask,
674 .coherent_dma_mask = DMA_BIT_MASK(64),
675 .platform_data = &orion_xor01_data,
679 void __init orion_xor0_init(unsigned long mapbase_low,
680 unsigned long mapbase_high,
681 unsigned long irq_0,
682 unsigned long irq_1)
684 orion_xor0_shared_resources[0].start = mapbase_low;
685 orion_xor0_shared_resources[0].end = mapbase_low + 0xff;
686 orion_xor0_shared_resources[1].start = mapbase_high;
687 orion_xor0_shared_resources[1].end = mapbase_high + 0xff;
689 orion_xor00_resources[0].start = irq_0;
690 orion_xor00_resources[0].end = irq_0;
691 orion_xor01_resources[0].start = irq_1;
692 orion_xor01_resources[0].end = irq_1;
694 platform_device_register(&orion_xor0_shared);
696 orion_xor_init_channels(&orion_xor00_data, &orion_xor00_channel,
697 &orion_xor01_data, &orion_xor01_channel);
700 /*****************************************************************************
701 * XOR1
702 ****************************************************************************/
703 static struct resource orion_xor1_shared_resources[] = {
705 .name = "xor 1 low",
706 .flags = IORESOURCE_MEM,
707 }, {
708 .name = "xor 1 high",
709 .flags = IORESOURCE_MEM,
713 static struct platform_device orion_xor1_shared = {
714 .name = MV_XOR_SHARED_NAME,
715 .id = 1,
716 .num_resources = ARRAY_SIZE(orion_xor1_shared_resources),
717 .resource = orion_xor1_shared_resources,
720 static struct resource orion_xor10_resources[] = {
721 [0] = {
722 .flags = IORESOURCE_IRQ,
726 static struct mv_xor_platform_data orion_xor10_data = {
727 .shared = &orion_xor1_shared,
728 .hw_id = 0,
729 .pool_size = PAGE_SIZE,
732 static struct platform_device orion_xor10_channel = {
733 .name = MV_XOR_NAME,
734 .id = 2,
735 .num_resources = ARRAY_SIZE(orion_xor10_resources),
736 .resource = orion_xor10_resources,
737 .dev = {
738 .dma_mask = &orion_xor_dmamask,
739 .coherent_dma_mask = DMA_BIT_MASK(64),
740 .platform_data = &orion_xor10_data,
744 static struct resource orion_xor11_resources[] = {
745 [0] = {
746 .flags = IORESOURCE_IRQ,
750 static struct mv_xor_platform_data orion_xor11_data = {
751 .shared = &orion_xor1_shared,
752 .hw_id = 1,
753 .pool_size = PAGE_SIZE,
756 static struct platform_device orion_xor11_channel = {
757 .name = MV_XOR_NAME,
758 .id = 3,
759 .num_resources = ARRAY_SIZE(orion_xor11_resources),
760 .resource = orion_xor11_resources,
761 .dev = {
762 .dma_mask = &orion_xor_dmamask,
763 .coherent_dma_mask = DMA_BIT_MASK(64),
764 .platform_data = &orion_xor11_data,
768 void __init orion_xor1_init(unsigned long mapbase_low,
769 unsigned long mapbase_high,
770 unsigned long irq_0,
771 unsigned long irq_1)
773 orion_xor1_shared_resources[0].start = mapbase_low;
774 orion_xor1_shared_resources[0].end = mapbase_low + 0xff;
775 orion_xor1_shared_resources[1].start = mapbase_high;
776 orion_xor1_shared_resources[1].end = mapbase_high + 0xff;
778 orion_xor10_resources[0].start = irq_0;
779 orion_xor10_resources[0].end = irq_0;
780 orion_xor11_resources[0].start = irq_1;
781 orion_xor11_resources[0].end = irq_1;
783 platform_device_register(&orion_xor1_shared);
785 orion_xor_init_channels(&orion_xor10_data, &orion_xor10_channel,
786 &orion_xor11_data, &orion_xor11_channel);
789 /*****************************************************************************
790 * EHCI
791 ****************************************************************************/
792 static struct orion_ehci_data orion_ehci_data;
793 static u64 ehci_dmamask = DMA_BIT_MASK(32);
796 /*****************************************************************************
797 * EHCI0
798 ****************************************************************************/
799 static struct resource orion_ehci_resources[2];
801 static struct platform_device orion_ehci = {
802 .name = "orion-ehci",
803 .id = 0,
804 .dev = {
805 .dma_mask = &ehci_dmamask,
806 .coherent_dma_mask = DMA_BIT_MASK(32),
807 .platform_data = &orion_ehci_data,
811 void __init orion_ehci_init(unsigned long mapbase,
812 unsigned long irq,
813 enum orion_ehci_phy_ver phy_version)
815 orion_ehci_data.phy_version = phy_version;
816 fill_resources(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1,
817 irq);
819 platform_device_register(&orion_ehci);
822 /*****************************************************************************
823 * EHCI1
824 ****************************************************************************/
825 static struct resource orion_ehci_1_resources[2];
827 static struct platform_device orion_ehci_1 = {
828 .name = "orion-ehci",
829 .id = 1,
830 .dev = {
831 .dma_mask = &ehci_dmamask,
832 .coherent_dma_mask = DMA_BIT_MASK(32),
833 .platform_data = &orion_ehci_data,
837 void __init orion_ehci_1_init(unsigned long mapbase,
838 unsigned long irq)
840 fill_resources(&orion_ehci_1, orion_ehci_1_resources,
841 mapbase, SZ_4K - 1, irq);
843 platform_device_register(&orion_ehci_1);
846 /*****************************************************************************
847 * EHCI2
848 ****************************************************************************/
849 static struct resource orion_ehci_2_resources[2];
851 static struct platform_device orion_ehci_2 = {
852 .name = "orion-ehci",
853 .id = 2,
854 .dev = {
855 .dma_mask = &ehci_dmamask,
856 .coherent_dma_mask = DMA_BIT_MASK(32),
857 .platform_data = &orion_ehci_data,
861 void __init orion_ehci_2_init(unsigned long mapbase,
862 unsigned long irq)
864 fill_resources(&orion_ehci_2, orion_ehci_2_resources,
865 mapbase, SZ_4K - 1, irq);
867 platform_device_register(&orion_ehci_2);
870 /*****************************************************************************
871 * SATA
872 ****************************************************************************/
873 static struct resource orion_sata_resources[2] = {
875 .name = "sata base",
876 }, {
877 .name = "sata irq",
881 static struct platform_device orion_sata = {
882 .name = "sata_mv",
883 .id = 0,
884 .dev = {
885 .coherent_dma_mask = DMA_BIT_MASK(32),
889 void __init orion_sata_init(struct mv_sata_platform_data *sata_data,
890 unsigned long mapbase,
891 unsigned long irq)
893 orion_sata.dev.platform_data = sata_data;
894 fill_resources(&orion_sata, orion_sata_resources,
895 mapbase, 0x5000 - 1, irq);
897 platform_device_register(&orion_sata);
900 /*****************************************************************************
901 * Cryptographic Engines and Security Accelerator (CESA)
902 ****************************************************************************/
903 static struct resource orion_crypto_resources[] = {
905 .name = "regs",
906 }, {
907 .name = "crypto interrupt",
908 }, {
909 .name = "sram",
910 .flags = IORESOURCE_MEM,
914 static struct platform_device orion_crypto = {
915 .name = "mv_crypto",
916 .id = -1,
919 void __init orion_crypto_init(unsigned long mapbase,
920 unsigned long srambase,
921 unsigned long sram_size,
922 unsigned long irq)
924 fill_resources(&orion_crypto, orion_crypto_resources,
925 mapbase, 0xffff, irq);
926 orion_crypto.num_resources = 3;
927 orion_crypto_resources[2].start = srambase;
928 orion_crypto_resources[2].end = srambase + sram_size - 1;
930 platform_device_register(&orion_crypto);