Skip to contentSkip to conversation

ARM: dts: helios4: add Wake-on-LAN gpio key

PATCH In review Rosen Penev 3 participants 5 messages Sep 1

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: helios4: add Wake-on-LAN gpio key

Add a gpio-keys node exposing Wake-On-LAN on its gpio0 18 input, allowing the board to be woken from suspend.

Assisted-by opencode:big-pickle
---
 arch/arm/boot/dts/marvell/armada-388-helios4.dts | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/boot/dts/marvell/armada-388-helios4.dts +12 -0
index 176198d99c26..e3376c703cbf 100644
@@ -87,6 +87,18 @@ fault-led {
 		};
 	};
 
+	gpio-keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&microsom_phy0_int_pins>;
+
+		wol {
+			label = "Wake-On-LAN";
+			linux,code = <KEY_WAKEUP>;
+			gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
+			wakeup-source;
+		};
+	};
+
 	io-leds {
 		compatible = "gpio-leds";
 		pinctrl-names = "default";
Signature · 1 line
2.55.0
maintainer
#1 lore raw
Quoted 2 lines · Rosen Penev

Add a gpio-keys node exposing Wake-On-LAN on its gpio0 18 input, allowing the board to be woken from suspend.

Could you explain this some more. Why a GPIO key? The MAC needs to know if the PHY can wake the system, in order to offload the WoL to the PHY.

Andrew

#2 lore raw
Quoted 8 lines · Andrew Lunn
Quoted 2 lines · Rosen Penev

Add a gpio-keys node exposing Wake-On-LAN on its gpio0 18 input, allowing the board to be woken from suspend.

Could you explain this some more. Why a GPIO key? The MAC needs to know if the PHY can wake the system, in order to offload the WoL to the PHY.

This was an out of tree solution to get WOL working on this board.

After some back and forth with an LLM, the conclusion reached was that this is the simplest way to get it working, not upstream ready. And as sashiko points out, it has problems. I'll respin.

Quoted 2 lines

Andrew

maintainer
#3 lore raw
Quoted 6 lines · Rosen Penev
Quoted 5 lines · Andrew Lunn
Quoted 2 lines · Rosen Penev

Add a gpio-keys node exposing Wake-On-LAN on its gpio0 18 input, allowing the board to be woken from suspend.

Quoted 8 lines
Quoted 3 lines

Could you explain this some more. Why a GPIO key? The MAC needs to know if the PHY can wake the system, in order to offload the WoL to the PHY.

This was an out of tree solution to get WOL working on this board.

After some back and forth with an LLM, the conclusion reached was that this is the simplest way to get it working, not upstream ready. And as sashiko points out, it has problems. I'll respin.

Please do look at the work Russell King did for phylink and WoL.

What MAC and PHY are involved?

Andrew

#4 lore raw
In reply to Rosen Penev
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] Missing `pinctrl-names` property causes the `pinctrl-0` configuration to be ignored. - [Medium]…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Missing pinctrl-names property causes the pinctrl-0 configuration to be ignored.
- [Medium] Routing the PHY Wake-On-LAN interrupt to gpio-keys causes the interrupt pin to get stuck low after the first wakeup. --

commit a86b93404f7467809ab8336ca71556ed631044f5
Author: Rosen Penev <[email protected]>

ARM: dts: helios4: add Wake-on-LAN gpio key

Add a gpio-keys node exposing Wake-On-LAN on its gpio0 18 input, allowing the board to be woken from suspend.

arch/arm/boot/dts/marvell/armada-388-helios4.dts fault-led { · line 92

Quoted 11 lines
arch/arm/boot/dts/marvell/armada-388-helios4.dts +3 -0
index ec134e22bae3e..8e30963b9b409 100644
@@ -87,6 +87,18 @@ fault-led {
 		};
 	};
 
+	gpio-keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&microsom_phy0_int_pins>;

[Severity: Medium]
Will this pinctrl configuration be ignored by the kernel?

During device probe, pinctrl_bind_pins() in the driver core looks for a state named 'default'. Because pinctrl-names is omitted, the device tree parser assigns the state the default name '0'.

Does this cause the core to fail to find 'default', log 'no default pinctrl state', and skip applying the pin multiplexing configuration?

arch/arm/boot/dts/marvell/armada-388-helios4.dts fault-led { · line 98

Quoted 6 lines
arch/arm/boot/dts/marvell/armada-388-helios4.dts +6 -0
+
+		wol {
+			label = "Wake-On-LAN";
+			linux,code = <KEY_WAKEUP>;
+			gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
+			wakeup-source;

[Severity: Medium]
Could routing the PHY Wake-On-LAN interrupt to gpio-keys cause the interrupt pin to get stuck low after the first wakeup?

When the Marvell PHY receives a WoL magic packet, it pulls the INTn pin low, and the gpio-keys driver wakes the system via a falling edge interrupt. However, because the PHY node lacks an interrupts property, the PHY driver operates in polling mode and never registers an interrupt handler to read the PHY interrupt status register.

Since the internal interrupt state is never cleared, will the INTn pin remain permanently stuck low, causing WoL to silently fail on all subsequent attempts until the device is rebooted?

Quoted 6 lines
arch/arm/boot/dts/marvell/armada-388-helios4.dts +3 -0
+		};
+	};
+
 	io-leds {
 		compatible = "gpio-leds";
 		pinctrl-names = "default";
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1