2019-10-22 10:37:13 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. /lib/functions/leds.sh
|
|
|
|
. /lib/functions/uci-defaults.sh
|
|
|
|
|
|
|
|
set_wifi_led() {
|
|
|
|
ucidef_set_led_netdev "wifi_led" "wifi" "${1}" "${2:-wlan0}"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
board=$(board_name)
|
|
|
|
boardname="${board##*,}"
|
|
|
|
|
|
|
|
board_config_update
|
|
|
|
|
|
|
|
led_wlan="$(get_dt_led wlan)"
|
|
|
|
[ -n "$led_wlan" ] && ucidef_set_led_wlan "wifi_led" "wifi" "$led_wlan" "phy0tpt"
|
|
|
|
|
|
|
|
case $board in
|
|
|
|
d-team,newifi-d2)
|
2020-03-18 15:38:58 +00:00
|
|
|
ucidef_set_led_netdev "internet" "internet" "$boardname:amber:internet" "wan"
|
2019-10-22 10:37:13 +00:00
|
|
|
ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:blue:wlan2g" "wlan0"
|
|
|
|
ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:blue:wlan5g" "wlan1"
|
|
|
|
;;
|
|
|
|
d-team,pbr-m1|\
|
|
|
|
gehua,ghl-r-001)
|
2020-03-18 15:38:58 +00:00
|
|
|
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan"
|
2019-10-22 10:37:13 +00:00
|
|
|
;;
|
2020-07-10 03:49:20 +00:00
|
|
|
dlink,dir-860l-b1|\
|
|
|
|
dlink,dir-878-a1)
|
2020-03-18 15:38:58 +00:00
|
|
|
ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "wan"
|
2019-10-22 10:37:13 +00:00
|
|
|
;;
|
|
|
|
gnubee,gb-pc1|\
|
|
|
|
gnubee,gb-pc2)
|
2020-03-18 15:38:58 +00:00
|
|
|
ucidef_set_led_netdev "lan1" "lan1" "$boardname:green:lan1" "lan1"
|
|
|
|
ucidef_set_led_netdev "lan2" "lan2" "$boardname:green:lan2" "lan2"
|
2019-10-22 10:37:13 +00:00
|
|
|
;;
|
ramips: add support for Linksys EA7500 v2
The Linksys EA7500 v2 is advertised as AC1900, but its internal
hardware is AC2600 capable.
Hardware
--------
SoC: Mediatek MT7621AT (880 MHz, 2 cores 4 threads)
RAM: 256M (Nanya NT5CC128M16IP-DI)
FLASH: 128MB NAND (Macronix MX30LF1G18AC-TI)
ETH: 5x 10/100/1000 Mbps Ethernet (MT7530)
WIFI:
- 2.4GHz: 1x MT7615N (4x4:4)
- 5GHz: 1x MT7615N (4x4:4)
- 4 antennas: 3 external detachable antennas and 1 internal
USB:
- 1x USB 3.0
- 1x USB 2.0
BTN:
- 1x Reset button
- 1x WPS button
LEDS:
- 1x White led (Power)
- 6x Green leds (link lan1-lan4, link wan, wps)
- 5x Orange leds (act lan1-lan4, act wan) (working but unmodifiable)
Everything works correctly.
Installation
------------
The “factory” openwrt image can be flashed directly from OEM stock
firmware. After the flash the router will reboot automatically.
However, due to the dual boot system, the first installation could fail
(if you want to know why, read the footnotes).
If the flash succeed and you can reach OpenWrt through the web
interface or ssh, you are done.
Otherwise the router will try to boot 3 times and then will
automatically boot the OEM firmware (don’t turn off the router.
Simply wait and try to reach the router through the web interface
every now and then, it will take few minutes).
After this, you should be back in the OEM firmware.
Now you have to flash the OEM Firmware over itself using the OEM web
interface (I tested it using the FW_EA7500v2_2.0.8.194281_prod.img
downloaded from the Linksys website).
When the router reboots flash the “factory” OpenWrt image and this
time it should work.
After the OpenWrt installation you have to use the sysupgrade image
for future updates.
Restore OEM Firmware
--------------------
After the OpenWrt flash, the OEM firmware is still stored in the
second partition thanks to the dual boot system.
You can switch from OpenWrt to OEM firmware and vice-versa failing
the boot 3 times in a row:
1) power on the router
2) wait 15 seconds
3) power off the router
4) repeat steps 1-2-3 twice more.
5) power on the router and you should be in the “other” firmware
If you want to completely remove OpenWrt from your router, switch to
the OEM firmware and then flash OEM firmware from the web interface
as a normal update.
This procedure will overwrite the OpenWrt partition.
Footnotes
---------
The Linksys EA7500-v2 has a dual boot system to avoid bricks.
This system works using 2 pair of partitions:
1) "kernel" and "rootfs"
2) "alt_kernel" and "alt_rootfs".
After 3 failed boot attempts, the bootloader tries to boot the other
pair of partitions and so on.
This system is managed by the bootloader, which writes a bootcount in
the s_env partition, and if successfully booted, the system add a
"zero-bootcount" after the previous value.
A system update performed from OEM firmware, writes the firmware on the
other pair of partitions and sets the bootloader to boot the new pair
of partitions editing the “boot_part” variable in the bootloader vars.
Effectively it's a quick and safe system to switch the selected boot
partition.
Another way to switch the boot partition is:
1) power on the router
2) wait 15 seconds
3) power off the router
4) repeat steps 1-2-3 twice more.
5) power on the router and you should be in the “other” firmware
In this OpenWrt port, this dual boot system is partially working
because the bootloader sets the right rootfs partition in the cmdline
but unfortunately OpenWrt for ramips platform overwrites the cmdline
so is not possible to detect the right rootfs partition.
Because all of this, I preferred to simply use the first pair of
partitions and set read-only the other pair.
However this solution is not optimal because is not possible to know
without opening the case which is the current booted partition.
Let’s take for example a router booting the OEM firmware from the first
pair of partitions. If we flash the OpenWrt image, it will be written
on the second pair. In this situation the router will bootloop 3 times
and then will automatically come back to the first pair of partitions
containg the OEM firmware.
In this situation, to flash OpenWrt correctly is necessary to switch
the booting partition, flashing again the OEM firmware over itself.
At this point the OEM firmware is on both pair of partitions but the
current booted pair is the second one.
Now, flashing the OpenWrt factory image will write the firmware on
the first pair and then will boot correctly.
If this limitation in the ramips platform about the cmdline will be
fixed, the dual boot system can also be implemented in OpenWrt with
almost no effort.
Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
Co-Developed-by: Jackson Lim <jackcolentern@gmail.com>
Signed-off-by: Jackson Lim <jackcolentern@gmail.com>
2020-05-11 23:27:50 +00:00
|
|
|
linksys,ea7500-v2)
|
|
|
|
ucidef_set_led_netdev "lan1" "lan1 link" "$boardname:green:lan1" "lan1" "link"
|
|
|
|
ucidef_set_led_netdev "lan2" "lan2 link" "$boardname:green:lan2" "lan2" "link"
|
|
|
|
ucidef_set_led_netdev "lan3" "lan3 link" "$boardname:green:lan3" "lan3" "link"
|
|
|
|
ucidef_set_led_netdev "lan4" "lan4 link" "$boardname:green:lan4" "lan4" "link"
|
|
|
|
ucidef_set_led_netdev "wan" "wan link" "$boardname:green:wan" "wan" "link"
|
|
|
|
;;
|
2020-04-07 08:34:33 +00:00
|
|
|
mikrotik,routerboard-m11g)
|
2019-10-22 10:37:13 +00:00
|
|
|
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"
|
|
|
|
;;
|
|
|
|
mtc,wr1201)
|
2020-03-18 15:38:58 +00:00
|
|
|
ucidef_set_led_netdev "eth_link" "LAN link" "$boardname:green:eth_link" "br-lan"
|
2019-10-22 10:37:13 +00:00
|
|
|
;;
|
|
|
|
netgear,r6220|\
|
|
|
|
netgear,r6260|\
|
|
|
|
netgear,r6350|\
|
|
|
|
netgear,r6850|\
|
2020-06-26 21:46:19 +00:00
|
|
|
netgear,wac124|\
|
2019-10-22 10:37:13 +00:00
|
|
|
netgear,wndr3700-v5)
|
2020-03-18 15:38:58 +00:00
|
|
|
ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" "wan"
|
2019-10-22 10:37:13 +00:00
|
|
|
;;
|
ramips: add support for NETGEAR R6700v2/AC2400
SoC: MediaTek MT7621AT
RAM: 256M DDR3
FLASH: 128M NAND
WiFi: MediaTek MT7615N an+ac
MediaTek MT7615N bgn
ETH: MediaTek MT7621AT
BTN: 1x Connect (WPS), 1x WLAN, 1x Reset
LED: Power (white/amber), WAN(white/amber), 2.4G(white), 5G(white),
USB(white) , GuestWifi(white) 4x LAN(white/amber), Wifi Button(white),
WPS Button(white)
Installation:
Login to netgear webinterface and flash factory.img
Based on a discontinued GitHub Pull Request by
kuyokushin <codenamezero@protonmail.com>
https://github.com/openwrt/openwrt/pull/2545
NOTE: Netgear R6700 v2 have five clones: R6900 v2, R7450, Nighthawk
AC2400, Nighthawk AC2100 and already added R6800. Rest of them should
be really easy supportable. Image for R6700v2 should work perfectly with
them. Please refer:
https://github.com/openwrt/openwrt/pull/2614
Tested-by: Víctor Gibrán <victorgibranmz@hotmail.com> [R6700v2]
Tested-by: John Landrum <jl31m10@yahoo.com> [AC2400]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[add guest led to mt7621_netgear_r6700-v2.dts end edit commit message]
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2019-12-27 18:05:06 +00:00
|
|
|
netgear,r6700-v2|\
|
2019-12-11 20:54:24 +00:00
|
|
|
netgear,r6800)
|
2020-03-18 15:38:58 +00:00
|
|
|
ucidef_set_led_netdev "wan" "WAN" "$boardname:white:wan" "wan"
|
|
|
|
ucidef_set_led_netdev "lan1" "LAN1" "$boardname:white:lan1" "lan1"
|
|
|
|
ucidef_set_led_netdev "lan2" "LAN2" "$boardname:white:lan2" "lan2"
|
|
|
|
ucidef_set_led_netdev "lan3" "LAN3" "$boardname:white:lan3" "lan3"
|
|
|
|
ucidef_set_led_netdev "lan4" "LAN4" "$boardname:white:lan4" "lan4"
|
2019-12-11 20:54:24 +00:00
|
|
|
;;
|
2020-07-07 09:49:36 +00:00
|
|
|
tplink,re350-v1)
|
2019-10-22 10:37:13 +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"
|
2020-03-18 15:38:58 +00:00
|
|
|
ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "lan" "tx rx"
|
|
|
|
ucidef_set_led_netdev "eth_link" "LAN link" "$boardname:green:eth_link" "lan" "link"
|
2019-10-22 10:37:13 +00:00
|
|
|
;;
|
2020-07-07 09:49:36 +00:00
|
|
|
tplink,re500-v1|\
|
|
|
|
tplink,re650-v1)
|
ramips: add support for TP-Link RE500 v1
This device uses the same hardware as RE650 v1 which got supported in
8c51dde.
Hardware specification:
- SoC 880 MHz - MediaTek MT7621AT
- 128 MB of DDR3 RAM
- 16 MB - Winbond 25Q128FVSG
- 4T4R 2.4 GHz - MediaTek MT7615E
- 4T4R 5 GHz - MediaTek MT7615E
- 1x 1 Gbps Ethernet - MT7621AT integrated
- 7x LEDs (Power, 2G, 5G, WPS(x2), Lan(x2))
- 4x buttons (Reset, Power, WPS, LED)
- UART header (J1) - 2:GND, 3:RX, 4:TX
Serial console @ 57600,8n1
Flash instructions:
Upload
openwrt-ramips-mt7621-tplink_re500-v1-squashfs-factory.bin
from the RE500 web interface.
TFTP recovery to stock firmware:
Unfortunately, I can't find an easy way to recover the RE
without opening the device and using modified binaries. The
TFTP upload will only work if selected from u-boot, which
means you have to open the device and attach to the serial
console. The TFTP update procedure does *not* accept the
published vendor firmware binaries. However, it allows to
flash kernel + rootfs binaries, and this works if you have
a backup of the original contents of the flash. It's probably
possible to create special image out of the vendor binaries
and use that as recovery image.
Signed-off-by: Christoph Krapp <achterin@googlemail.com>
[remove dts-v1 in DTSI, do not touch WiFi LEDs for RE650, keep
state_default in DTS files, fix label-mac-device, use lower case
for WiFi LEDs]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-06 21:05:25 +00:00
|
|
|
ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "lan" "tx rx"
|
|
|
|
ucidef_set_led_netdev "eth_link" "LAN link" "$boardname:green:eth_link" "lan" "link"
|
|
|
|
;;
|
2019-10-22 10:37:13 +00:00
|
|
|
xzwifi,creativebox-v1)
|
2020-03-18 15:38:58 +00:00
|
|
|
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan"
|
2019-10-22 10:37:13 +00:00
|
|
|
;;
|
2020-05-30 09:18:50 +00:00
|
|
|
xiaomi,mi-router-ac2100)
|
|
|
|
ucidef_set_led_netdev "wan-blue" "WAN (blue)" "$boardname:blue:wan" "wan"
|
|
|
|
;;
|
2020-04-23 02:50:21 +00:00
|
|
|
xiaomi,redmi-router-ac2100)
|
|
|
|
ucidef_set_led_netdev "wan" "wan" "$boardname:white:wan" "wan"
|
|
|
|
;;
|
2019-10-22 10:37:13 +00:00
|
|
|
youhua,wr1200js)
|
2020-03-18 15:38:58 +00:00
|
|
|
ucidef_set_led_netdev "internet" "INTERNET" "$boardname:green:wan" "wan"
|
2019-10-22 10:37:13 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
board_config_flush
|
|
|
|
|
|
|
|
exit 0
|