net: phy: broadcom: Preserve LED4 settings

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: 9704fab964 ("net: phy: broadcom: Allow ethernet LED mode to be set via device tree")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
This commit is contained in:
Nicolai Buchwitz
2025-07-18 13:02:51 +02:00
committed by Dom Cobley
parent 5b5cbdb854
commit 01a137eed6

View File

@@ -546,10 +546,14 @@ static int bcm54xx_config_init(struct phy_device *phydev)
BCM54XX_SHD_LEDS1_LED3(BCM_LED_SRC_MULTICOLOR1);
bcm_phy_write_shadow(phydev, BCM54XX_SHD_LEDS1, val);
/* BCM54210PE controls two extra LEDs with the next register.
* Make them shadow the first pair of LEDs - useful on CM4 which
* uses LED3 for ETH_LEDY instead of LED1.
* Make LED3 shadow LED1, but preserve LED4 as is - useful on
* CM4/CM5 which use LED3 for ETH_LEDY instead of LED1. LED4
* is either unused or configured as INT pin on CM5.
*/
bcm_phy_write_shadow(phydev, BCM54XX_SHD_LEDS1 + 1, val);
reg = bcm_phy_read_shadow(phydev, BCM54XX_SHD_LEDS2);
reg &= ~(0xf << 0);
reg |= BCM54XX_SHD_LEDS1_LED1(BCM_LED_SRC_MULTICOLOR1);
bcm_phy_write_shadow(phydev, BCM54XX_SHD_LEDS2, reg);
val = BCM_LED_MULTICOLOR_IN_PHASE |
BCM54XX_SHD_LEDS1_LED1(led_modes[0]) |