Skip to contentSkip to conversation

Add Actions Semi Owl family sirq support

PATCH Superseded Cristian Ciocaltea 2 participants 10 messages Sep 8, 2020 – Sep 14, 2020

Subsystems (3)

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v6 cover Add Actions Semi Owl family sirq support

This patch series adds support for the external interrupt controller (SIRQ) found in the Actions Semi Owl family of SoC's (S500, S700 and S900). The controller handles up to 3 external interrupt lines through dedicated SIRQ pins.

This is a rework of the patch series submitted some time ago by Parthiban Nallathambi:
https://lore.kernel.org/lkml/[email protected]/

Please note I have dropped, for the moment, the S700 related patches since I do not own a compatible hardware for testing. I'm using instead an S500 SoC based board for which I have already provided the initial support:
https://lore.kernel.org/lkml/[email protected]/

Additionally, I have taken the authorship for the driver patch, considering the original code has been already modified to a great extent and I'm firmly committed to maintaining it in the long run.

The SIRQ controller support is a prerequisite of the upcoming MFD driver for the Actions Semi ATC260x PMICs.

Thanks and regards,
Cristi

Changes in v6:
- Integrated binding doc related feedback from Rob and Marc
- Updated cover letter to handle the authorship issue indicated by Mani
- Rebased patch series on v5.9-rc4

Changes in v5:
- Integrated Marc's review (more details in the driver patch changelog)
- Rebased patch series on v5.9-rc1

Changes in v4:
- Simplified the DTS structure:
* dropped 'actions,sirq-shared-reg' node, now the differentiation between SoC variants is handled via the compatible property
* dropped 'actions,sirq-reg-offset', now controller base address in DTS points to SIRQ0 register, so no additional information is required for S500 and S700, while for S900 SoC the offsets of SIRQ1 and SIRQ2 regs are provided by the driver
* 'actions,ext-irq-range' was replaced with 'actions,ext-interrupts', an array of the GIC interrupts triggered by the controller
- Fixed wrong INTC_EXTCTL_TYPE_MASK definition
- Removed redundant irq_fwspec checks in owl_sirq_domain_alloc()
- Improved error handling in owl_sirq_of_init()
- Added yaml binding document
- Dropped S700 related DTS patches for lack of testing hardware:
* arm64: dts: actions: Add sirq node for Actions Semi S700
* arm64: dts: actions: s700-cubieboard7: Enable SIRQ
- Updated MAINTAINERS
- Rebased patchset on kernel v5.8
- Cosmetic changes
* Ordered include statements alphabetically
* Added comment to owl_sirq_set_type() describing conversion of falling edge or active low signals
* Replaced IRQF_TRIGGER_* with corresponding IRQ_TYPE_* variants
* Ensured data types and function naming are consistent regarding the 'owl_sirq' prefix

Changes in v3 (Parthiban Nallathambi):
- 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/

Changes in v2 (Parthiban Nallathambi):
- 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

Cristian Ciocaltea (3):
dt-bindings: interrupt-controller: Add Actions SIRQ controller binding
irqchip: Add Actions Semi Owl SIRQ controller
MAINTAINERS: Add entries for Actions Semi Owl SIRQ controller

 .../actions,owl-sirq.yaml                     |  65 ++++
 MAINTAINERS                                   |   2 +
 drivers/irqchip/Makefile                      |   1 +
 drivers/irqchip/irq-owl-sirq.c                | 359 ++++++++++++++++++
 4 files changed, 427 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.yaml
 create mode 100644 drivers/irqchip/irq-owl-sirq.c
Signature · 1 line
2.28.0
#1 lore raw

PATCH v6 1/3 dt-bindings: interrupt-controller: Add Actions SIRQ controller binding

Actions Semi Owl SoCs SIRQ interrupt controller is found in S500, S700 and S900 SoCs and provides support for handling up to 3 external interrupt lines.

---
Changes in v6:
- Got rid of the 'actions,owl-sirq' compatible, per Robs's feedback
- Replaced 'actions,ext-interrupts' with 'interrupts', as agreed with Rob and Marc

