2 * sh73a0 processor support
4 * Copyright (C) 2010 Takashi Yoshii
5 * Copyright (C) 2010 Magnus Damm
6 * Copyright (C) 2008 Yoshihiro Shimoda
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 #include <linux/kernel.h>
18 #include <linux/init.h>
19 #include <linux/interrupt.h>
20 #include <linux/irq.h>
21 #include <linux/platform_device.h>
22 #include <linux/of_platform.h>
23 #include <linux/delay.h>
24 #include <linux/input.h>
25 #include <linux/i2c/i2c-sh_mobile.h>
27 #include <linux/serial_sci.h>
28 #include <linux/sh_dma.h>
29 #include <linux/sh_timer.h>
30 #include <linux/platform_data/sh_ipmmu.h>
31 #include <linux/platform_data/irq-renesas-intc-irqpin.h>
33 #include <asm/mach-types.h>
34 #include <asm/mach/map.h>
35 #include <asm/mach/arch.h>
36 #include <asm/mach/time.h>
39 #include "dma-register.h"
44 static struct map_desc sh73a0_io_desc[] __initdata = {
45 /* create a 1:1 entity map for 0xe6xxxxxx
46 * used by CPGA, INTC and PFC.
49 .virtual = 0xe6000000,
50 .pfn = __phys_to_pfn(0xe6000000),
52 .type = MT_DEVICE_NONSHARED
56 void __init sh73a0_map_io(void)
58 iotable_init(sh73a0_io_desc, ARRAY_SIZE(sh73a0_io_desc));
62 static struct resource pfc_resources[] __initdata = {
63 DEFINE_RES_MEM(0xe6050000, 0x8000),
64 DEFINE_RES_MEM(0xe605801c, 0x000c),
67 void __init sh73a0_pinmux_init(void)
69 platform_device_register_simple("pfc-sh73a0", -1, pfc_resources,
70 ARRAY_SIZE(pfc_resources));
74 #define SH73A0_SCIF(scif_type, index, baseaddr, irq) \
75 static struct plat_sci_port scif##index##_platform_data = { \
77 .flags = UPF_BOOT_AUTOCONF, \
78 .scscr = SCSCR_RE | SCSCR_TE, \
81 static struct resource scif##index##_resources[] = { \
82 DEFINE_RES_MEM(baseaddr, 0x100), \
83 DEFINE_RES_IRQ(irq), \
86 static struct platform_device scif##index##_device = { \
89 .resource = scif##index##_resources, \
90 .num_resources = ARRAY_SIZE(scif##index##_resources), \
92 .platform_data = &scif##index##_platform_data, \
96 SH73A0_SCIF(PORT_SCIFA, 0, 0xe6c40000, gic_spi(72));
97 SH73A0_SCIF(PORT_SCIFA, 1, 0xe6c50000, gic_spi(73));
98 SH73A0_SCIF(PORT_SCIFA, 2, 0xe6c60000, gic_spi(74));
99 SH73A0_SCIF(PORT_SCIFA, 3, 0xe6c70000, gic_spi(75));
100 SH73A0_SCIF(PORT_SCIFA, 4, 0xe6c80000, gic_spi(78));
101 SH73A0_SCIF(PORT_SCIFA, 5, 0xe6cb0000, gic_spi(79));
102 SH73A0_SCIF(PORT_SCIFA, 6, 0xe6cc0000, gic_spi(156));
103 SH73A0_SCIF(PORT_SCIFA, 7, 0xe6cd0000, gic_spi(143));
104 SH73A0_SCIF(PORT_SCIFB, 8, 0xe6c30000, gic_spi(80));
106 static struct sh_timer_config cmt1_platform_data = {
107 .channels_mask = 0x3f,
110 static struct resource cmt1_resources[] = {
111 DEFINE_RES_MEM(0xe6138000, 0x200),
112 DEFINE_RES_IRQ(gic_spi(65)),
115 static struct platform_device cmt1_device = {
119 .platform_data = &cmt1_platform_data,
121 .resource = cmt1_resources,
122 .num_resources = ARRAY_SIZE(cmt1_resources),
126 static struct sh_timer_config tmu0_platform_data = {
130 static struct resource tmu0_resources[] = {
131 DEFINE_RES_MEM(0xfff60000, 0x2c),
132 DEFINE_RES_IRQ(intcs_evt2irq(0xe80)),
133 DEFINE_RES_IRQ(intcs_evt2irq(0xea0)),
134 DEFINE_RES_IRQ(intcs_evt2irq(0xec0)),
137 static struct platform_device tmu0_device = {
141 .platform_data = &tmu0_platform_data,
143 .resource = tmu0_resources,
144 .num_resources = ARRAY_SIZE(tmu0_resources),
147 static struct resource i2c0_resources[] = {
148 [0] = DEFINE_RES_MEM(0xe6820000, 0x426),
150 .start = gic_spi(167),
152 .flags = IORESOURCE_IRQ,
156 static struct resource i2c1_resources[] = {
157 [0] = DEFINE_RES_MEM(0xe6822000, 0x426),
159 .start = gic_spi(51),
161 .flags = IORESOURCE_IRQ,
165 static struct resource i2c2_resources[] = {
166 [0] = DEFINE_RES_MEM(0xe6824000, 0x426),
168 .start = gic_spi(171),
170 .flags = IORESOURCE_IRQ,
174 static struct resource i2c3_resources[] = {
175 [0] = DEFINE_RES_MEM(0xe6826000, 0x426),
177 .start = gic_spi(183),
179 .flags = IORESOURCE_IRQ,
183 static struct resource i2c4_resources[] = {
184 [0] = DEFINE_RES_MEM(0xe6828000, 0x426),
186 .start = gic_spi(187),
188 .flags = IORESOURCE_IRQ,
192 static struct i2c_sh_mobile_platform_data i2c_platform_data = {
196 static struct platform_device i2c0_device = {
197 .name = "i2c-sh_mobile",
199 .resource = i2c0_resources,
200 .num_resources = ARRAY_SIZE(i2c0_resources),
202 .platform_data = &i2c_platform_data,
206 static struct platform_device i2c1_device = {
207 .name = "i2c-sh_mobile",
209 .resource = i2c1_resources,
210 .num_resources = ARRAY_SIZE(i2c1_resources),
212 .platform_data = &i2c_platform_data,
216 static struct platform_device i2c2_device = {
217 .name = "i2c-sh_mobile",
219 .resource = i2c2_resources,
220 .num_resources = ARRAY_SIZE(i2c2_resources),
222 .platform_data = &i2c_platform_data,
226 static struct platform_device i2c3_device = {
227 .name = "i2c-sh_mobile",
229 .resource = i2c3_resources,
230 .num_resources = ARRAY_SIZE(i2c3_resources),
232 .platform_data = &i2c_platform_data,
236 static struct platform_device i2c4_device = {
237 .name = "i2c-sh_mobile",
239 .resource = i2c4_resources,
240 .num_resources = ARRAY_SIZE(i2c4_resources),
242 .platform_data = &i2c_platform_data,
246 static const struct sh_dmae_slave_config sh73a0_dmae_slaves[] = {
248 .slave_id = SHDMA_SLAVE_SCIF0_TX,
250 .chcr = CHCR_TX(XMIT_SZ_8BIT),
253 .slave_id = SHDMA_SLAVE_SCIF0_RX,
255 .chcr = CHCR_RX(XMIT_SZ_8BIT),
258 .slave_id = SHDMA_SLAVE_SCIF1_TX,
260 .chcr = CHCR_TX(XMIT_SZ_8BIT),
263 .slave_id = SHDMA_SLAVE_SCIF1_RX,
265 .chcr = CHCR_RX(XMIT_SZ_8BIT),
268 .slave_id = SHDMA_SLAVE_SCIF2_TX,
270 .chcr = CHCR_TX(XMIT_SZ_8BIT),
273 .slave_id = SHDMA_SLAVE_SCIF2_RX,
275 .chcr = CHCR_RX(XMIT_SZ_8BIT),
278 .slave_id = SHDMA_SLAVE_SCIF3_TX,
280 .chcr = CHCR_TX(XMIT_SZ_8BIT),
283 .slave_id = SHDMA_SLAVE_SCIF3_RX,
285 .chcr = CHCR_RX(XMIT_SZ_8BIT),
288 .slave_id = SHDMA_SLAVE_SCIF4_TX,
290 .chcr = CHCR_TX(XMIT_SZ_8BIT),
293 .slave_id = SHDMA_SLAVE_SCIF4_RX,
295 .chcr = CHCR_RX(XMIT_SZ_8BIT),
298 .slave_id = SHDMA_SLAVE_SCIF5_TX,
300 .chcr = CHCR_TX(XMIT_SZ_8BIT),
303 .slave_id = SHDMA_SLAVE_SCIF5_RX,
305 .chcr = CHCR_RX(XMIT_SZ_8BIT),
308 .slave_id = SHDMA_SLAVE_SCIF6_TX,
310 .chcr = CHCR_TX(XMIT_SZ_8BIT),
313 .slave_id = SHDMA_SLAVE_SCIF6_RX,
315 .chcr = CHCR_RX(XMIT_SZ_8BIT),
318 .slave_id = SHDMA_SLAVE_SCIF7_TX,
320 .chcr = CHCR_TX(XMIT_SZ_8BIT),
323 .slave_id = SHDMA_SLAVE_SCIF7_RX,
325 .chcr = CHCR_RX(XMIT_SZ_8BIT),
328 .slave_id = SHDMA_SLAVE_SCIF8_TX,
330 .chcr = CHCR_TX(XMIT_SZ_8BIT),
333 .slave_id = SHDMA_SLAVE_SCIF8_RX,
335 .chcr = CHCR_RX(XMIT_SZ_8BIT),
338 .slave_id = SHDMA_SLAVE_SDHI0_TX,
340 .chcr = CHCR_TX(XMIT_SZ_16BIT),
343 .slave_id = SHDMA_SLAVE_SDHI0_RX,
345 .chcr = CHCR_RX(XMIT_SZ_16BIT),
348 .slave_id = SHDMA_SLAVE_SDHI1_TX,
350 .chcr = CHCR_TX(XMIT_SZ_16BIT),
353 .slave_id = SHDMA_SLAVE_SDHI1_RX,
355 .chcr = CHCR_RX(XMIT_SZ_16BIT),
358 .slave_id = SHDMA_SLAVE_SDHI2_TX,
360 .chcr = CHCR_TX(XMIT_SZ_16BIT),
363 .slave_id = SHDMA_SLAVE_SDHI2_RX,
365 .chcr = CHCR_RX(XMIT_SZ_16BIT),
368 .slave_id = SHDMA_SLAVE_MMCIF_TX,
370 .chcr = CHCR_TX(XMIT_SZ_32BIT),
373 .slave_id = SHDMA_SLAVE_MMCIF_RX,
375 .chcr = CHCR_RX(XMIT_SZ_32BIT),
380 #define DMAE_CHANNEL(_offset) \
382 .offset = _offset - 0x20, \
383 .dmars = _offset - 0x20 + 0x40, \
386 static const struct sh_dmae_channel sh73a0_dmae_channels[] = {
387 DMAE_CHANNEL(0x8000),
388 DMAE_CHANNEL(0x8080),
389 DMAE_CHANNEL(0x8100),
390 DMAE_CHANNEL(0x8180),
391 DMAE_CHANNEL(0x8200),
392 DMAE_CHANNEL(0x8280),
393 DMAE_CHANNEL(0x8300),
394 DMAE_CHANNEL(0x8380),
395 DMAE_CHANNEL(0x8400),
396 DMAE_CHANNEL(0x8480),
397 DMAE_CHANNEL(0x8500),
398 DMAE_CHANNEL(0x8580),
399 DMAE_CHANNEL(0x8600),
400 DMAE_CHANNEL(0x8680),
401 DMAE_CHANNEL(0x8700),
402 DMAE_CHANNEL(0x8780),
403 DMAE_CHANNEL(0x8800),
404 DMAE_CHANNEL(0x8880),
405 DMAE_CHANNEL(0x8900),
406 DMAE_CHANNEL(0x8980),
409 static struct sh_dmae_pdata sh73a0_dmae_platform_data = {
410 .slave = sh73a0_dmae_slaves,
411 .slave_num = ARRAY_SIZE(sh73a0_dmae_slaves),
412 .channel = sh73a0_dmae_channels,
413 .channel_num = ARRAY_SIZE(sh73a0_dmae_channels),
414 .ts_low_shift = TS_LOW_SHIFT,
415 .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT,
416 .ts_high_shift = TS_HI_SHIFT,
417 .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT,
418 .ts_shift = dma_ts_shift,
419 .ts_shift_num = ARRAY_SIZE(dma_ts_shift),
420 .dmaor_init = DMAOR_DME,
423 static struct resource sh73a0_dmae_resources[] = {
424 DEFINE_RES_MEM(0xfe000020, 0x89e0),
427 .start = gic_spi(129),
429 .flags = IORESOURCE_IRQ,
432 /* IRQ for channels 0-19 */
433 .start = gic_spi(109),
435 .flags = IORESOURCE_IRQ,
439 static struct platform_device dma0_device = {
440 .name = "sh-dma-engine",
442 .resource = sh73a0_dmae_resources,
443 .num_resources = ARRAY_SIZE(sh73a0_dmae_resources),
445 .platform_data = &sh73a0_dmae_platform_data,
450 static const struct sh_dmae_slave_config sh73a0_mpdma_slaves[] = {
452 .slave_id = SHDMA_SLAVE_FSI2A_RX,
454 .chcr = CHCR_RX(XMIT_SZ_32BIT),
455 .mid_rid = 0xd6, /* CHECK ME */
457 .slave_id = SHDMA_SLAVE_FSI2A_TX,
459 .chcr = CHCR_TX(XMIT_SZ_32BIT),
460 .mid_rid = 0xd5, /* CHECK ME */
462 .slave_id = SHDMA_SLAVE_FSI2C_RX,
464 .chcr = CHCR_RX(XMIT_SZ_32BIT),
465 .mid_rid = 0xda, /* CHECK ME */
467 .slave_id = SHDMA_SLAVE_FSI2C_TX,
469 .chcr = CHCR_TX(XMIT_SZ_32BIT),
470 .mid_rid = 0xd9, /* CHECK ME */
472 .slave_id = SHDMA_SLAVE_FSI2B_RX,
474 .chcr = CHCR_RX(XMIT_SZ_32BIT),
475 .mid_rid = 0x8e, /* CHECK ME */
477 .slave_id = SHDMA_SLAVE_FSI2B_TX,
479 .chcr = CHCR_RX(XMIT_SZ_32BIT),
480 .mid_rid = 0x8d, /* CHECK ME */
482 .slave_id = SHDMA_SLAVE_FSI2D_RX,
484 .chcr = CHCR_RX(XMIT_SZ_32BIT),
485 .mid_rid = 0x9a, /* CHECK ME */
489 #define MPDMA_CHANNEL(a, b, c) \
494 .chclr_offset = (0x220 - 0x20) + a \
497 static const struct sh_dmae_channel sh73a0_mpdma_channels[] = {
498 MPDMA_CHANNEL(0x00, 0, 0),
499 MPDMA_CHANNEL(0x10, 0, 8),
500 MPDMA_CHANNEL(0x20, 4, 0),
501 MPDMA_CHANNEL(0x30, 4, 8),
502 MPDMA_CHANNEL(0x50, 8, 0),
503 MPDMA_CHANNEL(0x70, 8, 8),
506 static struct sh_dmae_pdata sh73a0_mpdma_platform_data = {
507 .slave = sh73a0_mpdma_slaves,
508 .slave_num = ARRAY_SIZE(sh73a0_mpdma_slaves),
509 .channel = sh73a0_mpdma_channels,
510 .channel_num = ARRAY_SIZE(sh73a0_mpdma_channels),
511 .ts_low_shift = TS_LOW_SHIFT,
512 .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT,
513 .ts_high_shift = TS_HI_SHIFT,
514 .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT,
515 .ts_shift = dma_ts_shift,
516 .ts_shift_num = ARRAY_SIZE(dma_ts_shift),
517 .dmaor_init = DMAOR_DME,
521 /* Resource order important! */
522 static struct resource sh73a0_mpdma_resources[] = {
523 /* Channel registers and DMAOR */
524 DEFINE_RES_MEM(0xec618020, 0x270),
526 DEFINE_RES_MEM(0xec619000, 0xc),
529 .start = gic_spi(181),
531 .flags = IORESOURCE_IRQ,
534 /* IRQ for channels 0-5 */
535 .start = gic_spi(175),
537 .flags = IORESOURCE_IRQ,
541 static struct platform_device mpdma0_device = {
542 .name = "sh-dma-engine",
544 .resource = sh73a0_mpdma_resources,
545 .num_resources = ARRAY_SIZE(sh73a0_mpdma_resources),
547 .platform_data = &sh73a0_mpdma_platform_data,
551 static struct resource pmu_resources[] = {
553 .start = gic_spi(55),
555 .flags = IORESOURCE_IRQ,
558 .start = gic_spi(56),
560 .flags = IORESOURCE_IRQ,
564 static struct platform_device pmu_device = {
567 .num_resources = ARRAY_SIZE(pmu_resources),
568 .resource = pmu_resources,
571 /* an IPMMU module for ICB */
572 static struct resource ipmmu_resources[] = {
573 DEFINE_RES_MEM(0xfe951000, 0x100),
576 static const char * const ipmmu_dev_names[] = {
577 "sh_mobile_lcdc_fb.0",
580 static struct shmobile_ipmmu_platform_data ipmmu_platform_data = {
581 .dev_names = ipmmu_dev_names,
582 .num_dev_names = ARRAY_SIZE(ipmmu_dev_names),
585 static struct platform_device ipmmu_device = {
589 .platform_data = &ipmmu_platform_data,
591 .resource = ipmmu_resources,
592 .num_resources = ARRAY_SIZE(ipmmu_resources),
595 static struct renesas_intc_irqpin_config irqpin0_platform_data = {
596 .irq_base = irq_pin(0), /* IRQ0 -> IRQ7 */
599 static struct resource irqpin0_resources[] = {
600 DEFINE_RES_MEM(0xe6900000, 4), /* ICR1A */
601 DEFINE_RES_MEM(0xe6900010, 4), /* INTPRI00A */
602 DEFINE_RES_MEM(0xe6900020, 1), /* INTREQ00A */
603 DEFINE_RES_MEM(0xe6900040, 1), /* INTMSK00A */
604 DEFINE_RES_MEM(0xe6900060, 1), /* INTMSKCLR00A */
605 DEFINE_RES_IRQ(gic_spi(1)), /* IRQ0 */
606 DEFINE_RES_IRQ(gic_spi(2)), /* IRQ1 */
607 DEFINE_RES_IRQ(gic_spi(3)), /* IRQ2 */
608 DEFINE_RES_IRQ(gic_spi(4)), /* IRQ3 */
609 DEFINE_RES_IRQ(gic_spi(5)), /* IRQ4 */
610 DEFINE_RES_IRQ(gic_spi(6)), /* IRQ5 */
611 DEFINE_RES_IRQ(gic_spi(7)), /* IRQ6 */
612 DEFINE_RES_IRQ(gic_spi(8)), /* IRQ7 */
615 static struct platform_device irqpin0_device = {
616 .name = "renesas_intc_irqpin",
618 .resource = irqpin0_resources,
619 .num_resources = ARRAY_SIZE(irqpin0_resources),
621 .platform_data = &irqpin0_platform_data,
625 static struct renesas_intc_irqpin_config irqpin1_platform_data = {
626 .irq_base = irq_pin(8), /* IRQ8 -> IRQ15 */
627 .control_parent = true, /* Disable spurious IRQ10 */
630 static struct resource irqpin1_resources[] = {
631 DEFINE_RES_MEM(0xe6900004, 4), /* ICR2A */
632 DEFINE_RES_MEM(0xe6900014, 4), /* INTPRI10A */
633 DEFINE_RES_MEM(0xe6900024, 1), /* INTREQ10A */
634 DEFINE_RES_MEM(0xe6900044, 1), /* INTMSK10A */
635 DEFINE_RES_MEM(0xe6900064, 1), /* INTMSKCLR10A */
636 DEFINE_RES_IRQ(gic_spi(9)), /* IRQ8 */
637 DEFINE_RES_IRQ(gic_spi(10)), /* IRQ9 */
638 DEFINE_RES_IRQ(gic_spi(11)), /* IRQ10 */
639 DEFINE_RES_IRQ(gic_spi(12)), /* IRQ11 */
640 DEFINE_RES_IRQ(gic_spi(13)), /* IRQ12 */
641 DEFINE_RES_IRQ(gic_spi(14)), /* IRQ13 */
642 DEFINE_RES_IRQ(gic_spi(15)), /* IRQ14 */
643 DEFINE_RES_IRQ(gic_spi(16)), /* IRQ15 */
646 static struct platform_device irqpin1_device = {
647 .name = "renesas_intc_irqpin",
649 .resource = irqpin1_resources,
650 .num_resources = ARRAY_SIZE(irqpin1_resources),
652 .platform_data = &irqpin1_platform_data,
656 static struct renesas_intc_irqpin_config irqpin2_platform_data = {
657 .irq_base = irq_pin(16), /* IRQ16 -> IRQ23 */
660 static struct resource irqpin2_resources[] = {
661 DEFINE_RES_MEM(0xe6900008, 4), /* ICR3A */
662 DEFINE_RES_MEM(0xe6900018, 4), /* INTPRI20A */
663 DEFINE_RES_MEM(0xe6900028, 1), /* INTREQ20A */
664 DEFINE_RES_MEM(0xe6900048, 1), /* INTMSK20A */
665 DEFINE_RES_MEM(0xe6900068, 1), /* INTMSKCLR20A */
666 DEFINE_RES_IRQ(gic_spi(17)), /* IRQ16 */
667 DEFINE_RES_IRQ(gic_spi(18)), /* IRQ17 */
668 DEFINE_RES_IRQ(gic_spi(19)), /* IRQ18 */
669 DEFINE_RES_IRQ(gic_spi(20)), /* IRQ19 */
670 DEFINE_RES_IRQ(gic_spi(21)), /* IRQ20 */
671 DEFINE_RES_IRQ(gic_spi(22)), /* IRQ21 */
672 DEFINE_RES_IRQ(gic_spi(23)), /* IRQ22 */
673 DEFINE_RES_IRQ(gic_spi(24)), /* IRQ23 */
676 static struct platform_device irqpin2_device = {
677 .name = "renesas_intc_irqpin",
679 .resource = irqpin2_resources,
680 .num_resources = ARRAY_SIZE(irqpin2_resources),
682 .platform_data = &irqpin2_platform_data,
686 static struct renesas_intc_irqpin_config irqpin3_platform_data = {
687 .irq_base = irq_pin(24), /* IRQ24 -> IRQ31 */
690 static struct resource irqpin3_resources[] = {
691 DEFINE_RES_MEM(0xe690000c, 4), /* ICR4A */
692 DEFINE_RES_MEM(0xe690001c, 4), /* INTPRI30A */
693 DEFINE_RES_MEM(0xe690002c, 1), /* INTREQ30A */
694 DEFINE_RES_MEM(0xe690004c, 1), /* INTMSK30A */
695 DEFINE_RES_MEM(0xe690006c, 1), /* INTMSKCLR30A */
696 DEFINE_RES_IRQ(gic_spi(25)), /* IRQ24 */
697 DEFINE_RES_IRQ(gic_spi(26)), /* IRQ25 */
698 DEFINE_RES_IRQ(gic_spi(27)), /* IRQ26 */
699 DEFINE_RES_IRQ(gic_spi(28)), /* IRQ27 */
700 DEFINE_RES_IRQ(gic_spi(29)), /* IRQ28 */
701 DEFINE_RES_IRQ(gic_spi(30)), /* IRQ29 */
702 DEFINE_RES_IRQ(gic_spi(31)), /* IRQ30 */
703 DEFINE_RES_IRQ(gic_spi(32)), /* IRQ31 */
706 static struct platform_device irqpin3_device = {
707 .name = "renesas_intc_irqpin",
709 .resource = irqpin3_resources,
710 .num_resources = ARRAY_SIZE(irqpin3_resources),
712 .platform_data = &irqpin3_platform_data,
716 static struct platform_device *sh73a0_early_devices[] __initdata = {
731 static struct platform_device *sh73a0_late_devices[] __initdata = {
746 #define SRCR2 IOMEM(0xe61580b0)
748 void __init sh73a0_add_standard_devices(void)
750 /* Clear software reset bit on SY-DMAC module */
751 __raw_writel(__raw_readl(SRCR2) & ~(1 << 18), SRCR2);
753 platform_add_devices(sh73a0_early_devices,
754 ARRAY_SIZE(sh73a0_early_devices));
755 platform_add_devices(sh73a0_late_devices,
756 ARRAY_SIZE(sh73a0_late_devices));
759 void __init sh73a0_init_delay(void)
761 shmobile_init_delay();
764 /* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
765 void __init __weak sh73a0_register_twd(void) { }
767 void __init sh73a0_earlytimer_init(void)
771 shmobile_earlytimer_init();
772 sh73a0_register_twd();
775 void __init sh73a0_add_early_devices(void)
777 early_platform_add_devices(sh73a0_early_devices,
778 ARRAY_SIZE(sh73a0_early_devices));
780 /* setup early console here as well */
781 shmobile_setup_console();
786 void __init sh73a0_add_standard_devices_dt(void)
788 /* clocks are setup late during boot in the case of DT */
791 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
794 static const char *sh73a0_boards_compat_dt[] __initdata = {
799 DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)")
800 .smp = smp_ops(sh73a0_smp_ops),
801 .map_io = sh73a0_map_io,
802 .init_early = sh73a0_init_delay,
803 .init_machine = sh73a0_add_standard_devices_dt,
804 .init_late = shmobile_init_late,
805 .dt_compat = sh73a0_boards_compat_dt,
807 #endif /* CONFIG_USE_OF */