From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org,
bones-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: [PATCH] ARM: Tegra: dt: Set up an OF IRQ translation range
Date: Fri, 29 Apr 2011 16:31:33 -0600 [thread overview]
Message-ID: <1304116293-25139-1-git-send-email-swarren@nvidia.com> (raw)
Without this, none of the devicetree devices in tegra-harmony.dts can
map interrupts, and the system fails to boot.
Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
Note: This patch is based on Grant's latest
git://git.secretlab.ca/git/linux-2.6 devicetree/test
plus all the Tegra fixes I recently posted to linaro-dev, which in
particular move tegra-harmony.dts to a different location.
Question: It seems like the call to of_irq_domain_add_simple should be
part of arch/arm/common/gic.c:gic_init(), rather than each SoC's DT board
file having to do this. However, that'd require gic_init having an OF
device node to pass to of_irq_domain_add_simple.
Question 2: Should the range of IRQ numbers cover just the IRQs directly
managed by the GIC itself, or cover the entire range of IRQ numbers for
the SoC? Put another way, should it include mappings for a GPIO controller
then aggregates interrupts from N GPIOs into 1 or M GIC interrupts, or not?
Put yet another way, should the code pass INT_MAIN_NR or NR_IRQS for Tegra?
I suspect the former, and that child interrupt devices should themselves
call of_irq_domain_add_simple to set up their mappings?
Question 3: I'm not sure "arm,gic" is the correct sanctioned compatible value?
arch/arm/boot/dts/tegra-harmony.dts | 2 ++
arch/arm/mach-tegra/board-dt.c | 13 +++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/arch/arm/boot/dts/tegra-harmony.dts b/arch/arm/boot/dts/tegra-harmony.dts
index 6fe09d7..1972f61 100644
--- a/arch/arm/boot/dts/tegra-harmony.dts
+++ b/arch/arm/boot/dts/tegra-harmony.dts
@@ -26,8 +26,10 @@
ranges;
intc: intc {
+ compatible = "arm,gic";
interrupt-controller;
#interrupt-cells = <1>;
+ reg = <0x50041000 0x1000 0x50040100 0x100 >;
};
};
diff --git a/arch/arm/mach-tegra/board-dt.c b/arch/arm/mach-tegra/board-dt.c
index aa37783..894c7a3 100644
--- a/arch/arm/mach-tegra/board-dt.c
+++ b/arch/arm/mach-tegra/board-dt.c
@@ -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,19 @@ static struct of_device_id tegra_dt_match_table[] __initdata = {
{}
};
+struct of_device_id gic_match[] = {
+ { .compatible = "arm,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
--
1.7.0.4
next reply other threads:[~2011-04-29 22:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-29 22:31 Stephen Warren [this message]
[not found] ` <1304116293-25139-1-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-04-29 23:19 ` [PATCH] ARM: Tegra: dt: Set up an OF IRQ translation range Grant Likely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1304116293-25139-1-git-send-email-swarren@nvidia.com \
--to=swarren-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
--cc=bones-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).