Changes in v5:
- Updated controller description statements both in the commit message and the binding doc

 .../actions,owl-sirq.yaml                     | 65 +++++++++++++++++++
 1 file changed, 65 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.yaml
Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.yaml new file +65 -0
new file mode 100644
index 000000000000..5da333c644c9
@@ -0,0 +1,65 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/actions,owl-sirq.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Actions Semi Owl SoCs SIRQ interrupt controller
+
+maintainers:
+  - Manivannan Sadhasivam <[email protected]>
+  - Cristian Ciocaltea <[email protected]>
+
+description: |
+  This interrupt controller is found in the Actions Semi Owl SoCs (S500, S700
+  and S900) and provides support for handling up to 3 external interrupt lines.
+
+properties:
+  compatible:
+    enum:
+      - actions,s500-sirq
+      - actions,s700-sirq
+      - actions,s900-sirq
+
+  reg:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  '#interrupt-cells':
+    const: 2
+    description:
+      The first cell is the input IRQ number, between 0 and 2, while the second
+      cell is the trigger type as defined in interrupt.txt in this directory.
+
+  'interrupts':
+    description: |
+      Contains the GIC SPI IRQs mapped to the external interrupt lines.
+      They shall be specified sequentially from output 0 to 2.
+    minItems: 3
+    maxItems: 3
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - '#interrupt-cells'
+  - 'interrupts'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    sirq: interrupt-controller@b01b0200 {
+      compatible = "actions,s500-sirq";
+      reg = <0xb01b0200 0x4>;
+      interrupt-controller;
+      #interrupt-cells = <2>;
+      interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>, /* SIRQ0 */
+                   <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>, /* SIRQ1 */
+                   <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; /* SIRQ2 */
+    };
+
+...
Signature · 1 line
2.28.0
#2 lore raw

PATCH v6 2/3 irqchip: Add Actions Semi Owl SIRQ controller

In reply to Cristian Ciocaltea

This interrupt controller is found in the Actions Semi Owl SoCs (S500, S700 and S900) and provides support for handling up to 3 external interrupt lines.

Each line can be independently configured as interrupt and triggers on either of the edges or either of the levels. Additionally, each line can also be masked individually.

The patch is based on the work started by Parthiban Nallathambi:
https://lore.kernel.org/lkml/[email protected]/

[cristi: optimized DT, various fixes/cleanups/improvements]

---
Changes in v6:
- Got rid of the of_match table and used IRQCHIP_DECLARE for each of the 3 driver compatibles
- Transformed owl_sirq_of_init() into a helper function: renamed to owl_sirq_of_init(), dropped handling of the custom property 'actions,ext-interrupts' and used standard API for parsing the replacement 'interrupts'
- Used GIC_SPI constant instead of the related number
- Minor changes in the commit message

Changes in v5 - according to Marc's review:
- Updated commit message
- Aligned members in struct owl_sirq_chip_data
- Added naming for SIRQ0 control register offset
- Improved code readability by using FIELD_PREP and FIELD_GET
- Dropped redundant handling of the IRQ trigger information
- Added missing irq_set_affinity to owl_sirq_chip descriptor

 drivers/irqchip/Makefile       |   1 +
 drivers/irqchip/irq-owl-sirq.c | 359 +++++++++++++++++++++++++++++++++
 2 files changed, 360 insertions(+)
 create mode 100644 drivers/irqchip/irq-owl-sirq.c
drivers/irqchip/Makefile +1 -0
index 133f9c45744a..b8eb5b8b766d 100644
@@ -7,6 +7,7 @@ obj-$(CONFIG_ATH79)			+= irq-ath79-cpu.o
 obj-$(CONFIG_ATH79)			+= irq-ath79-misc.o
 obj-$(CONFIG_ARCH_BCM2835)		+= irq-bcm2835.o
 obj-$(CONFIG_ARCH_BCM2835)		+= irq-bcm2836.o
+obj-$(CONFIG_ARCH_ACTIONS)		+= irq-owl-sirq.o
 obj-$(CONFIG_DAVINCI_AINTC)		+= irq-davinci-aintc.o
 obj-$(CONFIG_DAVINCI_CP_INTC)		+= irq-davinci-cp-intc.o
 obj-$(CONFIG_EXYNOS_IRQ_COMBINER)	+= exynos-combiner.o
