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
|
|
|
|
aigale,ai-br100)
|
|
|
|
ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" "eth0.2"
|
|
|
|
set_wifi_led "$boardname:blue:wlan"
|
|
|
|
;;
|
|
|
|
alfa-network,ac1200rm)
|
|
|
|
set_wifi_led "$boardname:green:wlan2g" "wlan1"
|
|
|
|
;;
|
ramips: add support for ALFA Network R36M-E4G
ALFA Network R36M-E4G is a dual-SIM, N300 Wi-Fi, compact size platform
based on MediaTek MT7620A WiSoC. This product is designed for operation
with 4G modem (can be bought in bundle with Quectel EC25, EG25 or EP06)
but supports also Wi-Fi modules (miniPCIe slot has USB and PCIe buses).
Specification:
- MT7620A (580 MHz)
- 64/128/256 MB of RAM (DDR2)
- 16/32+ MB of FLASH (SPI NOR)
- 2x 10/100 Mbps Ethernet, with passive PoE support (24 V)
- 2T2R 2.4 GHz (MT7620A), with ext. LNA (RFFM4227)
- 1x miniPCIe slot (with PCIe and USB 2.0 buses and optional 5 V)
- 2x SIM slot (mini, micro) with detect and switch driven by GPIO
- 2x u.fl antenna connectors (for Wi-Fi)
- 8x LED (7 driven by GPIO)
- 2x button (reset, wifi)
- 2x UART (4-pin/2.54 mm pitch, 10-pin/1.27 mm pitch) headers on PCB
- 1x I2C (4-pin, 1.27 mm pitch) header on PCB
- 1x LED (8-pin, 1.27 mm pitch) header on PCB
- 1x DC jack with lock (12 V)
Other:
- there is a dedicated, 4-pin connector for optional RTC module (Holtek
HT138x) with 'enable' input, not available at the time of preparing
support for this board
- miniPCIe slot supports additional 5 V supply on pins 47 and 49 but a
jumper resistor (R174) is not installed by default
- U-Boot selects default SIM slot, based on value of 'default_sim' env
variable: '1' or unset -> SIM1 (mini), '2' -> SIM2 (micro). This will
work only if both slots are occupied, otherwise U-Boot will always
select slot with SIM card inside (user can override it later, in
user-space)
- U-Boot resets the modem, using PERSTn signal, before starting kernel
- this board supports 'dual image' feature (controlled by 'dual_image'
U-Boot environment variable)
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 modem 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-10-29 23:10:40 +00:00
|
|
|
alfa-network,r36m-e4g)
|
|
|
|
ucidef_set_led_netdev "4g" "4g" "$boardname:orange:4g" "wwan0"
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x8"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
|
|
|
|
;;
|
2019-10-22 10:37:13 +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"
|
|
|
|
;;
|
|
|
|
asus,rp-n53)
|
|
|
|
ucidef_set_led_netdev "eth" "Network" "$boardname:white:back" "eth0"
|
|
|
|
set_wifi_led "$boardname:blue:wifi"
|
|
|
|
;;
|
|
|
|
asus,rt-n12p)
|
|
|
|
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"
|
|
|
|
;;
|
|
|
|
asus,rt-n14u)
|
|
|
|
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"
|
|
|
|
;;
|
|
|
|
bdcom,wap2100-sk)
|
|
|
|
set_wifi_led "$boardname:green:wlan2g"
|
|
|
|
;;
|
|
|
|
comfast,cf-wr800n)
|
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:white:ethernet" eth0.1
|
|
|
|
set_wifi_led "$boardname:white:wifi"
|
|
|
|
;;
|
2020-06-09 09:52:26 +00:00
|
|
|
dlink,dir-810l|\
|
|
|
|
trendnet,tew-810dr)
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
|
|
|
|
;;
|
2019-10-22 10:37:13 +00:00
|
|
|
dlink,dwr-116-a1|\
|
|
|
|
head-weblink,hdrm200|\
|
|
|
|
ohyeah,oy-0001|\
|
|
|
|
planex,mzk-ex300np|\
|
|
|
|
zbtlink,zbt-wr8305rt|\
|
|
|
|
zyxel,keenetic-omni|\
|
|
|
|
zyxel,keenetic-omni-ii|\
|
|
|
|
zyxel,keenetic-viva)
|
|
|
|
set_wifi_led "$boardname:green:wifi"
|
|
|
|
;;
|
|
|
|
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"
|
|
|
|
;;
|
|
|
|
dlink,dwr-118-a2)
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
|
|
|
|
set_wifi_led "$boardname:green:wlan2g" "wlan1"
|
|
|
|
;;
|
|
|
|
dlink,dwr-921-c1|\
|
|
|
|
dlink,dwr-922-e2)
|
|
|
|
set_wifi_led "$boardname:green:wifi"
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f"
|
|
|
|
ucidef_set_led_netdev "signalstrength" "signalstrength" "$boardname:green:sigstrength" "wwan0" "link"
|
|
|
|
ucidef_set_led_netdev "4g" "4g" "$boardname:green:4g" "wwan0" "tx rx"
|
|
|
|
;;
|
2018-04-19 07:20:58 +00:00
|
|
|
dlink,dwr-960)
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x2e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
|
2020-04-10 06:56:37 +00:00
|
|
|
;;
|
2019-10-22 10:37:13 +00:00
|
|
|
dovado,tiny-ac)
|
|
|
|
set_wifi_led "$boardname:orange:wifi"
|
|
|
|
;;
|
|
|
|
edimax,br-6478ac-v2|\
|
|
|
|
edimax,ew-7478apc)
|
|
|
|
set_wifi_led "$boardname:blue:wlan"
|
|
|
|
;;
|
|
|
|
edimax,ew-7476rpc|\
|
|
|
|
edimax,ew-7478ac)
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x20"
|
|
|
|
;;
|
|
|
|
elecom,wrh-300cr)
|
|
|
|
set_wifi_led "$boardname:green:wlan"
|
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0"
|
|
|
|
;;
|
|
|
|
engenius,esr600)
|
|
|
|
ucidef_set_led_netdev "wlan5g" "5.0GHz" "$boardname:blue:wlan5g" "wlan0"
|
|
|
|
ucidef_set_led_netdev "wlan2g" "2.4GHz" "$boardname:blue:wlan2g" "wlan1"
|
|
|
|
;;
|
|
|
|
glinet,gl-mt300a|\
|
|
|
|
glinet,gl-mt300n|\
|
|
|
|
glinet,gl-mt750)
|
|
|
|
set_wifi_led "$boardname:wlan"
|
|
|
|
;;
|
2019-12-31 14:35:41 +00:00
|
|
|
hiwifi,hc5661|\
|
2019-10-22 10:37:13 +00:00
|
|
|
hiwifi,hc5761)
|
|
|
|
ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x01"
|
|
|
|
;;
|
|
|
|
hiwifi,hc5861)
|
|
|
|
ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x20"
|
|
|
|
;;
|
|
|
|
hnet,c108)
|
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
|
|
|
|
ucidef_set_led_netdev "modem" "modem" "$boardname:green:modem" "wwan0"
|
|
|
|
;;
|
|
|
|
iodata,wn-ac1167gr|\
|
|
|
|
iodata,wn-ac733gr3)
|
|
|
|
ucidef_set_led_wlan "wlan5g" "WLAN5G" "$boardname:green:wlan5g" "phy0radio"
|
|
|
|
ucidef_set_led_wlan "wlan2g" "WLAN2G" "$boardname:green:wlan2g" "phy1radio"
|
|
|
|
;;
|
|
|
|
kimax,u25awf-h1)
|
|
|
|
set_wifi_led "u25awf:red:wifi"
|
|
|
|
ucidef_set_led_netdev "eth" "eth" "u25awf:green:lan" "eth0"
|
|
|
|
;;
|
|
|
|
kimax,u35wf)
|
|
|
|
set_wifi_led "$boardname:blue:wifi"
|
|
|
|
ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0"
|
|
|
|
;;
|
2020-05-14 13:16:57 +00:00
|
|
|
kingston,mlw221|\
|
|
|
|
kingston,mlwg2|\
|
|
|
|
sanlinking,d240)
|
|
|
|
set_wifi_led "$boardname:blue:wifi"
|
|
|
|
;;
|
2019-10-22 10:37:13 +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"
|
|
|
|
;;
|
|
|
|
lenovo,newifi-y1)
|
|
|
|
ucidef_set_led_netdev "wifi" "WIFI" "$boardname:blue:wifi" "wlan1"
|
|
|
|
ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi5g" "wlan0"
|
|
|
|
ucidef_set_led_switch "lan" "LAN" "$boardname:blue:lan" "switch0" "0x03"
|
|
|
|
;;
|
|
|
|
lenovo,newifi-y1s)
|
|
|
|
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"
|
|
|
|
;;
|
|
|
|
netgear,ex2700|\
|
|
|
|
netgear,wn3000rp-v3)
|
|
|
|
set_wifi_led "$boardname:green:router"
|
|
|
|
;;
|
2019-07-29 18:23:28 +00:00
|
|
|
netgear,ex3700|\
|
|
|
|
netgear,ex6130)
|
2019-10-22 10:37:13 +00:00
|
|
|
ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "$boardname:green:router" "wlan0"
|
|
|
|
ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "$boardname:green:device" "wlan1"
|
|
|
|
;;
|
|
|
|
phicomm,psg1208)
|
|
|
|
set_wifi_led "$boardname:white:wlan2g"
|
|
|
|
;;
|
|
|
|
planex,mzk-ex750np|\
|
|
|
|
zbtlink,zbt-we826-e)
|
|
|
|
set_wifi_led "$boardname:red:wifi"
|
|
|
|
;;
|
|
|
|
tplink,archer-c2-v1)
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch1" "0x1e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch1" "0x01"
|
|
|
|
;;
|
|
|
|
tplink,archer-c20-v1)
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01"
|
|
|
|
;;
|
|
|
|
tplink,archer-c20i)
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01"
|
|
|
|
;;
|
|
|
|
tplink,archer-c50-v1)
|
|
|
|
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
|
|
|
|
;;
|
|
|
|
tplink,archer-mr200)
|
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:white:lan" "eth0.1"
|
|
|
|
ucidef_set_led_netdev "wan" "wan" "$boardname:white:wan" "usb0"
|
|
|
|
;;
|
ramips: add support for TP-Link RE200 v1
TP-Link RE200 v1 is a wireless range extender with Ethernet and 2.4G and 5G
WiFi with internal antennas. It's based on MediaTek MT7620A+MT7610EN.
Specifications
--------------
- MediaTek MT7620A (580 Mhz)
- 64 MB of RAM
- 8 MB of FLASH
- 2T2R 2.4 GHz and 1T1R 5 GHz
- 1x 10/100 Mbps Ethernet
- UART header on PCB (57600 8n1)
- 8x LED (GPIO-controlled; only 6 supported), 2x button
There are 2.4G and 5G LEDs in red and green which are controlled
separately. The 5G LED is currently not supported, since the GPIOs couldn't
be determined.
Installation
------------
Web Interface
-------------
It is possible to upgrade to OpenWrt via the web interface. However, the
OEM firmware upgrade file is required and a tool to fix the MD5 sum of
the header. This procedure overwrites U-Boot and there is not failsafe /
recovery mode present! To prepare an image, you need to take the header
and U-Boot (i.e. 0x200 + 0x20000 bytes) from an OEM firmware file and
attach the factory image to it. Then fix the header MD5Sum1.
Serial console
--------------
Opening the case is quite hard, since it is welded together. Rename the
OpenWrt factory image to "test.bin", then plug in the device and quickly
press "2" to enter flash mode (no line feed). Follow the prompts until
OpenWrt is installed.
Unfortunately, this devices does not offer a recovery mode or a tftp
installation method. If the web interface upgrade fails, you have to open
your device and attach serial console. Since the web upgrade overwrites
the boot loader, you might also brick your device.
Additional notes
----------------
MAC address assignment is based on stock-firmware. For me, the device
assigns the MAC on the label to Ethernet and the 2.4G WiFi, while the 5G
WiFi has a separate MAC with +2.
*:88 Ethernet/2.4G label, uboot 0x1fc00, userconfig 0x0158
*:89 unused userconfig 0x0160
*:8A 5G not present in flash
This seems to be the first ramips device with a TP-Link v1 header. The
original firmware has the string "EU" embedded, there might be some region-
checking going on during the firmware upgrade process. The original
firmware also contains U-Boot and thus overwrites the boot loader during
upgrade.
In order to flash back to stock, the first header and U-Boot need to be
stripped from the original firmware.
Signed-off-by: Andreas Böhler <dev@aboehler.at>
2019-12-19 09:29:14 +00:00
|
|
|
tplink,re200-v1)
|
|
|
|
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
|
|
|
|
;;
|
2019-10-22 10:37:13 +00:00
|
|
|
youku,yk1)
|
|
|
|
set_wifi_led "$boardname:blue:air"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10"
|
|
|
|
;;
|
|
|
|
zbtlink,zbt-ape522ii)
|
|
|
|
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"
|
|
|
|
;;
|
|
|
|
zbtlink,zbt-wa05)
|
|
|
|
set_wifi_led "$boardname:blue:air"
|
|
|
|
;;
|
|
|
|
zbtlink,zbt-we826-16m|\
|
|
|
|
zbtlink,zbt-we826-32m)
|
|
|
|
set_wifi_led "zbt-we826:green:wifi"
|
|
|
|
;;
|
|
|
|
zbtlink,zbt-we1026-5g-16m)
|
|
|
|
ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0"
|
|
|
|
set_wifi_led "we1026-5g:green:wifi"
|
|
|
|
;;
|
2019-11-02 14:18:55 +00:00
|
|
|
zbtlink,zbt-we1026-h-32m)
|
|
|
|
set_wifi_led "we1026-h:green:wifi"
|
|
|
|
ucidef_set_led_switch "lan" "lan" "we1026-h:green:lan" "switch0" "0x8"
|
|
|
|
ucidef_set_led_switch "wan" "wan" "we1026-h:green:wan" "switch0" "0x10"
|
|
|
|
;;
|
2019-10-22 10:37:13 +00:00
|
|
|
zbtlink,zbt-we2026)
|
|
|
|
set_wifi_led "$boardname:green:wlan"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
board_config_flush
|
|
|
|
|
|
|
|
exit 0
|