Skip to contentSkip to conversation

ARM: dts: ls1021a: define and use external interrupt lines

PATCH Superseded Rasmus Villemoes 4 participants 9 messages Nov 12, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/2 ARM: dts: ls1021a: add node describing external interrupt lines

In reply to Rasmus Villemoes

This adds a node describing the six external interrupt lines IRQ0-IRQ5 with configurable polarity.

---
 arch/arm/boot/dts/ls1021a.dtsi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm/boot/dts/ls1021a.dtsi +19 -0
index 2f6977ada447..0855b1fe98e0 100644
@@ -216,6 +216,25 @@
 			compatible = "fsl,ls1021a-scfg", "syscon";
 			reg = <0x0 0x1570000 0x0 0x10000>;
 			big-endian;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x0 0x0 0x1570000 0x10000>;
+
+			extirq: interrupt-controller@1ac {
+				compatible = "fsl,ls1021a-extirq";
+				#interrupt-cells = <2>;
+				#address-cells = <0>;
+				interrupt-controller;
+				reg = <0x1ac 4>;
+				interrupt-map =
+					<0 0 &gic GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>,
+					<1 0 &gic GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>,
+					<2 0 &gic GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>,
+					<3 0 &gic GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>,
+					<4 0 &gic GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>,
+					<5 0 &gic GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
+				interrupt-map-mask = <0xffffffff 0x0>;
+			};
 		};
 
 		crypto: crypto@1700000 {
Signature · 1 line
2.23.0
#0 lore raw

cover ARM: dts: ls1021a: define and use external interrupt lines

A device tree binding documentation as well as a driver implementing support for the external interrupt lines on the ls1021a has been merged into irqchip-next, so will very likely appear in v5.5. See

87cd38dfd9e6 dt/bindings: Add bindings for Layerscape external irqs 0dcd9f872769 irqchip: Add support for Layerscape external interrupt lines

present in next-20191112.

These patches simply add the extirq node to the ls1021a.dtsi and make use of it on the LS1021A-TSN board. I hope these can be picked up so they also land in v5.5, so we don't have to wait a full extra release cycle.

Rasmus Villemoes (1):
ARM: dts: ls1021a: add node describing external interrupt lines

Vladimir Oltean (1):
ARM: dts: ls1021a-tsn: Use interrupts for the SGMII PHYs

 arch/arm/boot/dts/ls1021a-tsn.dts |  4 ++++
 arch/arm/boot/dts/ls1021a.dtsi    | 19 +++++++++++++++++++
 2 files changed, 23 insertions(+)
Signature · 1 line
2.23.0
#2 lore raw

PATCH 2/2 ARM: dts: ls1021a-tsn: Use interrupts for the SGMII PHYs

From: Vladimir Oltean <[email protected]>

On the LS1021A-TSN board, the 2 Atheros AR8031 PHYs for eth0 and eth1 have interrupt lines connected to the shared IRQ2_B LS1021A pin.

Switching to interrupts offloads the PHY library from the task of polling the MDIO status and AN registers (1, 4, 5) every second.

Unfortunately, the BCM5464R quad PHY connected to the switch does not appear to have an interrupt line routed to the SoC.

---
 arch/arm/boot/dts/ls1021a-tsn.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/ls1021a-tsn.dts +4 -0
index 5b7689094b70..135d36461af4 100644
@@ -203,11 +203,15 @@
 	/* AR8031 */
 	sgmii_phy1: ethernet-phy@1 {
 		reg = <0x1>;
+		/* SGMII1_PHY_INT_B: connected to IRQ2, active low */
+		interrupts-extended = <&extirq 2 IRQ_TYPE_EDGE_FALLING>;
 	};
 
 	/* AR8031 */
 	sgmii_phy2: ethernet-phy@2 {
 		reg = <0x2>;
+		/* SGMII2_PHY_INT_B: connected to IRQ2, active low */
+		interrupts-extended = <&extirq 2 IRQ_TYPE_EDGE_FALLING>;
 	};
 
 	/* BCM5464 quad PHY */
Signature · 1 line
2.23.0
#3 lore raw

Re: [PATCH 2/2] ARM: dts: ls1021a-tsn: Use interrupts for the SGMII PHYs

Quoted 39 lines · Rasmus Villemoes

From: Vladimir Oltean <[email protected]>

On the LS1021A-TSN board, the 2 Atheros AR8031 PHYs for eth0 and eth1 have interrupt lines connected to the shared IRQ2_B LS1021A pin.

Switching to interrupts offloads the PHY library from the task of polling the MDIO status and AN registers (1, 4, 5) every second.

Unfortunately, the BCM5464R quad PHY connected to the switch does not appear to have an interrupt line routed to the SoC.

---
 arch/arm/boot/dts/ls1021a-tsn.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/ls1021a-tsn.dts +4 -1
index 5b7689094b70..135d36461af4 100644
@@ -203,11 +203,15 @@
        /* AR8031 */
        sgmii_phy1: ethernet-phy@1 {
                reg = <0x1>;
+               /* SGMII1_PHY_INT_B: connected to IRQ2, active low */
+               interrupts-extended = <&extirq 2 IRQ_TYPE_EDGE_FALLING>;
        };
 
        /* AR8031 */
        sgmii_phy2: ethernet-phy@2 {
                reg = <0x2>;
+               /* SGMII2_PHY_INT_B: connected to IRQ2, active low */
+               interrupts-extended = <&extirq 2 IRQ_TYPE_EDGE_FALLING>;
        };
 
        /* BCM5464 quad PHY */
--
Quoted 2 lines

2.23.0

+netdev and Andrew for this patch, since the interrupt polarity caught his attention in v1.

#4 lore raw

Re: [PATCH 2/2] ARM: dts: ls1021a-tsn: Use interrupts for the SGMII PHYs

Quoted 43 lines · Vladimir Oltean
Quoted 41 lines · Rasmus Villemoes

From: Vladimir Oltean <[email protected]>

On the LS1021A-TSN board, the 2 Atheros AR8031 PHYs for eth0 and eth1 have interrupt lines connected to the shared IRQ2_B LS1021A pin.

Switching to interrupts offloads the PHY library from the task of polling the MDIO status and AN registers (1, 4, 5) every second.

Unfortunately, the BCM5464R quad PHY connected to the switch does not appear to have an interrupt line routed to the SoC.

---
 arch/arm/boot/dts/ls1021a-tsn.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/ls1021a-tsn.dts +4 -0
index 5b7689094b70..135d36461af4 100644
@@ -203,11 +203,15 @@
        /* AR8031 */
        sgmii_phy1: ethernet-phy@1 {
                reg = <0x1>;
+               /* SGMII1_PHY_INT_B: connected to IRQ2, active low 
 */
+               interrupts-extended = <&extirq 2 
 IRQ_TYPE_EDGE_FALLING>;
        };
 
        /* AR8031 */
        sgmii_phy2: ethernet-phy@2 {
                reg = <0x2>;
+               /* SGMII2_PHY_INT_B: connected to IRQ2, active low 
 */
+               interrupts-extended = <&extirq 2 
IRQ_TYPE_EDGE_FALLING>;
        };
Quoted 8 lines
Quoted 4 lines
        /* BCM5464 quad PHY */

--
2.23.0

+netdev and Andrew for this patch, since the interrupt polarity caught
his attention in v1.

Certainly, the comments and the interrupt specifier do not match. Which one is true?

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

Re: [PATCH 2/2] ARM: dts: ls1021a-tsn: Use interrupts for the SGMII PHYs

Quoted 57 lines · Marc Zyngier
Quoted 46 lines · Vladimir Oltean
Quoted 44 lines · Rasmus Villemoes

From: Vladimir Oltean <[email protected]>

On the LS1021A-TSN board, the 2 Atheros AR8031 PHYs for eth0 and eth1
have interrupt lines connected to the shared IRQ2_B LS1021A pin.

Switching to interrupts offloads the PHY library from the task of polling the MDIO status and AN registers (1, 4, 5) every second.

Unfortunately, the BCM5464R quad PHY connected to the switch does not
appear to have an interrupt line routed to the SoC.

---
 arch/arm/boot/dts/ls1021a-tsn.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/ls1021a-tsn.dts +4 -0
index 5b7689094b70..135d36461af4 100644
@@ -203,11 +203,15 @@
        /* AR8031 */
        sgmii_phy1: ethernet-phy@1 {
                reg = <0x1>;
+               /* SGMII1_PHY_INT_B: connected to IRQ2, active low
 */
+               interrupts-extended = <&extirq 2
 IRQ_TYPE_EDGE_FALLING>;
        };
 
        /* AR8031 */
        sgmii_phy2: ethernet-phy@2 {
                reg = <0x2>;
+               /* SGMII2_PHY_INT_B: connected to IRQ2, active low
 */
+               interrupts-extended = <&extirq 2
IRQ_TYPE_EDGE_FALLING>;
        };
Quoted 8 lines
Quoted 4 lines
        /* BCM5464 quad PHY */

--
2.23.0

+netdev and Andrew for this patch, since the interrupt polarity caught
his attention in v1.

Quoted 6 lines

Certainly, the comments and the interrupt specifier do not match. Which one is true?

         M.

--
Jazz is not dead. It just smells funny...

The interrupt specifier certainly works. So that points to an issue with the description. What do you mean, exactly? Does "active low" mean "level-triggered"? How would you have described this?

#6 lore raw

Re: [PATCH 2/2] ARM: dts: ls1021a-tsn: Use interrupts for the SGMII PHYs

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

+ /* SGMII2_PHY_INT_B: connected to IRQ2, active low
*/
+ interrupts-extended = <&extirq 2
IRQ_TYPE_EDGE_FALLING>;

The interrupt specifier certainly works. So that points to an issue with the description. What do you mean, exactly? Does "active low" mean "level-triggered"? How would you have described this?

I would expect IRQ_TYPE_ACTIVE_LOW, or whatever it is called. Since this is a shared interrupt, going on the edge i think opens up a race condition and interrupts can be missed.

Andrew

#7 lore raw

Re: [PATCH 2/2] ARM: dts: ls1021a-tsn: Use interrupts for the SGMII PHYs

In reply to Vladimir Oltean
Quoted 63 lines · Vladimir Oltean
Quoted 62 lines · Marc Zyngier
Quoted 22 lines · Vladimir Oltean
Quoted 20 lines · Rasmus Villemoes

From: Vladimir Oltean <[email protected]>

On the LS1021A-TSN board, the 2 Atheros AR8031 PHYs for eth0 and eth1
have interrupt lines connected to the shared IRQ2_B LS1021A pin.

Switching to interrupts offloads the PHY library from the task of polling the MDIO status and AN registers (1, 4, 5) every second.

Unfortunately, the BCM5464R quad PHY connected to the switch does not
appear to have an interrupt line routed to the SoC.

---
 arch/arm/boot/dts/ls1021a-tsn.dts | 4 ++++
 1 file changed, 4 insertions(+)
Quoted 10 lines

arch/arm/boot/dts/ls1021a-tsn.dts line 206

Quoted 10 lines
arch/arm/boot/dts/ls1021a-tsn.dts +1 -0
index 5b7689094b70..135d36461af4 100644
@@ -203,11 +203,15 @@
        /* AR8031 */
        sgmii_phy1: ethernet-phy@1 {
                reg = <0x1>;
+               /* SGMII1_PHY_INT_B: connected to IRQ2, active 

low

Quoted 9 lines

arch/arm/boot/dts/ls1021a-tsn.dts

Quoted 9 lines
arch/arm/boot/dts/ls1021a-tsn.dts +2 -0
 */
+               interrupts-extended = <&extirq 2
 IRQ_TYPE_EDGE_FALLING>;
        };
 
        /* AR8031 */
        sgmii_phy2: ethernet-phy@2 {
                reg = <0x2>;
+               /* SGMII2_PHY_INT_B: connected to IRQ2, active 

low

Quoted 5 lines
Quoted 5 lines
arch/arm/boot/dts/ls1021a-tsn.dts +1 -0
 */
+               interrupts-extended = <&extirq 2
IRQ_TYPE_EDGE_FALLING>;
        };
Quoted 8 lines
Quoted 4 lines
        /* BCM5464 quad PHY */

--
2.23.0

+netdev and Andrew for this patch, since the interrupt polarity caught
his attention in v1.

Certainly, the comments and the interrupt specifier do not match. Which one is true?

Quoted 7 lines
Quoted 3 lines
         M.

--
Jazz is not dead. It just smells funny...

The interrupt specifier certainly works. So that points to an issue with the description. What do you mean, exactly? Does "active low" mean "level-triggered"? How would you have described this?

Active Low definitely implies level triggered. And if that's how it is described in the TRM, than the interrupt specifier is wrong, and just *seem to work* because the level goes back to high between two interrupts.

Also, shared *edge* interrupts do not work, full stop. So I'm pretty convinced that what you have here is just wrong.

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

Re: [PATCH 2/2] ARM: dts: ls1021a-tsn: Use interrupts for the SGMII PHYs

Quoted 78 lines · Marc Zyngier
Quoted 63 lines · Vladimir Oltean
Quoted 62 lines · Marc Zyngier
Quoted 22 lines · Vladimir Oltean
Quoted 20 lines · Rasmus Villemoes

From: Vladimir Oltean <[email protected]>

On the LS1021A-TSN board, the 2 Atheros AR8031 PHYs for eth0 and eth1
have interrupt lines connected to the shared IRQ2_B LS1021A pin.

Switching to interrupts offloads the PHY library from the task of polling the MDIO status and AN registers (1, 4, 5) every second.

Unfortunately, the BCM5464R quad PHY connected to the switch does not
appear to have an interrupt line routed to the SoC.

---
 arch/arm/boot/dts/ls1021a-tsn.dts | 4 ++++
 1 file changed, 4 insertions(+)
Quoted 10 lines

arch/arm/boot/dts/ls1021a-tsn.dts line 206

Quoted 10 lines
arch/arm/boot/dts/ls1021a-tsn.dts +1 -0
index 5b7689094b70..135d36461af4 100644
@@ -203,11 +203,15 @@
        /* AR8031 */
        sgmii_phy1: ethernet-phy@1 {
                reg = <0x1>;
+               /* SGMII1_PHY_INT_B: connected to IRQ2, active

low

Quoted 9 lines

arch/arm/boot/dts/ls1021a-tsn.dts

Quoted 9 lines
arch/arm/boot/dts/ls1021a-tsn.dts +2 -0
 */
+               interrupts-extended = <&extirq 2
 IRQ_TYPE_EDGE_FALLING>;
        };
 
        /* AR8031 */
        sgmii_phy2: ethernet-phy@2 {
                reg = <0x2>;
+               /* SGMII2_PHY_INT_B: connected to IRQ2, active

low

Quoted 5 lines
Quoted 5 lines
arch/arm/boot/dts/ls1021a-tsn.dts +1 -0
 */
+               interrupts-extended = <&extirq 2
IRQ_TYPE_EDGE_FALLING>;
        };
Quoted 8 lines
Quoted 4 lines
        /* BCM5464 quad PHY */

--
2.23.0

+netdev and Andrew for this patch, since the interrupt polarity caught
his attention in v1.

Certainly, the comments and the interrupt specifier do not match. Which one is true?

Quoted 7 lines
Quoted 3 lines
         M.

--
Jazz is not dead. It just smells funny...

The interrupt specifier certainly works. So that points to an issue with the description. What do you mean, exactly? Does "active low" mean "level-triggered"? How would you have described this?

Active Low definitely implies level triggered. And if that's how it is described in the TRM, than the interrupt specifier is wrong, and just *seem to work* because the level goes back to high between two interrupts.

Quoted 6 lines

Also, shared *edge* interrupts do not work, full stop. So I'm pretty convinced that what you have here is just wrong.

         M.

--
Jazz is not dead. It just smells funny...

Ok, I've tested both interrupts with IRQ_TYPE_LEVEL_LOW and they still work. I'll let Rasmus re-send if there is no trouble with the dtsi patch. Sorry for the trouble and thanks for teaching me something new.

Cheers,
-Vladimir