Skip to contentSkip to conversation

add support for Hisilicon SD5203 vector interrupt controller

PATCH In review Zhen Lei 3 participants 10 messages Sep 3, 2020 – Sep 19, 2020

Subsystems (2)
lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

cover add support for Hisilicon SD5203 vector interrupt controller

The interrupt controller of SD5203 SoC is VIC(vector interrupt controller), it's based on Synopsys DesignWare APB interrupt controller (dw_apb_ictl) IP, but it can not directly use dw_apb_ictl driver. The main reason is that VIC is used as primary interrupt controller and dw_apb_ictl driver worked for secondary interrupt controller. So add a new driver: "hisilicon,sd5203-vic".

Kefeng Wang (1):
irqchip: add Hisilicon SD5203 vector interrupt controller

Zhen Lei (1):
dt-bindings: interrupt-controller: add Hisilicon SD5203 vector
interrupt controller

 .../hisilicon,sd5203-vic.txt                  |  27 ++++
 drivers/irqchip/Kconfig                       |   5 +
 drivers/irqchip/Makefile                      |   1 +
 drivers/irqchip/irq-sd5203-vic.c              | 128 ++++++++++++++++++
 4 files changed, 161 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/hisilicon,sd5203-vic.txt
 create mode 100644 drivers/irqchip/irq-sd5203-vic.c
Signature · 1 line
2.26.0.106.g9fadedd
author
#1 lore raw

PATCH 1/2 dt-bindings: interrupt-controller: add Hisilicon SD5203 vector interrupt controller

Add DT bindings for the Hisilicon SD5203 vector interrupt controller.

---
 .../hisilicon,sd5203-vic.txt                  | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/hisilicon,sd5203-vic.txt
Documentation/devicetree/bindings/interrupt-controller/hisilicon,sd5203-vic.txt new file +27 -0
new file mode 100644
index 000000000000..a08292e868b0
@@ -0,0 +1,27 @@
+Hisilicon SD5203 vector interrupt controller (VIC)
+
+Hisilicon SD5203 VIC based on Synopsys DesignWare APB interrupt controller, but
+there's something special:
+1. The maximum number of irqs supported is 32. The registers ENABLE, MASK and
+   FINALSTATUS are 32 bits.
+2. There is only one VIC, it's used as primary interrupt controller.
+
+Required properties:
+- compatible: shall be "hisilicon,sd5203-vic"
+- reg: physical base address of the controller and length of memory mapped
+  region starting with ENABLE_LOW register
+- interrupt-controller: identifies the node as an interrupt controller
+- #interrupt-cells: number of cells to encode an interrupt-specifier, shall be 1
+
+The interrupt sources map to the corresponding bits in the interrupt
+registers, i.e.
+- 0 maps to bit 0 of low interrupts,
+- 1 maps to bit 1 of low interrupts,
+
+Example:
+	vic: interrupt-controller@10130000 {
+		compatible = "hisilicon,sd5203-vic";
+		reg = <0x10130000 0x1000>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+	};
Signature · 1 line
2.26.0.106.g9fadedd
maintainer
#2 lore raw

Re: [PATCH 1/2] dt-bindings: interrupt-controller: add Hisilicon SD5203 vector interrupt controller

Quoted 5 lines · Zhen Lei

Add DT bindings for the Hisilicon SD5203 vector interrupt controller.

---
 .../hisilicon,sd5203-vic.txt                  | 27 +++++++++++++++++++

Bindings should be in DT schema format now.

Quoted 40 lines
 1 file changed, 27 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/hisilicon,sd5203-vic.txt
Documentation/devicetree/bindings/interrupt-controller/hisilicon,sd5203-vic.txt new file +27 -0
new file mode 100644
index 000000000000..a08292e868b0
@@ -0,0 +1,27 @@
+Hisilicon SD5203 vector interrupt controller (VIC)
+
+Hisilicon SD5203 VIC based on Synopsys DesignWare APB interrupt controller, but
+there's something special:
+1. The maximum number of irqs supported is 32. The registers ENABLE, MASK and
+   FINALSTATUS are 32 bits.
+2. There is only one VIC, it's used as primary interrupt controller.
+
+Required properties:
+- compatible: shall be "hisilicon,sd5203-vic"
+- reg: physical base address of the controller and length of memory mapped
+  region starting with ENABLE_LOW register
+- interrupt-controller: identifies the node as an interrupt controller
+- #interrupt-cells: number of cells to encode an interrupt-specifier, shall be 1
+
+The interrupt sources map to the corresponding bits in the interrupt
+registers, i.e.
+- 0 maps to bit 0 of low interrupts,
+- 1 maps to bit 1 of low interrupts,
+
+Example:
+	vic: interrupt-controller@10130000 {
+		compatible = "hisilicon,sd5203-vic";
+		reg = <0x10130000 0x1000>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+	};
Signature · 1 line
2.26.0.106.g9fadedd
#3 lore raw

Re: [PATCH 1/2] dt-bindings: interrupt-controller: add Hisilicon SD5203 vector interrupt controller

