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 <mach/dma-register.h>
37 #include <mach/hardware.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));
63 * DMA memory at 0xff200000 - 0xffdfffff. The default 2MB size isn't
64 * enough to allocate the frame buffer memory.
66 init_consistent_dma_size(12 << 20);
70 static struct plat_sci_port scif0_platform_data = {
71 .mapbase = 0xe6c40000,
72 .flags = UPF_BOOT_AUTOCONF,
73 .scscr = SCSCR_RE | SCSCR_TE,
74 .scbrr_algo_id = SCBRR_ALGO_4,
76 .irqs = { evt2irq(0x0c00), evt2irq(0x0c00),
77 evt2irq(0x0c00), evt2irq(0x0c00) },
80 static struct platform_device scif0_device = {
84 .platform_data = &scif0_platform_data,
89 static struct plat_sci_port scif1_platform_data = {
90 .mapbase = 0xe6c50000,
91 .flags = UPF_BOOT_AUTOCONF,
92 .scscr = SCSCR_RE | SCSCR_TE,
93 .scbrr_algo_id = SCBRR_ALGO_4,
95 .irqs = { evt2irq(0x0c20), evt2irq(0x0c20),
96 evt2irq(0x0c20), evt2irq(0x0c20) },
99 static struct platform_device scif1_device = {
103 .platform_data = &scif1_platform_data,
108 static struct plat_sci_port scif2_platform_data = {
109 .mapbase = 0xe6c60000,
110 .flags = UPF_BOOT_AUTOCONF,
111 .scscr = SCSCR_RE | SCSCR_TE,
112 .scbrr_algo_id = SCBRR_ALGO_4,
114 .irqs = { evt2irq(0x0c40), evt2irq(0x0c40),
115 evt2irq(0x0c40), evt2irq(0x0c40) },
118 static struct platform_device scif2_device = {
122 .platform_data = &scif2_platform_data,
127 static struct plat_sci_port scif3_platform_data = {
128 .mapbase = 0xe6c70000,
129 .flags = UPF_BOOT_AUTOCONF,
130 .scscr = SCSCR_RE | SCSCR_TE,
131 .scbrr_algo_id = SCBRR_ALGO_4,
133 .irqs = { evt2irq(0x0c60), evt2irq(0x0c60),
134 evt2irq(0x0c60), evt2irq(0x0c60) },
137 static struct platform_device scif3_device = {
141 .platform_data = &scif3_platform_data,
146 static struct plat_sci_port scif4_platform_data = {
147 .mapbase = 0xe6c80000,
148 .flags = UPF_BOOT_AUTOCONF,
149 .scscr = SCSCR_RE | SCSCR_TE,
150 .scbrr_algo_id = SCBRR_ALGO_4,
152 .irqs = { evt2irq(0x0d20), evt2irq(0x0d20),
153 evt2irq(0x0d20), evt2irq(0x0d20) },
156 static struct platform_device scif4_device = {
160 .platform_data = &scif4_platform_data,
165 static struct plat_sci_port scif5_platform_data = {
166 .mapbase = 0xe6cb0000,
167 .flags = UPF_BOOT_AUTOCONF,
168 .scscr = SCSCR_RE | SCSCR_TE,
169 .scbrr_algo_id = SCBRR_ALGO_4,
171 .irqs = { evt2irq(0x0d40), evt2irq(0x0d40),
172 evt2irq(0x0d40), evt2irq(0x0d40) },
175 static struct platform_device scif5_device = {
179 .platform_data = &scif5_platform_data,
184 static struct plat_sci_port scif6_platform_data = {
185 .mapbase = 0xe6c30000,
186 .flags = UPF_BOOT_AUTOCONF,
187 .scscr = SCSCR_RE | SCSCR_TE,
188 .scbrr_algo_id = SCBRR_ALGO_4,
190 .irqs = { evt2irq(0x0d60), evt2irq(0x0d60),
191 evt2irq(0x0d60), evt2irq(0x0d60) },
194 static struct platform_device scif6_device = {
198 .platform_data = &scif6_platform_data,
203 static struct sh_timer_config cmt2_platform_data = {
205 .channel_offset = 0x40,
207 .clockevent_rating = 125,
208 .clocksource_rating = 125,
211 static struct resource cmt2_resources[] = {
216 .flags = IORESOURCE_MEM,
219 .start = evt2irq(0x0b80), /* CMT2 */
220 .flags = IORESOURCE_IRQ,
224 static struct platform_device cmt2_device = {
228 .platform_data = &cmt2_platform_data,
230 .resource = cmt2_resources,
231 .num_resources = ARRAY_SIZE(cmt2_resources),
235 static struct sh_timer_config tmu00_platform_data = {
237 .channel_offset = 0x4,
239 .clockevent_rating = 200,
242 static struct resource tmu00_resources[] = {
247 .flags = IORESOURCE_MEM,
250 .start = intcs_evt2irq(0xe80), /* TMU_TUNI0 */
251 .flags = IORESOURCE_IRQ,
255 static struct platform_device tmu00_device = {
259 .platform_data = &tmu00_platform_data,
261 .resource = tmu00_resources,
262 .num_resources = ARRAY_SIZE(tmu00_resources),
265 static struct sh_timer_config tmu01_platform_data = {
267 .channel_offset = 0x10,
269 .clocksource_rating = 200,
272 static struct resource tmu01_resources[] = {
277 .flags = IORESOURCE_MEM,
280 .start = intcs_evt2irq(0xea0), /* TMU_TUNI1 */
281 .flags = IORESOURCE_IRQ,
285 static struct platform_device tmu01_device = {
289 .platform_data = &tmu01_platform_data,
291 .resource = tmu01_resources,
292 .num_resources = ARRAY_SIZE(tmu01_resources),
296 static struct resource iic0_resources[] = {
300 .end = 0xFFF20425 - 1,
301 .flags = IORESOURCE_MEM,
304 .start = intcs_evt2irq(0xe00), /* IIC0_ALI0 */
305 .end = intcs_evt2irq(0xe60), /* IIC0_DTEI0 */
306 .flags = IORESOURCE_IRQ,
310 static struct platform_device iic0_device = {
311 .name = "i2c-sh_mobile",
312 .id = 0, /* "i2c0" clock */
313 .num_resources = ARRAY_SIZE(iic0_resources),
314 .resource = iic0_resources,
317 static struct resource iic1_resources[] = {
321 .end = 0xE6C20425 - 1,
322 .flags = IORESOURCE_MEM,
325 .start = evt2irq(0x780), /* IIC1_ALI1 */
326 .end = evt2irq(0x7e0), /* IIC1_DTEI1 */
327 .flags = IORESOURCE_IRQ,
331 static struct platform_device iic1_device = {
332 .name = "i2c-sh_mobile",
333 .id = 1, /* "i2c1" clock */
334 .num_resources = ARRAY_SIZE(iic1_resources),
335 .resource = iic1_resources,
339 static const struct sh_dmae_slave_config sh7372_dmae_slaves[] = {
341 .slave_id = SHDMA_SLAVE_SCIF0_TX,
343 .chcr = CHCR_TX(XMIT_SZ_8BIT),
346 .slave_id = SHDMA_SLAVE_SCIF0_RX,
348 .chcr = CHCR_RX(XMIT_SZ_8BIT),
351 .slave_id = SHDMA_SLAVE_SCIF1_TX,
353 .chcr = CHCR_TX(XMIT_SZ_8BIT),
356 .slave_id = SHDMA_SLAVE_SCIF1_RX,
358 .chcr = CHCR_RX(XMIT_SZ_8BIT),
361 .slave_id = SHDMA_SLAVE_SCIF2_TX,
363 .chcr = CHCR_TX(XMIT_SZ_8BIT),
366 .slave_id = SHDMA_SLAVE_SCIF2_RX,
368 .chcr = CHCR_RX(XMIT_SZ_8BIT),
371 .slave_id = SHDMA_SLAVE_SCIF3_TX,
373 .chcr = CHCR_TX(XMIT_SZ_8BIT),
376 .slave_id = SHDMA_SLAVE_SCIF3_RX,
378 .chcr = CHCR_RX(XMIT_SZ_8BIT),
381 .slave_id = SHDMA_SLAVE_SCIF4_TX,
383 .chcr = CHCR_TX(XMIT_SZ_8BIT),
386 .slave_id = SHDMA_SLAVE_SCIF4_RX,
388 .chcr = CHCR_RX(XMIT_SZ_8BIT),
391 .slave_id = SHDMA_SLAVE_SCIF5_TX,
393 .chcr = CHCR_TX(XMIT_SZ_8BIT),
396 .slave_id = SHDMA_SLAVE_SCIF5_RX,
398 .chcr = CHCR_RX(XMIT_SZ_8BIT),
401 .slave_id = SHDMA_SLAVE_SCIF6_TX,
403 .chcr = CHCR_TX(XMIT_SZ_8BIT),
406 .slave_id = SHDMA_SLAVE_SCIF6_RX,
408 .chcr = CHCR_RX(XMIT_SZ_8BIT),
411 .slave_id = SHDMA_SLAVE_FLCTL0_TX,
413 .chcr = CHCR_TX(XMIT_SZ_32BIT),
416 .slave_id = SHDMA_SLAVE_FLCTL0_RX,
418 .chcr = CHCR_RX(XMIT_SZ_32BIT),
421 .slave_id = SHDMA_SLAVE_FLCTL1_TX,
423 .chcr = CHCR_TX(XMIT_SZ_32BIT),
426 .slave_id = SHDMA_SLAVE_FLCTL1_RX,
428 .chcr = CHCR_RX(XMIT_SZ_32BIT),
431 .slave_id = SHDMA_SLAVE_SDHI0_TX,
433 .chcr = CHCR_TX(XMIT_SZ_16BIT),
436 .slave_id = SHDMA_SLAVE_SDHI0_RX,
438 .chcr = CHCR_RX(XMIT_SZ_16BIT),
441 .slave_id = SHDMA_SLAVE_SDHI1_TX,
443 .chcr = CHCR_TX(XMIT_SZ_16BIT),
446 .slave_id = SHDMA_SLAVE_SDHI1_RX,
448 .chcr = CHCR_RX(XMIT_SZ_16BIT),
451 .slave_id = SHDMA_SLAVE_SDHI2_TX,
453 .chcr = CHCR_TX(XMIT_SZ_16BIT),
456 .slave_id = SHDMA_SLAVE_SDHI2_RX,
458 .chcr = CHCR_RX(XMIT_SZ_16BIT),
461 .slave_id = SHDMA_SLAVE_FSIA_TX,
463 .chcr = CHCR_TX(XMIT_SZ_32BIT),
466 .slave_id = SHDMA_SLAVE_FSIA_RX,
468 .chcr = CHCR_RX(XMIT_SZ_32BIT),
471 .slave_id = SHDMA_SLAVE_MMCIF_TX,
473 .chcr = CHCR_TX(XMIT_SZ_32BIT),
476 .slave_id = SHDMA_SLAVE_MMCIF_RX,
478 .chcr = CHCR_RX(XMIT_SZ_32BIT),
483 #define SH7372_CHCLR (0x220 - 0x20)
485 static const struct sh_dmae_channel sh7372_dmae_channels[] = {
490 .chclr_offset = SH7372_CHCLR + 0,
495 .chclr_offset = SH7372_CHCLR + 0x10,
500 .chclr_offset = SH7372_CHCLR + 0x20,
505 .chclr_offset = SH7372_CHCLR + 0x30,
510 .chclr_offset = SH7372_CHCLR + 0x50,
515 .chclr_offset = SH7372_CHCLR + 0x60,
519 static struct sh_dmae_pdata dma_platform_data = {
520 .slave = sh7372_dmae_slaves,
521 .slave_num = ARRAY_SIZE(sh7372_dmae_slaves),
522 .channel = sh7372_dmae_channels,
523 .channel_num = ARRAY_SIZE(sh7372_dmae_channels),
524 .ts_low_shift = TS_LOW_SHIFT,
525 .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT,
526 .ts_high_shift = TS_HI_SHIFT,
527 .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT,
528 .ts_shift = dma_ts_shift,
529 .ts_shift_num = ARRAY_SIZE(dma_ts_shift),
530 .dmaor_init = DMAOR_DME,
534 /* Resource order important! */
535 static struct resource sh7372_dmae0_resources[] = {
537 /* Channel registers and DMAOR */
540 .flags = IORESOURCE_MEM,
546 .flags = IORESOURCE_MEM,
550 .start = evt2irq(0x20c0),
551 .end = evt2irq(0x20c0),
552 .flags = IORESOURCE_IRQ,
555 /* IRQ for channels 0-5 */
556 .start = evt2irq(0x2000),
557 .end = evt2irq(0x20a0),
558 .flags = IORESOURCE_IRQ,
562 /* Resource order important! */
563 static struct resource sh7372_dmae1_resources[] = {
565 /* Channel registers and DMAOR */
568 .flags = IORESOURCE_MEM,
574 .flags = IORESOURCE_MEM,
578 .start = evt2irq(0x21c0),
579 .end = evt2irq(0x21c0),
580 .flags = IORESOURCE_IRQ,
583 /* IRQ for channels 0-5 */
584 .start = evt2irq(0x2100),
585 .end = evt2irq(0x21a0),
586 .flags = IORESOURCE_IRQ,
590 /* Resource order important! */
591 static struct resource sh7372_dmae2_resources[] = {
593 /* Channel registers and DMAOR */
596 .flags = IORESOURCE_MEM,
602 .flags = IORESOURCE_MEM,
606 .start = evt2irq(0x22c0),
607 .end = evt2irq(0x22c0),
608 .flags = IORESOURCE_IRQ,
611 /* IRQ for channels 0-5 */
612 .start = evt2irq(0x2200),
613 .end = evt2irq(0x22a0),
614 .flags = IORESOURCE_IRQ,
618 static struct platform_device dma0_device = {
619 .name = "sh-dma-engine",
621 .resource = sh7372_dmae0_resources,
622 .num_resources = ARRAY_SIZE(sh7372_dmae0_resources),
624 .platform_data = &dma_platform_data,
628 static struct platform_device dma1_device = {
629 .name = "sh-dma-engine",
631 .resource = sh7372_dmae1_resources,
632 .num_resources = ARRAY_SIZE(sh7372_dmae1_resources),
634 .platform_data = &dma_platform_data,
638 static struct platform_device dma2_device = {
639 .name = "sh-dma-engine",
641 .resource = sh7372_dmae2_resources,
642 .num_resources = ARRAY_SIZE(sh7372_dmae2_resources),
644 .platform_data = &dma_platform_data,
651 static const struct sh_dmae_channel sh7372_usb_dmae_channels[] = {
660 static const struct sh_dmae_slave_config sh7372_usb_dmae0_slaves[] = {
662 .slave_id = SHDMA_SLAVE_USB0_TX,
663 .chcr = USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE),
665 .slave_id = SHDMA_SLAVE_USB0_RX,
666 .chcr = USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE),
670 static struct sh_dmae_pdata usb_dma0_platform_data = {
671 .slave = sh7372_usb_dmae0_slaves,
672 .slave_num = ARRAY_SIZE(sh7372_usb_dmae0_slaves),
673 .channel = sh7372_usb_dmae_channels,
674 .channel_num = ARRAY_SIZE(sh7372_usb_dmae_channels),
675 .ts_low_shift = USBTS_LOW_SHIFT,
676 .ts_low_mask = USBTS_LOW_BIT << USBTS_LOW_SHIFT,
677 .ts_high_shift = USBTS_HI_SHIFT,
678 .ts_high_mask = USBTS_HI_BIT << USBTS_HI_SHIFT,
679 .ts_shift = dma_usbts_shift,
680 .ts_shift_num = ARRAY_SIZE(dma_usbts_shift),
681 .dmaor_init = DMAOR_DME,
683 .chcr_ie_bit = 1 << 5,
690 static struct resource sh7372_usb_dmae0_resources[] = {
692 /* Channel registers and DMAOR */
694 .end = 0xe68a0064 - 1,
695 .flags = IORESOURCE_MEM,
700 .end = 0xe68a0014 - 1,
701 .flags = IORESOURCE_MEM,
704 /* IRQ for channels */
705 .start = evt2irq(0x0a00),
706 .end = evt2irq(0x0a00),
707 .flags = IORESOURCE_IRQ,
711 static struct platform_device usb_dma0_device = {
712 .name = "sh-dma-engine",
714 .resource = sh7372_usb_dmae0_resources,
715 .num_resources = ARRAY_SIZE(sh7372_usb_dmae0_resources),
717 .platform_data = &usb_dma0_platform_data,
722 static const struct sh_dmae_slave_config sh7372_usb_dmae1_slaves[] = {
724 .slave_id = SHDMA_SLAVE_USB1_TX,
725 .chcr = USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE),
727 .slave_id = SHDMA_SLAVE_USB1_RX,
728 .chcr = USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE),
732 static struct sh_dmae_pdata usb_dma1_platform_data = {
733 .slave = sh7372_usb_dmae1_slaves,
734 .slave_num = ARRAY_SIZE(sh7372_usb_dmae1_slaves),
735 .channel = sh7372_usb_dmae_channels,
736 .channel_num = ARRAY_SIZE(sh7372_usb_dmae_channels),
737 .ts_low_shift = USBTS_LOW_SHIFT,
738 .ts_low_mask = USBTS_LOW_BIT << USBTS_LOW_SHIFT,
739 .ts_high_shift = USBTS_HI_SHIFT,
740 .ts_high_mask = USBTS_HI_BIT << USBTS_HI_SHIFT,
741 .ts_shift = dma_usbts_shift,
742 .ts_shift_num = ARRAY_SIZE(dma_usbts_shift),
743 .dmaor_init = DMAOR_DME,
745 .chcr_ie_bit = 1 << 5,
752 static struct resource sh7372_usb_dmae1_resources[] = {
754 /* Channel registers and DMAOR */
756 .end = 0xe68c0064 - 1,
757 .flags = IORESOURCE_MEM,
762 .end = 0xe68c0014 - 1,
763 .flags = IORESOURCE_MEM,
766 /* IRQ for channels */
767 .start = evt2irq(0x1d00),
768 .end = evt2irq(0x1d00),
769 .flags = IORESOURCE_IRQ,
773 static struct platform_device usb_dma1_device = {
774 .name = "sh-dma-engine",
776 .resource = sh7372_usb_dmae1_resources,
777 .num_resources = ARRAY_SIZE(sh7372_usb_dmae1_resources),
779 .platform_data = &usb_dma1_platform_data,
784 static struct uio_info vpu_platform_data = {
787 .irq = intcs_evt2irq(0x980),
790 static struct resource vpu_resources[] = {
795 .flags = IORESOURCE_MEM,
799 static struct platform_device vpu_device = {
800 .name = "uio_pdrv_genirq",
803 .platform_data = &vpu_platform_data,
805 .resource = vpu_resources,
806 .num_resources = ARRAY_SIZE(vpu_resources),
810 static struct uio_info veu0_platform_data = {
813 .irq = intcs_evt2irq(0x700),
816 static struct resource veu0_resources[] = {
821 .flags = IORESOURCE_MEM,
825 static struct platform_device veu0_device = {
826 .name = "uio_pdrv_genirq",
829 .platform_data = &veu0_platform_data,
831 .resource = veu0_resources,
832 .num_resources = ARRAY_SIZE(veu0_resources),
836 static struct uio_info veu1_platform_data = {
839 .irq = intcs_evt2irq(0x720),
842 static struct resource veu1_resources[] = {
847 .flags = IORESOURCE_MEM,
851 static struct platform_device veu1_device = {
852 .name = "uio_pdrv_genirq",
855 .platform_data = &veu1_platform_data,
857 .resource = veu1_resources,
858 .num_resources = ARRAY_SIZE(veu1_resources),
862 static struct uio_info veu2_platform_data = {
865 .irq = intcs_evt2irq(0x740),
868 static struct resource veu2_resources[] = {
873 .flags = IORESOURCE_MEM,
877 static struct platform_device veu2_device = {
878 .name = "uio_pdrv_genirq",
881 .platform_data = &veu2_platform_data,
883 .resource = veu2_resources,
884 .num_resources = ARRAY_SIZE(veu2_resources),
888 static struct uio_info veu3_platform_data = {
891 .irq = intcs_evt2irq(0x760),
894 static struct resource veu3_resources[] = {
899 .flags = IORESOURCE_MEM,
903 static struct platform_device veu3_device = {
904 .name = "uio_pdrv_genirq",
907 .platform_data = &veu3_platform_data,
909 .resource = veu3_resources,
910 .num_resources = ARRAY_SIZE(veu3_resources),
914 static struct uio_info jpu_platform_data = {
917 .irq = intcs_evt2irq(0x560),
920 static struct resource jpu_resources[] = {
925 .flags = IORESOURCE_MEM,
929 static struct platform_device jpu_device = {
930 .name = "uio_pdrv_genirq",
933 .platform_data = &jpu_platform_data,
935 .resource = jpu_resources,
936 .num_resources = ARRAY_SIZE(jpu_resources),
940 static struct uio_info spu0_platform_data = {
943 .irq = evt2irq(0x1800),
946 static struct resource spu0_resources[] = {
951 .flags = IORESOURCE_MEM,
955 static struct platform_device spu0_device = {
956 .name = "uio_pdrv_genirq",
959 .platform_data = &spu0_platform_data,
961 .resource = spu0_resources,
962 .num_resources = ARRAY_SIZE(spu0_resources),
966 static struct uio_info spu1_platform_data = {
969 .irq = evt2irq(0x1820),
972 static struct resource spu1_resources[] = {
977 .flags = IORESOURCE_MEM,
981 static struct platform_device spu1_device = {
982 .name = "uio_pdrv_genirq",
985 .platform_data = &spu1_platform_data,
987 .resource = spu1_resources,
988 .num_resources = ARRAY_SIZE(spu1_resources),
991 static struct platform_device *sh7372_early_devices[] __initdata = {
1004 static struct platform_device *sh7372_late_devices[] __initdata = {
1022 void __init sh7372_add_standard_devices(void)
1024 struct pm_domain_device domain_devices[] = {
1025 { "A3RV", &vpu_device, },
1026 { "A4MP", &spu0_device, },
1027 { "A4MP", &spu1_device, },
1028 { "A3SP", &scif0_device, },
1029 { "A3SP", &scif1_device, },
1030 { "A3SP", &scif2_device, },
1031 { "A3SP", &scif3_device, },
1032 { "A3SP", &scif4_device, },
1033 { "A3SP", &scif5_device, },
1034 { "A3SP", &scif6_device, },
1035 { "A3SP", &iic1_device, },
1036 { "A3SP", &dma0_device, },
1037 { "A3SP", &dma1_device, },
1038 { "A3SP", &dma2_device, },
1039 { "A3SP", &usb_dma0_device, },
1040 { "A3SP", &usb_dma1_device, },
1041 { "A4R", &iic0_device, },
1042 { "A4R", &veu0_device, },
1043 { "A4R", &veu1_device, },
1044 { "A4R", &veu2_device, },
1045 { "A4R", &veu3_device, },
1046 { "A4R", &jpu_device, },
1047 { "A4R", &tmu00_device, },
1048 { "A4R", &tmu01_device, },
1051 sh7372_init_pm_domains();
1053 platform_add_devices(sh7372_early_devices,
1054 ARRAY_SIZE(sh7372_early_devices));
1056 platform_add_devices(sh7372_late_devices,
1057 ARRAY_SIZE(sh7372_late_devices));
1059 rmobile_add_devices_to_domains(domain_devices,
1060 ARRAY_SIZE(domain_devices));
1063 static void __init sh7372_earlytimer_init(void)
1065 sh7372_clock_init();
1066 shmobile_earlytimer_init();
1069 void __init sh7372_add_early_devices(void)
1071 early_platform_add_devices(sh7372_early_devices,
1072 ARRAY_SIZE(sh7372_early_devices));
1074 /* setup early console here as well */
1075 shmobile_setup_console();
1077 /* override timer setup with soc-specific code */
1078 shmobile_timer.init = sh7372_earlytimer_init;
1081 #ifdef CONFIG_USE_OF
1083 void __init sh7372_add_early_devices_dt(void)
1085 shmobile_setup_delay(800, 1, 3); /* Cortex-A8 @ 800MHz */
1087 early_platform_add_devices(sh7372_early_devices,
1088 ARRAY_SIZE(sh7372_early_devices));
1090 /* setup early console here as well */
1091 shmobile_setup_console();
1094 static const struct of_dev_auxdata sh7372_auxdata_lookup[] __initconst = {
1098 void __init sh7372_add_standard_devices_dt(void)
1100 /* clocks are setup late during boot in the case of DT */
1101 sh7372_clock_init();
1103 platform_add_devices(sh7372_early_devices,
1104 ARRAY_SIZE(sh7372_early_devices));
1106 of_platform_populate(NULL, of_default_bus_match_table,
1107 sh7372_auxdata_lookup, NULL);
1110 static const char *sh7372_boards_compat_dt[] __initdata = {
1115 DT_MACHINE_START(SH7372_DT, "Generic SH7372 (Flattened Device Tree)")
1116 .map_io = sh7372_map_io,
1117 .init_early = sh7372_add_early_devices_dt,
1118 .nr_irqs = NR_IRQS_LEGACY,
1119 .init_irq = sh7372_init_irq,
1120 .handle_irq = shmobile_handle_irq_intc,
1121 .init_machine = sh7372_add_standard_devices_dt,
1122 .timer = &shmobile_timer,
1123 .dt_compat = sh7372_boards_compat_dt,
1126 #endif /* CONFIG_USE_OF */