drivers/irqchip/irq-owl-sirq.c new file +359 -0

359 lines not on this page · raw message

Signature · 1 line
2.28.0
#3 lore raw

Re: [PATCH v6 2/3] irqchip: Add Actions Semi Owl SIRQ controller

Quoted 8 lines · Cristian Ciocaltea

This interrupt controller is found in the Actions Semi Owl SoCs (S500, S700 and S900) and provides support for handling up to 3 external interrupt lines.

Each line can be independently configured as interrupt and triggers on either of the edges or either of the levels. Additionally, each line can also be masked individually.

Quoted 7 lines

The patch is based on the work started by Parthiban Nallathambi:
https://lore.kernel.org/lkml/[email protected]/

[cristi: optimized DT, various fixes/cleanups/improvements]

Who is the author of these patches? If this is a co-development, please use the relevant tags. Otherwise, the author of the patch must come as the first SoB.

The patch itself looks good.

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

Re: [PATCH v6 2/3] irqchip: Add Actions Semi Owl SIRQ controller

Hi Marc,

Quoted 12 lines · Marc Zyngier
Quoted 11 lines · Cristian Ciocaltea

This interrupt controller is found in the Actions Semi Owl SoCs (S500, S700 and S900) and provides support for handling up to 3 external interrupt lines.

Each line can be independently configured as interrupt and triggers on either of the edges or either of the levels. Additionally, each line can also be masked individually.

The patch is based on the work started by Parthiban Nallathambi:
https://lore.kernel.org/lkml/[email protected]/

Quoted 8 lines
Quoted 4 lines
[cristi: optimized DT, various fixes/cleanups/improvements]

Who is the author of these patches? If this is a co-development, please use the relevant tags. Otherwise, the author of the patch must come as the first SoB.

I took the authorship for the driver patch, as mentioned in the cover letter. So, if I understand correctly, my SoB should be moved on top and I assume I also need to drop the related comment line.

Quoted 1 line

The patch itself looks good.

Thanks for reviewing,
Cristi

Quoted 4 lines
        M.
Signature · 1 line
Jazz is not dead. It just smells funny...
#5 lore raw

Re: [PATCH v6 2/3] irqchip: Add Actions Semi Owl SIRQ controller

Cristian,

Quoted 20 lines · Cristian Ciocaltea

Hi Marc,

Quoted 17 lines · Marc Zyngier
Quoted 15 lines · Cristian Ciocaltea

This interrupt controller is found in the Actions Semi Owl SoCs (S500, S700 and S900) and provides support for handling up to 3 external interrupt lines.

Each line can be independently configured as interrupt and triggers on either of the edges or either of the levels. Additionally, each line can also be masked individually.

The patch is based on the work started by Parthiban Nallathambi:
https://lore.kernel.org/lkml/[email protected]/

[cristi: optimized DT, various fixes/cleanups/improvements]
Quoted 7 lines
Quoted 3 lines

Who is the author of these patches? If this is a co-development, please use the relevant tags. Otherwise, the author of the patch must come as the first SoB.

I took the authorship for the driver patch, as mentioned in the cover letter. So, if I understand correctly, my SoB should be moved on top and I assume I also need to drop the related comment line.

Not quite. Please look at Documentation/process/submitting-patches.rst.

If Parthiban and Saravanan haven't authored anything in this patch, then drop them from the SoB list. If they have contributed to the patch (which I expect), then their SoB must be preceded by their own
Co-developed-by: tag. To sum it up, it probably should look like:

This is of course an assumption, and you should check it with the individuals above.

Thanks,

        M.
Signature · 6 lines
Jazz is not dead. It just smells funny...

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#6 lore raw

Re: [PATCH v6 2/3] irqchip: Add Actions Semi Owl SIRQ controller

Quoted 28 lines · Marc Zyngier

Cristian,

Quoted 25 lines · Cristian Ciocaltea

Hi Marc,

Quoted 21 lines · Marc Zyngier
Quoted 8 lines · Cristian Ciocaltea

This interrupt controller is found in the Actions Semi Owl SoCs (S500, S700 and S900) and provides support for handling up to 3 external interrupt lines.

Each line can be independently configured as interrupt and triggers on either of the edges or either of the levels. Additionally, each line can also be masked individually.

