Skip to contentSkip to conversation

Amazon's Annapurna Labs Fabric Interrupt Controller

PATCH In review Talel Shenhar 3 participants 9 messages Jun 10, 2019 – Jul 9, 2019

Subsystems (3)
lore
Share & tools
lore

Talel Shenhar

author maintainer
#0 lore raw

v4 cover Amazon's Annapurna Labs Fabric Interrupt Controller

This series introduces support for Amazon's Annapurna Labs Fabric Interrupt Controller.

The Amazon's Annapurna Labs FIC (Fabric Interrupt Controller) has 32 inputs/sources. This FIC may be cascaded into another FIC or connected directly to the main CPU Interrupt Controller (e.g. GIC).

Changes since v3:
=================
- tightened the verification for supported trigger types
- updated dt-binding's example to meet the binding description (interrupt-cells to 2)
- added description to interrupt-cells to explain each field
- changed pr_err to pr_debug inside al_fic_irq_set_type in order to allow the user to enable printouts for verbose information in case of errors

Changes since v2:
=================
- updated dt-bindings to use proper format for entry name
- removed kernel-doc format style from Copyright
- removed unneeded/misplaced selects from Kconfig
- changed used mmio operation to relaxed flavor
- changed error return value from EPERM to EINVAL int case of attempting to reconfigure the FIC after it has been configured
- fixed commenting format
- used drivers define instead of subsystem internals
- moved al_fic_hw_init function to caller
- removed al_fic_wire_get_domain from documentation
- removed argument validation from al_fic_wire_init

Changes since v1:
=================
- removing unused exported APIs
- updating cover letter and commit message accordingly

Talel Shenhar (2):
dt-bindings: interrupt-controller: Amazon's Annapurna Labs FIC
irqchip: al-fic: Introduce Amazon's Annapurna Labs Fabric Interrupt
Controller Driver

 .../interrupt-controller/amazon,al-fic.txt         |  29 +++
 MAINTAINERS                                        |   6 +
 drivers/irqchip/Kconfig                            |   8 +
 drivers/irqchip/Makefile                           |   1 +
 drivers/irqchip/irq-al-fic.c                       | 278 +++++++++++++++++++++
 5 files changed, 322 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt
 create mode 100644 drivers/irqchip/irq-al-fic.c
Signature · 1 line
2.7.4
author maintainer
#1 lore raw

PATCH v4 1/2 dt-bindings: interrupt-controller: Amazon's Annapurna Labs FIC

Document Amazon's Annapurna Labs Fabric Interrupt Controller SoC binding.

---
 .../interrupt-controller/amazon,al-fic.txt         | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt
Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt new file +29 -0
new file mode 100644
index 0000000..4e82fd5
@@ -0,0 +1,29 @@
+Amazon's Annapurna Labs Fabric Interrupt Controller
+
+Required properties:
+
+- compatible: should be "amazon,al-fic"
+- reg: physical base address and size of the registers
+- interrupt-controller: identifies the node as an interrupt controller
+- #interrupt-cells: must be 2.
+  First cell defines the index of the interrupt within the controller.
+  Second cell is used to specify the trigger type and must be one of the
+  following:
+    - bits[3:0] trigger type and level flags
+	1 = low-to-high edge triggered
+	4 = active high level-sensitive
+- interrupt-parent: specifies the parent interrupt controller.
+- interrupts: describes which input line in the interrupt parent, this
+  fic's output is connected to. This field property depends on the parent's
+  binding
+
+Example:
+
+amazon_fic: interrupt-controller@0xfd8a8500 {
+	compatible = "amazon,al-fic";
+	interrupt-controller;
+	#interrupt-cells = <2>;
+	reg = <0x0 0xfd8a8500 0x0 0x1000>;
+	interrupt-parent = <&gic>;
+	interrupts = <GIC_SPI 0x0 IRQ_TYPE_LEVEL_HIGH>;
+};
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH v4 1/2] dt-bindings: interrupt-controller: Amazon's Annapurna Labs FIC

Quoted 34 lines · Talel Shenhar

Document Amazon's Annapurna Labs Fabric Interrupt Controller SoC binding.

---
 .../interrupt-controller/amazon,al-fic.txt         | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt
Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt new file +19 -0
new file mode 100644
index 0000000..4e82fd5
@@ -0,0 +1,29 @@
+Amazon's Annapurna Labs Fabric Interrupt Controller
+
+Required properties:
+
+- compatible: should be "amazon,al-fic"
+- reg: physical base address and size of the registers
+- interrupt-controller: identifies the node as an interrupt controller
+- #interrupt-cells: must be 2.
+  First cell defines the index of the interrupt within the controller.
+  Second cell is used to specify the trigger type and must be one of the
+  following:
+    - bits[3:0] trigger type and level flags
+	1 = low-to-high edge triggered
+	4 = active high level-sensitive
+- interrupt-parent: specifies the parent interrupt controller.
+- interrupts: describes which input line in the interrupt parent, this
+  fic's output is connected to. This field property depends on the parent's
+  binding
+

Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt line 29

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt new file +10 -0
+Example:
+
+amazon_fic: interrupt-controller@0xfd8a8500 {
+	compatible = "amazon,al-fic";
+	interrupt-controller;
+	#interrupt-cells = <2>;
+	reg = <0x0 0xfd8a8500 0x0 0x1000>;
+	interrupt-parent = <&gic>;
+	interrupts = <GIC_SPI 0x0 IRQ_TYPE_LEVEL_HIGH>;
+};

Rob, are you OK with this DT binding?

Thanks,

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...
maintainer
#3 lore raw

Re: [PATCH v4 1/2] dt-bindings: interrupt-controller: Amazon's Annapurna Labs FIC

In reply to Talel Shenhar
Quoted 18 lines · Talel Shenhar

Document Amazon's Annapurna Labs Fabric Interrupt Controller SoC binding.

---
 .../interrupt-controller/amazon,al-fic.txt         | 29 ++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt
Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt new file +4 -0
new file mode 100644
index 0000000..4e82fd5
@@ -0,0 +1,29 @@
+Amazon's Annapurna Labs Fabric Interrupt Controller
+
+Required properties:
+

Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt line 14

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt new file +10 -0
+- compatible: should be "amazon,al-fic"
+- reg: physical base address and size of the registers
+- interrupt-controller: identifies the node as an interrupt controller
+- #interrupt-cells: must be 2.
+  First cell defines the index of the interrupt within the controller.
+  Second cell is used to specify the trigger type and must be one of the
+  following:
+    - bits[3:0] trigger type and level flags
+	1 = low-to-high edge triggered
+	4 = active high level-sensitive

No need to define this here. Reference the standard definition.

Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt line 15

Quoted 1 line
Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt new file +1 -0
+- interrupt-parent: specifies the parent interrupt controller.

Drop this. It is implied and could be in the parent.

Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt line 22

Quoted 7 lines
Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt new file +7 -0
+- interrupts: describes which input line in the interrupt parent, this
+  fic's output is connected to. This field property depends on the parent's
+  binding
+
+Example:
+
+amazon_fic: interrupt-controller@0xfd8a8500 {

Drop the '0x'

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt new file +7 -0
+	compatible = "amazon,al-fic";
+	interrupt-controller;
+	#interrupt-cells = <2>;
+	reg = <0x0 0xfd8a8500 0x0 0x1000>;
+	interrupt-parent = <&gic>;
+	interrupts = <GIC_SPI 0x0 IRQ_TYPE_LEVEL_HIGH>;
+};
Signature · 1 line
2.7.4
author maintainer
#4 lore raw

Re: [PATCH v4 1/2] dt-bindings: interrupt-controller: Amazon's Annapurna Labs FIC

Marc, should I publish those fixes as new patch that updates the dt-bindings or new patchset to this list?

Quoted 9 lines · Rob Herring

Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt line 14

Quoted 7 lines · Talel Shenhar

+- #interrupt-cells: must be 2.

Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt new file +6 -0
+  First cell defines the index of the interrupt within the controller.
+  Second cell is used to specify the trigger type and must be one of the
+  following:
+    - bits[3:0] trigger type and level flags
+	1 = low-to-high edge triggered
+	4 = active high level-sensitive

No need to define this here. Reference the standard definition.

This device only support those two modes.

This definition tries to capture the supported modes.

Should I just state that those two modes are supported and then avoid the actual bits and values?

Quoted 3 lines
Quoted 2 lines

+- interrupt-parent: specifies the parent interrupt controller.

Drop this. It is implied and could be in the parent.

ack

Quoted 9 lines

Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt line 22

Quoted 8 lines