Quoted 8 lines · Rob Herring
Quoted 5 lines · Zhen Lei

Add DT bindings for the Hisilicon SD5203 vector interrupt controller.

---
 .../hisilicon,sd5203-vic.txt                  | 27 +++++++++++++++++++

Bindings should be in DT schema format now.

Hi, Rob Herring:

As Marc Zyngier's suggestion, I discarded adding an independent SD5203-VIC driver, but make the dw-apb-ictl irqchip driver to support hierarchy irq domain. So this new file was also dropped. Now, I updated the descriptions in the existing file "snps,dw-apb-ictl.txt" in the following versions.

Quoted 44 lines
Quoted 41 lines
 1 file changed, 27 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/hisilicon,sd5203-vic.txt
Documentation/devicetree/bindings/interrupt-controller/hisilicon,sd5203-vic.txt new file +27 -0
new file mode 100644
index 000000000000..a08292e868b0
@@ -0,0 +1,27 @@
+Hisilicon SD5203 vector interrupt controller (VIC)
+
+Hisilicon SD5203 VIC based on Synopsys DesignWare APB interrupt controller, but
+there's something special:
+1. The maximum number of irqs supported is 32. The registers ENABLE, MASK and
+   FINALSTATUS are 32 bits.
+2. There is only one VIC, it's used as primary interrupt controller.
+
+Required properties:
+- compatible: shall be "hisilicon,sd5203-vic"
+- reg: physical base address of the controller and length of memory mapped
+  region starting with ENABLE_LOW register
+- interrupt-controller: identifies the node as an interrupt controller
+- #interrupt-cells: number of cells to encode an interrupt-specifier, shall be 1
+
+The interrupt sources map to the corresponding bits in the interrupt
+registers, i.e.
+- 0 maps to bit 0 of low interrupts,
+- 1 maps to bit 1 of low interrupts,
+
+Example:
+	vic: interrupt-controller@10130000 {
+		compatible = "hisilicon,sd5203-vic";
+		reg = <0x10130000 0x1000>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+	};
Signature · 1 line
2.26.0.106.g9fadedd

.

#4 lore raw

Re: [PATCH 1/2] dt-bindings: interrupt-controller: add Hisilicon SD5203 vector interrupt controller

Quoted 11 lines · Leizhen (ThunderTown)
Quoted 8 lines · Rob Herring
Quoted 5 lines · Zhen Lei

Add DT bindings for the Hisilicon SD5203 vector interrupt controller.

---
 .../hisilicon,sd5203-vic.txt                  | 27 +++++++++++++++++++

Bindings should be in DT schema format now.

Do I need to change the existing "snps,dw-apb-ictl.txt" to DT schema format?

Quoted 52 lines

Hi, Rob Herring:

As Marc Zyngier's suggestion, I discarded adding an independent SD5203-VIC driver, but make the dw-apb-ictl irqchip driver to support hierarchy irq domain. So this new file was also dropped. Now, I updated the descriptions in the existing file "snps,dw-apb-ictl.txt" in the following versions.

Quoted 44 lines
Quoted 41 lines
 1 file changed, 27 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/hisilicon,sd5203-vic.txt
Documentation/devicetree/bindings/interrupt-controller/hisilicon,sd5203-vic.txt new file +27 -0
new file mode 100644
index 000000000000..a08292e868b0
@@ -0,0 +1,27 @@
+Hisilicon SD5203 vector interrupt controller (VIC)
+
+Hisilicon SD5203 VIC based on Synopsys DesignWare APB interrupt controller, but
+there's something special:
+1. The maximum number of irqs supported is 32. The registers ENABLE, MASK and
+   FINALSTATUS are 32 bits.
+2. There is only one VIC, it's used as primary interrupt controller.
+
+Required properties:
+- compatible: shall be "hisilicon,sd5203-vic"
+- reg: physical base address of the controller and length of memory mapped
+  region starting with ENABLE_LOW register
+- interrupt-controller: identifies the node as an interrupt controller
+- #interrupt-cells: number of cells to encode an interrupt-specifier, shall be 1
+
+The interrupt sources map to the corresponding bits in the interrupt
+registers, i.e.
+- 0 maps to bit 0 of low interrupts,
+- 1 maps to bit 1 of low interrupts,
+
+Example:
+	vic: interrupt-controller@10130000 {
+		compatible = "hisilicon,sd5203-vic";
+		reg = <0x10130000 0x1000>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+	};
Signature · 1 line
2.26.0.106.g9fadedd

.

maintainer
#5 lore raw

Re: [PATCH 1/2] dt-bindings: interrupt-controller: add Hisilicon SD5203 vector interrupt controller

Quoted 10 lines · Leizhen (ThunderTown)
Quoted 6 lines · Leizhen (ThunderTown)
Quoted 3 lines · Rob Herring
Quoted 2 lines · Zhen Lei

Add DT bindings for the Hisilicon SD5203 vector interrupt controller.

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
---
 .../hisilicon,sd5203-vic.txt                  | 27 +++++++++++++++++++

