2 * sh7372 processor support
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #include <linux/kernel.h>
21 #include <linux/init.h>
22 #include <linux/interrupt.h>
23 #include <linux/irq.h>
24 #include <linux/platform_device.h>
25 #include <linux/of_platform.h>
26 #include <linux/uio_driver.h>
27 #include <linux/delay.h>
28 #include <linux/input.h>
30 #include <linux/serial_sci.h>
31 #include <linux/sh_dma.h>
32 #include <linux/sh_intc.h>
33 #include <linux/sh_timer.h>
34 #include <linux/pm_domain.h>
35 #include <linux/dma-mapping.h>
36 #include <linux/platform_data/sh_ipmmu.h>
37 #include <mach/dma-register.h>
38 #include <mach/irqs.h>
39 #include <mach/sh7372.h>
40 #include <mach/common.h>
41 #include <asm/mach/map.h>
42 #include <asm/mach-types.h>
43 #include <asm/mach/arch.h>
44 #include <asm/mach/time.h>
46 static struct map_desc sh7372_io_desc
[] __initdata
= {
47 /* create a 1:1 entity map for 0xe6xxxxxx
48 * used by CPGA, INTC and PFC.
51 .virtual = 0xe6000000,
52 .pfn
= __phys_to_pfn(0xe6000000),
54 .type
= MT_DEVICE_NONSHARED
58 void __init
sh7372_map_io(void)
60 iotable_init(sh7372_io_desc
, ARRAY_SIZE(sh7372_io_desc
));
64 static struct resource sh7372_pfc_resources
[] = {
68 .flags
= IORESOURCE_MEM
,
73 .flags
= IORESOURCE_MEM
,
77 static struct platform_device sh7372_pfc_device
= {
80 .resource
= sh7372_pfc_resources
,
81 .num_resources
= ARRAY_SIZE(sh7372_pfc_resources
),
84 void __init
sh7372_pinmux_init(void)
86 platform_device_register(&sh7372_pfc_device
);
90 static struct plat_sci_port scif0_platform_data
= {
91 .mapbase
= 0xe6c40000,
92 .flags
= UPF_BOOT_AUTOCONF
,
93 .scscr
= SCSCR_RE
| SCSCR_TE
,
94 .scbrr_algo_id
= SCBRR_ALGO_4
,
96 .irqs
= { evt2irq(0x0c00), evt2irq(0x0c00),
97 evt2irq(0x0c00), evt2irq(0x0c00) },
100 static struct platform_device scif0_device
= {
104 .platform_data
= &scif0_platform_data
,
109 static struct plat_sci_port scif1_platform_data
= {
110 .mapbase
= 0xe6c50000,
111 .flags
= UPF_BOOT_AUTOCONF
,
112 .scscr
= SCSCR_RE
| SCSCR_TE
,
113 .scbrr_algo_id
= SCBRR_ALGO_4
,
115 .irqs
= { evt2irq(0x0c20), evt2irq(0x0c20),
116 evt2irq(0x0c20), evt2irq(0x0c20) },
119 static struct platform_device scif1_device
= {
123 .platform_data
= &scif1_platform_data
,
128 static struct plat_sci_port scif2_platform_data
= {
129 .mapbase
= 0xe6c60000,
130 .flags
= UPF_BOOT_AUTOCONF
,
131 .scscr
= SCSCR_RE
| SCSCR_TE
,
132 .scbrr_algo_id
= SCBRR_ALGO_4
,
134 .irqs
= { evt2irq(0x0c40), evt2irq(0x0c40),
135 evt2irq(0x0c40), evt2irq(0x0c40) },
138 static struct platform_device scif2_device
= {
142 .platform_data
= &scif2_platform_data
,
147 static struct plat_sci_port scif3_platform_data
= {
148 .mapbase
= 0xe6c70000,
149 .flags
= UPF_BOOT_AUTOCONF
,
150 .scscr
= SCSCR_RE
| SCSCR_TE
,
151 .scbrr_algo_id
= SCBRR_ALGO_4
,
153 .irqs
= { evt2irq(0x0c60), evt2irq(0x0c60),
154 evt2irq(0x0c60), evt2irq(0x0c60) },
157 static struct platform_device scif3_device
= {
161 .platform_data
= &scif3_platform_data
,
166 static struct plat_sci_port scif4_platform_data
= {
167 .mapbase
= 0xe6c80000,
168 .flags
= UPF_BOOT_AUTOCONF
,
169 .scscr
= SCSCR_RE
| SCSCR_TE
,
170 .scbrr_algo_id
= SCBRR_ALGO_4
,
172 .irqs
= { evt2irq(0x0d20), evt2irq(0x0d20),
173 evt2irq(0x0d20), evt2irq(0x0d20) },
176 static struct platform_device scif4_device
= {
180 .platform_data
= &scif4_platform_data
,
185 static struct plat_sci_port scif5_platform_data
= {
186 .mapbase
= 0xe6cb0000,
187 .flags
= UPF_BOOT_AUTOCONF
,
188 .scscr
= SCSCR_RE
| SCSCR_TE
,
189 .scbrr_algo_id
= SCBRR_ALGO_4
,
191 .irqs
= { evt2irq(0x0d40), evt2irq(0x0d40),
192 evt2irq(0x0d40), evt2irq(0x0d40) },
195 static struct platform_device scif5_device
= {
199 .platform_data
= &scif5_platform_data
,
204 static struct plat_sci_port scif6_platform_data
= {
205 .mapbase
= 0xe6c30000,
206 .flags
= UPF_BOOT_AUTOCONF
,
207 .scscr
= SCSCR_RE
| SCSCR_TE
,
208 .scbrr_algo_id
= SCBRR_ALGO_4
,
210 .irqs
= { evt2irq(0x0d60), evt2irq(0x0d60),
211 evt2irq(0x0d60), evt2irq(0x0d60) },
214 static struct platform_device scif6_device
= {
218 .platform_data
= &scif6_platform_data
,
223 static struct sh_timer_config cmt2_platform_data
= {
225 .channel_offset
= 0x40,
227 .clockevent_rating
= 125,
228 .clocksource_rating
= 125,
231 static struct resource cmt2_resources
[] = {
236 .flags
= IORESOURCE_MEM
,
239 .start
= evt2irq(0x0b80), /* CMT2 */
240 .flags
= IORESOURCE_IRQ
,
244 static struct platform_device cmt2_device
= {
248 .platform_data
= &cmt2_platform_data
,
250 .resource
= cmt2_resources
,
251 .num_resources
= ARRAY_SIZE(cmt2_resources
),
255 static struct sh_timer_config tmu00_platform_data
= {
257 .channel_offset
= 0x4,
259 .clockevent_rating
= 200,
262 static struct resource tmu00_resources
[] = {
267 .flags
= IORESOURCE_MEM
,
270 .start
= intcs_evt2irq(0xe80), /* TMU_TUNI0 */
271 .flags
= IORESOURCE_IRQ
,
275 static struct platform_device tmu00_device
= {
279 .platform_data
= &tmu00_platform_data
,
281 .resource
= tmu00_resources
,
282 .num_resources
= ARRAY_SIZE(tmu00_resources
),
285 static struct sh_timer_config tmu01_platform_data
= {
287 .channel_offset
= 0x10,
289 .clocksource_rating
= 200,
292 static struct resource tmu01_resources
[] = {
297 .flags
= IORESOURCE_MEM
,
300 .start
= intcs_evt2irq(0xea0), /* TMU_TUNI1 */
301 .flags
= IORESOURCE_IRQ
,
305 static struct platform_device tmu01_device
= {
309 .platform_data
= &tmu01_platform_data
,
311 .resource
= tmu01_resources
,
312 .num_resources
= ARRAY_SIZE(tmu01_resources
),
316 static struct resource iic0_resources
[] = {
320 .end
= 0xFFF20425 - 1,
321 .flags
= IORESOURCE_MEM
,
324 .start
= intcs_evt2irq(0xe00), /* IIC0_ALI0 */
325 .end
= intcs_evt2irq(0xe60), /* IIC0_DTEI0 */
326 .flags
= IORESOURCE_IRQ
,
330 static struct platform_device iic0_device
= {
331 .name
= "i2c-sh_mobile",
332 .id
= 0, /* "i2c0" clock */
333 .num_resources
= ARRAY_SIZE(iic0_resources
),
334 .resource
= iic0_resources
,
337 static struct resource iic1_resources
[] = {
341 .end
= 0xE6C20425 - 1,
342 .flags
= IORESOURCE_MEM
,
345 .start
= evt2irq(0x780), /* IIC1_ALI1 */
346 .end
= evt2irq(0x7e0), /* IIC1_DTEI1 */
347 .flags
= IORESOURCE_IRQ
,
351 static struct platform_device iic1_device
= {
352 .name
= "i2c-sh_mobile",
353 .id
= 1, /* "i2c1" clock */
354 .num_resources
= ARRAY_SIZE(iic1_resources
),
355 .resource
= iic1_resources
,
359 static const struct sh_dmae_slave_config sh7372_dmae_slaves
[] = {
361 .slave_id
= SHDMA_SLAVE_SCIF0_TX
,
363 .chcr
= CHCR_TX(XMIT_SZ_8BIT
),
366 .slave_id
= SHDMA_SLAVE_SCIF0_RX
,
368 .chcr
= CHCR_RX(XMIT_SZ_8BIT
),
371 .slave_id
= SHDMA_SLAVE_SCIF1_TX
,
373 .chcr
= CHCR_TX(XMIT_SZ_8BIT
),
376 .slave_id
= SHDMA_SLAVE_SCIF1_RX
,
378 .chcr
= CHCR_RX(XMIT_SZ_8BIT
),
381 .slave_id
= SHDMA_SLAVE_SCIF2_TX
,
383 .chcr
= CHCR_TX(XMIT_SZ_8BIT
),
386 .slave_id
= SHDMA_SLAVE_SCIF2_RX
,
388 .chcr
= CHCR_RX(XMIT_SZ_8BIT
),
391 .slave_id
= SHDMA_SLAVE_SCIF3_TX
,
393 .chcr
= CHCR_TX(XMIT_SZ_8BIT
),
396 .slave_id
= SHDMA_SLAVE_SCIF3_RX
,
398 .chcr
= CHCR_RX(XMIT_SZ_8BIT
),
401 .slave_id
= SHDMA_SLAVE_SCIF4_TX
,
403 .chcr
= CHCR_TX(XMIT_SZ_8BIT
),
406 .slave_id
= SHDMA_SLAVE_SCIF4_RX
,
408 .chcr
= CHCR_RX(XMIT_SZ_8BIT
),
411 .slave_id
= SHDMA_SLAVE_SCIF5_TX
,
413 .chcr
= CHCR_TX(XMIT_SZ_8BIT
),
416 .slave_id
= SHDMA_SLAVE_SCIF5_RX
,
418 .chcr
= CHCR_RX(XMIT_SZ_8BIT
),
421 .slave_id
= SHDMA_SLAVE_SCIF6_TX
,
423 .chcr
= CHCR_TX(XMIT_SZ_8BIT
),
426 .slave_id
= SHDMA_SLAVE_SCIF6_RX
,
428 .chcr
= CHCR_RX(XMIT_SZ_8BIT
),
431 .slave_id
= SHDMA_SLAVE_FLCTL0_TX
,
433 .chcr
= CHCR_TX(XMIT_SZ_32BIT
),
436 .slave_id
= SHDMA_SLAVE_FLCTL0_RX
,
438 .chcr
= CHCR_RX(XMIT_SZ_32BIT
),
441 .slave_id
= SHDMA_SLAVE_FLCTL1_TX
,
443 .chcr
= CHCR_TX(XMIT_SZ_32BIT
),
446 .slave_id
= SHDMA_SLAVE_FLCTL1_RX
,
448 .chcr
= CHCR_RX(XMIT_SZ_32BIT
),
451 .slave_id
= SHDMA_SLAVE_SDHI0_TX
,
453 .chcr
= CHCR_TX(XMIT_SZ_16BIT
),
456 .slave_id
= SHDMA_SLAVE_SDHI0_RX
,
458 .chcr
= CHCR_RX(XMIT_SZ_16BIT
),
461 .slave_id
= SHDMA_SLAVE_SDHI1_TX
,
463 .chcr
= CHCR_TX(XMIT_SZ_16BIT
),
466 .slave_id
= SHDMA_SLAVE_SDHI1_RX
,
468 .chcr
= CHCR_RX(XMIT_SZ_16BIT
),
471 .slave_id
= SHDMA_SLAVE_SDHI2_TX
,
473 .chcr
= CHCR_TX(XMIT_SZ_16BIT
),
476 .slave_id
= SHDMA_SLAVE_SDHI2_RX
,
478 .chcr
= CHCR_RX(XMIT_SZ_16BIT
),
481 .slave_id
= SHDMA_SLAVE_FSIA_TX
,
483 .chcr
= CHCR_TX(XMIT_SZ_32BIT
),
486 .slave_id
= SHDMA_SLAVE_FSIA_RX
,
488 .chcr
= CHCR_RX(XMIT_SZ_32BIT
),
491 .slave_id
= SHDMA_SLAVE_MMCIF_TX
,
493 .chcr
= CHCR_TX(XMIT_SZ_32BIT
),
496 .slave_id
= SHDMA_SLAVE_MMCIF_RX
,
498 .chcr
= CHCR_RX(XMIT_SZ_32BIT
),
503 #define SH7372_CHCLR (0x220 - 0x20)
505 static const struct sh_dmae_channel sh7372_dmae_channels
[] = {
510 .chclr_offset
= SH7372_CHCLR
+ 0,
515 .chclr_offset
= SH7372_CHCLR
+ 0x10,
520 .chclr_offset
= SH7372_CHCLR
+ 0x20,
525 .chclr_offset
= SH7372_CHCLR
+ 0x30,
530 .chclr_offset
= SH7372_CHCLR
+ 0x50,
535 .chclr_offset
= SH7372_CHCLR
+ 0x60,
539 static struct sh_dmae_pdata dma_platform_data
= {
540 .slave
= sh7372_dmae_slaves
,
541 .slave_num
= ARRAY_SIZE(sh7372_dmae_slaves
),
542 .channel
= sh7372_dmae_channels
,
543 .channel_num
= ARRAY_SIZE(sh7372_dmae_channels
),
544 .ts_low_shift
= TS_LOW_SHIFT
,
545 .ts_low_mask
= TS_LOW_BIT
<< TS_LOW_SHIFT
,
546 .ts_high_shift
= TS_HI_SHIFT
,
547 .ts_high_mask
= TS_HI_BIT
<< TS_HI_SHIFT
,
548 .ts_shift
= dma_ts_shift
,
549 .ts_shift_num
= ARRAY_SIZE(dma_ts_shift
),
550 .dmaor_init
= DMAOR_DME
,
554 /* Resource order important! */
555 static struct resource sh7372_dmae0_resources
[] = {
557 /* Channel registers and DMAOR */
560 .flags
= IORESOURCE_MEM
,
566 .flags
= IORESOURCE_MEM
,
570 .start
= evt2irq(0x20c0),
571 .end
= evt2irq(0x20c0),
572 .flags
= IORESOURCE_IRQ
,
575 /* IRQ for channels 0-5 */
576 .start
= evt2irq(0x2000),
577 .end
= evt2irq(0x20a0),
578 .flags
= IORESOURCE_IRQ
,
582 /* Resource order important! */
583 static struct resource sh7372_dmae1_resources
[] = {
585 /* Channel registers and DMAOR */
588 .flags
= IORESOURCE_MEM
,
594 .flags
= IORESOURCE_MEM
,
598 .start
= evt2irq(0x21c0),
599 .end
= evt2irq(0x21c0),
600 .flags
= IORESOURCE_IRQ
,
603 /* IRQ for channels 0-5 */
604 .start
= evt2irq(0x2100),
605 .end
= evt2irq(0x21a0),
606 .flags
= IORESOURCE_IRQ
,
610 /* Resource order important! */
611 static struct resource sh7372_dmae2_resources
[] = {
613 /* Channel registers and DMAOR */
616 .flags
= IORESOURCE_MEM
,
622 .flags
= IORESOURCE_MEM
,
626 .start
= evt2irq(0x22c0),
627 .end
= evt2irq(0x22c0),
628 .flags
= IORESOURCE_IRQ
,
631 /* IRQ for channels 0-5 */
632 .start
= evt2irq(0x2200),
633 .end
= evt2irq(0x22a0),
634 .flags
= IORESOURCE_IRQ
,
638 static struct platform_device dma0_device
= {
639 .name
= "sh-dma-engine",
641 .resource
= sh7372_dmae0_resources
,
642 .num_resources
= ARRAY_SIZE(sh7372_dmae0_resources
),
644 .platform_data
= &dma_platform_data
,
648 static struct platform_device dma1_device
= {
649 .name
= "sh-dma-engine",
651 .resource
= sh7372_dmae1_resources
,
652 .num_resources
= ARRAY_SIZE(sh7372_dmae1_resources
),
654 .platform_data
= &dma_platform_data
,
658 static struct platform_device dma2_device
= {
659 .name
= "sh-dma-engine",
661 .resource
= sh7372_dmae2_resources
,
662 .num_resources
= ARRAY_SIZE(sh7372_dmae2_resources
),
664 .platform_data
= &dma_platform_data
,
671 static const struct sh_dmae_channel sh7372_usb_dmae_channels
[] = {
680 static const struct sh_dmae_slave_config sh7372_usb_dmae0_slaves
[] = {
682 .slave_id
= SHDMA_SLAVE_USB0_TX
,
683 .chcr
= USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE
),
685 .slave_id
= SHDMA_SLAVE_USB0_RX
,
686 .chcr
= USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE
),
690 static struct sh_dmae_pdata usb_dma0_platform_data
= {
691 .slave
= sh7372_usb_dmae0_slaves
,
692 .slave_num
= ARRAY_SIZE(sh7372_usb_dmae0_slaves
),
693 .channel
= sh7372_usb_dmae_channels
,
694 .channel_num
= ARRAY_SIZE(sh7372_usb_dmae_channels
),
695 .ts_low_shift
= USBTS_LOW_SHIFT
,
696 .ts_low_mask
= USBTS_LOW_BIT
<< USBTS_LOW_SHIFT
,
697 .ts_high_shift
= USBTS_HI_SHIFT
,
698 .ts_high_mask
= USBTS_HI_BIT
<< USBTS_HI_SHIFT
,
699 .ts_shift
= dma_usbts_shift
,
700 .ts_shift_num
= ARRAY_SIZE(dma_usbts_shift
),
701 .dmaor_init
= DMAOR_DME
,
703 .chcr_ie_bit
= 1 << 5,
710 static struct resource sh7372_usb_dmae0_resources
[] = {
712 /* Channel registers and DMAOR */
714 .end
= 0xe68a0064 - 1,
715 .flags
= IORESOURCE_MEM
,
720 .end
= 0xe68a0014 - 1,
721 .flags
= IORESOURCE_MEM
,
724 /* IRQ for channels */
725 .start
= evt2irq(0x0a00),
726 .end
= evt2irq(0x0a00),
727 .flags
= IORESOURCE_IRQ
,
731 static struct platform_device usb_dma0_device
= {
732 .name
= "sh-dma-engine",
734 .resource
= sh7372_usb_dmae0_resources
,
735 .num_resources
= ARRAY_SIZE(sh7372_usb_dmae0_resources
),
737 .platform_data
= &usb_dma0_platform_data
,
742 static const struct sh_dmae_slave_config sh7372_usb_dmae1_slaves
[] = {
744 .slave_id
= SHDMA_SLAVE_USB1_TX
,
745 .chcr
= USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE
),
747 .slave_id
= SHDMA_SLAVE_USB1_RX
,
748 .chcr
= USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE
),
752 static struct sh_dmae_pdata usb_dma1_platform_data
= {
753 .slave
= sh7372_usb_dmae1_slaves
,
754 .slave_num
= ARRAY_SIZE(sh7372_usb_dmae1_slaves
),
755 .channel
= sh7372_usb_dmae_channels
,
756 .channel_num
= ARRAY_SIZE(sh7372_usb_dmae_channels
),
757 .ts_low_shift
= USBTS_LOW_SHIFT
,
758 .ts_low_mask
= USBTS_LOW_BIT
<< USBTS_LOW_SHIFT
,
759 .ts_high_shift
= USBTS_HI_SHIFT
,
760 .ts_high_mask
= USBTS_HI_BIT
<< USBTS_HI_SHIFT
,
761 .ts_shift
= dma_usbts_shift
,
762 .ts_shift_num
= ARRAY_SIZE(dma_usbts_shift
),
763 .dmaor_init
= DMAOR_DME
,
765 .chcr_ie_bit
= 1 << 5,
772 static struct resource sh7372_usb_dmae1_resources
[] = {
774 /* Channel registers and DMAOR */
776 .end
= 0xe68c0064 - 1,
777 .flags
= IORESOURCE_MEM
,
782 .end
= 0xe68c0014 - 1,
783 .flags
= IORESOURCE_MEM
,
786 /* IRQ for channels */
787 .start
= evt2irq(0x1d00),
788 .end
= evt2irq(0x1d00),
789 .flags
= IORESOURCE_IRQ
,
793 static struct platform_device usb_dma1_device
= {
794 .name
= "sh-dma-engine",
796 .resource
= sh7372_usb_dmae1_resources
,
797 .num_resources
= ARRAY_SIZE(sh7372_usb_dmae1_resources
),
799 .platform_data
= &usb_dma1_platform_data
,
804 static struct uio_info vpu_platform_data
= {
807 .irq
= intcs_evt2irq(0x980),
810 static struct resource vpu_resources
[] = {
815 .flags
= IORESOURCE_MEM
,
819 static struct platform_device vpu_device
= {
820 .name
= "uio_pdrv_genirq",
823 .platform_data
= &vpu_platform_data
,
825 .resource
= vpu_resources
,
826 .num_resources
= ARRAY_SIZE(vpu_resources
),
830 static struct uio_info veu0_platform_data
= {
833 .irq
= intcs_evt2irq(0x700),
836 static struct resource veu0_resources
[] = {
841 .flags
= IORESOURCE_MEM
,
845 static struct platform_device veu0_device
= {
846 .name
= "uio_pdrv_genirq",
849 .platform_data
= &veu0_platform_data
,
851 .resource
= veu0_resources
,
852 .num_resources
= ARRAY_SIZE(veu0_resources
),
856 static struct uio_info veu1_platform_data
= {
859 .irq
= intcs_evt2irq(0x720),
862 static struct resource veu1_resources
[] = {
867 .flags
= IORESOURCE_MEM
,
871 static struct platform_device veu1_device
= {
872 .name
= "uio_pdrv_genirq",
875 .platform_data
= &veu1_platform_data
,
877 .resource
= veu1_resources
,
878 .num_resources
= ARRAY_SIZE(veu1_resources
),
882 static struct uio_info veu2_platform_data
= {
885 .irq
= intcs_evt2irq(0x740),
888 static struct resource veu2_resources
[] = {
893 .flags
= IORESOURCE_MEM
,
897 static struct platform_device veu2_device
= {
898 .name
= "uio_pdrv_genirq",
901 .platform_data
= &veu2_platform_data
,
903 .resource
= veu2_resources
,
904 .num_resources
= ARRAY_SIZE(veu2_resources
),
908 static struct uio_info veu3_platform_data
= {
911 .irq
= intcs_evt2irq(0x760),
914 static struct resource veu3_resources
[] = {
919 .flags
= IORESOURCE_MEM
,
923 static struct platform_device veu3_device
= {
924 .name
= "uio_pdrv_genirq",
927 .platform_data
= &veu3_platform_data
,
929 .resource
= veu3_resources
,
930 .num_resources
= ARRAY_SIZE(veu3_resources
),
934 static struct uio_info jpu_platform_data
= {
937 .irq
= intcs_evt2irq(0x560),
940 static struct resource jpu_resources
[] = {
945 .flags
= IORESOURCE_MEM
,
949 static struct platform_device jpu_device
= {
950 .name
= "uio_pdrv_genirq",
953 .platform_data
= &jpu_platform_data
,
955 .resource
= jpu_resources
,
956 .num_resources
= ARRAY_SIZE(jpu_resources
),
960 static struct uio_info spu0_platform_data
= {
963 .irq
= evt2irq(0x1800),
966 static struct resource spu0_resources
[] = {
971 .flags
= IORESOURCE_MEM
,
975 static struct platform_device spu0_device
= {
976 .name
= "uio_pdrv_genirq",
979 .platform_data
= &spu0_platform_data
,
981 .resource
= spu0_resources
,
982 .num_resources
= ARRAY_SIZE(spu0_resources
),
986 static struct uio_info spu1_platform_data
= {
989 .irq
= evt2irq(0x1820),
992 static struct resource spu1_resources
[] = {
997 .flags
= IORESOURCE_MEM
,
1001 static struct platform_device spu1_device
= {
1002 .name
= "uio_pdrv_genirq",
1005 .platform_data
= &spu1_platform_data
,
1007 .resource
= spu1_resources
,
1008 .num_resources
= ARRAY_SIZE(spu1_resources
),
1011 /* IPMMUI (an IPMMU module for ICB/LMB) */
1012 static struct resource ipmmu_resources
[] = {
1015 .start
= 0xfe951000,
1017 .flags
= IORESOURCE_MEM
,
1021 static const char * const ipmmu_dev_names
[] = {
1022 "sh_mobile_lcdc_fb.0",
1023 "sh_mobile_lcdc_fb.1",
1025 "uio_pdrv_genirq.0",
1026 "uio_pdrv_genirq.1",
1027 "uio_pdrv_genirq.2",
1028 "uio_pdrv_genirq.3",
1029 "uio_pdrv_genirq.4",
1030 "uio_pdrv_genirq.5",
1033 static struct shmobile_ipmmu_platform_data ipmmu_platform_data
= {
1034 .dev_names
= ipmmu_dev_names
,
1035 .num_dev_names
= ARRAY_SIZE(ipmmu_dev_names
),
1038 static struct platform_device ipmmu_device
= {
1042 .platform_data
= &ipmmu_platform_data
,
1044 .resource
= ipmmu_resources
,
1045 .num_resources
= ARRAY_SIZE(ipmmu_resources
),
1048 static struct platform_device
*sh7372_early_devices
[] __initdata
= {
1062 static struct platform_device
*sh7372_late_devices
[] __initdata
= {
1080 void __init
sh7372_add_standard_devices(void)
1082 struct pm_domain_device domain_devices
[] = {
1083 { "A3RV", &vpu_device
, },
1084 { "A4MP", &spu0_device
, },
1085 { "A4MP", &spu1_device
, },
1086 { "A3SP", &scif0_device
, },
1087 { "A3SP", &scif1_device
, },
1088 { "A3SP", &scif2_device
, },
1089 { "A3SP", &scif3_device
, },
1090 { "A3SP", &scif4_device
, },
1091 { "A3SP", &scif5_device
, },
1092 { "A3SP", &scif6_device
, },
1093 { "A3SP", &iic1_device
, },
1094 { "A3SP", &dma0_device
, },
1095 { "A3SP", &dma1_device
, },
1096 { "A3SP", &dma2_device
, },
1097 { "A3SP", &usb_dma0_device
, },
1098 { "A3SP", &usb_dma1_device
, },
1099 { "A4R", &iic0_device
, },
1100 { "A4R", &veu0_device
, },
1101 { "A4R", &veu1_device
, },
1102 { "A4R", &veu2_device
, },
1103 { "A4R", &veu3_device
, },
1104 { "A4R", &jpu_device
, },
1105 { "A4R", &tmu00_device
, },
1106 { "A4R", &tmu01_device
, },
1109 sh7372_init_pm_domains();
1111 platform_add_devices(sh7372_early_devices
,
1112 ARRAY_SIZE(sh7372_early_devices
));
1114 platform_add_devices(sh7372_late_devices
,
1115 ARRAY_SIZE(sh7372_late_devices
));
1117 rmobile_add_devices_to_domains(domain_devices
,
1118 ARRAY_SIZE(domain_devices
));
1121 void __init
sh7372_earlytimer_init(void)
1123 sh7372_clock_init();
1124 shmobile_earlytimer_init();
1127 void __init
sh7372_add_early_devices(void)
1129 early_platform_add_devices(sh7372_early_devices
,
1130 ARRAY_SIZE(sh7372_early_devices
));
1132 /* setup early console here as well */
1133 shmobile_setup_console();
1136 #ifdef CONFIG_USE_OF
1138 void __init
sh7372_add_early_devices_dt(void)
1140 shmobile_setup_delay(800, 1, 3); /* Cortex-A8 @ 800MHz */
1142 early_platform_add_devices(sh7372_early_devices
,
1143 ARRAY_SIZE(sh7372_early_devices
));
1145 /* setup early console here as well */
1146 shmobile_setup_console();
1149 void __init
sh7372_add_standard_devices_dt(void)
1151 /* clocks are setup late during boot in the case of DT */
1152 sh7372_clock_init();
1154 platform_add_devices(sh7372_early_devices
,
1155 ARRAY_SIZE(sh7372_early_devices
));
1157 of_platform_populate(NULL
, of_default_bus_match_table
, NULL
, NULL
);
1160 static const char *sh7372_boards_compat_dt
[] __initdata
= {
1165 DT_MACHINE_START(SH7372_DT
, "Generic SH7372 (Flattened Device Tree)")
1166 .map_io
= sh7372_map_io
,
1167 .init_early
= sh7372_add_early_devices_dt
,
1168 .nr_irqs
= NR_IRQS_LEGACY
,
1169 .init_irq
= sh7372_init_irq
,
1170 .handle_irq
= shmobile_handle_irq_intc
,
1171 .init_machine
= sh7372_add_standard_devices_dt
,
1172 .dt_compat
= sh7372_boards_compat_dt
,
1175 #endif /* CONFIG_USE_OF */