Ethernet PHY interrupt improvements
Subsystems (2)
Martin Blumenstingl
reviewercover Ethernet PHY interrupt improvements
this small series consists of two patches:
#1 documents the GPIO to which the PHY's interrupt line is connected
(the name "MAC_INTR" is used in the schematics of Odroid-C2 and
Khadas VIM2)
#2 adds the RTL8211F PHY's interrupt line on Khadas VIM2
I was a bit surprised to see that the GXM Q200 board seems to use GPIOH_3 instead of GPIOZ_15 like all other boards. @Jerome: could you please check if GPIOH_3 is correct or if it's a "copy-and-paste" issue (Q200 is the only GXL/GXM based board. GXL/GXM SoCs have fewer GPIOAO pins than GXBB, so the interrupt offset for the same non-GPIOAO pin is different than on GXBB)
compile-tested: all boards
runtime tested: Khadas VIM2 (unplugging / plugging the Ethernet cable increases the interrupt counter in /proc/interrupts and the kernel correctly reports that the cable has been {un,}plugged)
Martin Blumenstingl (2):
ARM64: dts: meson: add comments with the GPIO for the PHY interrupts
ARM64: dts: meson-gxm: add the PHY interrupt line on Khadas VIM2
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 1 + arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 2 ++ arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts | 1 + arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 3 +++ arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts | 1 + 5 files changed, 8 insertions(+)
Signature · 1 line
2.15.1
Martin Blumenstingl
reviewerPATCH 1/2 ARM64: dts: meson: add comments with the GPIO for the PHY interrupts
Currently one has to look/calculate the GPIO for the PHY interrupts manually. Add a comment for the existing PHY interrupt lines to make it easier to find out which GPIO is used.
This is done using the following calculation:
- number of GPIO AO pins (14 on GXBB: GPIOAO_0..13)
- add the offset of the pin which is used for the interrupt (for example GPIOZ_15 = 15 on Odroid-C2)
--- arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 1 + arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 2 ++ arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts | 1 + arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts | 1 + 4 files changed, 5 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +1 -0
@@ -169,6 +169,7 @@ /* Realtek RTL8211F (0x001cc916) */ reg = <0>; interrupt-parent = <&gpio_intc>; + /* MAC_INTR on GPIOZ_15 */ interrupts = <29 IRQ_TYPE_LEVEL_LOW>; }; };
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +2 -0
@@ -156,8 +156,10 @@ #size-cells = <0>; eth_phy0: ethernet-phy at 0 { + /* Realtek RTL8211F (0x001cc916) */ reg = <0>; interrupt-parent = <&gpio_intc>; + /* MAC_INTR on GPIOZ_15 */ interrupts = <29 IRQ_TYPE_LEVEL_LOW>; eee-broken-1000t; };
arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts +1 -0
@@ -118,6 +118,7 @@ /* Micrel KSZ9031 (0x00221620) */ reg = <3>; interrupt-parent = <&gpio_intc>; + /* MAC_INTR on GPIOZ_15 */ interrupts = <29 IRQ_TYPE_LEVEL_LOW>; }; };
arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts +1 -0
@@ -111,6 +111,7 @@ reg = <0>; max-speed = <1000>; interrupt-parent = <&gpio_intc>; + /* MAC_INTR on GPIOH_3 */ interrupts = <29 IRQ_TYPE_LEVEL_LOW>; }; };
Signature · 1 line
2.15.1
Jerome Brunet
reviewerPATCH 1/2 ARM64: dts: meson: add comments with the GPIO for the PHY interrupts
Quoted 8 lines · Martin Blumenstingl
Currently one has to look/calculate the GPIO for the PHY interrupts manually. Add a comment for the existing PHY interrupt lines to make it easier to find out which GPIO is used.
This is done using the following calculation:
- number of GPIO AO pins (14 on GXBB: GPIOAO_0..13)
- add the offset of the pin which is used for the interrupt (for exampleGPIOZ_15= 15 on Odroid-C2)
Quoted 1 line
Signed-off-by Martin Blumenstingl <[email protected]>
Martin Blumenstingl
reviewerPATCH 2/2 ARM64: dts: meson-gxm: add the PHY interrupt line on Khadas VIM2
In reply to Martin BlumenstinglThe INTB/PMEB pin of the RTL8211F PHY on the Khadas VIM2 is routed to GPIOZ_15. Add the corresponding interrupt using the GPIO interrupt controller so the PHY framework doesn't have to poll the PHY for it's status.
--- arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts +3 -0
@@ -232,6 +232,9 @@ external_phy: ethernet-phy at 0 { /* Realtek RTL8211F (0x001cc916) */ reg = <0>; + interrupt-parent = <&gpio_intc>; + /* MAC_INTR on GPIOZ_15 */ + interrupts = <25 IRQ_TYPE_LEVEL_LOW>; }; };
Signature · 1 line
2.15.1
Jerome Brunet
reviewerPATCH 2/2 ARM64: dts: meson-gxm: add the PHY interrupt line on Khadas VIM2
Quoted 5 lines · Martin Blumenstingl
The INTB/PMEB pin of the RTL8211F PHY on the Khadas VIM2 is routed to
GPIOZ_15. Add the corresponding interrupt using the GPIO interrupt controller so the PHY framework doesn't have to poll the PHY for it's status.
Quoted 1 line
Signed-off-by Martin Blumenstingl <[email protected]>
Jerome Brunet
reviewercover Ethernet PHY interrupt improvements
In reply to Martin BlumenstinglQuoted 6 lines · Martin Blumenstingl
this small series consists of two patches:
#1 documents the GPIO to which the PHY's interrupt line is connected
(the name "MAC_INTR" is used in the schematics of Odroid-C2 and
Khadas VIM2)
#2 adds the RTL8211F PHY's interrupt line on Khadas VIM2
Quoted 6 lines
I was a bit surprised to see that the GXM Q200 board seems to use
GPIOH_3instead ofGPIOZ_15like all other boards. @Jerome: could you please check ifGPIOH_3is correct or if it's a "copy-and-paste" issue (Q200 is the only GXL/GXM based board. GXL/GXM SoCs have fewer GPIOAO pins than GXBB, so the interrupt offset for the same non-GPIOAO pin is different than on GXBB)
Good catch, I confirm that the interrupt in GPIOZ_15 and certainly not GPIOH_3
Quoted 18 lines
compile-tested: all boards
runtime tested: Khadas VIM2 (unplugging / plugging the Ethernet cable increases the interrupt counter in/proc/interruptsand the kernel correctly reports that the cable has been {un,}plugged)Martin Blumenstingl (2):
ARM64: dts: meson: add comments with the GPIO for the PHY interrupts
ARM64: dts: meson-gxm: add the PHY interrupt line on Khadas VIM2arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 1 + arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 2 ++ arch/arm64/boot/dts/amlogic/meson-gxbb-p200.dts | 1 + arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 3 +++ arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts | 1 + 5 files changed, 8 insertions(+)
Kevin Hilman
maintainercover Ethernet PHY interrupt improvements
Quoted 7 lines · Jerome Brunet
Quoted 6 lines · Martin Blumenstingl
this small series consists of two patches:
#1 documents the GPIO to which the PHY's interrupt line is connected
(the name "MAC_INTR" is used in the schematics of Odroid-C2 and
Khadas VIM2)
#2 adds the RTL8211F PHY's interrupt line on Khadas VIM2
Quoted 9 lines
Quoted 6 lines
I was a bit surprised to see that the GXM Q200 board seems to use
GPIOH_3instead ofGPIOZ_15like all other boards. @Jerome: could you please check ifGPIOH_3is correct or if it's a "copy-and-paste" issue (Q200 is the only GXL/GXM based board. GXL/GXM SoCs have fewer GPIOAO pins than GXBB, so the interrupt offset for the same non-GPIOAO pin is different than on GXBB)Good catch, I confirm that the interrupt in
GPIOZ_15and certainly notGPIOH_3
Series applied to v4.16/dt64 with Jerome's review tags.
Thanks,
Kevin