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/uio_driver.h>
26 #include <linux/delay.h>
27 #include <linux/input.h>
29 #include <linux/serial_sci.h>
30 #include <linux/sh_dma.h>
31 #include <linux/sh_intc.h>
32 #include <linux/sh_timer.h>
33 #include <linux/pm_domain.h>
34 #include <linux/dma-mapping.h>
35 #include <mach/hardware.h>
36 #include <mach/sh7372.h>
37 #include <mach/common.h>
38 #include <asm/mach/map.h>
39 #include <asm/mach-types.h>
40 #include <asm/mach/arch.h>
41 #include <asm/mach/time.h>
43 static struct map_desc sh7372_io_desc
[] __initdata
= {
44 /* create a 1:1 entity map for 0xe6xxxxxx
45 * used by CPGA, INTC and PFC.
48 .virtual = 0xe6000000,
49 .pfn
= __phys_to_pfn(0xe6000000),
51 .type
= MT_DEVICE_NONSHARED
55 void __init
sh7372_map_io(void)
57 iotable_init(sh7372_io_desc
, ARRAY_SIZE(sh7372_io_desc
));
60 * DMA memory at 0xff200000 - 0xffdfffff. The default 2MB size isn't
61 * enough to allocate the frame buffer memory.
63 init_consistent_dma_size(12 << 20);
67 static struct plat_sci_port scif0_platform_data
= {
68 .mapbase
= 0xe6c40000,
69 .flags
= UPF_BOOT_AUTOCONF
,
70 .scscr
= SCSCR_RE
| SCSCR_TE
,
71 .scbrr_algo_id
= SCBRR_ALGO_4
,
73 .irqs
= { evt2irq(0x0c00), evt2irq(0x0c00),
74 evt2irq(0x0c00), evt2irq(0x0c00) },
77 static struct platform_device scif0_device
= {
81 .platform_data
= &scif0_platform_data
,
86 static struct plat_sci_port scif1_platform_data
= {
87 .mapbase
= 0xe6c50000,
88 .flags
= UPF_BOOT_AUTOCONF
,
89 .scscr
= SCSCR_RE
| SCSCR_TE
,
90 .scbrr_algo_id
= SCBRR_ALGO_4
,
92 .irqs
= { evt2irq(0x0c20), evt2irq(0x0c20),
93 evt2irq(0x0c20), evt2irq(0x0c20) },
96 static struct platform_device scif1_device
= {
100 .platform_data
= &scif1_platform_data
,
105 static struct plat_sci_port scif2_platform_data
= {
106 .mapbase
= 0xe6c60000,
107 .flags
= UPF_BOOT_AUTOCONF
,
108 .scscr
= SCSCR_RE
| SCSCR_TE
,
109 .scbrr_algo_id
= SCBRR_ALGO_4
,
111 .irqs
= { evt2irq(0x0c40), evt2irq(0x0c40),
112 evt2irq(0x0c40), evt2irq(0x0c40) },
115 static struct platform_device scif2_device
= {
119 .platform_data
= &scif2_platform_data
,
124 static struct plat_sci_port scif3_platform_data
= {
125 .mapbase
= 0xe6c70000,
126 .flags
= UPF_BOOT_AUTOCONF
,
127 .scscr
= SCSCR_RE
| SCSCR_TE
,
128 .scbrr_algo_id
= SCBRR_ALGO_4
,
130 .irqs
= { evt2irq(0x0c60), evt2irq(0x0c60),
131 evt2irq(0x0c60), evt2irq(0x0c60) },
134 static struct platform_device scif3_device
= {
138 .platform_data
= &scif3_platform_data
,
143 static struct plat_sci_port scif4_platform_data
= {
144 .mapbase
= 0xe6c80000,
145 .flags
= UPF_BOOT_AUTOCONF
,
146 .scscr
= SCSCR_RE
| SCSCR_TE
,
147 .scbrr_algo_id
= SCBRR_ALGO_4
,
149 .irqs
= { evt2irq(0x0d20), evt2irq(0x0d20),
150 evt2irq(0x0d20), evt2irq(0x0d20) },
153 static struct platform_device scif4_device
= {
157 .platform_data
= &scif4_platform_data
,
162 static struct plat_sci_port scif5_platform_data
= {
163 .mapbase
= 0xe6cb0000,
164 .flags
= UPF_BOOT_AUTOCONF
,
165 .scscr
= SCSCR_RE
| SCSCR_TE
,
166 .scbrr_algo_id
= SCBRR_ALGO_4
,
168 .irqs
= { evt2irq(0x0d40), evt2irq(0x0d40),
169 evt2irq(0x0d40), evt2irq(0x0d40) },
172 static struct platform_device scif5_device
= {
176 .platform_data
= &scif5_platform_data
,
181 static struct plat_sci_port scif6_platform_data
= {
182 .mapbase
= 0xe6c30000,
183 .flags
= UPF_BOOT_AUTOCONF
,
184 .scscr
= SCSCR_RE
| SCSCR_TE
,
185 .scbrr_algo_id
= SCBRR_ALGO_4
,
187 .irqs
= { evt2irq(0x0d60), evt2irq(0x0d60),
188 evt2irq(0x0d60), evt2irq(0x0d60) },
191 static struct platform_device scif6_device
= {
195 .platform_data
= &scif6_platform_data
,
200 static struct sh_timer_config cmt2_platform_data
= {
202 .channel_offset
= 0x40,
204 .clockevent_rating
= 125,
205 .clocksource_rating
= 125,
208 static struct resource cmt2_resources
[] = {
213 .flags
= IORESOURCE_MEM
,
216 .start
= evt2irq(0x0b80), /* CMT2 */
217 .flags
= IORESOURCE_IRQ
,
221 static struct platform_device cmt2_device
= {
225 .platform_data
= &cmt2_platform_data
,
227 .resource
= cmt2_resources
,
228 .num_resources
= ARRAY_SIZE(cmt2_resources
),
232 static struct sh_timer_config tmu00_platform_data
= {
234 .channel_offset
= 0x4,
236 .clockevent_rating
= 200,
239 static struct resource tmu00_resources
[] = {
244 .flags
= IORESOURCE_MEM
,
247 .start
= intcs_evt2irq(0xe80), /* TMU_TUNI0 */
248 .flags
= IORESOURCE_IRQ
,
252 static struct platform_device tmu00_device
= {
256 .platform_data
= &tmu00_platform_data
,
258 .resource
= tmu00_resources
,
259 .num_resources
= ARRAY_SIZE(tmu00_resources
),
262 static struct sh_timer_config tmu01_platform_data
= {
264 .channel_offset
= 0x10,
266 .clocksource_rating
= 200,
269 static struct resource tmu01_resources
[] = {
274 .flags
= IORESOURCE_MEM
,
277 .start
= intcs_evt2irq(0xea0), /* TMU_TUNI1 */
278 .flags
= IORESOURCE_IRQ
,
282 static struct platform_device tmu01_device
= {
286 .platform_data
= &tmu01_platform_data
,
288 .resource
= tmu01_resources
,
289 .num_resources
= ARRAY_SIZE(tmu01_resources
),
293 static struct resource iic0_resources
[] = {
297 .end
= 0xFFF20425 - 1,
298 .flags
= IORESOURCE_MEM
,
301 .start
= intcs_evt2irq(0xe00), /* IIC0_ALI0 */
302 .end
= intcs_evt2irq(0xe60), /* IIC0_DTEI0 */
303 .flags
= IORESOURCE_IRQ
,
307 static struct platform_device iic0_device
= {
308 .name
= "i2c-sh_mobile",
309 .id
= 0, /* "i2c0" clock */
310 .num_resources
= ARRAY_SIZE(iic0_resources
),
311 .resource
= iic0_resources
,
314 static struct resource iic1_resources
[] = {
318 .end
= 0xE6C20425 - 1,
319 .flags
= IORESOURCE_MEM
,
322 .start
= evt2irq(0x780), /* IIC1_ALI1 */
323 .end
= evt2irq(0x7e0), /* IIC1_DTEI1 */
324 .flags
= IORESOURCE_IRQ
,
328 static struct platform_device iic1_device
= {
329 .name
= "i2c-sh_mobile",
330 .id
= 1, /* "i2c1" clock */
331 .num_resources
= ARRAY_SIZE(iic1_resources
),
332 .resource
= iic1_resources
,
336 /* Transmit sizes and respective CHCR register values */
347 /* log2(size / 8) - used to calculate number of transfers */
349 [XMIT_SZ_8BIT] = 0, \
350 [XMIT_SZ_16BIT] = 1, \
351 [XMIT_SZ_32BIT] = 2, \
352 [XMIT_SZ_64BIT] = 3, \
353 [XMIT_SZ_128BIT] = 4, \
354 [XMIT_SZ_256BIT] = 5, \
355 [XMIT_SZ_512BIT] = 6, \
358 #define TS_INDEX2VAL(i) ((((i) & 3) << 3) | \
359 (((i) & 0xc) << (20 - 2)))
361 static const struct sh_dmae_slave_config sh7372_dmae_slaves
[] = {
363 .slave_id
= SHDMA_SLAVE_SCIF0_TX
,
365 .chcr
= DM_FIX
| SM_INC
| 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT
),
368 .slave_id
= SHDMA_SLAVE_SCIF0_RX
,
370 .chcr
= DM_INC
| SM_FIX
| 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT
),
373 .slave_id
= SHDMA_SLAVE_SCIF1_TX
,
375 .chcr
= DM_FIX
| SM_INC
| 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT
),
378 .slave_id
= SHDMA_SLAVE_SCIF1_RX
,
380 .chcr
= DM_INC
| SM_FIX
| 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT
),
383 .slave_id
= SHDMA_SLAVE_SCIF2_TX
,
385 .chcr
= DM_FIX
| SM_INC
| 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT
),
388 .slave_id
= SHDMA_SLAVE_SCIF2_RX
,
390 .chcr
= DM_INC
| SM_FIX
| 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT
),
393 .slave_id
= SHDMA_SLAVE_SCIF3_TX
,
395 .chcr
= DM_FIX
| SM_INC
| 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT
),
398 .slave_id
= SHDMA_SLAVE_SCIF3_RX
,
400 .chcr
= DM_INC
| SM_FIX
| 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT
),
403 .slave_id
= SHDMA_SLAVE_SCIF4_TX
,
405 .chcr
= DM_FIX
| SM_INC
| 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT
),
408 .slave_id
= SHDMA_SLAVE_SCIF4_RX
,
410 .chcr
= DM_INC
| SM_FIX
| 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT
),
413 .slave_id
= SHDMA_SLAVE_SCIF5_TX
,
415 .chcr
= DM_FIX
| SM_INC
| 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT
),
418 .slave_id
= SHDMA_SLAVE_SCIF5_RX
,
420 .chcr
= DM_INC
| SM_FIX
| 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT
),
423 .slave_id
= SHDMA_SLAVE_SCIF6_TX
,
425 .chcr
= DM_FIX
| SM_INC
| 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT
),
428 .slave_id
= SHDMA_SLAVE_SCIF6_RX
,
430 .chcr
= DM_INC
| SM_FIX
| 0x800 | TS_INDEX2VAL(XMIT_SZ_8BIT
),
433 .slave_id
= SHDMA_SLAVE_SDHI0_TX
,
435 .chcr
= DM_FIX
| SM_INC
| 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT
),
438 .slave_id
= SHDMA_SLAVE_SDHI0_RX
,
440 .chcr
= DM_INC
| SM_FIX
| 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT
),
443 .slave_id
= SHDMA_SLAVE_SDHI1_TX
,
445 .chcr
= DM_FIX
| SM_INC
| 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT
),
448 .slave_id
= SHDMA_SLAVE_SDHI1_RX
,
450 .chcr
= DM_INC
| SM_FIX
| 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT
),
453 .slave_id
= SHDMA_SLAVE_SDHI2_TX
,
455 .chcr
= DM_FIX
| SM_INC
| 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT
),
458 .slave_id
= SHDMA_SLAVE_SDHI2_RX
,
460 .chcr
= DM_INC
| SM_FIX
| 0x800 | TS_INDEX2VAL(XMIT_SZ_16BIT
),
463 .slave_id
= SHDMA_SLAVE_MMCIF_TX
,
465 .chcr
= DM_FIX
| SM_INC
| 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT
),
468 .slave_id
= SHDMA_SLAVE_MMCIF_RX
,
470 .chcr
= DM_INC
| SM_FIX
| 0x800 | TS_INDEX2VAL(XMIT_SZ_32BIT
),
475 #define SH7372_CHCLR 0x220
477 static const struct sh_dmae_channel sh7372_dmae_channels
[] = {
482 .chclr_offset
= SH7372_CHCLR
+ 0,
487 .chclr_offset
= SH7372_CHCLR
+ 0x10,
492 .chclr_offset
= SH7372_CHCLR
+ 0x20,
497 .chclr_offset
= SH7372_CHCLR
+ 0x30,
502 .chclr_offset
= SH7372_CHCLR
+ 0x50,
507 .chclr_offset
= SH7372_CHCLR
+ 0x60,
511 static const unsigned int ts_shift
[] = TS_SHIFT
;
513 static struct sh_dmae_pdata dma_platform_data
= {
514 .slave
= sh7372_dmae_slaves
,
515 .slave_num
= ARRAY_SIZE(sh7372_dmae_slaves
),
516 .channel
= sh7372_dmae_channels
,
517 .channel_num
= ARRAY_SIZE(sh7372_dmae_channels
),
520 .ts_high_shift
= (20 - 2), /* 2 bits for shifted low TS */
521 .ts_high_mask
= 0x00300000,
522 .ts_shift
= ts_shift
,
523 .ts_shift_num
= ARRAY_SIZE(ts_shift
),
524 .dmaor_init
= DMAOR_DME
,
528 /* Resource order important! */
529 static struct resource sh7372_dmae0_resources
[] = {
531 /* Channel registers and DMAOR */
534 .flags
= IORESOURCE_MEM
,
540 .flags
= IORESOURCE_MEM
,
544 .start
= evt2irq(0x20c0),
545 .end
= evt2irq(0x20c0),
546 .flags
= IORESOURCE_IRQ
,
549 /* IRQ for channels 0-5 */
550 .start
= evt2irq(0x2000),
551 .end
= evt2irq(0x20a0),
552 .flags
= IORESOURCE_IRQ
,
556 /* Resource order important! */
557 static struct resource sh7372_dmae1_resources
[] = {
559 /* Channel registers and DMAOR */
562 .flags
= IORESOURCE_MEM
,
568 .flags
= IORESOURCE_MEM
,
572 .start
= evt2irq(0x21c0),
573 .end
= evt2irq(0x21c0),
574 .flags
= IORESOURCE_IRQ
,
577 /* IRQ for channels 0-5 */
578 .start
= evt2irq(0x2100),
579 .end
= evt2irq(0x21a0),
580 .flags
= IORESOURCE_IRQ
,
584 /* Resource order important! */
585 static struct resource sh7372_dmae2_resources
[] = {
587 /* Channel registers and DMAOR */
590 .flags
= IORESOURCE_MEM
,
596 .flags
= IORESOURCE_MEM
,
600 .start
= evt2irq(0x22c0),
601 .end
= evt2irq(0x22c0),
602 .flags
= IORESOURCE_IRQ
,
605 /* IRQ for channels 0-5 */
606 .start
= evt2irq(0x2200),
607 .end
= evt2irq(0x22a0),
608 .flags
= IORESOURCE_IRQ
,
612 static struct platform_device dma0_device
= {
613 .name
= "sh-dma-engine",
615 .resource
= sh7372_dmae0_resources
,
616 .num_resources
= ARRAY_SIZE(sh7372_dmae0_resources
),
618 .platform_data
= &dma_platform_data
,
622 static struct platform_device dma1_device
= {
623 .name
= "sh-dma-engine",
625 .resource
= sh7372_dmae1_resources
,
626 .num_resources
= ARRAY_SIZE(sh7372_dmae1_resources
),
628 .platform_data
= &dma_platform_data
,
632 static struct platform_device dma2_device
= {
633 .name
= "sh-dma-engine",
635 .resource
= sh7372_dmae2_resources
,
636 .num_resources
= ARRAY_SIZE(sh7372_dmae2_resources
),
638 .platform_data
= &dma_platform_data
,
646 unsigned int usbts_shift
[] = {3, 4, 5};
654 #define USBTS_INDEX2VAL(i) (((i) & 3) << 6)
656 static const struct sh_dmae_channel sh7372_usb_dmae_channels
[] = {
665 static const struct sh_dmae_slave_config sh7372_usb_dmae0_slaves
[] = {
667 .slave_id
= SHDMA_SLAVE_USB0_TX
,
668 .chcr
= USBTS_INDEX2VAL(XMIT_SZ_8BYTE
),
670 .slave_id
= SHDMA_SLAVE_USB0_RX
,
671 .chcr
= USBTS_INDEX2VAL(XMIT_SZ_8BYTE
),
675 static struct sh_dmae_pdata usb_dma0_platform_data
= {
676 .slave
= sh7372_usb_dmae0_slaves
,
677 .slave_num
= ARRAY_SIZE(sh7372_usb_dmae0_slaves
),
678 .channel
= sh7372_usb_dmae_channels
,
679 .channel_num
= ARRAY_SIZE(sh7372_usb_dmae_channels
),
684 .ts_shift
= usbts_shift
,
685 .ts_shift_num
= ARRAY_SIZE(usbts_shift
),
686 .dmaor_init
= DMAOR_DME
,
688 .chcr_ie_bit
= 1 << 5,
695 static struct resource sh7372_usb_dmae0_resources
[] = {
697 /* Channel registers and DMAOR */
699 .end
= 0xe68a0064 - 1,
700 .flags
= IORESOURCE_MEM
,
705 .end
= 0xe68a0014 - 1,
706 .flags
= IORESOURCE_MEM
,
709 /* IRQ for channels */
710 .start
= evt2irq(0x0a00),
711 .end
= evt2irq(0x0a00),
712 .flags
= IORESOURCE_IRQ
,
716 static struct platform_device usb_dma0_device
= {
717 .name
= "sh-dma-engine",
719 .resource
= sh7372_usb_dmae0_resources
,
720 .num_resources
= ARRAY_SIZE(sh7372_usb_dmae0_resources
),
722 .platform_data
= &usb_dma0_platform_data
,
727 static const struct sh_dmae_slave_config sh7372_usb_dmae1_slaves
[] = {
729 .slave_id
= SHDMA_SLAVE_USB1_TX
,
730 .chcr
= USBTS_INDEX2VAL(XMIT_SZ_8BYTE
),
732 .slave_id
= SHDMA_SLAVE_USB1_RX
,
733 .chcr
= USBTS_INDEX2VAL(XMIT_SZ_8BYTE
),
737 static struct sh_dmae_pdata usb_dma1_platform_data
= {
738 .slave
= sh7372_usb_dmae1_slaves
,
739 .slave_num
= ARRAY_SIZE(sh7372_usb_dmae1_slaves
),
740 .channel
= sh7372_usb_dmae_channels
,
741 .channel_num
= ARRAY_SIZE(sh7372_usb_dmae_channels
),
746 .ts_shift
= usbts_shift
,
747 .ts_shift_num
= ARRAY_SIZE(usbts_shift
),
748 .dmaor_init
= DMAOR_DME
,
750 .chcr_ie_bit
= 1 << 5,
757 static struct resource sh7372_usb_dmae1_resources
[] = {
759 /* Channel registers and DMAOR */
761 .end
= 0xe68c0064 - 1,
762 .flags
= IORESOURCE_MEM
,
767 .end
= 0xe68c0014 - 1,
768 .flags
= IORESOURCE_MEM
,
771 /* IRQ for channels */
772 .start
= evt2irq(0x1d00),
773 .end
= evt2irq(0x1d00),
774 .flags
= IORESOURCE_IRQ
,
778 static struct platform_device usb_dma1_device
= {
779 .name
= "sh-dma-engine",
781 .resource
= sh7372_usb_dmae1_resources
,
782 .num_resources
= ARRAY_SIZE(sh7372_usb_dmae1_resources
),
784 .platform_data
= &usb_dma1_platform_data
,
789 static struct uio_info vpu_platform_data
= {
792 .irq
= intcs_evt2irq(0x980),
795 static struct resource vpu_resources
[] = {
800 .flags
= IORESOURCE_MEM
,
804 static struct platform_device vpu_device
= {
805 .name
= "uio_pdrv_genirq",
808 .platform_data
= &vpu_platform_data
,
810 .resource
= vpu_resources
,
811 .num_resources
= ARRAY_SIZE(vpu_resources
),
815 static struct uio_info veu0_platform_data
= {
818 .irq
= intcs_evt2irq(0x700),
821 static struct resource veu0_resources
[] = {
826 .flags
= IORESOURCE_MEM
,
830 static struct platform_device veu0_device
= {
831 .name
= "uio_pdrv_genirq",
834 .platform_data
= &veu0_platform_data
,
836 .resource
= veu0_resources
,
837 .num_resources
= ARRAY_SIZE(veu0_resources
),
841 static struct uio_info veu1_platform_data
= {
844 .irq
= intcs_evt2irq(0x720),
847 static struct resource veu1_resources
[] = {
852 .flags
= IORESOURCE_MEM
,
856 static struct platform_device veu1_device
= {
857 .name
= "uio_pdrv_genirq",
860 .platform_data
= &veu1_platform_data
,
862 .resource
= veu1_resources
,
863 .num_resources
= ARRAY_SIZE(veu1_resources
),
867 static struct uio_info veu2_platform_data
= {
870 .irq
= intcs_evt2irq(0x740),
873 static struct resource veu2_resources
[] = {
878 .flags
= IORESOURCE_MEM
,
882 static struct platform_device veu2_device
= {
883 .name
= "uio_pdrv_genirq",
886 .platform_data
= &veu2_platform_data
,
888 .resource
= veu2_resources
,
889 .num_resources
= ARRAY_SIZE(veu2_resources
),
893 static struct uio_info veu3_platform_data
= {
896 .irq
= intcs_evt2irq(0x760),
899 static struct resource veu3_resources
[] = {
904 .flags
= IORESOURCE_MEM
,
908 static struct platform_device veu3_device
= {
909 .name
= "uio_pdrv_genirq",
912 .platform_data
= &veu3_platform_data
,
914 .resource
= veu3_resources
,
915 .num_resources
= ARRAY_SIZE(veu3_resources
),
919 static struct uio_info jpu_platform_data
= {
922 .irq
= intcs_evt2irq(0x560),
925 static struct resource jpu_resources
[] = {
930 .flags
= IORESOURCE_MEM
,
934 static struct platform_device jpu_device
= {
935 .name
= "uio_pdrv_genirq",
938 .platform_data
= &jpu_platform_data
,
940 .resource
= jpu_resources
,
941 .num_resources
= ARRAY_SIZE(jpu_resources
),
945 static struct uio_info spu0_platform_data
= {
948 .irq
= evt2irq(0x1800),
951 static struct resource spu0_resources
[] = {
956 .flags
= IORESOURCE_MEM
,
960 static struct platform_device spu0_device
= {
961 .name
= "uio_pdrv_genirq",
964 .platform_data
= &spu0_platform_data
,
966 .resource
= spu0_resources
,
967 .num_resources
= ARRAY_SIZE(spu0_resources
),
971 static struct uio_info spu1_platform_data
= {
974 .irq
= evt2irq(0x1820),
977 static struct resource spu1_resources
[] = {
982 .flags
= IORESOURCE_MEM
,
986 static struct platform_device spu1_device
= {
987 .name
= "uio_pdrv_genirq",
990 .platform_data
= &spu1_platform_data
,
992 .resource
= spu1_resources
,
993 .num_resources
= ARRAY_SIZE(spu1_resources
),
996 static struct platform_device
*sh7372_early_devices
[] __initdata
= {
1009 static struct platform_device
*sh7372_late_devices
[] __initdata
= {
1027 void __init
sh7372_add_standard_devices(void)
1029 sh7372_init_pm_domain(&sh7372_a4lc
);
1030 sh7372_init_pm_domain(&sh7372_a4mp
);
1031 sh7372_init_pm_domain(&sh7372_d4
);
1032 sh7372_init_pm_domain(&sh7372_a4r
);
1033 sh7372_init_pm_domain(&sh7372_a3rv
);
1034 sh7372_init_pm_domain(&sh7372_a3ri
);
1035 sh7372_init_pm_domain(&sh7372_a4s
);
1036 sh7372_init_pm_domain(&sh7372_a3sp
);
1037 sh7372_init_pm_domain(&sh7372_a3sg
);
1039 sh7372_pm_add_subdomain(&sh7372_a4lc
, &sh7372_a3rv
);
1040 sh7372_pm_add_subdomain(&sh7372_a4r
, &sh7372_a4lc
);
1042 sh7372_pm_add_subdomain(&sh7372_a4s
, &sh7372_a3sg
);
1043 sh7372_pm_add_subdomain(&sh7372_a4s
, &sh7372_a3sp
);
1045 platform_add_devices(sh7372_early_devices
,
1046 ARRAY_SIZE(sh7372_early_devices
));
1048 platform_add_devices(sh7372_late_devices
,
1049 ARRAY_SIZE(sh7372_late_devices
));
1051 sh7372_add_device_to_domain(&sh7372_a3rv
, &vpu_device
);
1052 sh7372_add_device_to_domain(&sh7372_a4mp
, &spu0_device
);
1053 sh7372_add_device_to_domain(&sh7372_a4mp
, &spu1_device
);
1054 sh7372_add_device_to_domain(&sh7372_a3sp
, &scif0_device
);
1055 sh7372_add_device_to_domain(&sh7372_a3sp
, &scif1_device
);
1056 sh7372_add_device_to_domain(&sh7372_a3sp
, &scif2_device
);
1057 sh7372_add_device_to_domain(&sh7372_a3sp
, &scif3_device
);
1058 sh7372_add_device_to_domain(&sh7372_a3sp
, &scif4_device
);
1059 sh7372_add_device_to_domain(&sh7372_a3sp
, &scif5_device
);
1060 sh7372_add_device_to_domain(&sh7372_a3sp
, &scif6_device
);
1061 sh7372_add_device_to_domain(&sh7372_a3sp
, &iic1_device
);
1062 sh7372_add_device_to_domain(&sh7372_a3sp
, &dma0_device
);
1063 sh7372_add_device_to_domain(&sh7372_a3sp
, &dma1_device
);
1064 sh7372_add_device_to_domain(&sh7372_a3sp
, &dma2_device
);
1065 sh7372_add_device_to_domain(&sh7372_a3sp
, &usb_dma0_device
);
1066 sh7372_add_device_to_domain(&sh7372_a3sp
, &usb_dma1_device
);
1067 sh7372_add_device_to_domain(&sh7372_a4r
, &iic0_device
);
1068 sh7372_add_device_to_domain(&sh7372_a4r
, &veu0_device
);
1069 sh7372_add_device_to_domain(&sh7372_a4r
, &veu1_device
);
1070 sh7372_add_device_to_domain(&sh7372_a4r
, &veu2_device
);
1071 sh7372_add_device_to_domain(&sh7372_a4r
, &veu3_device
);
1072 sh7372_add_device_to_domain(&sh7372_a4r
, &jpu_device
);
1075 static void __init
sh7372_earlytimer_init(void)
1077 sh7372_clock_init();
1078 shmobile_earlytimer_init();
1081 void __init
sh7372_add_early_devices(void)
1083 early_platform_add_devices(sh7372_early_devices
,
1084 ARRAY_SIZE(sh7372_early_devices
));
1086 /* setup early console here as well */
1087 shmobile_setup_console();
1089 /* override timer setup with soc-specific code */
1090 shmobile_timer
.init
= sh7372_earlytimer_init
;