From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] ARM: Orion: Bind the orion bridge interrupt controller through DT
Date: Tue, 11 Dec 2012 07:24:30 +0100 [thread overview]
Message-ID: <20121211062430.GD25466@lunn.ch> (raw)
In-Reply-To: <1355188683-18208-2-git-send-email-jgunthorpe@obsidianresearch.com>
On Mon, Dec 10, 2012 at 06:18:02PM -0700, Jason Gunthorpe wrote:
> This adds the common DT code and board support for kirkwood and dove
>
> - Add the marvell,orion-bridge-intc DT node to the DTSI file
> - Make the call to orion_bridge_irq_init happen only in the non-DT
> case
>
> Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
> ---
> .../devicetree/bindings/arm/mrvl/intc.txt | 21 ++++++++++++++++++++
> arch/arm/boot/dts/dove.dtsi | 10 +++++++++
> arch/arm/boot/dts/kirkwood.dtsi | 12 +++++++++++
> arch/arm/mach-dove/common.c | 4 ---
> arch/arm/mach-dove/irq.c | 5 ++++
> arch/arm/mach-kirkwood/common.c | 4 ---
> arch/arm/mach-kirkwood/irq.c | 5 ++++
> arch/arm/plat-orion/irq.c | 20 +++++++++++++++++++
> 8 files changed, 73 insertions(+), 8 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/arm/mrvl/intc.txt b/Documentation/devicetree/bindings/arm/mrvl/intc.txt
> index 8b53273..cf633f1 100644
> --- a/Documentation/devicetree/bindings/arm/mrvl/intc.txt
> +++ b/Documentation/devicetree/bindings/arm/mrvl/intc.txt
> @@ -58,3 +58,24 @@ Example:
> reg = <0xfed20204 0x04>,
> <0xfed20214 0x04>;
> };
> +
> +* Marvell Orion Bridge Interrupt controller
> +
> +Required properties
> +- compatible : Should be "marvell,orion-bridge-intc".
> +- #interrupt-cells: Specifies the number of cells needed to encode an
> + interrupt source. Supported value is <1>.
> +- interrupt-controller : Declare this node to be an interrupt controller.
> +- interrupts: The interrupt number the bridge is attached to on the main
> + controller.
> +- reg : Interrupt cause address.
> +
> +Example:
> +
> + bridge_intc: bridge_intc at 20110 {
> + compatible = "marvell,orion-bridge-intc";
> + interrupt-controller;
> + #interrupt-cells = <1>;
> + interrupts = <1>;
> + reg = <0x20110 0x08>;
> + };
> diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi
> index 5a00022..b726ba8 100644
> --- a/arch/arm/boot/dts/dove.dtsi
> +++ b/arch/arm/boot/dts/dove.dtsi
> @@ -67,6 +67,8 @@
> status = "disabled";
> };
>
> + /* The interrupt controller stanzas are in an
> + * order that matches irqs.h */
> gpio0: gpio at d0400 {
> compatible = "marvell,orion-gpio";
> #gpio-cells = <2>;
> @@ -93,6 +95,14 @@
> ngpio = <8>;
> };
>
> + bridge_intc: bridge_intc at 20110 {
> + compatible = "marvell,orion-bridge-intc";
> + interrupt-controller;
> + #interrupt-cells = <1>;
> + interrupts = <0>;
> + reg = <0x20110 0x08>;
> + };
> +
> spi0: spi at 10600 {
> compatible = "marvell,orion-spi";
> #address-cells = <1>;
> diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
> index 4e5b815..854e532 100644
> --- a/arch/arm/boot/dts/kirkwood.dtsi
> +++ b/arch/arm/boot/dts/kirkwood.dtsi
> @@ -19,6 +19,8 @@
> #address-cells = <1>;
> #size-cells = <1>;
>
> + /* The interrupt controller stanzas are in an
> + * order that matches irqs.h */
> gpio0: gpio at 10100 {
> compatible = "marvell,orion-gpio";
> #gpio-cells = <2>;
> @@ -37,6 +39,14 @@
> interrupts = <39>, <40>, <41>;
> };
>
> + bridge_intc: bridge_intc at 20110 {
> + compatible = "marvell,orion-bridge-intc";
> + interrupt-controller;
> + #interrupt-cells = <1>;
> + interrupts = <1>;
> + reg = <0x20110 0x08>;
> + };
> +
> serial at 12000 {
> compatible = "ns16550a";
> reg = <0x12000 0x100>;
> @@ -73,6 +83,8 @@
>
> wdt at 20300 {
> compatible = "marvell,orion-wdt";
> + interrupt-parent = <&bridge_intc>;
> + interrupts = <3>;
> reg = <0x20300 0x28>;
> status = "okay";
> };
> diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
> index 6bad21b..b570211 100644
> --- a/arch/arm/mach-dove/common.c
> +++ b/arch/arm/mach-dove/common.c
> @@ -243,10 +243,6 @@ static int __init dove_find_tclk(void)
> static void __init dove_timer_init(void)
> {
> dove_tclk = dove_find_tclk();
> - if (orion_bridge_irq_init(IRQ_DOVE_BRIDGE,
> - IRQ_DOVE_BRIDGE_START,
> - BRIDGE_CAUSE, NULL))
> - panic("Unable to setup bridge irqs");
> orion_time_init(IRQ_DOVE_BRIDGE_TIMER1, dove_tclk);
> }
>
> diff --git a/arch/arm/mach-dove/irq.c b/arch/arm/mach-dove/irq.c
> index bc4344a..bcb193f 100644
> --- a/arch/arm/mach-dove/irq.c
> +++ b/arch/arm/mach-dove/irq.c
> @@ -139,4 +139,9 @@ void __init dove_init_irq(void)
> set_irq_flags(i, IRQF_VALID);
> }
> irq_set_chained_handler(IRQ_DOVE_PMU, pmu_irq_handler);
> +
> + if (orion_bridge_irq_init(IRQ_DOVE_BRIDGE,
> + IRQ_DOVE_BRIDGE_START,
> + BRIDGE_CAUSE, NULL))
> + panic("Unable to setup bridge irqs");
> }
> diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
> index ccd3ed5..7398f8b 100644
> --- a/arch/arm/mach-kirkwood/common.c
> +++ b/arch/arm/mach-kirkwood/common.c
> @@ -535,10 +535,6 @@ static void __init kirkwood_timer_init(void)
> {
> kirkwood_tclk = kirkwood_find_tclk();
>
> - if (orion_bridge_irq_init(IRQ_KIRKWOOD_BRIDGE,
> - IRQ_KIRKWOOD_BRIDGE_START,
> - BRIDGE_CAUSE, NULL))
> - panic("Unable to setup bridge irqs");
> orion_time_init(IRQ_KIRKWOOD_BRIDGE_TIMER1, kirkwood_tclk);
> }
>
> diff --git a/arch/arm/mach-kirkwood/irq.c b/arch/arm/mach-kirkwood/irq.c
> index 8847035..a1388ef 100644
> --- a/arch/arm/mach-kirkwood/irq.c
> +++ b/arch/arm/mach-kirkwood/irq.c
> @@ -41,4 +41,9 @@ void __init kirkwood_init_irq(void)
> IRQ_KIRKWOOD_GPIO_START, gpio0_irqs);
> orion_gpio_init(NULL, 32, 18, GPIO_HIGH_VIRT_BASE, 0,
> IRQ_KIRKWOOD_GPIO_START + 32, gpio1_irqs);
> +
> + if (orion_bridge_irq_init(IRQ_KIRKWOOD_BRIDGE,
> + IRQ_KIRKWOOD_BRIDGE_START,
> + BRIDGE_CAUSE, NULL))
> + panic("Unable to setup bridge irqs");
> }
> diff --git a/arch/arm/plat-orion/irq.c b/arch/arm/plat-orion/irq.c
> index a903012..2dcccda 100644
> --- a/arch/arm/plat-orion/irq.c
> +++ b/arch/arm/plat-orion/irq.c
> @@ -131,9 +131,29 @@ static int __init orion_add_irq_domain(struct device_node *np,
> return 0;
> }
>
> +static int __init orion_add_bridge_irq_domain(
> + struct device_node *np, struct device_node *interrupt_parent)
> +{
> + void __iomem *base;
> + int bridge_irq;
> +
> + base = of_iomap(np, 0);
> + if (!base)
> + return -ENODEV;
> + bridge_irq = irq_of_parse_and_map(np, 0);
> + /* FIXME: irq_of_parse_and_map returns 0 on error, but on Dove the
> + * bridge IRQ is 0.
> + if (!bridge_irq)
> + return -ENODEV;*/
> +
> + return orion_bridge_irq_init(bridge_irq, -1, base, np);
Hi Jason
So does this mean for Dove it will currently always fail?
Thanks
Andrew
next prev parent reply other threads:[~2012-12-11 6:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-11 1:18 [PATCHv2 1/3] ARM: Orion: Hoist bridge interrupt handling out of the timer Jason Gunthorpe
2012-12-11 1:18 ` [PATCH 2/3] ARM: Orion: Bind the orion bridge interrupt controller through DT Jason Gunthorpe
2012-12-11 6:24 ` Andrew Lunn [this message]
2012-12-11 6:58 ` Jason Gunthorpe
2012-12-11 7:13 ` Andrew Lunn
2012-12-11 18:55 ` Jason Gunthorpe
2013-01-10 1:47 ` Jason Cooper
2013-01-10 6:07 ` Andrew Lunn
2013-01-10 9:54 ` Sebastian Hesselbarth
2013-01-10 18:48 ` Jason Gunthorpe
2013-01-10 18:57 ` Jason Cooper
2013-01-11 4:02 ` Jason Gunthorpe
2013-01-11 8:13 ` Thomas Petazzoni
2013-01-11 11:59 ` Jason Cooper
2012-12-11 1:18 ` [PATCH 3/3] ARM: Orion: Bind the orion timer " Jason Gunthorpe
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=20121211062430.GD25466@lunn.ch \
--to=andrew@lunn.ch \
--cc=linux-arm-kernel@lists.infradead.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).