Skip to contentSkip to conversation

ARM: Tegra: dt: Set up an OF IRQ translation range

PATCH Applied Stephen Warren 2 participants 2 messages Apr 30, 2011 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: Tegra: dt: Set up an OF IRQ translation range

Without this, none of the devicetree devices in tegra-harmony.dts can map interrupts, and the system fails to boot.

---
v2: Add a Tegra-specific compatible value, search by that value, minor
formatting fixes.

 arch/arm/boot/dts/tegra-harmony.dts |    3 +++
 arch/arm/mach-tegra/board-dt.c      |   14 ++++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)
arch/arm/boot/dts/tegra-harmony.dts +3 -0
index 82fa0c2..a22c1bb 100644
@@ -25,8 +25,11 @@
 		ranges;
 
 		intc: intc {
+			compatible = "nvidia,tegra250-gic", "arm,gic";
 			interrupt-controller;
 			#interrupt-cells = <1>;
+			reg = < 0x50041000 0x1000
+			        0x50040100 0x100 >;
 		};
 	};
 
arch/arm/mach-tegra/board-dt.c +14 -0
index 0efedb8..fb0d75d 100644
@@ -22,7 +22,9 @@
 #include <linux/clk.h>
 #include <linux/dma-mapping.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/of_fdt.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/pda_power.h>
 #include <linux/io.h>
@@ -137,8 +139,20 @@ static struct of_device_id tegra_dt_match_table[] __initdata = {
 	{}
 };
 
+struct of_device_id gic_match[] __initdata = {
+	{ .compatible = "nvidia,tegra250-gic", },
+	{}
+};
+
 static void __init tegra_dt_init(void)
 {
+	struct device_node *node;
+
+	node = of_find_matching_node_by_address(NULL, gic_match,
+						TEGRA_ARM_INT_DIST_BASE);
+	if (node)
+		of_irq_domain_add_simple(node, INT_GIC_BASE, INT_MAIN_NR);
+
 	/*
 	 * Before registering devices; tell Linux about which device nodes
 	 * are intended to be registered so that it doesn't create devices
Signature · 1 line
1.7.1

A message that is not in the archive (sent off-list or not yet received): 1304136608-11584-1-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org

Applied
#2 lore raw
Quoted 4 lines · Stephen Warren

Without this, none of the devicetree devices in tegra-harmony.dts can map interrupts, and the system fails to boot.

Merged into arm/dt: full tegra devicetree support patch, thanks.

g.

Quoted 62 lines

---
v2: Add a Tegra-specific compatible value, search by that value, minor
formatting fixes.

 arch/arm/boot/dts/tegra-harmony.dts |    3 +++
 arch/arm/mach-tegra/board-dt.c      |   14 ++++++++++++++
 2 files changed, 17 insertions(+), 0 deletions(-)
arch/arm/boot/dts/tegra-harmony.dts +3 -0
index 82fa0c2..a22c1bb 100644
@@ -25,8 +25,11 @@
 		ranges;
 
 		intc: intc {
+			compatible = "nvidia,tegra250-gic", "arm,gic";
 			interrupt-controller;
 			#interrupt-cells = <1>;
+			reg = < 0x50041000 0x1000
+			        0x50040100 0x100 >;
 		};
 	};
 
arch/arm/mach-tegra/board-dt.c +14 -0
index 0efedb8..fb0d75d 100644
@@ -22,7 +22,9 @@
 #include <linux/clk.h>
 #include <linux/dma-mapping.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/of_fdt.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/pda_power.h>
 #include <linux/io.h>
@@ -137,8 +139,20 @@ static struct of_device_id tegra_dt_match_table[] __initdata = {
 	{}
 };
 
+struct of_device_id gic_match[] __initdata = {
+	{ .compatible = "nvidia,tegra250-gic", },
+	{}
+};
+
 static void __init tegra_dt_init(void)
 {
+	struct device_node *node;
+
+	node = of_find_matching_node_by_address(NULL, gic_match,
+						TEGRA_ARM_INT_DIST_BASE);
+	if (node)
+		of_irq_domain_add_simple(node, INT_GIC_BASE, INT_MAIN_NR);
+
 	/*
 	 * Before registering devices; tell Linux about which device nodes
 	 * are intended to be registered so that it doesn't create devices
Signature · 1 line
1.7.1