aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2013-10-01 04:12:19 -0400
committerSimon Horman <horms+renesas@verge.net.au>2013-10-07 20:29:15 -0400
commit1e4953d817712e52616d9a40460435eb8881d32d (patch)
tree8c6452e6a7337d4c3758a434da6f3acdfd4f61a7 /arch/arm/mach-shmobile
parent44a268e2a652eab3c21e282b6418a8c9ea279626 (diff)
ARM: shmobile: r8a7791 IRQC platform device support
Add a platform device for the r8a7791 IRQC hardware driving IRQ pins IRQ0 to IRQ9. The Linux interrupt number is statically assigned to allow board code written in C to make use of static interrupt numbers. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7791.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c
index 350dfc4918e3..ba4fa3edf44f 100644
--- a/arch/arm/mach-shmobile/setup-r8a7791.c
+++ b/arch/arm/mach-shmobile/setup-r8a7791.c
@@ -22,6 +22,7 @@
22#include <linux/irq.h> 22#include <linux/irq.h>
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/of_platform.h> 24#include <linux/of_platform.h>
25#include <linux/platform_data/irq-renesas-irqc.h>
25#include <linux/serial_sci.h> 26#include <linux/serial_sci.h>
26#include <linux/sh_timer.h> 27#include <linux/sh_timer.h>
27#include <mach/common.h> 28#include <mach/common.h>
@@ -109,6 +110,31 @@ static const struct resource cmt00_resources[] __initconst = {
109 &cmt##idx##_platform_data, \ 110 &cmt##idx##_platform_data, \
110 sizeof(struct sh_timer_config)) 111 sizeof(struct sh_timer_config))
111 112
113static struct renesas_irqc_config irqc0_data = {
114 .irq_base = irq_pin(0), /* IRQ0 -> IRQ9 */
115};
116
117static struct resource irqc0_resources[] = {
118 DEFINE_RES_MEM(0xe61c0000, 0x200), /* IRQC Event Detector Block_0 */
119 DEFINE_RES_IRQ(gic_spi(0)), /* IRQ0 */
120 DEFINE_RES_IRQ(gic_spi(1)), /* IRQ1 */
121 DEFINE_RES_IRQ(gic_spi(2)), /* IRQ2 */
122 DEFINE_RES_IRQ(gic_spi(3)), /* IRQ3 */
123 DEFINE_RES_IRQ(gic_spi(12)), /* IRQ4 */
124 DEFINE_RES_IRQ(gic_spi(13)), /* IRQ5 */
125 DEFINE_RES_IRQ(gic_spi(14)), /* IRQ6 */
126 DEFINE_RES_IRQ(gic_spi(15)), /* IRQ7 */
127 DEFINE_RES_IRQ(gic_spi(16)), /* IRQ8 */
128 DEFINE_RES_IRQ(gic_spi(17)), /* IRQ9 */
129};
130
131#define r8a7791_register_irqc(idx) \
132 platform_device_register_resndata(&platform_bus, "renesas_irqc", \
133 idx, irqc##idx##_resources, \
134 ARRAY_SIZE(irqc##idx##_resources), \
135 &irqc##idx##_data, \
136 sizeof(struct renesas_irqc_config))
137
112void __init r8a7791_add_dt_devices(void) 138void __init r8a7791_add_dt_devices(void)
113{ 139{
114 r8a7791_register_scif(SCIFA0); 140 r8a7791_register_scif(SCIFA0);
@@ -132,6 +158,7 @@ void __init r8a7791_add_dt_devices(void)
132void __init r8a7791_add_standard_devices(void) 158void __init r8a7791_add_standard_devices(void)
133{ 159{
134 r8a7791_add_dt_devices(); 160 r8a7791_add_dt_devices();
161 r8a7791_register_irqc(0);
135} 162}
136 163
137void __init r8a7791_init_early(void) 164void __init r8a7791_init_early(void)