+- interrupts: describes which input line in the interrupt parent, this

Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt new file +6 -0
+  fic's output is connected to. This field property depends on the parent's
+  binding
+
+Example:
+
+amazon_fic: interrupt-controller@0xfd8a8500 {

Drop the '0x'

ack

#5 lore raw

Re: [PATCH v4 1/2] dt-bindings: interrupt-controller: Amazon's Annapurna Labs FIC

Quoted 2 lines · Talel

Marc, should I publish those fixes as new patch that updates the dt-bindings or new patchset to this list?

If you are going to update the binding, please submit a patch on top of mainline, as it's been merged already.

Thanks,

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...
author maintainer
#6 lore raw

Re: [PATCH v4 1/2] dt-bindings: interrupt-controller: Amazon's Annapurna Labs FIC

Thanks, will do.

Quoted 10 lines · Marc Zyngier
Quoted 2 lines · Talel

Marc, should I publish those fixes as new patch that updates the dt-bindings or new patchset to this list?

If you are going to update the binding, please submit a patch on top of mainline, as it's been merged already.

Thanks,

	M.
maintainer
#7 lore raw

Re: [PATCH v4 1/2] dt-bindings: interrupt-controller: Amazon's Annapurna Labs FIC

In reply to Shenhar, Talel
Quoted 13 lines · Talel

Marc, should I publish those fixes as new patch that updates the dt-bindings or new patchset to this list?

Quoted 8 lines · Rob Herring
Quoted 7 lines · Talel Shenhar

+- #interrupt-cells: must be 2.

Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt new file +6 -0
+  First cell defines the index of the interrupt within the controller.
+  Second cell is used to specify the trigger type and must be one of the
+  following:
+    - bits[3:0] trigger type and level flags
+    1 = low-to-high edge triggered
+    4 = active high level-sensitive
Quoted 8 lines
Quoted 1 line

No need to define this here. Reference the standard definition.

This device only support those two modes.

This definition tries to capture the supported modes.

Should I just state that those two modes are supported and then avoid the actual bits and values?

Yes.

Rob

author maintainer
#8 lore raw

PATCH v4 2/2 irqchip: al-fic: Introduce Amazon's Annapurna Labs Fabric Interrupt Controller Driver

In reply to Talel Shenhar

The Amazon's Annapurna Labs Fabric Interrupt Controller has 32 inputs. A FIC (Fabric Interrupt Controller) may be cascaded into another FIC or directly to the main CPU Interrupt Controller (e.g. GIC).

---
 MAINTAINERS                  |   6 +
 drivers/irqchip/Kconfig      |   8 ++
 drivers/irqchip/Makefile     |   1 +
 drivers/irqchip/irq-al-fic.c | 278 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 293 insertions(+)
 create mode 100644 drivers/irqchip/irq-al-fic.c
MAINTAINERS +6 -0
index f485597..b4f5255 100644
@@ -1209,6 +1209,12 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/interrupt-controller/arm,vic.txt
 F:	drivers/irqchip/irq-vic.c
 
+AMAZON ANNAPURNA LABS FIC DRIVER
+M:	Talel Shenhar <[email protected]>
+S:	Maintained
+F:	Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt
+F:	drivers/irqchip/irq-al-fic.c
+
 ARM SMMU DRIVERS
 M:	Will Deacon <[email protected]>
 R:	Robin Murphy <[email protected]>
drivers/irqchip/Kconfig +8 -0
index 51a5ef0..7237892 100644
@@ -89,6 +89,14 @@ config ALPINE_MSI
 	select PCI_MSI
 	select GENERIC_IRQ_CHIP
 
+config AL_FIC
+	bool "Amazon's Annapurna Labs Fabric Interrupt Controller"
+	depends on OF || COMPILE_TEST
+	select GENERIC_IRQ_CHIP
+	select IRQ_DOMAIN
+	help
+	  Support Amazon's Annapurna Labs Fabric Interrupt Controller.
+
 config ATMEL_AIC_IRQ
 	bool
 	select GENERIC_IRQ_CHIP
drivers/irqchip/Makefile +1 -0
index 794c13d..a20eba5 100644
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_IRQCHIP)			+= irqchip.o
 
+obj-$(CONFIG_AL_FIC)			+= irq-al-fic.o
 obj-$(CONFIG_ALPINE_MSI)		+= irq-alpine-msi.o
 obj-$(CONFIG_ATH79)			+= irq-ath79-cpu.o
 obj-$(CONFIG_ATH79)			+= irq-ath79-misc.o
drivers/irqchip/irq-al-fic.c new file +278 -0

278 lines not on this page · raw message

Signature · 1 line
2.7.4