Quoted 7 lines

The patch is based on the work started by Parthiban Nallathambi:
https://lore.kernel.org/lkml/[email protected]/

[cristi: optimized DT, various fixes/cleanups/improvements]

Who is the author of these patches? If this is a co-development, please
use the relevant tags. Otherwise, the author of the patch must come as the first SoB.

Quoted 5 lines
Quoted 3 lines

I took the authorship for the driver patch, as mentioned in the cover letter. So, if I understand correctly, my SoB should be moved on top and I assume I also need to drop the related comment line.

Not quite. Please look at Documentation/process/submitting-patches.rst.

Yes, I have read it, but most probably I missed the information that clarifies this authorship change handling.

Quoted 2 lines

If Parthiban and Saravanan haven't authored anything in this patch, then drop them from the SoB list.

Sorry I haven't properly explained this before!

Their contributions to the driver code stopped in 2018, when v3 of the patch series has been submitted.

Quoted 3 lines

If they have contributed to the
patch (which I expect), then their SoB must be preceded by their own
Co-developed-by: tag.

Starting with v4, the work has been done exclusively by myself.

Quoted 10 lines

To sum it up, it probably should look like:

This is of course an assumption, and you should check it with the individuals above.

I have recently contacted Parthiban and he agreed that I can take the authorship. So I should proceed with the 1st approach?

Quoted 5 lines

Thanks,

        M.
Signature · 1 line
Jazz is not dead. It just smells funny...

Thanks,
Cristi

#7 lore raw

Re: [PATCH v6 2/3] irqchip: Add Actions Semi Owl SIRQ controller

Quoted 60 lines · Cristian Ciocaltea
Quoted 28 lines · Marc Zyngier

Cristian,

Quoted 25 lines · Cristian Ciocaltea

Hi Marc,

Quoted 21 lines · Marc Zyngier
Quoted 8 lines · Cristian Ciocaltea

This interrupt controller is found in the Actions Semi Owl SoCs (S500, S700 and S900) and provides support for handling up to 3 external interrupt lines.

Each line can be independently configured as interrupt and triggers on either of the edges or either of the levels. Additionally, each line can also be masked individually.

Quoted 7 lines

The patch is based on the work started by Parthiban Nallathambi:
https://lore.kernel.org/lkml/[email protected]/

[cristi: optimized DT, various fixes/cleanups/improvements]

Who is the author of these patches? If this is a co-development, please
use the relevant tags. Otherwise, the author of the patch must come as the first SoB.

Quoted 5 lines
Quoted 3 lines

I took the authorship for the driver patch, as mentioned in the cover letter. So, if I understand correctly, my SoB should be moved on top and I assume I also need to drop the related comment line.

Not quite. Please look at Documentation/process/submitting-patches.rst.

Yes, I have read it, but most probably I missed the information that clarifies this authorship change handling.

Quoted 2 lines

If Parthiban and Saravanan haven't authored anything in this patch, then drop them from the SoB list.

Sorry I haven't properly explained this before!

Their contributions to the driver code stopped in 2018, when v3 of the patch series has been submitted.

Quoted 3 lines

If they have contributed to the
patch (which I expect), then their SoB must be preceded by their own
Co-developed-by: tag.

Starting with v4, the work has been done exclusively by myself.

Quoted 8 lines

To sum it up, it probably should look like:

Quoted 5 lines
Quoted 2 lines

This is of course an assumption, and you should check it with the individuals above.

I have recently contacted Parthiban and he agreed that I can take the authorship. So I should proceed with the 1st approach?

The authorship of the patch is one thing, acknowledging the work done by others is another. As you said above, you started by contributing to an existing series, instead of writing it from scratch. You changed it to a degree where it makes sense for you to be the author of the patches, but it doesn't invalidate the contributions made by others before you.

Unless the two other contributors explicitly say they'd rather not be named, I don't see how you can avoid mentioning them.

Thanks,

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

Re: [PATCH v6 2/3] irqchip: Add Actions Semi Owl SIRQ controller

Quoted 68 lines · Marc Zyngier
Quoted 61 lines · Cristian Ciocaltea
Quoted 28 lines · Marc Zyngier

