aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-shmobile/setup-r8a7791.c
diff options
context:
space:
mode:
authorKevin Hilman2013-10-14 13:58:37 -0700
committerKevin Hilman2013-10-14 14:00:10 -0700
commit4fd0376356ed2e1f6c2a4e8628782aedf903292e (patch)
tree581f8dbb860ca6176c543379bc455bdc4a95c088 /arch/arm/mach-shmobile/setup-r8a7791.c
parentd174ec22872c35d5ce1d223072bc8bd12ad1fef4 (diff)
parent7d4bde88e1135c4a3106b79650d3b85335f35717 (diff)
Merge branch 'renesas/boards2' into next/boards
From Simon Horman: * renesas/boards2: (64 commits) ARM: shmobile: marzen: enable INTC IRQ ARM: shmobile: bockw: add SMSC support on reference ARM: shmobile: Use SMP on Koelsch ARM: shmobile: Remove KZM9D reference DTS ARM: shmobile: Let KZM9D multiplatform boot with KZM9D DTB ARM: shmobile: Remove non-multiplatform KZM9D reference support ARM: shmobile: Use KZM9D without reference for multiplatform ARM: shmobile: Sync KZM9D DTS with KZM9D reference DTS ARM: shmobile: Use arch timer on Koelsch ARM: shmobile: Use r8a7791_add_standard_devices() on Koelsch ARM: shmobile: Genmai support ARM: shmobile: marzen: enable DMA for SDHI0 ARM: shmobile: bockw: enable DMA for SDHI0 ARM: shmobile: ape6evm: add DMA support to MMCIF ARM: shmobile: r8a7791 SMP support ARM: shmobile: r8a7779: split r8a7779_init_irq_extpin() for DT ARM: shmobile: r8a7778: split r8a7778_init_irq_extpin() for DT ARM: shmobile: r7s72100 SCIF support ARM: shmobile: Initial r7s72100 SoC support ARM: shmobile: r8a7791 Arch timer workaround ... Signed-off-by: Kevin Hilman <khilman@linaro.org>
Diffstat (limited to 'arch/arm/mach-shmobile/setup-r8a7791.c')
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7791.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c
index b56399d2e1de..d9393d61ee27 100644
--- a/arch/arm/mach-shmobile/setup-r8a7791.c
+++ b/arch/arm/mach-shmobile/setup-r8a7791.c
@@ -22,11 +22,13 @@
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/of_platform.h>
+#include <linux/platform_data/irq-renesas-irqc.h>
#include <linux/serial_sci.h>
#include <linux/sh_timer.h>
#include <mach/common.h>
#include <mach/irqs.h>
#include <mach/r8a7791.h>
+#include <mach/rcar-gen2.h>
#include <asm/mach/arch.h>
#define SCIF_COMMON(scif_type, baseaddr, irq) \
@@ -109,6 +111,31 @@ static const struct resource cmt00_resources[] __initconst = {
&cmt##idx##_platform_data, \
sizeof(struct sh_timer_config))
+static struct renesas_irqc_config irqc0_data = {
+ .irq_base = irq_pin(0), /* IRQ0 -> IRQ9 */
+};
+
+static struct resource irqc0_resources[] = {
+ DEFINE_RES_MEM(0xe61c0000, 0x200), /* IRQC Event Detector Block_0 */
+ DEFINE_RES_IRQ(gic_spi(0)), /* IRQ0 */
+ DEFINE_RES_IRQ(gic_spi(1)), /* IRQ1 */
+ DEFINE_RES_IRQ(gic_spi(2)), /* IRQ2 */
+ DEFINE_RES_IRQ(gic_spi(3)), /* IRQ3 */
+ DEFINE_RES_IRQ(gic_spi(12)), /* IRQ4 */
+ DEFINE_RES_IRQ(gic_spi(13)), /* IRQ5 */
+ DEFINE_RES_IRQ(gic_spi(14)), /* IRQ6 */
+ DEFINE_RES_IRQ(gic_spi(15)), /* IRQ7 */
+ DEFINE_RES_IRQ(gic_spi(16)), /* IRQ8 */
+ DEFINE_RES_IRQ(gic_spi(17)), /* IRQ9 */
+};
+
+#define r8a7791_register_irqc(idx) \
+ platform_device_register_resndata(&platform_bus, "renesas_irqc", \
+ idx, irqc##idx##_resources, \
+ ARRAY_SIZE(irqc##idx##_resources), \
+ &irqc##idx##_data, \
+ sizeof(struct renesas_irqc_config))
+
void __init r8a7791_add_dt_devices(void)
{
r8a7791_register_scif(SCIFA0);
@@ -129,6 +156,12 @@ void __init r8a7791_add_dt_devices(void)
r8a7791_register_cmt(00);
}
+void __init r8a7791_add_standard_devices(void)
+{
+ r8a7791_add_dt_devices();
+ r8a7791_register_irqc(0);
+}
+
void __init r8a7791_init_early(void)
{
#ifndef CONFIG_ARM_ARCH_TIMER
@@ -143,7 +176,9 @@ static const char *r8a7791_boards_compat_dt[] __initdata = {
};
DT_MACHINE_START(R8A7791_DT, "Generic R8A7791 (Flattened Device Tree)")
+ .smp = smp_ops(r8a7791_smp_ops),
.init_early = r8a7791_init_early,
+ .init_time = rcar_gen2_timer_init,
.dt_compat = r8a7791_boards_compat_dt,
MACHINE_END
#endif /* CONFIG_USE_OF */