GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / arm / mach-pxa / devices.c
blob65447dc736c2fd5b3f0fd4e3ce4c46c3c9711dc3
1 #include <linux/module.h>
2 #include <linux/kernel.h>
3 #include <linux/init.h>
4 #include <linux/platform_device.h>
5 #include <linux/dma-mapping.h>
7 #include <asm/pmu.h>
8 #include <mach/udc.h>
9 #include <mach/pxafb.h>
10 #include <mach/mmc.h>
11 #include <mach/irda.h>
12 #include <mach/ohci.h>
13 #include <mach/pxa27x_keypad.h>
14 #include <mach/pxa2xx_spi.h>
15 #include <mach/camera.h>
16 #include <mach/audio.h>
17 #include <mach/hardware.h>
18 #include <plat/i2c.h>
19 #include <plat/pxa3xx_nand.h>
21 #include "devices.h"
22 #include "generic.h"
24 void __init pxa_register_device(struct platform_device *dev, void *data)
26 int ret;
28 dev->dev.platform_data = data;
30 ret = platform_device_register(dev);
31 if (ret)
32 dev_err(&dev->dev, "unable to register device: %d\n", ret);
35 static struct resource pxa_resource_pmu = {
36 .start = IRQ_PMU,
37 .end = IRQ_PMU,
38 .flags = IORESOURCE_IRQ,
41 struct platform_device pxa_device_pmu = {
42 .name = "arm-pmu",
43 .id = ARM_PMU_DEVICE_CPU,
44 .resource = &pxa_resource_pmu,
45 .num_resources = 1,
48 static struct resource pxamci_resources[] = {
49 [0] = {
50 .start = 0x41100000,
51 .end = 0x41100fff,
52 .flags = IORESOURCE_MEM,
54 [1] = {
55 .start = IRQ_MMC,
56 .end = IRQ_MMC,
57 .flags = IORESOURCE_IRQ,
59 [2] = {
60 .start = 21,
61 .end = 21,
62 .flags = IORESOURCE_DMA,
64 [3] = {
65 .start = 22,
66 .end = 22,
67 .flags = IORESOURCE_DMA,
71 static u64 pxamci_dmamask = 0xffffffffUL;
73 struct platform_device pxa_device_mci = {
74 .name = "pxa2xx-mci",
75 .id = 0,
76 .dev = {
77 .dma_mask = &pxamci_dmamask,
78 .coherent_dma_mask = 0xffffffff,
80 .num_resources = ARRAY_SIZE(pxamci_resources),
81 .resource = pxamci_resources,
84 void __init pxa_set_mci_info(struct pxamci_platform_data *info)
86 pxa_register_device(&pxa_device_mci, info);
90 static struct pxa2xx_udc_mach_info pxa_udc_info = {
91 .gpio_pullup = -1,
92 .gpio_vbus = -1,
95 void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info)
97 memcpy(&pxa_udc_info, info, sizeof *info);
100 static struct resource pxa2xx_udc_resources[] = {
101 [0] = {
102 .start = 0x40600000,
103 .end = 0x4060ffff,
104 .flags = IORESOURCE_MEM,
106 [1] = {
107 .start = IRQ_USB,
108 .end = IRQ_USB,
109 .flags = IORESOURCE_IRQ,
113 static u64 udc_dma_mask = ~(u32)0;
115 struct platform_device pxa25x_device_udc = {
116 .name = "pxa25x-udc",
117 .id = -1,
118 .resource = pxa2xx_udc_resources,
119 .num_resources = ARRAY_SIZE(pxa2xx_udc_resources),
120 .dev = {
121 .platform_data = &pxa_udc_info,
122 .dma_mask = &udc_dma_mask,
126 struct platform_device pxa27x_device_udc = {
127 .name = "pxa27x-udc",
128 .id = -1,
129 .resource = pxa2xx_udc_resources,
130 .num_resources = ARRAY_SIZE(pxa2xx_udc_resources),
131 .dev = {
132 .platform_data = &pxa_udc_info,
133 .dma_mask = &udc_dma_mask,
137 static struct resource pxafb_resources[] = {
138 [0] = {
139 .start = 0x44000000,
140 .end = 0x4400ffff,
141 .flags = IORESOURCE_MEM,
143 [1] = {
144 .start = IRQ_LCD,
145 .end = IRQ_LCD,
146 .flags = IORESOURCE_IRQ,
150 static u64 fb_dma_mask = ~(u64)0;
152 struct platform_device pxa_device_fb = {
153 .name = "pxa2xx-fb",
154 .id = -1,
155 .dev = {
156 .dma_mask = &fb_dma_mask,
157 .coherent_dma_mask = 0xffffffff,
159 .num_resources = ARRAY_SIZE(pxafb_resources),
160 .resource = pxafb_resources,
163 void __init set_pxa_fb_info(struct pxafb_mach_info *info)
165 pxa_register_device(&pxa_device_fb, info);
168 void __init set_pxa_fb_parent(struct device *parent_dev)
170 pxa_device_fb.dev.parent = parent_dev;
173 static struct resource pxa_resource_ffuart[] = {
175 .start = 0x40100000,
176 .end = 0x40100023,
177 .flags = IORESOURCE_MEM,
178 }, {
179 .start = IRQ_FFUART,
180 .end = IRQ_FFUART,
181 .flags = IORESOURCE_IRQ,
185 struct platform_device pxa_device_ffuart = {
186 .name = "pxa2xx-uart",
187 .id = 0,
188 .resource = pxa_resource_ffuart,
189 .num_resources = ARRAY_SIZE(pxa_resource_ffuart),
192 void __init pxa_set_ffuart_info(void *info)
194 pxa_register_device(&pxa_device_ffuart, info);
197 static struct resource pxa_resource_btuart[] = {
199 .start = 0x40200000,
200 .end = 0x40200023,
201 .flags = IORESOURCE_MEM,
202 }, {
203 .start = IRQ_BTUART,
204 .end = IRQ_BTUART,
205 .flags = IORESOURCE_IRQ,
209 struct platform_device pxa_device_btuart = {
210 .name = "pxa2xx-uart",
211 .id = 1,
212 .resource = pxa_resource_btuart,
213 .num_resources = ARRAY_SIZE(pxa_resource_btuart),
216 void __init pxa_set_btuart_info(void *info)
218 pxa_register_device(&pxa_device_btuart, info);
221 static struct resource pxa_resource_stuart[] = {
223 .start = 0x40700000,
224 .end = 0x40700023,
225 .flags = IORESOURCE_MEM,
226 }, {
227 .start = IRQ_STUART,
228 .end = IRQ_STUART,
229 .flags = IORESOURCE_IRQ,
233 struct platform_device pxa_device_stuart = {
234 .name = "pxa2xx-uart",
235 .id = 2,
236 .resource = pxa_resource_stuart,
237 .num_resources = ARRAY_SIZE(pxa_resource_stuart),
240 void __init pxa_set_stuart_info(void *info)
242 pxa_register_device(&pxa_device_stuart, info);
245 static struct resource pxa_resource_hwuart[] = {
247 .start = 0x41600000,
248 .end = 0x4160002F,
249 .flags = IORESOURCE_MEM,
250 }, {
251 .start = IRQ_HWUART,
252 .end = IRQ_HWUART,
253 .flags = IORESOURCE_IRQ,
257 struct platform_device pxa_device_hwuart = {
258 .name = "pxa2xx-uart",
259 .id = 3,
260 .resource = pxa_resource_hwuart,
261 .num_resources = ARRAY_SIZE(pxa_resource_hwuart),
264 void __init pxa_set_hwuart_info(void *info)
266 if (cpu_is_pxa255())
267 pxa_register_device(&pxa_device_hwuart, info);
268 else
269 pr_info("UART: Ignoring attempt to register HWUART on non-PXA255 hardware");
272 static struct resource pxai2c_resources[] = {
274 .start = 0x40301680,
275 .end = 0x403016a3,
276 .flags = IORESOURCE_MEM,
277 }, {
278 .start = IRQ_I2C,
279 .end = IRQ_I2C,
280 .flags = IORESOURCE_IRQ,
284 struct platform_device pxa_device_i2c = {
285 .name = "pxa2xx-i2c",
286 .id = 0,
287 .resource = pxai2c_resources,
288 .num_resources = ARRAY_SIZE(pxai2c_resources),
291 void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info)
293 pxa_register_device(&pxa_device_i2c, info);
296 #ifdef CONFIG_PXA27x
297 static struct resource pxa27x_resources_i2c_power[] = {
299 .start = 0x40f00180,
300 .end = 0x40f001a3,
301 .flags = IORESOURCE_MEM,
302 }, {
303 .start = IRQ_PWRI2C,
304 .end = IRQ_PWRI2C,
305 .flags = IORESOURCE_IRQ,
309 struct platform_device pxa27x_device_i2c_power = {
310 .name = "pxa2xx-i2c",
311 .id = 1,
312 .resource = pxa27x_resources_i2c_power,
313 .num_resources = ARRAY_SIZE(pxa27x_resources_i2c_power),
315 #endif
317 #ifdef CONFIG_PXA3xx
318 static struct resource pxa3xx_resources_i2c_power[] = {
320 .start = 0x40f500c0,
321 .end = 0x40f500d3,
322 .flags = IORESOURCE_MEM,
323 }, {
324 .start = IRQ_PWRI2C,
325 .end = IRQ_PWRI2C,
326 .flags = IORESOURCE_IRQ,
330 struct platform_device pxa3xx_device_i2c_power = {
331 .name = "pxa3xx-pwri2c",
332 .id = 1,
333 .resource = pxa3xx_resources_i2c_power,
334 .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power),
336 #endif
338 static struct resource pxai2s_resources[] = {
340 .start = 0x40400000,
341 .end = 0x40400083,
342 .flags = IORESOURCE_MEM,
343 }, {
344 .start = IRQ_I2S,
345 .end = IRQ_I2S,
346 .flags = IORESOURCE_IRQ,
350 struct platform_device pxa_device_i2s = {
351 .name = "pxa2xx-i2s",
352 .id = -1,
353 .resource = pxai2s_resources,
354 .num_resources = ARRAY_SIZE(pxai2s_resources),
357 static u64 pxaficp_dmamask = ~(u32)0;
359 struct platform_device pxa_device_ficp = {
360 .name = "pxa2xx-ir",
361 .id = -1,
362 .dev = {
363 .dma_mask = &pxaficp_dmamask,
364 .coherent_dma_mask = 0xffffffff,
368 void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
370 pxa_register_device(&pxa_device_ficp, info);
373 static struct resource pxa_rtc_resources[] = {
374 [0] = {
375 .start = 0x40900000,
376 .end = 0x40900000 + 0x3b,
377 .flags = IORESOURCE_MEM,
379 [1] = {
380 .start = IRQ_RTC1Hz,
381 .end = IRQ_RTC1Hz,
382 .flags = IORESOURCE_IRQ,
384 [2] = {
385 .start = IRQ_RTCAlrm,
386 .end = IRQ_RTCAlrm,
387 .flags = IORESOURCE_IRQ,
391 struct platform_device sa1100_device_rtc = {
392 .name = "sa1100-rtc",
393 .id = -1,
396 struct platform_device pxa_device_rtc = {
397 .name = "pxa-rtc",
398 .id = -1,
399 .num_resources = ARRAY_SIZE(pxa_rtc_resources),
400 .resource = pxa_rtc_resources,
403 static struct resource pxa_ac97_resources[] = {
404 [0] = {
405 .start = 0x40500000,
406 .end = 0x40500000 + 0xfff,
407 .flags = IORESOURCE_MEM,
409 [1] = {
410 .start = IRQ_AC97,
411 .end = IRQ_AC97,
412 .flags = IORESOURCE_IRQ,
416 static u64 pxa_ac97_dmamask = 0xffffffffUL;
418 struct platform_device pxa_device_ac97 = {
419 .name = "pxa2xx-ac97",
420 .id = -1,
421 .dev = {
422 .dma_mask = &pxa_ac97_dmamask,
423 .coherent_dma_mask = 0xffffffff,
425 .num_resources = ARRAY_SIZE(pxa_ac97_resources),
426 .resource = pxa_ac97_resources,
429 void __init pxa_set_ac97_info(pxa2xx_audio_ops_t *ops)
431 pxa_register_device(&pxa_device_ac97, ops);
434 #ifdef CONFIG_PXA25x
436 static struct resource pxa25x_resource_pwm0[] = {
437 [0] = {
438 .start = 0x40b00000,
439 .end = 0x40b0000f,
440 .flags = IORESOURCE_MEM,
444 struct platform_device pxa25x_device_pwm0 = {
445 .name = "pxa25x-pwm",
446 .id = 0,
447 .resource = pxa25x_resource_pwm0,
448 .num_resources = ARRAY_SIZE(pxa25x_resource_pwm0),
451 static struct resource pxa25x_resource_pwm1[] = {
452 [0] = {
453 .start = 0x40c00000,
454 .end = 0x40c0000f,
455 .flags = IORESOURCE_MEM,
459 struct platform_device pxa25x_device_pwm1 = {
460 .name = "pxa25x-pwm",
461 .id = 1,
462 .resource = pxa25x_resource_pwm1,
463 .num_resources = ARRAY_SIZE(pxa25x_resource_pwm1),
466 static u64 pxa25x_ssp_dma_mask = DMA_BIT_MASK(32);
468 static struct resource pxa25x_resource_ssp[] = {
469 [0] = {
470 .start = 0x41000000,
471 .end = 0x4100001f,
472 .flags = IORESOURCE_MEM,
474 [1] = {
475 .start = IRQ_SSP,
476 .end = IRQ_SSP,
477 .flags = IORESOURCE_IRQ,
479 [2] = {
480 /* DRCMR for RX */
481 .start = 13,
482 .end = 13,
483 .flags = IORESOURCE_DMA,
485 [3] = {
486 /* DRCMR for TX */
487 .start = 14,
488 .end = 14,
489 .flags = IORESOURCE_DMA,
493 struct platform_device pxa25x_device_ssp = {
494 .name = "pxa25x-ssp",
495 .id = 0,
496 .dev = {
497 .dma_mask = &pxa25x_ssp_dma_mask,
498 .coherent_dma_mask = DMA_BIT_MASK(32),
500 .resource = pxa25x_resource_ssp,
501 .num_resources = ARRAY_SIZE(pxa25x_resource_ssp),
504 static u64 pxa25x_nssp_dma_mask = DMA_BIT_MASK(32);
506 static struct resource pxa25x_resource_nssp[] = {
507 [0] = {
508 .start = 0x41400000,
509 .end = 0x4140002f,
510 .flags = IORESOURCE_MEM,
512 [1] = {
513 .start = IRQ_NSSP,
514 .end = IRQ_NSSP,
515 .flags = IORESOURCE_IRQ,
517 [2] = {
518 /* DRCMR for RX */
519 .start = 15,
520 .end = 15,
521 .flags = IORESOURCE_DMA,
523 [3] = {
524 /* DRCMR for TX */
525 .start = 16,
526 .end = 16,
527 .flags = IORESOURCE_DMA,
531 struct platform_device pxa25x_device_nssp = {
532 .name = "pxa25x-nssp",
533 .id = 1,
534 .dev = {
535 .dma_mask = &pxa25x_nssp_dma_mask,
536 .coherent_dma_mask = DMA_BIT_MASK(32),
538 .resource = pxa25x_resource_nssp,
539 .num_resources = ARRAY_SIZE(pxa25x_resource_nssp),
542 static u64 pxa25x_assp_dma_mask = DMA_BIT_MASK(32);
544 static struct resource pxa25x_resource_assp[] = {
545 [0] = {
546 .start = 0x41500000,
547 .end = 0x4150002f,
548 .flags = IORESOURCE_MEM,
550 [1] = {
551 .start = IRQ_ASSP,
552 .end = IRQ_ASSP,
553 .flags = IORESOURCE_IRQ,
555 [2] = {
556 /* DRCMR for RX */
557 .start = 23,
558 .end = 23,
559 .flags = IORESOURCE_DMA,
561 [3] = {
562 /* DRCMR for TX */
563 .start = 24,
564 .end = 24,
565 .flags = IORESOURCE_DMA,
569 struct platform_device pxa25x_device_assp = {
570 /* ASSP is basically equivalent to NSSP */
571 .name = "pxa25x-nssp",
572 .id = 2,
573 .dev = {
574 .dma_mask = &pxa25x_assp_dma_mask,
575 .coherent_dma_mask = DMA_BIT_MASK(32),
577 .resource = pxa25x_resource_assp,
578 .num_resources = ARRAY_SIZE(pxa25x_resource_assp),
580 #endif /* CONFIG_PXA25x */
582 #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
584 static struct resource pxa27x_resource_keypad[] = {
585 [0] = {
586 .start = 0x41500000,
587 .end = 0x4150004c,
588 .flags = IORESOURCE_MEM,
590 [1] = {
591 .start = IRQ_KEYPAD,
592 .end = IRQ_KEYPAD,
593 .flags = IORESOURCE_IRQ,
597 struct platform_device pxa27x_device_keypad = {
598 .name = "pxa27x-keypad",
599 .id = -1,
600 .resource = pxa27x_resource_keypad,
601 .num_resources = ARRAY_SIZE(pxa27x_resource_keypad),
604 void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info)
606 pxa_register_device(&pxa27x_device_keypad, info);
609 static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32);
611 static struct resource pxa27x_resource_ohci[] = {
612 [0] = {
613 .start = 0x4C000000,
614 .end = 0x4C00ff6f,
615 .flags = IORESOURCE_MEM,
617 [1] = {
618 .start = IRQ_USBH1,
619 .end = IRQ_USBH1,
620 .flags = IORESOURCE_IRQ,
624 struct platform_device pxa27x_device_ohci = {
625 .name = "pxa27x-ohci",
626 .id = -1,
627 .dev = {
628 .dma_mask = &pxa27x_ohci_dma_mask,
629 .coherent_dma_mask = DMA_BIT_MASK(32),
631 .num_resources = ARRAY_SIZE(pxa27x_resource_ohci),
632 .resource = pxa27x_resource_ohci,
635 void __init pxa_set_ohci_info(struct pxaohci_platform_data *info)
637 pxa_register_device(&pxa27x_device_ohci, info);
640 static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32);
642 static struct resource pxa27x_resource_ssp1[] = {
643 [0] = {
644 .start = 0x41000000,
645 .end = 0x4100003f,
646 .flags = IORESOURCE_MEM,
648 [1] = {
649 .start = IRQ_SSP,
650 .end = IRQ_SSP,
651 .flags = IORESOURCE_IRQ,
653 [2] = {
654 /* DRCMR for RX */
655 .start = 13,
656 .end = 13,
657 .flags = IORESOURCE_DMA,
659 [3] = {
660 /* DRCMR for TX */
661 .start = 14,
662 .end = 14,
663 .flags = IORESOURCE_DMA,
667 struct platform_device pxa27x_device_ssp1 = {
668 .name = "pxa27x-ssp",
669 .id = 0,
670 .dev = {
671 .dma_mask = &pxa27x_ssp1_dma_mask,
672 .coherent_dma_mask = DMA_BIT_MASK(32),
674 .resource = pxa27x_resource_ssp1,
675 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp1),
678 static u64 pxa27x_ssp2_dma_mask = DMA_BIT_MASK(32);
680 static struct resource pxa27x_resource_ssp2[] = {
681 [0] = {
682 .start = 0x41700000,
683 .end = 0x4170003f,
684 .flags = IORESOURCE_MEM,
686 [1] = {
687 .start = IRQ_SSP2,
688 .end = IRQ_SSP2,
689 .flags = IORESOURCE_IRQ,
691 [2] = {
692 /* DRCMR for RX */
693 .start = 15,
694 .end = 15,
695 .flags = IORESOURCE_DMA,
697 [3] = {
698 /* DRCMR for TX */
699 .start = 16,
700 .end = 16,
701 .flags = IORESOURCE_DMA,
705 struct platform_device pxa27x_device_ssp2 = {
706 .name = "pxa27x-ssp",
707 .id = 1,
708 .dev = {
709 .dma_mask = &pxa27x_ssp2_dma_mask,
710 .coherent_dma_mask = DMA_BIT_MASK(32),
712 .resource = pxa27x_resource_ssp2,
713 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp2),
716 static u64 pxa27x_ssp3_dma_mask = DMA_BIT_MASK(32);
718 static struct resource pxa27x_resource_ssp3[] = {
719 [0] = {
720 .start = 0x41900000,
721 .end = 0x4190003f,
722 .flags = IORESOURCE_MEM,
724 [1] = {
725 .start = IRQ_SSP3,
726 .end = IRQ_SSP3,
727 .flags = IORESOURCE_IRQ,
729 [2] = {
730 /* DRCMR for RX */
731 .start = 66,
732 .end = 66,
733 .flags = IORESOURCE_DMA,
735 [3] = {
736 /* DRCMR for TX */
737 .start = 67,
738 .end = 67,
739 .flags = IORESOURCE_DMA,
743 struct platform_device pxa27x_device_ssp3 = {
744 .name = "pxa27x-ssp",
745 .id = 2,
746 .dev = {
747 .dma_mask = &pxa27x_ssp3_dma_mask,
748 .coherent_dma_mask = DMA_BIT_MASK(32),
750 .resource = pxa27x_resource_ssp3,
751 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3),
754 static struct resource pxa27x_resource_pwm0[] = {
755 [0] = {
756 .start = 0x40b00000,
757 .end = 0x40b0001f,
758 .flags = IORESOURCE_MEM,
762 struct platform_device pxa27x_device_pwm0 = {
763 .name = "pxa27x-pwm",
764 .id = 0,
765 .resource = pxa27x_resource_pwm0,
766 .num_resources = ARRAY_SIZE(pxa27x_resource_pwm0),
769 static struct resource pxa27x_resource_pwm1[] = {
770 [0] = {
771 .start = 0x40c00000,
772 .end = 0x40c0001f,
773 .flags = IORESOURCE_MEM,
777 struct platform_device pxa27x_device_pwm1 = {
778 .name = "pxa27x-pwm",
779 .id = 1,
780 .resource = pxa27x_resource_pwm1,
781 .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1),
784 static struct resource pxa27x_resource_camera[] = {
785 [0] = {
786 .start = 0x50000000,
787 .end = 0x50000fff,
788 .flags = IORESOURCE_MEM,
790 [1] = {
791 .start = IRQ_CAMERA,
792 .end = IRQ_CAMERA,
793 .flags = IORESOURCE_IRQ,
797 static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32);
799 static struct platform_device pxa27x_device_camera = {
800 .name = "pxa27x-camera",
801 .id = 0, /* This is used to put cameras on this interface */
802 .dev = {
803 .dma_mask = &pxa27x_dma_mask_camera,
804 .coherent_dma_mask = 0xffffffff,
806 .num_resources = ARRAY_SIZE(pxa27x_resource_camera),
807 .resource = pxa27x_resource_camera,
810 void __init pxa_set_camera_info(struct pxacamera_platform_data *info)
812 pxa_register_device(&pxa27x_device_camera, info);
814 #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
816 #ifdef CONFIG_PXA3xx
817 static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32);
819 static struct resource pxa3xx_resource_ssp4[] = {
820 [0] = {
821 .start = 0x41a00000,
822 .end = 0x41a0003f,
823 .flags = IORESOURCE_MEM,
825 [1] = {
826 .start = IRQ_SSP4,
827 .end = IRQ_SSP4,
828 .flags = IORESOURCE_IRQ,
830 [2] = {
831 /* DRCMR for RX */
832 .start = 2,
833 .end = 2,
834 .flags = IORESOURCE_DMA,
836 [3] = {
837 /* DRCMR for TX */
838 .start = 3,
839 .end = 3,
840 .flags = IORESOURCE_DMA,
844 struct platform_device pxa3xx_device_ssp4 = {
845 /* PXA3xx SSP is basically equivalent to PXA27x */
846 .name = "pxa27x-ssp",
847 .id = 3,
848 .dev = {
849 .dma_mask = &pxa3xx_ssp4_dma_mask,
850 .coherent_dma_mask = DMA_BIT_MASK(32),
852 .resource = pxa3xx_resource_ssp4,
853 .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4),
856 static struct resource pxa3xx_resources_mci2[] = {
857 [0] = {
858 .start = 0x42000000,
859 .end = 0x42000fff,
860 .flags = IORESOURCE_MEM,
862 [1] = {
863 .start = IRQ_MMC2,
864 .end = IRQ_MMC2,
865 .flags = IORESOURCE_IRQ,
867 [2] = {
868 .start = 93,
869 .end = 93,
870 .flags = IORESOURCE_DMA,
872 [3] = {
873 .start = 94,
874 .end = 94,
875 .flags = IORESOURCE_DMA,
879 struct platform_device pxa3xx_device_mci2 = {
880 .name = "pxa2xx-mci",
881 .id = 1,
882 .dev = {
883 .dma_mask = &pxamci_dmamask,
884 .coherent_dma_mask = 0xffffffff,
886 .num_resources = ARRAY_SIZE(pxa3xx_resources_mci2),
887 .resource = pxa3xx_resources_mci2,
890 void __init pxa3xx_set_mci2_info(struct pxamci_platform_data *info)
892 pxa_register_device(&pxa3xx_device_mci2, info);
895 static struct resource pxa3xx_resources_mci3[] = {
896 [0] = {
897 .start = 0x42500000,
898 .end = 0x42500fff,
899 .flags = IORESOURCE_MEM,
901 [1] = {
902 .start = IRQ_MMC3,
903 .end = IRQ_MMC3,
904 .flags = IORESOURCE_IRQ,
906 [2] = {
907 .start = 100,
908 .end = 100,
909 .flags = IORESOURCE_DMA,
911 [3] = {
912 .start = 101,
913 .end = 101,
914 .flags = IORESOURCE_DMA,
918 struct platform_device pxa3xx_device_mci3 = {
919 .name = "pxa2xx-mci",
920 .id = 2,
921 .dev = {
922 .dma_mask = &pxamci_dmamask,
923 .coherent_dma_mask = 0xffffffff,
925 .num_resources = ARRAY_SIZE(pxa3xx_resources_mci3),
926 .resource = pxa3xx_resources_mci3,
929 void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info)
931 pxa_register_device(&pxa3xx_device_mci3, info);
934 static struct resource pxa3xx_resources_nand[] = {
935 [0] = {
936 .start = 0x43100000,
937 .end = 0x43100053,
938 .flags = IORESOURCE_MEM,
940 [1] = {
941 .start = IRQ_NAND,
942 .end = IRQ_NAND,
943 .flags = IORESOURCE_IRQ,
945 [2] = {
946 /* DRCMR for Data DMA */
947 .start = 97,
948 .end = 97,
949 .flags = IORESOURCE_DMA,
951 [3] = {
952 /* DRCMR for Command DMA */
953 .start = 99,
954 .end = 99,
955 .flags = IORESOURCE_DMA,
959 static u64 pxa3xx_nand_dma_mask = DMA_BIT_MASK(32);
961 struct platform_device pxa3xx_device_nand = {
962 .name = "pxa3xx-nand",
963 .id = -1,
964 .dev = {
965 .dma_mask = &pxa3xx_nand_dma_mask,
966 .coherent_dma_mask = DMA_BIT_MASK(32),
968 .num_resources = ARRAY_SIZE(pxa3xx_resources_nand),
969 .resource = pxa3xx_resources_nand,
972 void __init pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info)
974 pxa_register_device(&pxa3xx_device_nand, info);
977 static struct resource pxa3xx_resources_gcu[] = {
979 .start = 0x54000000,
980 .end = 0x54000fff,
981 .flags = IORESOURCE_MEM,
984 .start = IRQ_GCU,
985 .end = IRQ_GCU,
986 .flags = IORESOURCE_IRQ,
990 static u64 pxa3xx_gcu_dmamask = DMA_BIT_MASK(32);
992 struct platform_device pxa3xx_device_gcu = {
993 .name = "pxa3xx-gcu",
994 .id = -1,
995 .num_resources = ARRAY_SIZE(pxa3xx_resources_gcu),
996 .resource = pxa3xx_resources_gcu,
997 .dev = {
998 .dma_mask = &pxa3xx_gcu_dmamask,
999 .coherent_dma_mask = 0xffffffff,
1003 #endif /* CONFIG_PXA3xx */
1005 /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1.
1006 * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */
1007 void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info)
1009 struct platform_device *pd;
1011 pd = platform_device_alloc("pxa2xx-spi", id);
1012 if (pd == NULL) {
1013 printk(KERN_ERR "pxa2xx-spi: failed to allocate device id %d\n",
1014 id);
1015 return;
1018 pd->dev.platform_data = info;
1019 platform_device_add(pd);