diff options
| author | Ivan Rainbolt | 2026-08-26 08:52:15 +0000 |
|---|---|---|
| committer | Hauke Mehrtens | 2026-08-29 21:43:20 +0000 |
| commit | 93cf01b0b6fe169492be255db8613016b9d0c3cd (patch) | |
| tree | a2a5d3586f636b6f737741761dbb52eb5e2745e7 | |
| parent | d5e3504f86b1af50b6045a71e10a177c9ca51902 (diff) | |
The WR3000P's front-panel WAN lamp is wired to the LED1 pin of the
RTL8221B 2.5G WAN PHY, not to a SoC GPIO. With rtl822x PHY LED support
backported (previous commit), declare it properly: add a "leds" node
under the WAN PHY (phy6) describing the white WAN LED, and a board.d
netdev entry so the lamp is driven by the standard netdev trigger on
the wan interface, with no raw register writes.
Use the generic "link" mode rather than the per-speed
"link_10 link_100 link_1000 link_2500" list. The per-speed netdev
attributes are created dynamically from the PHY's reported supported
modes, so at early boot - PHY still probing, wan link still down -
they may not exist yet and /etc/init.d/led silently skips them,
leaving the lamp lit only at 2.5G (a 1G WAN would boot dark). The
generic "link" attribute always exists and the offload driver maps it
to all speed bits, so the lamp lights at any link speed. This matches
the stock firmware, which programs the LED1 speed-select register
(0xd034) to light at every speed.
Tested on a WR3000P v1 (RTL8221B-VB-CG, phy_id 0x001cc849): after a
config-wipe sysupgrade (-n) and cold boot the board.d entry is applied
automatically and the kernel programs 0xd034=0x0027 (all speeds) plus
0xd040=0x391f (blink), with no mdio hook or other out-of-tree helper
involved. The lamp lights and blinks on traffic at 10, 100, 1000 and
2500 Mb.
Depends on the phantom led-wan removal in "mediatek: filogic: drop
bogus WAN and LAN LEDs on Cudy WR3000P v1".
Signed-off-by: Ivan Rainbolt <ivan@github.ivanthegeek.com>
Link: https://github.com/openwrt/openwrt/pull/24913
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
| -rw-r--r-- | target/linux/mediatek/dts/mt7981b-cudy-wr3000p-v1.dtsi | 11 | ||||
| -rw-r--r-- | target/linux/mediatek/filogic/base-files/etc/board.d/01_leds | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000p-v1.dtsi b/target/linux/mediatek/dts/mt7981b-cudy-wr3000p-v1.dtsi index 19fc75bdf1..4a99385ee0 100644 --- a/target/linux/mediatek/dts/mt7981b-cudy-wr3000p-v1.dtsi +++ b/target/linux/mediatek/dts/mt7981b-cudy-wr3000p-v1.dtsi @@ -79,6 +79,17 @@ reset-assert-us = <100000>; reset-deassert-us = <100000>; reset-gpios = <&pio 3 GPIO_ACTIVE_LOW>; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + led@1 { + reg = <1>; + color = <LED_COLOR_ID_WHITE>; + function = LED_FUNCTION_WAN; + }; + }; }; }; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index f84faa7d27..764cfff876 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -106,6 +106,7 @@ cudy,wr3000h-v1-ubootmod) ;; cudy,wr3000p-v1|\ cudy,wr3000p-v1-ubootmod) + ucidef_set_led_netdev "wan" "wan" "mdio-bus:06:white:wan" "wan" "link tx rx" ucidef_set_led_netdev "internet" "internet" "white:wan-online" "wan" "link" ;; cudy,wr3000u-v1|\ |