2 * R8A7740 processor support
4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
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/delay.h>
21 #include <linux/dma-mapping.h>
22 #include <linux/kernel.h>
23 #include <linux/init.h>
25 #include <linux/irqchip.h>
26 #include <linux/irqchip/arm-gic.h>
27 #include <linux/platform_data/irq-renesas-intc-irqpin.h>
28 #include <linux/platform_device.h>
29 #include <linux/of_platform.h>
30 #include <linux/serial_sci.h>
31 #include <linux/sh_dma.h>
32 #include <linux/sh_timer.h>
33 #include <linux/platform_data/sh_ipmmu.h>
35 #include <asm/mach-types.h>
36 #include <asm/mach/map.h>
37 #include <asm/mach/arch.h>
38 #include <asm/mach/time.h>
39 #include <asm/hardware/cache-l2x0.h>
42 #include "dma-register.h"
44 #include "pm-rmobile.h"
47 static struct map_desc r8a7740_io_desc[] __initdata = {
50 * 0xe6000000-0xefffffff -> 0xe6000000-0xefffffff
53 .virtual = 0xe6000000,
54 .pfn = __phys_to_pfn(0xe6000000),
56 .type = MT_DEVICE_NONSHARED
58 #ifdef CONFIG_CACHE_L2X0
61 * 0xf0100000-0xf0101000 -> 0xf0002000-0xf0003000
64 .virtual = 0xf0002000,
65 .pfn = __phys_to_pfn(0xf0100000),
67 .type = MT_DEVICE_NONSHARED
72 void __init r8a7740_map_io(void)
75 iotable_init(r8a7740_io_desc, ARRAY_SIZE(r8a7740_io_desc));
79 static const struct resource pfc_resources[] = {
80 DEFINE_RES_MEM(0xe6050000, 0x8000),
81 DEFINE_RES_MEM(0xe605800c, 0x0020),
84 void __init r8a7740_pinmux_init(void)
86 platform_device_register_simple("pfc-r8a7740", -1, pfc_resources,
87 ARRAY_SIZE(pfc_resources));
90 static struct renesas_intc_irqpin_config irqpin0_platform_data = {
91 .irq_base = irq_pin(0), /* IRQ0 -> IRQ7 */
94 static struct resource irqpin0_resources[] = {
95 DEFINE_RES_MEM(0xe6900000, 4), /* ICR1A */
96 DEFINE_RES_MEM(0xe6900010, 4), /* INTPRI00A */
97 DEFINE_RES_MEM(0xe6900020, 1), /* INTREQ00A */
98 DEFINE_RES_MEM(0xe6900040, 1), /* INTMSK00A */
99 DEFINE_RES_MEM(0xe6900060, 1), /* INTMSKCLR00A */
100 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ0 */
101 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ1 */
102 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ2 */
103 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ3 */
104 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ4 */
105 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ5 */
106 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ6 */
107 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ7 */
110 static struct platform_device irqpin0_device = {
111 .name = "renesas_intc_irqpin",
113 .resource = irqpin0_resources,
114 .num_resources = ARRAY_SIZE(irqpin0_resources),
116 .platform_data = &irqpin0_platform_data,
120 static struct renesas_intc_irqpin_config irqpin1_platform_data = {
121 .irq_base = irq_pin(8), /* IRQ8 -> IRQ15 */
124 static struct resource irqpin1_resources[] = {
125 DEFINE_RES_MEM(0xe6900004, 4), /* ICR2A */
126 DEFINE_RES_MEM(0xe6900014, 4), /* INTPRI10A */
127 DEFINE_RES_MEM(0xe6900024, 1), /* INTREQ10A */
128 DEFINE_RES_MEM(0xe6900044, 1), /* INTMSK10A */
129 DEFINE_RES_MEM(0xe6900064, 1), /* INTMSKCLR10A */
130 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ8 */
131 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ9 */
132 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ10 */
133 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ11 */
134 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ12 */
135 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ13 */
136 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ14 */
137 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ15 */
140 static struct platform_device irqpin1_device = {
141 .name = "renesas_intc_irqpin",
143 .resource = irqpin1_resources,
144 .num_resources = ARRAY_SIZE(irqpin1_resources),
146 .platform_data = &irqpin1_platform_data,
150 static struct renesas_intc_irqpin_config irqpin2_platform_data = {
151 .irq_base = irq_pin(16), /* IRQ16 -> IRQ23 */
154 static struct resource irqpin2_resources[] = {
155 DEFINE_RES_MEM(0xe6900008, 4), /* ICR3A */
156 DEFINE_RES_MEM(0xe6900018, 4), /* INTPRI30A */
157 DEFINE_RES_MEM(0xe6900028, 1), /* INTREQ30A */
158 DEFINE_RES_MEM(0xe6900048, 1), /* INTMSK30A */
159 DEFINE_RES_MEM(0xe6900068, 1), /* INTMSKCLR30A */
160 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ16 */
161 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ17 */
162 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ18 */
163 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ19 */
164 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ20 */
165 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ21 */
166 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ22 */
167 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ23 */
170 static struct platform_device irqpin2_device = {
171 .name = "renesas_intc_irqpin",
173 .resource = irqpin2_resources,
174 .num_resources = ARRAY_SIZE(irqpin2_resources),
176 .platform_data = &irqpin2_platform_data,
180 static struct renesas_intc_irqpin_config irqpin3_platform_data = {
181 .irq_base = irq_pin(24), /* IRQ24 -> IRQ31 */
184 static struct resource irqpin3_resources[] = {
185 DEFINE_RES_MEM(0xe690000c, 4), /* ICR3A */
186 DEFINE_RES_MEM(0xe690001c, 4), /* INTPRI30A */
187 DEFINE_RES_MEM(0xe690002c, 1), /* INTREQ30A */
188 DEFINE_RES_MEM(0xe690004c, 1), /* INTMSK30A */
189 DEFINE_RES_MEM(0xe690006c, 1), /* INTMSKCLR30A */
190 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ24 */
191 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ25 */
192 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ26 */
193 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ27 */
194 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ28 */
195 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ29 */
196 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ30 */
197 DEFINE_RES_IRQ(gic_spi(149)), /* IRQ31 */
200 static struct platform_device irqpin3_device = {
201 .name = "renesas_intc_irqpin",
203 .resource = irqpin3_resources,
204 .num_resources = ARRAY_SIZE(irqpin3_resources),
206 .platform_data = &irqpin3_platform_data,
211 #define R8A7740_SCIF(scif_type, index, baseaddr, irq) \
212 static struct plat_sci_port scif##index##_platform_data = { \
214 .flags = UPF_BOOT_AUTOCONF, \
215 .scscr = SCSCR_RE | SCSCR_TE, \
218 static struct resource scif##index##_resources[] = { \
219 DEFINE_RES_MEM(baseaddr, 0x100), \
220 DEFINE_RES_IRQ(irq), \
223 static struct platform_device scif##index##_device = { \
226 .resource = scif##index##_resources, \
227 .num_resources = ARRAY_SIZE(scif##index##_resources), \
229 .platform_data = &scif##index##_platform_data, \
233 R8A7740_SCIF(PORT_SCIFA, 0, 0xe6c40000, gic_spi(100));
234 R8A7740_SCIF(PORT_SCIFA, 1, 0xe6c50000, gic_spi(101));
235 R8A7740_SCIF(PORT_SCIFA, 2, 0xe6c60000, gic_spi(102));
236 R8A7740_SCIF(PORT_SCIFA, 3, 0xe6c70000, gic_spi(103));
237 R8A7740_SCIF(PORT_SCIFA, 4, 0xe6c80000, gic_spi(104));
238 R8A7740_SCIF(PORT_SCIFA, 5, 0xe6cb0000, gic_spi(105));
239 R8A7740_SCIF(PORT_SCIFA, 6, 0xe6cc0000, gic_spi(106));
240 R8A7740_SCIF(PORT_SCIFA, 7, 0xe6cd0000, gic_spi(107));
241 R8A7740_SCIF(PORT_SCIFB, 8, 0xe6c30000, gic_spi(108));
244 static struct sh_timer_config cmt1_platform_data = {
245 .channels_mask = 0x3f,
248 static struct resource cmt1_resources[] = {
249 DEFINE_RES_MEM(0xe6138000, 0x170),
250 DEFINE_RES_IRQ(gic_spi(58)),
253 static struct platform_device cmt1_device = {
257 .platform_data = &cmt1_platform_data,
259 .resource = cmt1_resources,
260 .num_resources = ARRAY_SIZE(cmt1_resources),
264 static struct sh_timer_config tmu0_platform_data = {
268 static struct resource tmu0_resources[] = {
269 DEFINE_RES_MEM(0xfff80000, 0x2c),
270 DEFINE_RES_IRQ(gic_spi(198)),
271 DEFINE_RES_IRQ(gic_spi(199)),
272 DEFINE_RES_IRQ(gic_spi(200)),
275 static struct platform_device tmu0_device = {
279 .platform_data = &tmu0_platform_data,
281 .resource = tmu0_resources,
282 .num_resources = ARRAY_SIZE(tmu0_resources),
285 /* IPMMUI (an IPMMU module for ICB/LMB) */
286 static struct resource ipmmu_resources[] = {
291 .flags = IORESOURCE_MEM,
295 static const char * const ipmmu_dev_names[] = {
296 "sh_mobile_lcdc_fb.0",
297 "sh_mobile_lcdc_fb.1",
301 static struct shmobile_ipmmu_platform_data ipmmu_platform_data = {
302 .dev_names = ipmmu_dev_names,
303 .num_dev_names = ARRAY_SIZE(ipmmu_dev_names),
306 static struct platform_device ipmmu_device = {
310 .platform_data = &ipmmu_platform_data,
312 .resource = ipmmu_resources,
313 .num_resources = ARRAY_SIZE(ipmmu_resources),
316 static struct platform_device *r8a7740_early_devices[] __initdata = {
336 static const struct sh_dmae_slave_config r8a7740_dmae_slaves[] = {
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_FSIA_TX,
370 .chcr = CHCR_TX(XMIT_SZ_32BIT),
373 .slave_id = SHDMA_SLAVE_FSIA_RX,
375 .chcr = CHCR_RX(XMIT_SZ_32BIT),
378 .slave_id = SHDMA_SLAVE_FSIB_TX,
380 .chcr = CHCR_TX(XMIT_SZ_32BIT),
383 .slave_id = SHDMA_SLAVE_MMCIF_TX,
385 .chcr = CHCR_TX(XMIT_SZ_32BIT),
388 .slave_id = SHDMA_SLAVE_MMCIF_RX,
390 .chcr = CHCR_RX(XMIT_SZ_32BIT),
395 #define DMA_CHANNEL(a, b, c) \
400 .chclr_offset = (0x220 - 0x20) + a \
403 static const struct sh_dmae_channel r8a7740_dmae_channels[] = {
404 DMA_CHANNEL(0x00, 0, 0),
405 DMA_CHANNEL(0x10, 0, 8),
406 DMA_CHANNEL(0x20, 4, 0),
407 DMA_CHANNEL(0x30, 4, 8),
408 DMA_CHANNEL(0x50, 8, 0),
409 DMA_CHANNEL(0x60, 8, 8),
412 static struct sh_dmae_pdata dma_platform_data = {
413 .slave = r8a7740_dmae_slaves,
414 .slave_num = ARRAY_SIZE(r8a7740_dmae_slaves),
415 .channel = r8a7740_dmae_channels,
416 .channel_num = ARRAY_SIZE(r8a7740_dmae_channels),
417 .ts_low_shift = TS_LOW_SHIFT,
418 .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT,
419 .ts_high_shift = TS_HI_SHIFT,
420 .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT,
421 .ts_shift = dma_ts_shift,
422 .ts_shift_num = ARRAY_SIZE(dma_ts_shift),
423 .dmaor_init = DMAOR_DME,
427 /* Resource order important! */
428 static struct resource r8a7740_dmae0_resources[] = {
430 /* Channel registers and DMAOR */
433 .flags = IORESOURCE_MEM,
439 .flags = IORESOURCE_MEM,
443 .start = gic_spi(34),
445 .flags = IORESOURCE_IRQ,
448 /* IRQ for channels 0-5 */
449 .start = gic_spi(28),
451 .flags = IORESOURCE_IRQ,
455 /* Resource order important! */
456 static struct resource r8a7740_dmae1_resources[] = {
458 /* Channel registers and DMAOR */
461 .flags = IORESOURCE_MEM,
467 .flags = IORESOURCE_MEM,
471 .start = gic_spi(41),
473 .flags = IORESOURCE_IRQ,
476 /* IRQ for channels 0-5 */
477 .start = gic_spi(35),
479 .flags = IORESOURCE_IRQ,
483 /* Resource order important! */
484 static struct resource r8a7740_dmae2_resources[] = {
486 /* Channel registers and DMAOR */
489 .flags = IORESOURCE_MEM,
495 .flags = IORESOURCE_MEM,
499 .start = gic_spi(48),
501 .flags = IORESOURCE_IRQ,
504 /* IRQ for channels 0-5 */
505 .start = gic_spi(42),
507 .flags = IORESOURCE_IRQ,
511 static struct platform_device dma0_device = {
512 .name = "sh-dma-engine",
514 .resource = r8a7740_dmae0_resources,
515 .num_resources = ARRAY_SIZE(r8a7740_dmae0_resources),
517 .platform_data = &dma_platform_data,
521 static struct platform_device dma1_device = {
522 .name = "sh-dma-engine",
524 .resource = r8a7740_dmae1_resources,
525 .num_resources = ARRAY_SIZE(r8a7740_dmae1_resources),
527 .platform_data = &dma_platform_data,
531 static struct platform_device dma2_device = {
532 .name = "sh-dma-engine",
534 .resource = r8a7740_dmae2_resources,
535 .num_resources = ARRAY_SIZE(r8a7740_dmae2_resources),
537 .platform_data = &dma_platform_data,
542 static const struct sh_dmae_channel r8a7740_usb_dma_channels[] = {
550 static const struct sh_dmae_slave_config r8a7740_usb_dma_slaves[] = {
552 .slave_id = SHDMA_SLAVE_USBHS_TX,
553 .chcr = USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE),
555 .slave_id = SHDMA_SLAVE_USBHS_RX,
556 .chcr = USBTS_INDEX2VAL(USBTS_XMIT_SZ_8BYTE),
560 static struct sh_dmae_pdata usb_dma_platform_data = {
561 .slave = r8a7740_usb_dma_slaves,
562 .slave_num = ARRAY_SIZE(r8a7740_usb_dma_slaves),
563 .channel = r8a7740_usb_dma_channels,
564 .channel_num = ARRAY_SIZE(r8a7740_usb_dma_channels),
565 .ts_low_shift = USBTS_LOW_SHIFT,
566 .ts_low_mask = USBTS_LOW_BIT << USBTS_LOW_SHIFT,
567 .ts_high_shift = USBTS_HI_SHIFT,
568 .ts_high_mask = USBTS_HI_BIT << USBTS_HI_SHIFT,
569 .ts_shift = dma_usbts_shift,
570 .ts_shift_num = ARRAY_SIZE(dma_usbts_shift),
571 .dmaor_init = DMAOR_DME,
573 .chcr_ie_bit = 1 << 5,
580 static struct resource r8a7740_usb_dma_resources[] = {
582 /* Channel registers and DMAOR */
584 .end = 0xe68a0064 - 1,
585 .flags = IORESOURCE_MEM,
590 .end = 0xe68a0014 - 1,
591 .flags = IORESOURCE_MEM,
594 /* IRQ for channels */
595 .start = gic_spi(49),
597 .flags = IORESOURCE_IRQ,
601 static struct platform_device usb_dma_device = {
602 .name = "sh-dma-engine",
604 .resource = r8a7740_usb_dma_resources,
605 .num_resources = ARRAY_SIZE(r8a7740_usb_dma_resources),
607 .platform_data = &usb_dma_platform_data,
612 static struct resource i2c0_resources[] = {
616 .end = 0xfff20425 - 1,
617 .flags = IORESOURCE_MEM,
620 .start = gic_spi(201),
622 .flags = IORESOURCE_IRQ,
626 static struct resource i2c1_resources[] = {
630 .end = 0xe6c20425 - 1,
631 .flags = IORESOURCE_MEM,
634 .start = gic_spi(70), /* IIC1_ALI1 */
635 .end = gic_spi(73), /* IIC1_DTEI1 */
636 .flags = IORESOURCE_IRQ,
640 static struct platform_device i2c0_device = {
641 .name = "i2c-sh_mobile",
643 .resource = i2c0_resources,
644 .num_resources = ARRAY_SIZE(i2c0_resources),
647 static struct platform_device i2c1_device = {
648 .name = "i2c-sh_mobile",
650 .resource = i2c1_resources,
651 .num_resources = ARRAY_SIZE(i2c1_resources),
654 static struct resource pmu_resources[] = {
656 .start = gic_spi(83),
658 .flags = IORESOURCE_IRQ,
662 static struct platform_device pmu_device = {
665 .num_resources = ARRAY_SIZE(pmu_resources),
666 .resource = pmu_resources,
669 static struct platform_device *r8a7740_late_devices[] __initdata = {
680 * r8a7740 chip has lasting errata on MERAM buffer.
681 * this is work-around for it.
683 * "Media RAM (MERAM)" on r8a7740 documentation
685 #define MEBUFCNTR 0xFE950098
686 void __init r8a7740_meram_workaround(void)
690 reg = ioremap_nocache(MEBUFCNTR, 4);
692 iowrite32(0x01600164, reg);
698 #define ICSTART 0x0070
700 #define i2c_read(reg, offset) ioread8(reg + offset)
701 #define i2c_write(reg, offset, data) iowrite8(data, reg + offset)
704 * r8a7740 chip has lasting errata on I2C I/O pad reset.
705 * this is work-around for it.
707 static void r8a7740_i2c_workaround(struct platform_device *pdev)
709 struct resource *res;
712 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
713 if (unlikely(!res)) {
714 pr_err("r8a7740 i2c workaround fail (cannot find resource)\n");
718 reg = ioremap(res->start, resource_size(res));
719 if (unlikely(!reg)) {
720 pr_err("r8a7740 i2c workaround fail (cannot map IO)\n");
724 i2c_write(reg, ICCR, i2c_read(reg, ICCR) | 0x80);
725 i2c_read(reg, ICCR); /* dummy read */
727 i2c_write(reg, ICSTART, i2c_read(reg, ICSTART) | 0x10);
728 i2c_read(reg, ICSTART); /* dummy read */
732 i2c_write(reg, ICCR, 0x01);
733 i2c_write(reg, ICSTART, 0x00);
737 i2c_write(reg, ICCR, 0x10);
739 i2c_write(reg, ICCR, 0x00);
741 i2c_write(reg, ICCR, 0x10);
747 void __init r8a7740_add_standard_devices(void)
749 static struct pm_domain_device domain_devices[] __initdata = {
750 { "A3SP", &scif0_device },
751 { "A3SP", &scif1_device },
752 { "A3SP", &scif2_device },
753 { "A3SP", &scif3_device },
754 { "A3SP", &scif4_device },
755 { "A3SP", &scif5_device },
756 { "A3SP", &scif6_device },
757 { "A3SP", &scif7_device },
758 { "A3SP", &scif8_device },
759 { "A3SP", &i2c1_device },
762 /* I2C work-around */
763 r8a7740_i2c_workaround(&i2c0_device);
764 r8a7740_i2c_workaround(&i2c1_device);
766 r8a7740_init_pm_domains();
769 platform_add_devices(r8a7740_early_devices,
770 ARRAY_SIZE(r8a7740_early_devices));
771 platform_add_devices(r8a7740_late_devices,
772 ARRAY_SIZE(r8a7740_late_devices));
774 /* add devices to PM domain */
775 rmobile_add_devices_to_domains(domain_devices,
776 ARRAY_SIZE(domain_devices));
779 void __init r8a7740_add_early_devices(void)
781 early_platform_add_devices(r8a7740_early_devices,
782 ARRAY_SIZE(r8a7740_early_devices));
784 /* setup early console here as well */
785 shmobile_setup_console();
790 void __init r8a7740_init_irq_of(void)
792 void __iomem *intc_prio_base = ioremap_nocache(0xe6900010, 0x10);
793 void __iomem *intc_msk_base = ioremap_nocache(0xe6900040, 0x10);
794 void __iomem *pfc_inta_ctrl = ioremap_nocache(0xe605807c, 0x4);
796 #ifdef CONFIG_ARCH_SHMOBILE_LEGACY
797 void __iomem *gic_dist_base = ioremap_nocache(0xc2800000, 0x1000);
798 void __iomem *gic_cpu_base = ioremap_nocache(0xc2000000, 0x1000);
800 gic_init(0, 29, gic_dist_base, gic_cpu_base);
805 /* route signals to GIC */
806 iowrite32(0x0, pfc_inta_ctrl);
809 * To mask the shared interrupt to SPI 149 we must ensure to set
810 * PRIO *and* MASK. Else we run into IRQ floods when registering
811 * the intc_irqpin devices
813 iowrite32(0x0, intc_prio_base + 0x0);
814 iowrite32(0x0, intc_prio_base + 0x4);
815 iowrite32(0x0, intc_prio_base + 0x8);
816 iowrite32(0x0, intc_prio_base + 0xc);
817 iowrite8(0xff, intc_msk_base + 0x0);
818 iowrite8(0xff, intc_msk_base + 0x4);
819 iowrite8(0xff, intc_msk_base + 0x8);
820 iowrite8(0xff, intc_msk_base + 0xc);
822 iounmap(intc_prio_base);
823 iounmap(intc_msk_base);
824 iounmap(pfc_inta_ctrl);
827 static void __init r8a7740_generic_init(void)
829 r8a7740_meram_workaround();
831 #ifdef CONFIG_CACHE_L2X0
832 /* Shared attribute override enable, 32K*8way */
833 l2x0_init(IOMEM(0xf0002000), 0x00400000, 0xc20f0fff);
835 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
838 #define RESCNT2 IOMEM(0xe6188020)
839 static void r8a7740_restart(enum reboot_mode mode, const char *cmd)
841 /* Do soft power on reset */
842 writel(1 << 31, RESCNT2);
845 static const char *r8a7740_boards_compat_dt[] __initdata = {
850 DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
851 .map_io = r8a7740_map_io,
852 .init_early = shmobile_init_delay,
853 .init_irq = r8a7740_init_irq_of,
854 .init_machine = r8a7740_generic_init,
855 .init_late = shmobile_init_late,
856 .dt_compat = r8a7740_boards_compat_dt,
857 .restart = r8a7740_restart,
860 #endif /* CONFIG_USE_OF */