mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-14 02:19:06 +04:00
airoha: an7581: add PHY LEDs for the Gemtek W1700K
Both 10G ports have a yellow and a green LED driven by the RTL8261CE rather than by GPIO. Index 2 is yellow, index 3 green. The index-to-colour mapping was determined empirically by inverting the polarity bits in VEND2 0xd044 one at a time. Configure the triggers to match the 1G ports on this board, where green means gigabit: yellow for 10/100, green from 1000 up, and both together for 10000. Without this the LEDs come up with no trigger and stay dark, losing the firmware defaults they had before. The indices were only verified on an RTL8261CE. Board revisions carrying an RTL8261N are unaffected for now since that driver has no LED callbacks, but the mapping should be rechecked there before relying on it. Assisted-by: Claude:claude-opus-5 Signed-off-by: Simon Polack <spolack+git@mailbox.org> Link: https://github.com/openwrt/openwrt/pull/25092 Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
This commit is contained in:
1 parent
5d0c4349ad
commit
18304dd747
2 files changed
+40
No files matched your search
@@ -14,6 +14,10 @@ airoha,an7581-evb)
|
||||
ucidef_set_led_usbport "usb2" "USB 2" "green:usb-2" "usb3-port1" "usb4-port1"
|
||||
;;
|
||||
gemtek,w1700k-ubi)
|
||||
ucidef_set_led_netdev "wan-yellow" "wan" "mt7530-0:08:yellow:wan" "wan" "link_10 link_100 link_10000"
|
||||
ucidef_set_led_netdev "wan-green" "wan" "mt7530-0:08:green:wan" "wan" "link_1000 link_2500 link_5000 link_10000 tx rx"
|
||||
ucidef_set_led_netdev "lan2-yellow" "lan2" "mt7530-0:05:yellow:lan-2" "lan2" "link_10 link_100 link_10000"
|
||||
ucidef_set_led_netdev "lan2-green" "lan2" "mt7530-0:05:green:lan-2" "lan2" "link_1000 link_2500 link_5000 link_10000 tx rx"
|
||||
ucidef_set_led_netdev "lan3-yellow" "lan3" "yellow:lan-3" "lan3" "link_10 link_100"
|
||||
ucidef_set_led_netdev "lan3-green" "lan3" "green:lan-3" "lan3" "link_1000 tx rx"
|
||||
ucidef_set_led_netdev "lan4-yellow" "lan4" "yellow:lan-4" "lan4" "link_10 link_100"
|
||||
|
||||
@@ -366,6 +366,25 @@
|
||||
// interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
|
||||
tx-polarity = <PHY_POL_INVERT>;
|
||||
rx-polarity = <PHY_POL_INVERT>;
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
led@2 {
|
||||
reg = <2>;
|
||||
color = <LED_COLOR_ID_YELLOW>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
function-enumerator = <2>;
|
||||
};
|
||||
|
||||
led@3 {
|
||||
reg = <3>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
function-enumerator = <2>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
phy8: ethernet-phy@8 {
|
||||
@@ -378,6 +397,23 @@
|
||||
// interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
|
||||
tx-polarity = <PHY_POL_INVERT>;
|
||||
rx-polarity = <PHY_POL_INVERT>;
|
||||
|
||||
leds {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
led@2 {
|
||||
reg = <2>;
|
||||
color = <LED_COLOR_ID_YELLOW>;
|
||||
function = LED_FUNCTION_WAN;
|
||||
};
|
||||
|
||||
led@3 {
|
||||
reg = <3>;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WAN;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user