Cristian,

Quoted 25 lines · Cristian Ciocaltea

Hi Marc,

Quoted 21 lines · Marc Zyngier
Quoted 8 lines · Cristian Ciocaltea

This interrupt controller is found in the Actions Semi Owl SoCs (S500, S700 and S900) and provides support for handling up to 3 external interrupt lines.

Each line can be independently configured as interrupt and triggers on either of the edges or either of the levels. Additionally, each line can also be masked individually.

Quoted 7 lines

The patch is based on the work started by Parthiban Nallathambi:
https://lore.kernel.org/lkml/[email protected]/

[cristi: optimized DT, various fixes/cleanups/improvements]

Who is the author of these patches? If this is a co-development, please
use the relevant tags. Otherwise, the author of the patch must come as the first SoB.

Quoted 6 lines
Quoted 3 lines

I took the authorship for the driver patch, as mentioned in the cover letter. So, if I understand correctly, my SoB should be moved on top and I assume I also need to drop the related comment line.

Not quite. Please look at
Documentation/process/submitting-patches.rst.

Yes, I have read it, but most probably I missed the information that clarifies this authorship change handling.

Quoted 2 lines

If Parthiban and Saravanan haven't authored anything in this patch, then drop them from the SoB list.

Sorry I haven't properly explained this before!

Their contributions to the driver code stopped in 2018, when v3 of the patch series has been submitted.

Quoted 3 lines

If they have contributed to the
patch (which I expect), then their SoB must be preceded by their own
Co-developed-by: tag.

Starting with v4, the work has been done exclusively by myself.

Quoted 8 lines

To sum it up, it probably should look like:

Quoted 5 lines
Quoted 2 lines

This is of course an assumption, and you should check it with the individuals above.

I have recently contacted Parthiban and he agreed that I can take the authorship. So I should proceed with the 1st approach?

Quoted 8 lines

The authorship of the patch is one thing, acknowledging the work done by others is another. As you said above, you started by contributing to an existing series, instead of writing it from scratch. You changed it to a degree where it makes sense for you to be the author of the patches, but it doesn't invalidate the contributions made by others before you.

Unless the two other contributors explicitly say they'd rather not be named, I don't see how you can avoid mentioning them.

I just want to do the right thing and follow the recommended procedure. That's why I initially kept all the SoBs, but obviously I still missed some bits and pieces, as you have pointed out.

So I will add the indicated Co-developed-by tags and resend the series.

Quoted 5 lines

Thanks,

      M.
Signature · 1 line
Jazz is not dead. It just smells funny...

Thanks a lot for all the clarifications,
Cristi

#9 lore raw

PATCH v6 3/3 MAINTAINERS: Add entries for Actions Semi Owl SIRQ controller

In reply to Cristian Ciocaltea

Add entries for Actions Semi Owl SIRQ controller binding and driver.

---
 MAINTAINERS | 2 ++
 1 file changed, 2 insertions(+)
MAINTAINERS +2 -0
index 9544eec4eff2..04c75815fac6 100644
@@ -1525,6 +1525,7 @@ F:	Documentation/devicetree/bindings/arm/actions.yaml
 F:	Documentation/devicetree/bindings/clock/actions,owl-cmu.txt
 F:	Documentation/devicetree/bindings/dma/owl-dma.txt
 F:	Documentation/devicetree/bindings/i2c/i2c-owl.txt
+F:	Documentation/devicetree/bindings/interrupt-controller/actions,owl-sirq.yaml
 F:	Documentation/devicetree/bindings/mmc/owl-mmc.yaml
 F:	Documentation/devicetree/bindings/pinctrl/actions,*
 F:	Documentation/devicetree/bindings/power/actions,owl-sps.txt
@@ -1536,6 +1537,7 @@ F:	drivers/clk/actions/
 F:	drivers/clocksource/timer-owl*
 F:	drivers/dma/owl-dma.c
 F:	drivers/i2c/busses/i2c-owl.c
+F:	drivers/irqchip/irq-owl-sirq.c
 F:	drivers/mmc/host/owl-mmc.c
 F:	drivers/pinctrl/actions/*
 F:	drivers/soc/actions/
Signature · 1 line
2.28.0