Skip to content

Enable interrupts on CM5 ethernet phy (again) #6963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: rpi-6.12.y
Choose a base branch
from

Conversation

nbuchwitz
Copy link
Contributor

@nbuchwitz nbuchwitz commented Jul 18, 2025

Second attempt to enable interrupts on CM5's ethernet phy (see #6953). Took me some time, but I think I finally sorted it out:

  • Interrupt seems to be attached to LED4/INT_N, but was previously overridden by the led shadow patch (magically worked on my machine as I had a led_modes config which had link status on LED4 ...)
  • Interrupts were disable in ECR, but never re-enabled
  • Active low GPIO is missing a pull up, so just use the bias pull up in rp1

Happy for feedback and also some tests, so we won't missing anything out.

On CM5, the active-low interrupt pin (INT_N) of the Ethernet PHY is
connected to GPIO37. However, an internal pull-up resistor appears to
be missing, which causes the interrupt edge to be missed or not detected
reliably. Fix this by configuring a bias pull-up on the gpio controller.

Signed-off-by: Nicolai Buchwitz <[email protected]>
On CM4/CM5, LED3 is used for ETH_LEDY, while LED4 may be unused or serve
as INT_N. Previously, both LEDs 3 and 4 were mirrored from LED1, which
overwrote the INT_N configuration on CM5.

Fix this by only shadowing LED1 to LED3, preserving the setting for LED4/INT.

Fixes: 9704fab ("net: phy: broadcom: Make LEDs 3+4 shadow LEDs 1+2")
Signed-off-by: Nicolai Buchwitz <[email protected]>
…onfig_init

The driver previously set the global interrupt mask in the ECR register
in bcm54xx_config_init(), disabling all interrupts. This conflicts with
the configuration in bcm_phy_config_intr(), which enables or disables the
global interrupt mask as needed and is called earlier. As a result,
interrupts may remain globally disabled even when the IMR is configured
to unmask specific events.

Remove the ECR handling from bcm54xx_config_init() so that interrupt
enable/disable is managed exclusively by bcm_phy_config_intr().

Signed-off-by: Nicolai Buchwitz <[email protected]>
@nbuchwitz
Copy link
Contributor Author

Tested on cm5io (booted with cable attached, unplug, re-plug cable):

pi@rpicm5:~ $ grep ethernet /proc/interrupts
168:          2          0          0          0  pinctrl-rp1  37 Level     1f00100000.ethernet-ffffffff:00
pi@rpicm5:~ $ grep ethernet /proc/interrupts
168:          3          0          0          0  pinctrl-rp1  37 Level     1f00100000.ethernet-ffffffff:00
pi@rpicm5:~ $ grep ethernet /proc/interrupts
168:          5          0          0          0  pinctrl-rp1  37 Level     1f00100000.ethernet-ffffffff:00

2 interrupts when cable was attached make sense (probably one for link status + one for auto neg and other stuff)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant