aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Horman <horms+renesas@verge.net.au>2013-01-29 00:21:46 -0500
committerSimon Horman <horms+renesas@verge.net.au>2013-03-12 13:13:18 -0400
commitc58a1545e39ed1ff54dd2c167d3d25ae62c0dbd3 (patch)
tree6154acc9a50fe7112b3be8479794dc70fc541aa1
parentdf2ddd7b9b781f0aee7fc90e6bed21e62ebf7564 (diff)
ARM: mach-shmobile: r8a7779: Allow initialisation of GIC by DT
This allows the GIC interrupt controller of the r8a7779 SoC to be initialised using a flattened device tree blob. Signed-off-by: Simon Horman <horms+renesas@verge.net.au> --- v3 * Fix copy-paste error and use unique reg values for each CPU v2 As suggested by Mark Rutland * Add reg and device_type to cpus * Remove #address-cells from gic
-rw-r--r--arch/arm/boot/dts/r8a7779.dtsi50
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h1
-rw-r--r--arch/arm/mach-shmobile/intc-r8a7779.c27
3 files changed, 72 insertions, 6 deletions
diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi
new file mode 100644
index 000000000000..8c6d52cee6c6
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7779.dtsi
@@ -0,0 +1,50 @@
1/*
2 * Device Tree Source for Renesas r8a7740
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Simon Horman
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11
12/include/ "skeleton.dtsi"
13
14/ {
15 compatible = "renesas,r8a7779";
16
17 cpus {
18 #address-cells = <1>;
19 #size-cells = <0>;
20
21 cpu@0 {
22 device_type = "cpu";
23 compatible = "arm,cortex-a9";
24 reg = <0>;
25 };
26 cpu@1 {
27 device_type = "cpu";
28 compatible = "arm,cortex-a9";
29 reg = <1>;
30 };
31 cpu@2 {
32 device_type = "cpu";
33 compatible = "arm,cortex-a9";
34 reg = <2>;
35 };
36 cpu@3 {
37 device_type = "cpu";
38 compatible = "arm,cortex-a9";
39 reg = <3>;
40 };
41 };
42
43 gic: interrupt-controller@f0001000 {
44 compatible = "arm,cortex-a9-gic";
45 #interrupt-cells = <3>;
46 interrupt-controller;
47 reg = <0xf0001000 0x1000>,
48 <0xf0000100 0x100>;
49 };
50};
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index e48606d8a2be..3f067100bb05 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -59,6 +59,7 @@ extern void r8a7740_pinmux_init(void);
59extern void r8a7740_pm_init(void); 59extern void r8a7740_pm_init(void);
60 60
61extern void r8a7779_init_irq(void); 61extern void r8a7779_init_irq(void);
62extern void r8a7779_init_irq_dt(void);
62extern void r8a7779_map_io(void); 63extern void r8a7779_map_io(void);
63extern void r8a7779_earlytimer_init(void); 64extern void r8a7779_earlytimer_init(void);
64extern void r8a7779_add_early_devices(void); 65extern void r8a7779_add_early_devices(void);
diff --git a/arch/arm/mach-shmobile/intc-r8a7779.c b/arch/arm/mach-shmobile/intc-r8a7779.c
index 8807c27f71f9..f9cc4bc9c798 100644
--- a/arch/arm/mach-shmobile/intc-r8a7779.c
+++ b/arch/arm/mach-shmobile/intc-r8a7779.c
@@ -24,6 +24,7 @@
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/irqchip/arm-gic.h> 25#include <linux/irqchip/arm-gic.h>
26#include <mach/common.h> 26#include <mach/common.h>
27#include <linux/irqchip.h>
27#include <mach/intc.h> 28#include <mach/intc.h>
28#include <mach/r8a7779.h> 29#include <mach/r8a7779.h>
29#include <asm/mach-types.h> 30#include <asm/mach-types.h>
@@ -43,13 +44,8 @@ static int r8a7779_set_wake(struct irq_data *data, unsigned int on)
43 return 0; /* always allow wakeup */ 44 return 0; /* always allow wakeup */
44} 45}
45 46
46void __init r8a7779_init_irq(void) 47static void __init r8a7779_init_irq_common(void)
47{ 48{
48 void __iomem *gic_dist_base = IOMEM(0xf0001000);
49 void __iomem *gic_cpu_base = IOMEM(0xf0000100);
50
51 /* use GIC to handle interrupts */
52 gic_init(0, 29, gic_dist_base, gic_cpu_base);
53 gic_arch_extn.irq_set_wake = r8a7779_set_wake; 49 gic_arch_extn.irq_set_wake = r8a7779_set_wake;
54 50
55 /* route all interrupts to ARM */ 51 /* route all interrupts to ARM */
@@ -63,3 +59,22 @@ void __init r8a7779_init_irq(void)
63 __raw_writel(0xbffffffc, INT2SMSKCR3); 59 __raw_writel(0xbffffffc, INT2SMSKCR3);
64 __raw_writel(0x003fee3f, INT2SMSKCR4); 60 __raw_writel(0x003fee3f, INT2SMSKCR4);
65} 61}
62
63void __init r8a7779_init_irq(void)
64{
65 void __iomem *gic_dist_base = IOMEM(0xf0001000);
66 void __iomem *gic_cpu_base = IOMEM(0xf0000100);
67
68 /* use GIC to handle interrupts */
69 gic_init(0, 29, gic_dist_base, gic_cpu_base);
70
71 r8a7779_init_irq_common();
72}
73
74#ifdef CONFIG_OF
75void __init r8a7779_init_irq_dt(void)
76{
77 irqchip_init();
78 r8a7779_init_irq_common();
79}
80#endif