bcm27xx: 6.1: add kernel patches
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-6.1 / 950-0531-net-phy-broadcom-Make-LEDs-3-4-shadow-LEDs-1-2.patch
1 From 72f813551de816215429cae538359371730ade97 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Tue, 3 Jan 2023 16:00:21 +0000
4 Subject: [PATCH] net: phy: broadcom: Make LEDs 3+4 shadow LEDs 1+2
5
6 CM4 uses BCM54210PE, which supports 2 additional LEDs, choosing LED3
7 for the amber LED because it shows activity by default (LED4 is not
8 connected). However, this makes it uncontrollable by the eth_led<n>
9 dtparams which target LEDs 1+2.
10
11 Solve the problem by making LEDs 3+4 mirror LEDs 1+2 (which is much
12 simpler than adding baseboard-specific overrides, but comes with a
13 risk of making one of the LEDs redundant).
14
15 See: https://github.com/raspberrypi/linux/issues/5289
16
17 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
18 ---
19 drivers/net/phy/broadcom.c | 5 +++++
20 1 file changed, 5 insertions(+)
21
22 --- a/drivers/net/phy/broadcom.c
23 +++ b/drivers/net/phy/broadcom.c
24 @@ -416,6 +416,11 @@ static int bcm54xx_config_init(struct ph
25 val = BCM5482_SHD_LEDS1_LED1(BCM_LED_SRC_MULTICOLOR1) |
26 BCM5482_SHD_LEDS1_LED3(BCM_LED_SRC_MULTICOLOR1);
27 bcm_phy_write_shadow(phydev, BCM5482_SHD_LEDS1, val);
28 + /* BCM54210PE controls two extra LEDs with the next register.
29 + * Make them shadow the first pair of LEDs - useful on CM4 which
30 + * uses LED3 for ETH_LEDY instead of LED1.
31 + */
32 + bcm_phy_write_shadow(phydev, BCM5482_SHD_LEDS1 + 1, val);
33
34 val = BCM_LED_MULTICOLOR_IN_PHASE |
35 BCM5482_SHD_LEDS1_LED1(led_modes[0]) |