Hi, Folks,
Got a not-so-popular TOTOLINK A3 router (a clone of ipTIME A3). After successively flashing the custom-built firmware from the forum and the official 22.03.5 firmware, the router works great, except for part of the LEDs.
Just to be a little bit informative, this wee router has 5 LEDs (Power, WLAN, WAN, LAN1 and LAN2), and the first two can be turned on or off by using echo 1
or echo 0
to the corresponding brightness
files. But the last three LEDs are neither enumerated nor configurable, and just keep blinking once the Ethernet cable is plugged in. The output of ls -l
is as follows,
root@OpenWrt:~# ls -l /sys/class/leds
lrwxrwxrwx 1 root root 0 Jan 1 1970 blue:cpu -> ../../devices/platform/leds/leds/blue:cpu
lrwxrwxrwx 1 root root 0 Jan 1 1970 blue:wlan -> ../../devices/platform/leds/leds/blue:wlan
lrwxrwxrwx 1 root root 0 Apr 27 21:41 mt76-phy0 -> ../../devices/platform/10300000.wmac/leds/mt76-phy0
lrwxrwxrwx 1 root root 0 Apr 27 21:41 mt76-phy1 -> ../../devices/pci0000:00/0000:00:00.0/0000:01:00.0/leds/mt76-phy1
After searching on the Web for weeks, just stumbled upon a thread posted on Padavan-related forum by pa2w. As mentioned in that thread, the GPIO of WAN and LAN are likely to be 43 and 41, respectively.
board.h -
/* TOTOLINK A3 */
#define BOARD_PID "za3"
#define BOARD_NAME "za3"
#define BOARD_DESC "TOTOLINK A3"
...
#define BOARD_GPIO_BTN_RESET 6
#define BOARD_GPIO_BTN_WPS 13
...
#define BOARD_GPIO_LED_POWER 11
#define BOARD_GPIO_LED_LAN 41
#define BOARD_GPIO_LED_WAN 43
...
#define BOARD_GPIO_LED_WAN_PHY 42
...
#define BOARD_NUM_ETH_LEDS 0
#define BOARD_HAS_EPHY_L1000 0
#define BOARD_HAS_EPHY_W1000 0
After appending the following lines to the corresponding .dts
file, re-compiling and flashing the generated firmware, neither of these three LEDs is configurable.
--- a/target/linux/ramips/dts/mt7628an_totolink_a3.dts 2023-06-28 21:50:32.409113962 +0800
+++ b/target/linux/ramips/dts/mt7628an_totolink_a3.dts 2023-06-28 22:18:34.233634737 +0800
@@ -15,21 +15,29 @@
leds {
compatible = "gpio-leds";
led_cpu: cpu {
label = "blue:cpu";
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
};
wlan {
label = "blue:wlan";
gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};
+ wan {
+ label = "blue:wan";
+ gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
+ };
+ lan {
+ label = "blue:lan";
+ gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
+ };
};
};
&esw {
mediatek,portmap = <0x3e>;
mediatek,portdisable = <0x32>;
};
When running the newly generated firmware, the output of ls -l
is as follows,
root@OpenWrt:~# ls -l /sys/class/leds
lrwxrwxrwx 1 root root 0 Jan 1 1970 blue:cpu -> ../../devices/platform/leds/leds/blue:cpu
lrwxrwxrwx 1 root root 0 Jan 1 1970 blue:lan -> ../../devices/platform/leds/leds/blue:lan
lrwxrwxrwx 1 root root 0 Jan 1 1970 blue:wan -> ../../devices/platform/leds/leds/blue:wan
lrwxrwxrwx 1 root root 0 Jan 1 1970 blue:wlan -> ../../devices/platform/leds/leds/blue:wlan
lrwxrwxrwx 1 root root 0 Apr 27 22:11 mt76-phy0 -> ../../devices/platform/10300000.wmac/leds/mt76-phy0
To test further, the gpio-test.sh
posted on OpenWrt WiKi has also been run, and none of these three mystery LEDs blinked during testing (except for the one connecting with the laptop).
Since the programming or electronic stuff is way over my head, I would be grateful if any help could be given in this regard.
Many thanks,
CL