Bindings should be in DT schema format now.

Do I need to change the existing "snps,dw-apb-ictl.txt" to DT schema format?

That would be nice, but not necessary for minor changes.

Rob

#6 lore raw

Re: [PATCH 1/2] dt-bindings: interrupt-controller: add Hisilicon SD5203 vector interrupt controller

Quoted 16 lines · Rob Herring
Quoted 14 lines · Leizhen (ThunderTown)
Quoted 10 lines · Leizhen (ThunderTown)
Quoted 7 lines · Rob Herring
Quoted 5 lines · Zhen Lei

Add DT bindings for the Hisilicon SD5203 vector interrupt controller.

---
 .../hisilicon,sd5203-vic.txt                  | 27 +++++++++++++++++++
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line

Bindings should be in DT schema format now.

Do I need to change the existing "snps,dw-apb-ictl.txt" to DT schema format?

That would be nice, but not necessary for minor changes.

I had done it before you replied to me. Can you check it out?

https://www.spinics.net/lists/devicetree/msg378632.html

Quoted 5 lines

Rob

.

author
#7 lore raw

PATCH 2/2 irqchip: add Hisilicon SD5203 vector interrupt controller

In reply to Zhen Lei

From: Kefeng Wang <[email protected]>

This adds an irqchip driver and corresponding devicetree binding for the primary interrupt controller based on Hisilicon SD5203 VIC(vector interrupt controller).

---
 drivers/irqchip/Kconfig          |   5 ++
 drivers/irqchip/Makefile         |   1 +
 drivers/irqchip/irq-sd5203-vic.c | 128 +++++++++++++++++++++++++++++++
 3 files changed, 134 insertions(+)
 create mode 100644 drivers/irqchip/irq-sd5203-vic.c
drivers/irqchip/Kconfig +5 -0
index bfc9719dbcdc..f64611a47cf2 100644
@@ -156,6 +156,11 @@ config FARADAY_FTINTC010
 	select GENERIC_IRQ_MULTI_HANDLER
 	select SPARSE_IRQ
 
+config HISILICON_SD5203_VIC
+	bool
+	select GENERIC_IRQ_CHIP
+	select IRQ_DOMAIN_HIERARCHY
+
 config HISILICON_IRQ_MBIGEN
 	bool
 	select ARM_GIC_V3
drivers/irqchip/Makefile +1 -0
index 133f9c45744a..94b98f881940 100644
@@ -35,6 +35,7 @@ obj-$(CONFIG_ARM_GIC_V3_ITS)		+= irq-gic-v3-its.o irq-gic-v3-its-platform-msi.o
 obj-$(CONFIG_ARM_GIC_V3_ITS_PCI)	+= irq-gic-v3-its-pci-msi.o
 obj-$(CONFIG_ARM_GIC_V3_ITS_FSL_MC)	+= irq-gic-v3-its-fsl-mc-msi.o
 obj-$(CONFIG_PARTITION_PERCPU)		+= irq-partition-percpu.o
+obj-$(CONFIG_HISILICON_SD5203_VIC)	+= irq-sd5203-vic.o
 obj-$(CONFIG_HISILICON_IRQ_MBIGEN)	+= irq-mbigen.o
 obj-$(CONFIG_ARM_NVIC)			+= irq-nvic.o
 obj-$(CONFIG_ARM_VIC)			+= irq-vic.o
drivers/irqchip/irq-sd5203-vic.c new file +128 -0

128 lines not on this page · raw message

Signature · 1 line
2.26.0.106.g9fadedd
#8 lore raw
In reply to Zhen Lei
Quoted 5 lines · Zhen Lei

The interrupt controller of SD5203 SoC is VIC(vector interrupt controller), it's based on Synopsys DesignWare APB interrupt controller (dw_apb_ictl) IP, but it can not directly use dw_apb_ictl driver. The main reason is that VIC is used as primary interrupt controller and dw_apb_ictl driver worked for secondary interrupt controller.

What prevents you from improving the existing driver so that it can act as a primary interrupt controller? It shouldn't be rocket science, really.

There are some examples in the tree of drivers that can be used in both situations (GIC, VIC

Thanks,

        M.
Signature · 1 line
Jazz is not dead. It just smells funny...
#9 lore raw
Quoted 7 lines · Marc Zyngier
Quoted 5 lines · Zhen Lei

The interrupt controller of SD5203 SoC is VIC(vector interrupt controller), it's based on Synopsys DesignWare APB interrupt controller (dw_apb_ictl) IP, but it can not directly use dw_apb_ictl driver. The main reason is that VIC is used as primary interrupt controller and dw_apb_ictl driver worked for secondary interrupt controller.

Quoted 5 lines

What prevents you from improving the existing driver so that it can act as a primary interrupt controller? It shouldn't be rocket science, really.

There are some examples in the tree of drivers that can be used in both situations (GIC, VIC

OK, thanks for the tip.

Quoted 4 lines

Thanks,

        M.