2011-10-24 21:49:31 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2015-12-11 15:26:06 +00:00
|
|
|
. /lib/functions/uci-defaults.sh
|
2011-10-24 21:49:31 +00:00
|
|
|
|
2011-12-23 14:27:10 +00:00
|
|
|
set_wifi_led() {
|
2016-07-26 17:18:53 +00:00
|
|
|
ucidef_set_led_netdev "wifi_led" "wifi" "${1}" "${2:-wlan0}"
|
2012-05-29 16:39:03 +00:00
|
|
|
}
|
|
|
|
|
2014-08-18 13:09:20 +00:00
|
|
|
|
2017-05-12 20:36:07 +00:00
|
|
|
board=$(board_name)
|
2017-11-16 21:17:42 +00:00
|
|
|
boardname="${board##*,}"
|
2011-10-24 21:49:31 +00:00
|
|
|
|
2014-08-18 13:09:20 +00:00
|
|
|
board_config_update
|
|
|
|
|
2011-10-24 21:49:31 +00:00
|
|
|
case $board in
|
2015-08-17 06:24:34 +00:00
|
|
|
3g-6200n)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:amber:wlan"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2015-08-17 06:24:47 +00:00
|
|
|
3g-6200nl|\
|
2018-11-26 11:34:48 +00:00
|
|
|
skylab,skw92a|\
|
2016-09-27 05:16:16 +00:00
|
|
|
wnce2001)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:green:wlan"
|
2016-09-27 05:16:16 +00:00
|
|
|
;;
|
2015-08-17 06:24:47 +00:00
|
|
|
br-6475nd|\
|
|
|
|
mzk-w300nh2)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:amber:wlan"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
|
|
|
ai-br100)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" "eth0.2"
|
|
|
|
set_wifi_led "$boardname:blue:wlan"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
|
|
|
air3gii)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:green:wlan"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2017-10-14 08:44:39 +00:00
|
|
|
alfa-network,ac1200rm)
|
|
|
|
set_wifi_led "$boardname:green:wlan2g" "wlan1"
|
|
|
|
;;
|
2018-01-26 15:21:34 +00:00
|
|
|
alfa-network,awusfree1)
|
|
|
|
set_wifi_led "$boardname:blue:wlan"
|
|
|
|
;;
|
ramips: add support for ALFA Network Tube-E4G
ALFA Network Tube-E4G is an outdoor, dual-SIM LTE Cat. 4 CPE, based on
MediaTek MT7620A, equipped with Quectel EC25 miniPCIe modem.
Specification:
- MT7620A (580 MHz)
- 64/128/256 MB of RAM (DDR2)
- 16/32 MB of flash (SPI NOR)
- 1x 10/100 Mbps Ethernet, with passive PoE support (24 V)
- 1x miniPCIe slot (with PCIe and USB 2.0 buses)
- 2x SIM slot (mini, micro) with detect and switch driven by GPIO
- 1x detachable antenna (modem main)
- 1x internal antenna (modem div)
- 1x GPS passive antenna (optional)
- 5x LED (all driven by GPIO)
- 1x button (reset)
- UART (4-pin, 2.54 mm pitch) header on PCB
Other:
Default SIM slot is selected at an early stage by U-Boot, based on
'default_sim' environment value: 1 or unset = SIM1 (mini), 2 = SIM2
(micro). U-Boot also resets the modem, using #PERST signal, before
starting kernel.
Flash instruction:
You can use the 'sysupgrade' image directly in vendor firmware which is
based on OpenWrt (make sure to not preserve settings - use 'sysupgrade
-n -F ...' command). Alternatively, use web recovery mode in U-Boot:
1. Power the device with reset button pressed, the LAN LED will start
blinking slowly and after ~3 seconds, when it starts blinking faster,
you can release the button.
2. Setup static IP 192.168.1.2/24 on your PC.
3. Go to 192.168.1.1 in browser and upload 'sysupgrade' image.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2019-03-10 00:28:28 +00:00
|
|
|
alfa-network,tube-e4g)
|
|
|
|
ucidef_set_led_netdev "4g" "4g" "$boardname:green:4g" "wwan0"
|
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:blue:lan" "eth0"
|
|
|
|
;;
|
2017-04-07 22:34:48 +00:00
|
|
|
all0256n-4M|\
|
|
|
|
all0256n-8M)
|
2016-11-02 15:10:44 +00:00
|
|
|
ucidef_set_rssimon "wlan0" "200000" "1"
|
2017-04-07 22:34:48 +00:00
|
|
|
ucidef_set_led_rssi "rssilow" "RSSILOW" "all0256n:green:rssilow" "wlan0" "1" "40" "0" "6"
|
|
|
|
ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0256n:green:rssimed" "wlan0" "30" "80" "-29" "5"
|
|
|
|
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8"
|
2015-08-17 06:24:34 +00:00
|
|
|
set_wifi_led "rt2800pci-phy0::radio"
|
|
|
|
;;
|
|
|
|
ar670w|\
|
|
|
|
ar725w|\
|
|
|
|
awapn2403)
|
|
|
|
set_wifi_led "rt2800soc-phy0::radio"
|
|
|
|
;;
|
2017-04-07 22:34:48 +00:00
|
|
|
asl26555-8M|\
|
|
|
|
asl26555-16M)
|
|
|
|
ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0"
|
|
|
|
set_wifi_led "asl26555:green:wlan"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2018-11-26 12:26:06 +00:00
|
|
|
bdcom,wap2100-sk|\
|
|
|
|
hiwifi,hc5861b)
|
|
|
|
set_wifi_led "$boardname:green:wlan2g"
|
|
|
|
;;
|
ramips: add support for Belkin F9K1109v1
Device specification:
- SoC: Ralink RT3883 (MIPS 74Kc) 500Mhz
- RAM: 64Mb
- Flash: 8MB (SPI-NOR)
- Ethernet: 10/100/1000 Mbps
- WLAN
Wireless 1: SoC-integrated : 2.4/5 GHz
Wireless 2: 2.4 GHz RT3092L
- LED: 2x USB, WAN, LAN
- Key: WPS, reset
- Serial: 4-pin header, (57600,8,N,1), 3.3V TTL,
GND, RX, TX, V - J12 marking on board
- USB ports: 2 x USB 2.0
Flashing instructions:
Option 1 (from bootloader web)
- Hold reset button on the back of router when plugging
in power (for at-least 10 seconds after plugged in)
- Connect to a Lan port
- Set computer IP to 10.10.10.3
- Go to http://10.10.10.123 in a web browser
- Click the Browse... Button and select the
*squashfs.sysupgrade.bin file then click APPLY
Option 2 (from the stock admin web)
- Go to firmware upgrade
- Upload the **factory** image *initramfs.bin first
- Boot into openwrt
- From Luci web in openwrt upload the *squashfs.sysupgrade.bin
Signed-off-by: Kip Porterfield <kip.porterfield@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[added v1 to the compatible identifier, added pciid for
the RT3092L, fixed pci unit-address, split out the F9K110X.dtsi
to prepare for a possible F9K1103 patch]
2019-02-03 18:54:18 +00:00
|
|
|
belkin,f9k1109v1)
|
|
|
|
set_usb_led "$boardname:green:usb1"
|
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:blue:wps" "eth0"
|
|
|
|
;;
|
2015-08-17 06:24:34 +00:00
|
|
|
broadway)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:red:wps_active"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2017-09-06 09:14:16 +00:00
|
|
|
c108)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
|
|
|
|
ucidef_set_led_netdev "modem" "modem" "$boardname:green:modem" "wwan0"
|
2017-09-06 09:14:16 +00:00
|
|
|
;;
|
2016-07-26 04:44:19 +00:00
|
|
|
c20i)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01"
|
|
|
|
ucidef_set_led_wlan "wlan" "wlan" "$boardname:blue:wlan" "phy0radio"
|
2016-07-26 04:44:19 +00:00
|
|
|
;;
|
2016-06-12 21:43:51 +00:00
|
|
|
c50)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
|
|
|
|
ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:green:wlan2g" wlan1
|
|
|
|
set_wifi_led "$boardname:green:wlan5g"
|
2016-06-12 21:43:51 +00:00
|
|
|
;;
|
2015-08-17 06:24:34 +00:00
|
|
|
cf-wr800n)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:white:ethernet" eth0.1
|
|
|
|
set_wifi_led "$boardname:white:wifi"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2017-02-04 20:28:52 +00:00
|
|
|
d240)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:blue:wifi"
|
2017-02-04 20:28:52 +00:00
|
|
|
;;
|
2015-08-17 06:24:34 +00:00
|
|
|
dcs-930l-b1)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "wifi" "WiFi" "$boardname:blue:wps"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2015-08-17 06:24:47 +00:00
|
|
|
dir-300-b1|\
|
|
|
|
dir-600-b1|\
|
|
|
|
dir-620-a1)
|
2015-08-17 06:24:34 +00:00
|
|
|
set_wifi_led "rt2800pci-phy0::radio"
|
|
|
|
;;
|
|
|
|
dir-300-b7|\
|
|
|
|
dir-320-b1|\
|
|
|
|
dir-610-a1|\
|
|
|
|
esr-9753|\
|
|
|
|
hlk-rm04|\
|
|
|
|
sl-r7205|\
|
|
|
|
v11st-fe|\
|
|
|
|
w306r-v20|\
|
2017-04-07 22:34:48 +00:00
|
|
|
wt1520-4M|\
|
|
|
|
wt1520-8M)
|
2015-08-17 06:24:34 +00:00
|
|
|
set_wifi_led "rt2800pci-phy0::radio"
|
|
|
|
;;
|
2015-08-17 06:24:47 +00:00
|
|
|
dir-615-d|\
|
2015-08-17 06:24:34 +00:00
|
|
|
dir-615-h1)
|
|
|
|
set_wifi_led "rt2800pci-phy0::radio"
|
|
|
|
;;
|
2016-04-26 11:43:06 +00:00
|
|
|
dir-620-d1|\
|
2018-01-20 08:27:03 +00:00
|
|
|
dlink,dwr-116-a1|\
|
2016-04-26 11:43:06 +00:00
|
|
|
mzk-ex300np)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:green:wifi"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2018-10-24 12:06:35 +00:00
|
|
|
dlink,dwr-118-a1)
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1f"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x20"
|
|
|
|
set_wifi_led "$boardname:green:wlan2g" "wlan1"
|
|
|
|
;;
|
2018-04-19 17:34:22 +00:00
|
|
|
dlink,dwr-118-a2)
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
|
|
|
|
set_wifi_led "$boardname:green:wlan2g" "wlan1"
|
|
|
|
;;
|
ramips: add support for DLINK DWR-922-E2
Very similar to the DWR-921-C1, except has a telephony/RJ11 port (not
sure if supported, I didn't try), wireless router with QMI LTE embedded
modem is based on the MT7620N SoC.
Specification:
* MediaTek MT7620N (580 Mhz)
* 64 MB of RAM
* 16 MB of FLASH
* 802.11bgn radio
* 5x 10/100 Mbps Ethernet (1 WAN and 4 LAN)
* 2x external, detachable (LTE) antennas
* UART header on PCB (57600 8n1)
* 6x LED (GPIO-controlled)
* 1x bi-color Signal Strength LED (GPIO-controlled)
* 2x button
* JBOOT bootloader
The status led has been assigned to the dwr-922-e2:green:signalstrength
(lte signal strength) led. At the end of the boot it is switched off and
is available for lte operation. Works correctly also during sysupgrade
operation.
Installation:
Apply factory image via d-link http web-gui, or via recovery interface:
How to recover/revert to OEM firmware:
1.) Push and hold the reset button and turn on the power. Wait until all
LEDs start rapidly blinking (~10sec.)
2.) DHCP should give you an IP in the 192.168.123.0/24 subnet, or set
one manually
3.) Upload original factory image via JBOOT http interface at IP
192.168.123.254
4.) If http doesn't work, it can be done with curl command:
curl -F FN=@XXXXX.bin http://192.168.123.254/upg
where XXXXX.bin is name of firmware file.
5.) You can optionally telnet to 192.168.123.254 before or during the
upload and it will report the flashing status, memory address etc.
6.) Once web UI and/or telnet says "Success", power cycle the router, or
type "reboot" into the telnet session.
Signed-off-by: Simon Quigley <squigley@squigley.net>
[squashed commits, word wrap commit message, rename signal strenght led
name to match what is used for the DWR-921-C1 since they share the led
configuration, add label referenced in the aliases node]
Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-12-20 16:47:52 +00:00
|
|
|
dlink,dwr-921-c1|\
|
|
|
|
dlink,dwr-922-e2)
|
2018-03-10 09:34:38 +00:00
|
|
|
set_wifi_led "$boardname:green:wifi"
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f"
|
ramips: add support for DLINK DWR-922-E2
Very similar to the DWR-921-C1, except has a telephony/RJ11 port (not
sure if supported, I didn't try), wireless router with QMI LTE embedded
modem is based on the MT7620N SoC.
Specification:
* MediaTek MT7620N (580 Mhz)
* 64 MB of RAM
* 16 MB of FLASH
* 802.11bgn radio
* 5x 10/100 Mbps Ethernet (1 WAN and 4 LAN)
* 2x external, detachable (LTE) antennas
* UART header on PCB (57600 8n1)
* 6x LED (GPIO-controlled)
* 1x bi-color Signal Strength LED (GPIO-controlled)
* 2x button
* JBOOT bootloader
The status led has been assigned to the dwr-922-e2:green:signalstrength
(lte signal strength) led. At the end of the boot it is switched off and
is available for lte operation. Works correctly also during sysupgrade
operation.
Installation:
Apply factory image via d-link http web-gui, or via recovery interface:
How to recover/revert to OEM firmware:
1.) Push and hold the reset button and turn on the power. Wait until all
LEDs start rapidly blinking (~10sec.)
2.) DHCP should give you an IP in the 192.168.123.0/24 subnet, or set
one manually
3.) Upload original factory image via JBOOT http interface at IP
192.168.123.254
4.) If http doesn't work, it can be done with curl command:
curl -F FN=@XXXXX.bin http://192.168.123.254/upg
where XXXXX.bin is name of firmware file.
5.) You can optionally telnet to 192.168.123.254 before or during the
upload and it will report the flashing status, memory address etc.
6.) Once web UI and/or telnet says "Success", power cycle the router, or
type "reboot" into the telnet session.
Signed-off-by: Simon Quigley <squigley@squigley.net>
[squashed commits, word wrap commit message, rename signal strenght led
name to match what is used for the DWR-921-C1 since they share the led
configuration, add label referenced in the aliases node]
Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-12-20 16:47:52 +00:00
|
|
|
ucidef_set_led_netdev "signalstrength" "signalstrength" "$boardname:green:sigstrength" "wwan0" "link"
|
|
|
|
ucidef_set_led_netdev "4g" "4g" "$boardname:green:4g" "wwan0" "tx rx"
|
2018-03-10 09:34:38 +00:00
|
|
|
;;
|
2016-06-30 13:18:03 +00:00
|
|
|
dir-860l-b1)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "eth0.2"
|
2016-06-30 13:18:03 +00:00
|
|
|
;;
|
2018-08-06 17:52:28 +00:00
|
|
|
edimax,br-6478ac-v2)
|
|
|
|
set_wifi_led "$boardname:blue:wlan"
|
|
|
|
;;
|
2017-01-18 10:34:56 +00:00
|
|
|
ex2700|\
|
|
|
|
wn3000rpv3)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:green:router"
|
2016-02-12 08:29:33 +00:00
|
|
|
;;
|
2017-03-03 14:36:51 +00:00
|
|
|
ex3700)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "$boardname:green:router" "wlan0"
|
|
|
|
ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "$boardname:green:device" "wlan1"
|
2017-03-03 14:36:51 +00:00
|
|
|
;;
|
2016-12-01 14:08:22 +00:00
|
|
|
f5d8235-v1)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:blue:wireless"
|
2016-12-01 14:08:22 +00:00
|
|
|
;;
|
2015-08-17 06:24:34 +00:00
|
|
|
fonera20n)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:orange:wifi"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2018-05-27 00:26:14 +00:00
|
|
|
gnubee,gb-pc1|\
|
2018-02-17 08:54:57 +00:00
|
|
|
gnubee,gb-pc2)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x01"
|
|
|
|
ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x10"
|
2017-07-22 01:15:56 +00:00
|
|
|
;;
|
2016-03-10 19:12:04 +00:00
|
|
|
gl-mt300a|\
|
2016-03-10 19:12:10 +00:00
|
|
|
gl-mt300n|\
|
|
|
|
gl-mt750)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:wlan"
|
2016-03-10 19:11:57 +00:00
|
|
|
;;
|
2017-05-17 10:18:45 +00:00
|
|
|
gl-mt300n-v2)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:red:wlan"
|
2018-11-02 19:52:01 +00:00
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x1"
|
2017-05-17 10:18:45 +00:00
|
|
|
;;
|
2017-02-24 23:19:15 +00:00
|
|
|
hc5661|\
|
|
|
|
hc5661a)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
|
|
|
|
set_wifi_led "$boardname:blue:wlan2g"
|
2016-07-23 14:25:38 +00:00
|
|
|
;;
|
2018-12-14 10:15:52 +00:00
|
|
|
hc5761|\
|
2015-10-05 10:25:47 +00:00
|
|
|
hc5861)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
|
2018-12-14 10:15:52 +00:00
|
|
|
ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "wlan0"
|
|
|
|
ucidef_set_led_netdev "wifi2g" "wifi2g" "$boardname:blue:wlan2g" "wlan1"
|
2015-10-05 10:25:47 +00:00
|
|
|
;;
|
2015-08-17 06:24:34 +00:00
|
|
|
hg255d)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:green:wlan"
|
|
|
|
ucidef_set_led_netdev "internet" "internet" "$boardname:green:internet" "eth0.2"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
|
|
|
hpm)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0"
|
|
|
|
set_wifi_led "$boardname:green:wifi"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
|
|
|
ht-tm02)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:lan" "eth0"
|
|
|
|
set_wifi_led "$boardname:blue:wlan"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2019-03-14 14:46:43 +00:00
|
|
|
iodata,wn-ac1167gr|\
|
|
|
|
iodata,wn-ac733gr3)
|
2019-01-08 15:20:18 +00:00
|
|
|
ucidef_set_led_wlan "wlan5g" "WLAN5G" "$boardname:green:wlan5g" "phy0radio"
|
|
|
|
ucidef_set_led_wlan "wlan2g" "WLAN2G" "$boardname:green:wlan2g" "phy1radio"
|
|
|
|
;;
|
2018-07-04 01:29:36 +00:00
|
|
|
kimax,u35wf)
|
|
|
|
set_wifi_led "$boardname:blue:wifi"
|
|
|
|
ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0"
|
|
|
|
;;
|
2017-04-27 18:02:05 +00:00
|
|
|
kn|\
|
|
|
|
nbg-419n2)
|
|
|
|
set_wifi_led "rt2800pci-phy0::radio"
|
|
|
|
;;
|
2016-11-28 18:41:51 +00:00
|
|
|
kn_rc|\
|
|
|
|
kn_rf|\
|
2016-10-29 12:26:58 +00:00
|
|
|
kng_rc)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:green:wifi"
|
2016-10-29 12:26:58 +00:00
|
|
|
;;
|
2018-11-17 08:47:40 +00:00
|
|
|
lava,lr-25g001)
|
|
|
|
ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g" "wlan1"
|
|
|
|
ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:green:wlan5g" "wlan0"
|
|
|
|
;;
|
2017-12-21 18:55:25 +00:00
|
|
|
linkits7688)
|
|
|
|
ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "phy0tpt"
|
|
|
|
;;
|
2015-08-17 06:24:34 +00:00
|
|
|
m2m)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:blue:wifi"
|
|
|
|
ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:wan" "eth0"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2018-06-25 20:51:43 +00:00
|
|
|
mikrotik,rbm11g)
|
|
|
|
ucidef_set_rssimon "wlan0" "200000" "1"
|
|
|
|
ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:green:rssi0" "wlan0" "1" "100"
|
|
|
|
ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:green:rssi1" "wlan0" "20" "100"
|
|
|
|
ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssi2" "wlan0" "40" "100"
|
|
|
|
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssi3" "wlan0" "60" "100"
|
|
|
|
ucidef_set_led_rssi "rssiveryhigh" "RSSIVERYHIGH" "$boardname:green:rssi4" "wlan0" "80" "100"
|
|
|
|
;;
|
2015-08-17 06:24:34 +00:00
|
|
|
miniembplug)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:red:wlan"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
ramips: add support for Xiaomi Mi Router 3 Pro
Hardware:
CPU: MediaTek MT7621AT (2x880MHz)
RAM: 512MB DDR3
FLASH: 256MB NAND
WiFi: 2.4GHz 4x4 MT7615 b/g/n (Needs driver, See Issues!)
WiFI: 5GHz 4x4 MT7615 a/n/ac (Needs driver, See Issues!)
USB: 1x 3.0
ETH: 1x WAN 10/100/1000 3x LAN 10/100/1000
LED: Power/Status
BTN: RESET
UART: 115200 8n1
Partition layout and boot:
Stock Xiaomi firmware has the MTD split into (among others)
- kernel0 (@0x200000)
- kernel1 (@0x600000)
- rootfs0
- rootfs1
- overlay (ubi)
Xiaomi uboot expects to find kernels at 0x200000 & 0x600000
referred to as system 1 & system 2 respectively.
a kernel is considered suitable for handing control over
if its linux magic number exists & uImage CRC are correct.
If either of those conditions fail, a matching sys'n'_fail flag
is set in uboot env & a restart performed in the hope that the
alternate kernel is okay.
If neither kernel checksums ok and both are marked failed, system 2
is booted anyway.
Note uboot's tftp flash install writes the transferred
image to both kernel partitions.
Installation:
Similar to the Xiaomi MIR3G, we keep stock Xiaomi firmware in
kernel0 for ease of recovery, and install OpenWRT into kernel1 and
after.
The installation file for OpenWRT is a *squashfs-factory.bin file that
contains the kernel and a ubi partition. This is flashed as follows:
nvram set flag_try_sys1_failed=1
nvram set flag_try_sys2_failed=0
nvram commit
dd if=factory.bin bs=1M count=4 | mtd write - kernel1
dd if=factory.bin bs=1M skip=4 | mtd write - rootfs0
reboot
Reverting to stock:
The part of stock firmware we've kept in kernel0 allows us to run stock
recovery, which will re-flash stock firmware from a *.bin file on a USB.
For this we do the following:
fw_setenv flag_try_sys1_failed 0
fw_setenv flag_try_sys2_failed 1
reboot
After reboot the LED status light will blink red, at which point pressing
the 'reset' button will cause stock firmware to be installed from USB.
Issues:
OpenWRT currently does not have support for the MT7615 wifi chips. There is
ongoing work to add mt7615 support to the open source mt76 driver. Until that
support is in place, there are closed-source kernel modules that can be used.
See: https://forum.openwrt.org/t/support-for-xiaomi-wifi-r3p-pro/20290/170
Signed-off-by: Ozgur Can Leonard <ozgurcan@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[02_network remaps, Added link to notes]
2019-03-05 08:41:37 +00:00
|
|
|
xiaomi,mir3p)
|
|
|
|
ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x10" "0x08"
|
|
|
|
ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x02" "0x08"
|
|
|
|
ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
|
|
|
|
ucidef_set_led_switch "lan3-amber" "LAN3 (amber)" "$boardname:amber:lan3" "switch0" "0x08" "0x08"
|
|
|
|
;;
|
2017-08-12 14:56:11 +00:00
|
|
|
mir3g)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x02" "0x08"
|
|
|
|
ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x08" "0x08"
|
|
|
|
ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08"
|
2017-08-12 14:56:11 +00:00
|
|
|
;;
|
2015-08-17 06:24:47 +00:00
|
|
|
mlw221|\
|
2015-08-17 06:24:34 +00:00
|
|
|
mlwg2)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:blue:wifi"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
|
|
|
mr-102n)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:green:wlan"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2016-09-24 19:41:43 +00:00
|
|
|
mr200)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:white:lan" "eth0.1"
|
|
|
|
ucidef_set_led_netdev "wan" "wan" "$boardname:white:wan" "usb0"
|
|
|
|
set_wifi_led "$boardname:white:wlan"
|
2016-09-24 19:41:43 +00:00
|
|
|
;;
|
2018-11-29 23:13:53 +00:00
|
|
|
mtc,wr1201)
|
|
|
|
ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x0f"
|
|
|
|
;;
|
2016-04-29 11:34:56 +00:00
|
|
|
mzk-ex750np)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:red:wifi"
|
2016-04-29 11:34:56 +00:00
|
|
|
;;
|
2018-06-12 19:17:23 +00:00
|
|
|
netgear,r6120)
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f"
|
2019-02-01 23:34:43 +00:00
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
|
2018-06-12 19:17:23 +00:00
|
|
|
ucidef_set_led_wlan "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g" "phy0tpt"
|
|
|
|
;;
|
2015-08-17 06:24:34 +00:00
|
|
|
oy-0001)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:green:wifi"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2018-12-27 05:39:16 +00:00
|
|
|
gehua,ghl-r-001|\
|
2015-08-17 06:24:34 +00:00
|
|
|
pbr-m1)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
ramips: add support for newifi d2
Previously Newifi D2 could only use PandoraBox M1's firmware.
It works fine, but LED GPIO is different.
As a result, a separated DTS file for this device should be implemented.
Hardware spec:
* CPU: MTK MT7621A
* RAM: 512MB
* ROM: 32MB SPI Flash
* WiFi: MTK MT7603+MT7612
* Button: 2 buttons (reset, wps)
* LED: 3 single-color LEDs (USB, WiFi 2.4GHz, WiFi 5GHz) &
2 dual-color LEDs (Power, Internet)
* Ethernet: 5 ports, 4 LAN + 1 WAN
Installation method:
Same as Newifi D1, users may need to request unlock code from the device
manufacturer. Otherwise, a SPI flash programmer may be necessary to get
the firmware flashed. After the device is unlocked, press and hold reset
button before power cable plugs in. Then go to http://192.168.1.1 to
upload and flash the firmware package.
Signed-off-by: Jackson Ming Hu <huming2207@gmail.com>
2017-12-15 03:51:33 +00:00
|
|
|
d-team,newifi-d2)
|
|
|
|
ucidef_set_led_switch "internet" "internet" "$boardname:amber:internet" "switch0" "0x10"
|
|
|
|
ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:blue:wlan2g" "wlan0"
|
|
|
|
ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:blue:wlan5g" "wlan1"
|
|
|
|
;;
|
2016-02-15 18:45:22 +00:00
|
|
|
psg1208)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:white:wlan2g"
|
2016-02-15 18:45:22 +00:00
|
|
|
;;
|
2017-04-07 22:34:48 +00:00
|
|
|
px-4885-4M|\
|
|
|
|
px-4885-8M)
|
|
|
|
set_wifi_led "px-4885:orange:wifi"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2018-08-24 01:36:13 +00:00
|
|
|
r6220|\
|
|
|
|
netgear,r6350)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" eth0.2
|
|
|
|
set_wifi_led "$boardname:green:wifi"
|
2017-03-11 07:44:33 +00:00
|
|
|
;;
|
2017-07-23 19:06:44 +00:00
|
|
|
re350-v1)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$boardname:blue:wifi2G" "wlan0"
|
|
|
|
ucidef_set_led_netdev "wifi5g" "Wifi 5G" "$boardname:blue:wifi5G" "wlan1"
|
|
|
|
ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "eth0" "tx rx"
|
|
|
|
ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x01"
|
2017-07-23 19:06:44 +00:00
|
|
|
;;
|
2015-08-17 06:24:34 +00:00
|
|
|
rp-n53)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "eth" "Network" "$boardname:white:back" "eth0"
|
|
|
|
set_wifi_led "$boardname:blue:wifi"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2017-05-05 15:54:26 +00:00
|
|
|
rt-ac51u)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:blue:wifi"
|
2017-05-05 15:54:26 +00:00
|
|
|
;;
|
2017-12-06 14:43:55 +00:00
|
|
|
rt-n12p)
|
2018-08-29 06:59:46 +00:00
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" eth0.1
|
|
|
|
ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" eth0.2
|
|
|
|
set_wifi_led "$boardname:green:air"
|
2017-12-06 14:43:55 +00:00
|
|
|
;;
|
2015-08-17 06:24:34 +00:00
|
|
|
rt-n14u)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:blue:lan" eth0.1
|
|
|
|
ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" eth0.2
|
|
|
|
set_wifi_led "$boardname:blue:air"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2018-02-19 05:35:42 +00:00
|
|
|
tama,w06)
|
|
|
|
ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
|
|
|
|
ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
|
|
|
|
;;
|
2016-08-03 17:58:01 +00:00
|
|
|
tew-714tru)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:green:wifi"
|
2016-08-03 17:58:01 +00:00
|
|
|
;;
|
2015-11-02 10:17:51 +00:00
|
|
|
tiny-ac)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:orange:wifi"
|
2015-11-02 10:17:51 +00:00
|
|
|
;;
|
ramips: add support for TP-Link TL-WR840N v4 and TL-WR841N v13
TP-Link TL-WR840N v4 and TL-WR841N v13 are simple N300 routers with
5-port FE switch and non-detachable antennas. Both are very similar
and are based on MediaTek MT7628NN (aka MT7628N) WiSoC.
The difference between these two models is in number of available
LEDs, buttons and power input switch.
This work is partially based on GitHub PR#974.
Specification:
- MT7628N/N (580 MHz)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH
- 2T2R 2.4 GHz
- 5x 10/100 Mbps Ethernet
- 2x external, non-detachable antennas
- UART (J1) header on PCB (115200 8n1)
- TL-WR840N v4: 5x LED (GPIO-controlled), 1x button
- TL-WR841N v13: 8x LED (GPIO-controlled*), 2x button, power input
switch
* WAN LED in TL-WR841N v13 is a dual-color, dual-leads type which isn't
(fully) supported by gpio-leds driver. This type of LED requires both
GPIOs state change at the same time to select color or turn it off.
For now, we support/use only the green part of the LED.
Factory image notes:
These devices use version 3 of TP-Link header, fortunately without RSA
signature (at least in case of devices sold in Europe). The difference
lays in the requirement for a non-zero value in "Additional Hardware
Version" field. Ideally, it should match the value stored in vendor
firmware header on device ("0x4"/"0x13" for these devices) but it seems
that anything other than "0" is correct.
We are able to prepare factory firwmare file which is accepted and
(almost) correctly flashed from the vendor GUI. As it turned out, it
accepts files without U-Boot image with second header at the beginning
but due to some kind of bug in upgrade routine, flashed image gets
corrupted before it's written to flash.
Tests showed that the GUI upgrade routine copies value of "Additional
Hardware Version" from existing firmware into offset "0x2023c" in
provided file, _before_ storing it in flash. In case of vendor firmware
upgrade files (which all include U-Boot image and two headers), this
offset points to the matching field in kernel+rootfs firmware part
header. Unfortunately, in case of LEDE factory image file which contains
only one header, it points to the offset "0x2023c" in kernel image. This
leads to a corrupted kernel and ends up with a "soft-bricked" device.
The good news is that U-Boot in these devices contains well known tftp
recovery mode, which can be triggered with "reset" button. What's more,
in comparison to some of older MediaTek based TP-Link devices, this
recovery mode doesn't write whole file at offset "0x0" in flash, without
verifying provided file in advance. In case of recovery mode in these
devices, first "0x20000" bytes are always skipped and "0x7a0000" bytes
from rest of the file are stored in flash at offset "0x20000".
Flash instruction:
Until (if at all) TP-Link fixes described problem, the only way to flash
LEDE image in these devices is to use tftp recovery mode in U-Boot:
1. Configure PC with static IP 192.168.0.66/24 and tftp server.
2. Rename "lede-ramips-mt7628-tl-wr84...-squashfs-tftp-recovery.bin"
to "tp_recovery.bin" and place it in tftp server directory.
3. Connect PC with one of LAN ports, press the reset button, power up
the router and keep button pressed for around 6-7 seconds, until
device starts downloading the file.
4. Router will download file from server, write it to flash and reboot.
To access U-Boot CLI, keep pressed "4" key during boot.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2017-06-21 12:16:15 +00:00
|
|
|
tl-wr840n-v4)
|
2018-06-10 22:37:38 +00:00
|
|
|
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
|
ramips: add support for TP-Link TL-WR840N v4 and TL-WR841N v13
TP-Link TL-WR840N v4 and TL-WR841N v13 are simple N300 routers with
5-port FE switch and non-detachable antennas. Both are very similar
and are based on MediaTek MT7628NN (aka MT7628N) WiSoC.
The difference between these two models is in number of available
LEDs, buttons and power input switch.
This work is partially based on GitHub PR#974.
Specification:
- MT7628N/N (580 MHz)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH
- 2T2R 2.4 GHz
- 5x 10/100 Mbps Ethernet
- 2x external, non-detachable antennas
- UART (J1) header on PCB (115200 8n1)
- TL-WR840N v4: 5x LED (GPIO-controlled), 1x button
- TL-WR841N v13: 8x LED (GPIO-controlled*), 2x button, power input
switch
* WAN LED in TL-WR841N v13 is a dual-color, dual-leads type which isn't
(fully) supported by gpio-leds driver. This type of LED requires both
GPIOs state change at the same time to select color or turn it off.
For now, we support/use only the green part of the LED.
Factory image notes:
These devices use version 3 of TP-Link header, fortunately without RSA
signature (at least in case of devices sold in Europe). The difference
lays in the requirement for a non-zero value in "Additional Hardware
Version" field. Ideally, it should match the value stored in vendor
firmware header on device ("0x4"/"0x13" for these devices) but it seems
that anything other than "0" is correct.
We are able to prepare factory firwmare file which is accepted and
(almost) correctly flashed from the vendor GUI. As it turned out, it
accepts files without U-Boot image with second header at the beginning
but due to some kind of bug in upgrade routine, flashed image gets
corrupted before it's written to flash.
Tests showed that the GUI upgrade routine copies value of "Additional
Hardware Version" from existing firmware into offset "0x2023c" in
provided file, _before_ storing it in flash. In case of vendor firmware
upgrade files (which all include U-Boot image and two headers), this
offset points to the matching field in kernel+rootfs firmware part
header. Unfortunately, in case of LEDE factory image file which contains
only one header, it points to the offset "0x2023c" in kernel image. This
leads to a corrupted kernel and ends up with a "soft-bricked" device.
The good news is that U-Boot in these devices contains well known tftp
recovery mode, which can be triggered with "reset" button. What's more,
in comparison to some of older MediaTek based TP-Link devices, this
recovery mode doesn't write whole file at offset "0x0" in flash, without
verifying provided file in advance. In case of recovery mode in these
devices, first "0x20000" bytes are always skipped and "0x7a0000" bytes
from rest of the file are stored in flash at offset "0x20000".
Flash instruction:
Until (if at all) TP-Link fixes described problem, the only way to flash
LEDE image in these devices is to use tftp recovery mode in U-Boot:
1. Configure PC with static IP 192.168.0.66/24 and tftp server.
2. Rename "lede-ramips-mt7628-tl-wr84...-squashfs-tftp-recovery.bin"
to "tp_recovery.bin" and place it in tftp server directory.
3. Connect PC with one of LAN ports, press the reset button, power up
the router and keep button pressed for around 6-7 seconds, until
device starts downloading the file.
4. Router will download file from server, write it to flash and reboot.
To access U-Boot CLI, keep pressed "4" key during boot.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2017-06-21 12:16:15 +00:00
|
|
|
;;
|
|
|
|
tl-wr841n-v13)
|
2018-06-10 22:37:38 +00:00
|
|
|
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x2"
|
|
|
|
ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x4"
|
|
|
|
ucidef_set_led_switch "lan3" "lan3" "$boardname:green:lan3" "switch0" "0x8"
|
|
|
|
ucidef_set_led_switch "lan4" "lan4" "$boardname:green:lan4" "switch0" "0x10"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
|
ramips: add support for TP-Link TL-WR840N v4 and TL-WR841N v13
TP-Link TL-WR840N v4 and TL-WR841N v13 are simple N300 routers with
5-port FE switch and non-detachable antennas. Both are very similar
and are based on MediaTek MT7628NN (aka MT7628N) WiSoC.
The difference between these two models is in number of available
LEDs, buttons and power input switch.
This work is partially based on GitHub PR#974.
Specification:
- MT7628N/N (580 MHz)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH
- 2T2R 2.4 GHz
- 5x 10/100 Mbps Ethernet
- 2x external, non-detachable antennas
- UART (J1) header on PCB (115200 8n1)
- TL-WR840N v4: 5x LED (GPIO-controlled), 1x button
- TL-WR841N v13: 8x LED (GPIO-controlled*), 2x button, power input
switch
* WAN LED in TL-WR841N v13 is a dual-color, dual-leads type which isn't
(fully) supported by gpio-leds driver. This type of LED requires both
GPIOs state change at the same time to select color or turn it off.
For now, we support/use only the green part of the LED.
Factory image notes:
These devices use version 3 of TP-Link header, fortunately without RSA
signature (at least in case of devices sold in Europe). The difference
lays in the requirement for a non-zero value in "Additional Hardware
Version" field. Ideally, it should match the value stored in vendor
firmware header on device ("0x4"/"0x13" for these devices) but it seems
that anything other than "0" is correct.
We are able to prepare factory firwmare file which is accepted and
(almost) correctly flashed from the vendor GUI. As it turned out, it
accepts files without U-Boot image with second header at the beginning
but due to some kind of bug in upgrade routine, flashed image gets
corrupted before it's written to flash.
Tests showed that the GUI upgrade routine copies value of "Additional
Hardware Version" from existing firmware into offset "0x2023c" in
provided file, _before_ storing it in flash. In case of vendor firmware
upgrade files (which all include U-Boot image and two headers), this
offset points to the matching field in kernel+rootfs firmware part
header. Unfortunately, in case of LEDE factory image file which contains
only one header, it points to the offset "0x2023c" in kernel image. This
leads to a corrupted kernel and ends up with a "soft-bricked" device.
The good news is that U-Boot in these devices contains well known tftp
recovery mode, which can be triggered with "reset" button. What's more,
in comparison to some of older MediaTek based TP-Link devices, this
recovery mode doesn't write whole file at offset "0x0" in flash, without
verifying provided file in advance. In case of recovery mode in these
devices, first "0x20000" bytes are always skipped and "0x7a0000" bytes
from rest of the file are stored in flash at offset "0x20000".
Flash instruction:
Until (if at all) TP-Link fixes described problem, the only way to flash
LEDE image in these devices is to use tftp recovery mode in U-Boot:
1. Configure PC with static IP 192.168.0.66/24 and tftp server.
2. Rename "lede-ramips-mt7628-tl-wr84...-squashfs-tftp-recovery.bin"
to "tp_recovery.bin" and place it in tftp server directory.
3. Connect PC with one of LAN ports, press the reset button, power up
the router and keep button pressed for around 6-7 seconds, until
device starts downloading the file.
4. Router will download file from server, write it to flash and reboot.
To access U-Boot CLI, keep pressed "4" key during boot.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2017-06-21 12:16:15 +00:00
|
|
|
;;
|
2018-05-17 09:57:00 +00:00
|
|
|
tplink,c2-v1)
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch1" "0x1e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch1" "0x01"
|
|
|
|
set_wifi_led "$boardname:green:wlan"
|
|
|
|
;;
|
2018-01-13 07:16:20 +00:00
|
|
|
tplink,c20-v1)
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01"
|
|
|
|
ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:blue:wlan2g" "wlan0"
|
|
|
|
;;
|
2018-01-09 11:25:53 +00:00
|
|
|
tplink,c20-v4)
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
|
|
|
|
ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:green:wlan2g" "wlan0"
|
|
|
|
;;
|
ramips: add support for Archer C50 v4
This adds support for the TP-Link Archer C50 v4.
It uses the same hardware as the v3 variant, sharing the same FCC-ID.
CPU: MediaTek MT7628 (580MHz)
RAM: 64M DDR2
FLASH: 8M SPI
WiFi: 2.4GHz 2x2 MT7628 b/g/n integrated
WiFI: 5GHz 2x2 MT7612 a/n/ac
ETH: 1x WAN 4x LAN
LED: Power, WiFi2, WiFi5, LAN, WAN, WPS
BTN: WPS/WiFi, RESET
UART: Near ETH ports, 115200 8n1, TP-Link pinout
Create Factory image
--------------------
As all installation methods require a U-Boot to be integrated into the
Image (and we do not ship one with the image) we are not able to create
an image in the OpenWRT build-process.
Download a TP-Link image from their Wesite and a OpenWRT sysupgrade
image for the device and build yourself a factory image like following:
TP-Link image: tpl.bin
OpenWRT sysupgrade image: owrt.bin
> dd if=tpl.bin of=boot.bin bs=131584 count=1
> cat owrt.bin >> boot.bin
Installing via Web-UI
---------------------
Upload the boot.bin via TP-Links firmware upgrade tool in the
web-interface.
Installing via Recovery
-----------------------
Activate Web-Recovery by beginning the upgrade Process with a
Firmware-Image from TP-Link. After starting the Firmware Upgrade,
wait ~3 seconds (When update status is switching to 0%), then
disconnect the power supply from the device. Upgrade flag (which
activates Web-Recovery) is written before the OS-image is touched and
removed after write is succesfull, so this procedure should be safe.
Plug the power back in. It will come up in Recovery-Mode on 192.168.0.1.
When active, all LEDs but the WPS LED are off.
Remeber to assign yourself a static IP-address as DHCP is not active in
this mode.
The boot.bin can now be uploaded and flashed using the web-recovery.
Installing via TFTP
-------------------
Prepare an image like following (Filenames from factory image steps
apply here)
> dd if=/dev/zero of=tp_recovery.bin bs=196608 count=1
> dd if=tpl.bin of=tmp.bin bs=131584 count=1
> dd if=tmp.bin of=boot.bin bs=512 skip=1
> cat boot.bin >> tp_recovery.bin
> cat owrt.bin >> tp_recovery.bin
Place tp_recovery.bin in root directory of TFTP server and listen on
192.168.0.66/24.
Connect router LAN ports with your computer and power up the router
while pressing the reset button. The router will download the image via
tftp and after ~1 Minute reboot into OpenWRT.
U-Boot CLI
----------
U-Boot CLI can be activated by holding down '4' on bootup.
Dual U-Boot
-----------
This is the first TP-Link MediaTek device to feature a split-uboot
design. The first (factory-uboot) provides recovery via TFTP and HTTP,
jumping straight into the second (firmware-uboot) if no recovery needs
to be performed. The firmware-uboot unpacks and executed the kernel.
Web-Recovery
------------
TP-Link integrated a new Web-Recovery like the one on the Archer C7v4 /
TL-WR1043v5. Stock-firmware sets a flag in the "romfile" partition
before beginning to write and removes it afterwards. If the router boots
with this flag set, bootloader will automatically start Web-recovery and
listens on 192.168.0.1. This way, the vendor-firmware or an OpenWRT
factory image can be written.
By doing the same while performing sysupgrade, we can take advantage of
the Web-recovery in OpenWRT.
It is important to note that Web-Recovery is only based on this flag. It
can't detect e.g. a crashing kernel or other means. Once activated it
won't boot the OS before a recovery action (either via TFTP or HTTP) is
performed. This recovery-mode is indicated by an illuminated WPS-LED on
boot.
Signed-off-by: David Bauer <mail@david-bauer.net>
2018-12-31 15:24:26 +00:00
|
|
|
tplink,c50-v3|\
|
|
|
|
tplink,c50-v4)
|
2018-01-28 18:49:38 +00:00
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
|
2018-05-18 21:37:49 +00:00
|
|
|
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan2g" "phy0tpt"
|
|
|
|
ucidef_set_led_wlan "wlan5g" "wlan5g" "$boardname:green:wlan5g" "phy1tpt"
|
2018-01-28 18:49:38 +00:00
|
|
|
;;
|
2018-06-26 23:24:39 +00:00
|
|
|
tplink,tl-wa801nd-v5)
|
|
|
|
ucidef_set_led_wlan "wlan" "wlan" "$boardname:green:wlan" "phy0tpt"
|
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
|
|
|
|
;;
|
2018-08-26 19:11:59 +00:00
|
|
|
tplink,tl-mr3020-v3)
|
|
|
|
set_wifi_led "$boardname:green:wlan"
|
|
|
|
ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
|
|
|
|
;;
|
2018-05-30 15:41:53 +00:00
|
|
|
tplink,tl-mr3420-v5|\
|
|
|
|
tplink,tl-wr842n-v5)
|
2018-06-10 22:37:38 +00:00
|
|
|
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
|
2017-12-15 14:57:49 +00:00
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
|
|
|
|
;;
|
2018-03-17 17:47:51 +00:00
|
|
|
tplink,tl-wr902ac-v3)
|
2018-06-10 22:37:38 +00:00
|
|
|
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
|
2018-03-17 17:47:51 +00:00
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x10"
|
|
|
|
;;
|
2017-02-19 08:46:44 +00:00
|
|
|
u25awf-h1)
|
|
|
|
set_wifi_led "u25awf:red:wifi"
|
|
|
|
ucidef_set_led_netdev "eth" "eth" "u25awf:green:lan" "eth0"
|
|
|
|
;;
|
ramips: add support for UniElec U7628-01
UniElec U7628-01 is a router platform board based on MediaTek MT7628AN.
The device has the following specifications:
- MT7628AN (580MHz)
- 64/128/256 MB of RAM (DDR2)
- 8/16 MB of flash (SPI NOR)
- 5x 10/100 Mbps Ethernet (MT7628 built-in switch)
- 1x 2T2R 2.4 GHz Wi-Fi (MT7628)
- 1x miniPCIe slot (with PCIe and USB 2.0 buses)
- 1x miniSIM slot
- 1x microSD slot
- 1x USB 2.0 port
- 7x single-color LEDs (GPIO-controlled)
- 1x bi-color LED (green GPIO-controlled, red -> LED_WLAN# in miniPCIe)
- 1x reset button
- 1x UART header (4-pins)
- 1x SDXC/GPIO header (10-pins, connected with microSD slot)
- 1x DC jack for main power (12 V)
The following has been tested and is working:
- Ethernet switch
- miniPCIe slot (tested with modem and Wi-Fi card)
- miniSIM slot
- sysupgrade
- reset button
- USB 2.0 port*
Due to a missing driver (MMC over GPIO) this is not supported:
- microSD card reader
* Warning:
USB buses in miniPCIe and regular A-type socket are connected together,
without any proper analog switch or USB HUB.
Installation:
This board might come with a different firmware versions (MediaTek SDK,
PandoraBox, Padavan, etc.). If your board comes with PandoraBox, you can
install LEDE using sysupgrade. Just SSH to the router and perform forced
sysupgrade (due to a board name mismatch). The default IP of this board
should be: 192.168.1.1 and username/password: root/admin. In case of a
different firmware, you can use web based recovery described below.
Use the following command to perform the sysupgrade (for the 128MB
RAM/16MB flash version):
sysupgrade -n -F lede-ramips-mt76x8-u7628-01-128M-16M-squashfs-sysupgrade.bin
Recovery:
This board contains a Chinese, closed-source bootloader called Breed
(Boot and Recovery Environment for Embedded Devices). Breed supports web
recovery and to enter it, you keep the reset button pressed for around
5 seconds during boot. Your machine will be assigned an IP through DHCP
and the router will use IP address 192.168.1.1. The recovery website is
in Chinese, but is easy to use. Click on the second item in the list to
access the recovery page, then the second item on the next page is where
you select the firmware. In order to start the recovery, you click the
button at the bottom.
SDXC/GPIO header (J3):
1. SDXC_D3 / I2C_SCLK
2. SDXC_D2 / I2C_SD
3. SDXC_D1 / I2S_DI
4. SDXC_D0 / I2S_WS
5. SDXC_CMD / I2S_CLK
6. SDXC_CLK / GPIO0
7. SDXC_CD / UART_RXD1
8. UART_TXD1
9. 3V3
10. GND
Other notes:
1. The board is available with different amounts of RAM and flash. We
have only added support for the 128/16 MB configuration, as that seems
to be the default. However, all the required infrastructure is in place
for making support for the other configurations easy.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
2017-11-03 20:12:49 +00:00
|
|
|
u7628-01-128M-16M)
|
|
|
|
ucidef_set_led_switch "lan1" "lan1" "u7628-01:green:lan1" "switch0" "0x2"
|
|
|
|
ucidef_set_led_switch "lan2" "lan2" "u7628-01:green:lan2" "switch0" "0x4"
|
|
|
|
ucidef_set_led_switch "lan3" "lan3" "u7628-01:green:lan3" "switch0" "0x8"
|
|
|
|
ucidef_set_led_switch "lan4" "lan4" "u7628-01:green:lan4" "switch0" "0x10"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "u7628-01:green:wan" "switch0" "0x01"
|
|
|
|
set_wifi_led "u7628-01:green:wlan"
|
|
|
|
;;
|
2017-04-07 22:34:48 +00:00
|
|
|
vocore-8M|\
|
|
|
|
vocore-16M)
|
|
|
|
ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0"
|
2017-08-03 20:09:06 +00:00
|
|
|
;;
|
2015-08-17 06:24:34 +00:00
|
|
|
w502u)
|
|
|
|
set_wifi_led "rt2800pci-phy0::radio"
|
|
|
|
;;
|
2018-10-22 15:21:16 +00:00
|
|
|
wavlink,wl-wn570ha1)
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
|
|
|
|
ucidef_set_rssimon "wlan0" "200000" "1"
|
|
|
|
ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan0" "1" "49"
|
|
|
|
ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan0" "50" "84"
|
|
|
|
ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan0" "85" "100"
|
|
|
|
set_wifi_led "$boardname:green:wifi"
|
|
|
|
;;
|
2019-02-17 12:21:42 +00:00
|
|
|
wavlink,wl-wn575a3)
|
2016-11-02 15:10:44 +00:00
|
|
|
ucidef_set_rssimon "wlan1" "200000" "1"
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan1" "1" "49"
|
|
|
|
ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan1" "50" "84"
|
|
|
|
ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan1" "85" "100"
|
2016-11-06 12:00:38 +00:00
|
|
|
;;
|
2019-02-17 12:21:42 +00:00
|
|
|
we1026-5g-16m)
|
|
|
|
ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0"
|
|
|
|
set_wifi_led "we1026-5g:green:wifi"
|
|
|
|
;;
|
2016-04-21 19:46:59 +00:00
|
|
|
wrh-300cr)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:green:wlan"
|
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0"
|
2016-04-21 19:46:59 +00:00
|
|
|
;;
|
2018-12-08 18:55:56 +00:00
|
|
|
xzwifi,creativebox-v1)
|
|
|
|
ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10"
|
|
|
|
;;
|
2016-12-02 01:33:23 +00:00
|
|
|
y1)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "wifi" "WIFI" "$boardname:blue:wifi" "wlan1"
|
|
|
|
ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi5g" "wlan0"
|
2017-12-29 04:35:32 +00:00
|
|
|
ucidef_set_led_switch "lan" "LAN" "$boardname:blue:lan" "switch0" "0x03"
|
2016-12-02 01:33:23 +00:00
|
|
|
;;
|
2015-08-17 06:24:34 +00:00
|
|
|
y1s)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "wifi" "WIFI" "$boardname:yellow:wifi" "wlan1"
|
|
|
|
ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi" "wlan0"
|
|
|
|
ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:internet" "eth0.2" "tx rx"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2018-03-29 10:33:02 +00:00
|
|
|
youhua,wr1200js)
|
|
|
|
ucidef_set_led_switch "internet" "INTERNET" "$boardname:green:wan" "switch0" "0x01"
|
|
|
|
;;
|
2016-06-23 08:58:08 +00:00
|
|
|
zbt-ape522ii)
|
2017-11-16 21:17:42 +00:00
|
|
|
ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$boardname:green:wlan2g4" "wlan1"
|
|
|
|
ucidef_set_led_netdev "sys1" "wlan1" "$boardname:green:sys1" "wlan1" "tx rx"
|
|
|
|
ucidef_set_led_netdev "sys2" "wlan0" "$boardname:green:sys2" "wlan0" "tx rx"
|
2016-06-23 08:58:08 +00:00
|
|
|
;;
|
2015-08-17 06:24:34 +00:00
|
|
|
zbt-wa05)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:blue:air"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2017-03-15 08:37:05 +00:00
|
|
|
zbt-we2026)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:green:wlan"
|
2017-03-15 08:37:05 +00:00
|
|
|
;;
|
2017-04-12 05:53:56 +00:00
|
|
|
zbt-we826-16M|\
|
|
|
|
zbt-we826-32M)
|
|
|
|
set_wifi_led "zbt-we826:green:wifi"
|
2016-03-01 09:17:06 +00:00
|
|
|
;;
|
2018-01-24 00:27:51 +00:00
|
|
|
zbtlink,zbt-we1226)
|
2018-01-23 01:46:36 +00:00
|
|
|
set_wifi_led "$boardname:green:wlan"
|
|
|
|
ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x01"
|
|
|
|
ucidef_set_led_switch "lan2" "LAN2" "$boardname:green:lan2" "switch0" "0x02"
|
|
|
|
ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x10"
|
|
|
|
;;
|
2015-08-17 06:24:34 +00:00
|
|
|
zbt-wr8305rt)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:green:wifi"
|
2015-08-17 06:24:34 +00:00
|
|
|
;;
|
2018-04-03 23:19:22 +00:00
|
|
|
zorlik,zl5900v2)
|
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" eth0
|
|
|
|
;;
|
2018-04-08 14:04:11 +00:00
|
|
|
zyxel,keenetic-extra-ii)
|
|
|
|
set_wifi_led "$boardname:green:wifi"
|
|
|
|
ucidef_set_led_switch "internet" "internet" "$boardname:green:internet" "switch0" "0x01"
|
|
|
|
;;
|
2015-11-24 18:29:02 +00:00
|
|
|
youku-yk1)
|
2017-11-16 21:17:42 +00:00
|
|
|
set_wifi_led "$boardname:blue:air"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10"
|
2015-11-24 18:29:02 +00:00
|
|
|
;;
|
2011-10-24 21:49:31 +00:00
|
|
|
esac
|
2012-05-29 16:39:18 +00:00
|
|
|
|
2014-08-18 13:09:20 +00:00
|
|
|
board_config_flush
|
2012-05-29 16:39:18 +00:00
|
|
|
|
|
|
|
exit 0
|