diff options
Diffstat (limited to 'arch/arm/mach-shmobile/setup-r8a7778.c')
-rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7778.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index 57d6b0eba445..288230540d19 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/irqchip/arm-gic.h> | 23 | #include <linux/irqchip/arm-gic.h> |
24 | #include <linux/of.h> | 24 | #include <linux/of.h> |
25 | #include <linux/of_platform.h> | 25 | #include <linux/of_platform.h> |
26 | #include <linux/platform_data/irq-renesas-intc-irqpin.h> | ||
26 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
27 | #include <linux/irqchip.h> | 28 | #include <linux/irqchip.h> |
28 | #include <linux/serial_sci.h> | 29 | #include <linux/serial_sci.h> |
@@ -110,6 +111,49 @@ void __init r8a7778_add_standard_devices(void) | |||
110 | r8a7778_register_tmu(1); | 111 | r8a7778_register_tmu(1); |
111 | } | 112 | } |
112 | 113 | ||
114 | static struct renesas_intc_irqpin_config irqpin_platform_data = { | ||
115 | .irq_base = irq_pin(0), /* IRQ0 -> IRQ3 */ | ||
116 | .sense_bitfield_width = 2, | ||
117 | }; | ||
118 | |||
119 | static struct resource irqpin_resources[] = { | ||
120 | DEFINE_RES_MEM(0xfe78001c, 4), /* ICR1 */ | ||
121 | DEFINE_RES_MEM(0xfe780010, 4), /* INTPRI */ | ||
122 | DEFINE_RES_MEM(0xfe780024, 4), /* INTREQ */ | ||
123 | DEFINE_RES_MEM(0xfe780044, 4), /* INTMSK0 */ | ||
124 | DEFINE_RES_MEM(0xfe780064, 4), /* INTMSKCLR0 */ | ||
125 | DEFINE_RES_IRQ(gic_iid(0x3b)), /* IRQ0 */ | ||
126 | DEFINE_RES_IRQ(gic_iid(0x3c)), /* IRQ1 */ | ||
127 | DEFINE_RES_IRQ(gic_iid(0x3d)), /* IRQ2 */ | ||
128 | DEFINE_RES_IRQ(gic_iid(0x3e)), /* IRQ3 */ | ||
129 | }; | ||
130 | |||
131 | void __init r8a7778_init_irq_extpin(int irlm) | ||
132 | { | ||
133 | void __iomem *icr0 = ioremap_nocache(0xfe780000, PAGE_SIZE); | ||
134 | unsigned long tmp; | ||
135 | |||
136 | if (!icr0) { | ||
137 | pr_warn("r8a7778: unable to setup external irq pin mode\n"); | ||
138 | return; | ||
139 | } | ||
140 | |||
141 | tmp = ioread32(icr0); | ||
142 | if (irlm) | ||
143 | tmp |= 1 << 23; /* IRQ0 -> IRQ3 as individual pins */ | ||
144 | else | ||
145 | tmp &= ~(1 << 23); /* IRL mode - not supported */ | ||
146 | tmp |= (1 << 21); /* LVLMODE = 1 */ | ||
147 | iowrite32(tmp, icr0); | ||
148 | iounmap(icr0); | ||
149 | |||
150 | if (irlm) | ||
151 | platform_device_register_resndata( | ||
152 | &platform_bus, "renesas_intc_irqpin", -1, | ||
153 | irqpin_resources, ARRAY_SIZE(irqpin_resources), | ||
154 | &irqpin_platform_data, sizeof(irqpin_platform_data)); | ||
155 | } | ||
156 | |||
113 | #define INT2SMSKCR0 0x82288 /* 0xfe782288 */ | 157 | #define INT2SMSKCR0 0x82288 /* 0xfe782288 */ |
114 | #define INT2SMSKCR1 0x8228c /* 0xfe78228c */ | 158 | #define INT2SMSKCR1 0x8228c /* 0xfe78228c */ |
115 | 159 | ||