Add Actions Semi Owl family sirq support
Subsystems (3)
v3 cover Add Actions Semi Owl family sirq support
This patch series add support for external interrupt controller in Actions Semi Owl famil of SoC's (S500, S700 and S900). Actions provides support for external interrupt controller to be connected with it's SoC's using 3 SIRQ pins.
Each line can be configures independently, i.e 3 independent external interrupt controller can be connected and managed parallely.
Device tree node is created only for S700 after testing it in Cubieboard7.
Changelog in v3:
- Set default operating frequency to 24MHz
- Falling edge and Low Level interrupts translated to rising edge and high level
- Introduced common function with lock handling for register read and write
- Used direct GIC interrupt number for interrupt local hwirq and finding offset using DT entry (range) when registers are shared
- Changed irq_ack to irq_eoi
- Added translation method for irq_domain_ops
- Clearing interrupt pending based on bitmask for edge triggered
- Added pinctrl definition for sirq for cubieboard7. This depends on,
https://lore.kernel.org/patchwork/patch/1012859/
Changelog in v2:
- Added SIRQ as hierarchical chip
GIC <----> SIRQ <----> External interrupt controller/Child devices
- Device binding updates with vendor prefix
- Register sharing handled globally and common init sequence/data for all actions SoC family
Thanks,
Parthiban
Saravanan
Parthiban Nallathambi (4):
dt-bindings: interrupt-controller: Actions external interrupt
controller
drivers/irqchip: Add Actions external interrupts support
arm64: dts: actions: Add sirq node for Actions Semi S700
arm64: dts: actions: s700-cubieboard7: Enable SIRQ
.../interrupt-controller/actions,owl-sirq.txt | 57 ++++ .../boot/dts/actions/s700-cubieboard7.dts | 19 ++ arch/arm64/boot/dts/actions/s700.dtsi | 10 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-owl-sirq.c | 301 ++++++++++++++++++ 5 files changed, 388 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt create mode 100644 drivers/irqchip/irq-owl-sirq.c
Signature · 1 line
2.17.2
PATCH v3 1/4 dt-bindings: interrupt-controller: Actions external interrupt controller
Actions Semi OWL family SoC's provides support for external interrupt controller to be connected and controlled using SIRQ pins. S500, S700 and S900 provides 3 SIRQ lines and works independently for 3 external interrupt controllers.
--- .../interrupt-controller/actions,owl-sirq.txt | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +57 -0
@@ -0,0 +1,57 @@ +Actions Semi Owl SoCs SIRQ interrupt controller + +S500, S700 and S900 SoC's from Actions provides 3 SPI's from GIC, +in which external interrupt controller can be connected. 3 SPI's +45, 46, 47 from GIC are directly exposed as SIRQ. It has +the following properties: + +- inputs three interrupt signal from external interrupt controller + +Required properties: + +- compatible: should be "actions,owl-sirq" +- reg: physical base address of the controller and length of memory mapped + region. +- interrupt-controller: identifies the node as an interrupt controller +- #interrupt-cells: specifies the number of cells needed to encode an interrupt + source, should be 2. +- actions,sirq-shared-reg: Applicable for S500 and S700 where SIRQ register + details are maintained at same offset/register. +- actions,sirq-reg-offset: register offset for SIRQ interrupts. When registers are + shared, all the three offsets will be same (S500 and S700). +- actions,ext-irq-range: Identifies external irq number range in different SoCs. + +Example for S900: + +sirq: interrupt-controller at e01b0000 { + compatible = "actions,owl-sirq"; + reg = <0x0 0xe01b0000 0x0 0x1000>; + interrupt-controller; + #interrupt-cells = <3>; + actions,sirq-offset = <0x200 0x528 0x52c>; + actions,ext-irq-range = <13 15>; +}; + +Example for S700: + +sirq: interrupt-controller at e01b0000 { + compatible = "actions,owl-sirq"; + reg = <0x0 0xe01b0000 0x0 0x1000>; + interrupt-controller; + #interrupt-cells = <3>; + actions,sirq-shared-reg; + actions,sirq-reg-offset = <0x200 0x200 0x200>; + actions,ext-irq-range = <13 15>; +}; + +Example for S500: + +sirq: interrupt-controller at b01b0000 { + compatible = "actions,owl-sirq"; + reg = <0x0 0xb01b0000 0x0 0x1000>; + interrupt-controller; + #interrupt-cells = <3>; + actions,sirq-shared-reg; + actions,sirq-offset = <0x200 0x200 0x200>; + actions,ext-irq-range = <13 15>; +};
Signature · 1 line
2.17.2
Rob Herring
maintainerRe: [PATCH v3 1/4] dt-bindings: interrupt-controller: Actions external interrupt controller
Quoted 18 lines · Parthiban Nallathambi
Actions Semi OWL family SoC's provides support for external interrupt controller to be connected and controlled using SIRQ pins. S500, S700 and S900 provides 3 SIRQ lines and works independently for 3 external interrupt controllers.
Signed-off-by Parthiban Nallathambi <[email protected]>Signed-off-by Saravanan Sekar <[email protected]>--- .../interrupt-controller/actions,owl-sirq.txt | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txtDocumentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +0
-0
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt line 3
Quoted 3 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +3
-0@@ -0,0 +1,57 @@ +Actions Semi Owl SoCs SIRQ interrupt controller + +S500, S700 and S900 SoC's from Actions provides 3 SPI's from GIC,
Listing SoCs here means you have to update this line for every new SoC.
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt line 12
Quoted 9 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +9
-0+in which external interrupt controller can be connected. 3 SPI's +45, 46, 47 from GIC are directly exposed as SIRQ. It has +the following properties: + +- inputs three interrupt signal from external interrupt controller + +Required properties: + +- compatible: should be "actions,owl-sirq"
SoC specific compatibles needed.
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt line 21
Quoted 9 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +9
-0+- reg: physical base address of the controller and length of memory mapped + region. +- interrupt-controller: identifies the node as an interrupt controller +- #interrupt-cells: specifies the number of cells needed to encode an interrupt + source, should be 2. +- actions,sirq-shared-reg: Applicable for S500 and S700 where SIRQ register + details are maintained at same offset/register. +- actions,sirq-reg-offset: register offset for SIRQ interrupts. When registers are + shared, all the three offsets will be same (S500 and S700).
These properties should be implied by the compatible string.
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt line 22
Quoted 1 line
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +1
-0+- actions,ext-irq-range: Identifies external irq number range in different SoCs.
Why is this needed? It appears to always be the same.
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt line 35
Quoted 13 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +13
-0+ +Example for S900: + +sirq: interrupt-controller@e01b0000 { + compatible = "actions,owl-sirq"; + reg = <0x0 0xe01b0000 0x0 0x1000>; + interrupt-controller; + #interrupt-cells = <3>; + actions,sirq-offset = <0x200 0x528 0x52c>; + actions,ext-irq-range = <13 15>; +}; + +Example for S700:
Examples are examples, not an enumeration of all possible dts entries. So 1 should be sufficient.
Quoted 25 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +22
-0+ +sirq: interrupt-controller@e01b0000 { + compatible = "actions,owl-sirq"; + reg = <0x0 0xe01b0000 0x0 0x1000>; + interrupt-controller; + #interrupt-cells = <3>; + actions,sirq-shared-reg; + actions,sirq-reg-offset = <0x200 0x200 0x200>; + actions,ext-irq-range = <13 15>; +}; + +Example for S500: + +sirq: interrupt-controller@b01b0000 { + compatible = "actions,owl-sirq"; + reg = <0x0 0xb01b0000 0x0 0x1000>; + interrupt-controller; + #interrupt-cells = <3>; + actions,sirq-shared-reg; + actions,sirq-offset = <0x200 0x200 0x200>; + actions,ext-irq-range = <13 15>; +};Signature · 1 line
2.17.2
Re: [PATCH v3 1/4] dt-bindings: interrupt-controller: Actions external interrupt controller
Hello Rob,
Quoted 13 lines · Rob Herring
Quoted 12 lines · Parthiban Nallathambi
Actions Semi OWL family SoC's provides support for external interrupt controller to be connected and controlled using SIRQ pins. S500, S700 and S900 provides 3 SIRQ lines and works independently for 3 external interrupt controllers.
Signed-off-by Parthiban Nallathambi <[email protected]>Signed-off-by Saravanan Sekar <[email protected]>--- .../interrupt-controller/actions,owl-sirq.txt | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt
Quoted 11 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt line 3
Quoted 9 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +3
-0@@ -0,0 +1,57 @@ +Actions Semi Owl SoCs SIRQ interrupt controller + +S500, S700 and S900 SoC's from Actions provides 3 SPI's from GIC,Listing SoCs here means you have to update this line for every new SoC.
Ok, I will mark it as OWL SoC's here.
Quoted 12 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt line 12
Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +9
-0+in which external interrupt controller can be connected. 3 SPI's +45, 46, 47 from GIC are directly exposed as SIRQ. It has +the following properties: + +- inputs three interrupt signal from external interrupt controller + +Required properties: + +- compatible: should be "actions,owl-sirq"SoC specific compatibles needed.
Ok, I will change this into "actions,s700-sirq"
Quoted 11 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt line 21
Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +9
-0+- reg: physical base address of the controller and length of memory mapped + region. +- interrupt-controller: identifies the node as an interrupt controller +- #interrupt-cells: specifies the number of cells needed to encode an interrupt + source, should be 2. +- actions,sirq-shared-reg: Applicable for S500 and S700 where SIRQ register + details are maintained at same offset/register. +- actions,sirq-reg-offset: register offset for SIRQ interrupts. When registers are + shared, all the three offsets will be same (S500 and S700).
Quoted 1 line
These properties should be implied by the compatible string.
Agreed for sirq-shared-reg.
But for s900 sirq-reg-offset, the register offset will have different values. So this shall not be removed.
Quoted 4 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt line 22
Quoted 2 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +1
-0+- actions,ext-irq-range: Identifies external irq number range in different SoCs.Why is this needed? It appears to always be the same.
Yes, I agree for all the existing Owl SoC's this remains same.
In the previous version we defined this as constant in the code. But based on Marc's feedback I understood that this value should come from Device Tree instead on hard coding in the code.
Quoted 17 lines
Quoted 4 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +3
-0+ +Example for S900: +Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt line 35
Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +10
-0+sirq: interrupt-controller@e01b0000 { + compatible = "actions,owl-sirq"; + reg = <0x0 0xe01b0000 0x0 0x1000>; + interrupt-controller; + #interrupt-cells = <3>; + actions,sirq-offset = <0x200 0x528 0x52c>; + actions,ext-irq-range = <13 15>; +}; + +Example for S700:Examples are examples, not an enumeration of all possible dts entries. So 1 should be sufficient.
Sure, I will maintain only s700 here.
Quoted 27 lines
Quoted 26 lines
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.txt new file +22
-0+ +sirq: interrupt-controller@e01b0000 { + compatible = "actions,owl-sirq"; + reg = <0x0 0xe01b0000 0x0 0x1000>; + interrupt-controller; + #interrupt-cells = <3>; + actions,sirq-shared-reg; + actions,sirq-reg-offset = <0x200 0x200 0x200>; + actions,ext-irq-range = <13 15>; +}; + +Example for S500: + +sirq: interrupt-controller@b01b0000 { + compatible = "actions,owl-sirq"; + reg = <0x0 0xb01b0000 0x0 0x1000>; + interrupt-controller; + #interrupt-cells = <3>; + actions,sirq-shared-reg; + actions,sirq-offset = <0x200 0x200 0x200>; + actions,ext-irq-range = <13 15>; +};Signature · 1 line
2.17.2
Signature · 6 lines
Thanks, Parthiban N DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-22 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH v3 2/4 drivers/irqchip: Add Actions external interrupts support
In reply to Parthiban NallathambiActions Semi Owl family SoC's S500, S700 and S900 provides support for 3 external interrupt controllers through SIRQ pins.
Each line can be independently configured as interrupt and triggers on either of the edges (raising or falling) or either of the levels (high or low) . Each line can also be masked independently.
--- drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-owl-sirq.c | 301 +++++++++++++++++++++++++++++++++ 2 files changed, 302 insertions(+) create mode 100644 drivers/irqchip/irq-owl-sirq.c
drivers/irqchip/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_ATH79) += irq-ath79-misc.o obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2836.o obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o +obj-$(CONFIG_ARCH_ACTIONS) += irq-owl-sirq.o obj-$(CONFIG_FARADAY_FTINTC010) += irq-ftintc010.o obj-$(CONFIG_ARCH_HIP04) += irq-hip04.o obj-$(CONFIG_ARCH_LPC32XX) += irq-lpc32xx.o
drivers/irqchip/irq-owl-sirq.c new file +301 -0
301 lines not on this page · raw message
Signature · 1 line
2.17.2
Re: [PATCH v3 2/4] drivers/irqchip: Add Actions external interrupts support
Quoted 43 lines · Parthiban Nallathambi
Actions Semi Owl family SoC's S500, S700 and S900 provides support for 3 external interrupt controllers through SIRQ pins.
Each line can be independently configured as interrupt and triggers on either of the edges (raising or falling) or either of the levels (high or low) . Each line can also be masked independently.
Signed-off-by Parthiban Nallathambi <[email protected]>Signed-off-by Saravanan Sekar <[email protected]>--- drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-owl-sirq.c | 301 +++++++++++++++++++++++++++++++++ 2 files changed, 302 insertions(+) create mode 100644 drivers/irqchip/irq-owl-sirq.cdrivers/irqchip/Makefile +1
-0@@ -7,6 +7,7 @@ obj-$(CONFIG_ATH79) += irq-ath79-misc.o obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2836.o obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o +obj-$(CONFIG_ARCH_ACTIONS) += irq-owl-sirq.o obj-$(CONFIG_FARADAY_FTINTC010) += irq-ftintc010.o obj-$(CONFIG_ARCH_HIP04) += irq-hip04.o obj-$(CONFIG_ARCH_LPC32XX) += irq-lpc32xx.odrivers/irqchip/irq-owl-sirq.c new file +10
-0@@ -0,0 +1,301 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Actions Semi Owl SoCs SIRQ interrupt controller driver +* +* Copyright (C) 2014 Actions Semi Inc. +* David Liu <[email protected]> +* +* Author: Parthiban Nallathambi <[email protected]> +* Author: Saravanan Sekar <[email protected]> +*/
drivers/irqchip/irq-owl-sirq.c line 20
Quoted 10 lines
drivers/irqchip/irq-owl-sirq.c new file +10
-0+ +#include <linux/interrupt.h> +#include <linux/irqchip.h> +#include <linux/of_irq.h> +#include <linux/of_address.h> + +#define INTC_EXTCTL_PENDING BIT(0) +#define INTC_EXTCTL_CLK_SEL BIT(4) +#define INTC_EXTCTL_EN BIT(5) +#define INTC_EXTCTL_TYPE_MASK GENMASK(6, 7)
#define GENMASK(h, l) [...]
I sense a problem here.
Thanks,
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
PATCH v3 3/4 arm64: dts: actions: Add sirq node for Actions Semi S700
In reply to Parthiban NallathambiAdd sirq node for Actions Semi S700 SoC with 3 SIRQ pins support, in which external interrupt controllers can be connected.
Example:
atc260x: atc2603c at 65 {
interrupt-parent = <&sirq>;
interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
};--- arch/arm64/boot/dts/actions/s700.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/actions/s700.dtsi +10 -0
@@ -174,6 +174,16 @@ #clock-cells = <1>; }; + sirq: interrupt-controller at e01b0200 { + compatible = "actions,owl-sirq"; + reg = <0x0 0xe01b0000 0x0 0x1000>; + interrupt-controller; + #interrupt-cells = <3>; + actions,sirq-shared-reg; + actions,sirq-reg-offset = <0x200 0x200 0x200>; + actions,ext-irq-range = <13 15>; + }; + sps: power-controller at e01b0100 { compatible = "actions,s700-sps"; reg = <0x0 0xe01b0100 0x0 0x100>;
Signature · 1 line
2.17.2