aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorpdeschrijver@nvidia.com <pdeschrijver@nvidia.com>2011-11-29 20:29:19 -0500
committerOlof Johansson <olof@lixom.net>2011-12-08 00:20:12 -0500
commit0d4f74792e2946cb2ef40a1673851eda1041358c (patch)
tree3a09fab581dff11adf0df12ce84c77bea15a164b /arch/arm/mach-tegra
parent1292c129597ce42a75d9e97cd312c3242e10a6f3 (diff)
arm/tegra: convert tegra20 to GIC devicetree binding
Convert tegra20 IRQ intialization to the GIC devicetree binding. Modify the interrupt definitions in the dts files according to Documentation/devicetree/bindings/arm/gic.txt v3 (swarren): * Moved of_irq_init() call into board-dt.c to avoid ifdef'ing it. - Even with a dummy replacement if !CONFIG_OF, the reference from tegra_dt_irq_match[] to gic_of_init() would still have to be ifdef'd - It's plausible that tegra_dt_irq_match[] may need to contain more entries in the future, and defining what they are seems more suitable for board-dt.c than irq.c v2 (swarren): * Removed some stale GIC init code from board-dt.c * Undid some accidental 0x -> 0x0 search/replace. Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com> Acked-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> [olof: added include of <asm/hardware/gic.h> for compile to pass] Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/board-dt.c25
-rw-r--r--arch/arm/mach-tegra/irq.c10
2 files changed, 21 insertions, 14 deletions
diff --git a/arch/arm/mach-tegra/board-dt.c b/arch/arm/mach-tegra/board-dt.c
index ba27c13e44e0..2fa599da7deb 100644
--- a/arch/arm/mach-tegra/board-dt.c
+++ b/arch/arm/mach-tegra/board-dt.c
@@ -36,6 +36,7 @@
36#include <asm/mach/arch.h> 36#include <asm/mach/arch.h>
37#include <asm/mach/time.h> 37#include <asm/mach/time.h>
38#include <asm/setup.h> 38#include <asm/setup.h>
39#include <asm/hardware/gic.h>
39 40
40#include <mach/iomap.h> 41#include <mach/iomap.h>
41#include <mach/irqs.h> 42#include <mach/irqs.h>
@@ -51,6 +52,17 @@ void seaboard_pinmux_init(void);
51void trimslice_pinmux_init(void); 52void trimslice_pinmux_init(void);
52void ventana_pinmux_init(void); 53void ventana_pinmux_init(void);
53 54
55static const struct of_device_id tegra_dt_irq_match[] __initconst = {
56 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init },
57 { }
58};
59
60void __init tegra_dt_init_irq(void)
61{
62 tegra_init_irq();
63 of_irq_init(tegra_dt_irq_match);
64}
65
54struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = { 66struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
55 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC1_BASE, "sdhci-tegra.0", NULL), 67 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC1_BASE, "sdhci-tegra.0", NULL),
56 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC2_BASE, "sdhci-tegra.1", NULL), 68 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC2_BASE, "sdhci-tegra.1", NULL),
@@ -91,11 +103,6 @@ static struct of_device_id tegra_dt_match_table[] __initdata = {
91 {} 103 {}
92}; 104};
93 105
94static struct of_device_id tegra_dt_gic_match[] __initdata = {
95 { .compatible = "nvidia,tegra20-gic", },
96 {}
97};
98
99static struct { 106static struct {
100 char *machine; 107 char *machine;
101 void (*init)(void); 108 void (*init)(void);
@@ -109,14 +116,8 @@ static struct {
109 116
110static void __init tegra_dt_init(void) 117static void __init tegra_dt_init(void)
111{ 118{
112 struct device_node *node;
113 int i; 119 int i;
114 120
115 node = of_find_matching_node_by_address(NULL, tegra_dt_gic_match,
116 TEGRA_ARM_INT_DIST_BASE);
117 if (node)
118 irq_domain_add_simple(node, INT_GIC_BASE);
119
120 tegra_clk_init_from_table(tegra_dt_clk_init_table); 121 tegra_clk_init_from_table(tegra_dt_clk_init_table);
121 122
122 /* 123 /*
@@ -149,7 +150,7 @@ static const char * tegra_dt_board_compat[] = {
149DT_MACHINE_START(TEGRA_DT, "nVidia Tegra (Flattened Device Tree)") 150DT_MACHINE_START(TEGRA_DT, "nVidia Tegra (Flattened Device Tree)")
150 .map_io = tegra_map_common_io, 151 .map_io = tegra_map_common_io,
151 .init_early = tegra_init_early, 152 .init_early = tegra_init_early,
152 .init_irq = tegra_init_irq, 153 .init_irq = tegra_dt_init_irq,
153 .timer = &tegra_timer, 154 .timer = &tegra_timer,
154 .init_machine = tegra_dt_init, 155 .init_machine = tegra_dt_init,
155 .dt_compat = tegra_dt_board_compat, 156 .dt_compat = tegra_dt_board_compat,
diff --git a/arch/arm/mach-tegra/irq.c b/arch/arm/mach-tegra/irq.c
index 4956c3cea731..004b0fdf0d76 100644
--- a/arch/arm/mach-tegra/irq.c
+++ b/arch/arm/mach-tegra/irq.c
@@ -21,6 +21,7 @@
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/irq.h> 22#include <linux/irq.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/of.h>
24 25
25#include <asm/hardware/gic.h> 26#include <asm/hardware/gic.h>
26 27
@@ -129,6 +130,11 @@ void __init tegra_init_irq(void)
129 gic_arch_extn.irq_unmask = tegra_unmask; 130 gic_arch_extn.irq_unmask = tegra_unmask;
130 gic_arch_extn.irq_retrigger = tegra_retrigger; 131 gic_arch_extn.irq_retrigger = tegra_retrigger;
131 132
132 gic_init(0, 29, IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE), 133 /*
133 IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100)); 134 * Check if there is a devicetree present, since the GIC will be
135 * initialized elsewhere under DT.
136 */
137 if (!of_have_populated_dt())
138 gic_init(0, 29, IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE),
139 IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100));
134} 140}