You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

482 lines
17 KiB
Plaintext

#!/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
7links,px-4885-4m|\
7links,px-4885-8m)
set_wifi_led "px-4885:orange:wifi"
;;
aigale,ai-br100)
ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" "eth0.2"
set_wifi_led "$boardname:blue:wlan"
;;
airlink101,ar670w|\
airlink101,ar725w|\
asiarf,awapn2403)
set_wifi_led "rt2800soc-phy0::radio"
;;
airlive,air3gii|\
aximcom,mr-102n|\
edimax,3g-6200nl|\
hilink,hlk-7628n|\
netgear,wnce2001|\
skylab,skw92a|\
zbtlink,zbt-we2026)
set_wifi_led "$boardname:green:wlan"
;;
alfa-network,ac1200rm)
set_wifi_led "$boardname:green:wlan2g" "wlan1"
;;
alfa-network,awusfree1|\
edimax,br-6478ac-v2|\
edimax,ew-7478apc)
set_wifi_led "$boardname:blue:wlan"
;;
alfa-network,tube-e4g)
ucidef_set_led_netdev "4g" "4g" "$boardname:green:4g" "wwan0"
ucidef_set_led_netdev "lan" "lan" "$boardname:blue:lan" "eth0"
;;
allnet,all0256n-4m|\
allnet,all0256n-8m)
ucidef_set_rssimon "wlan0" "200000" "1"
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"
set_wifi_led "rt2800pci-phy0::radio"
;;
alphanetworks,asl26555-8m|\
alphanetworks,asl26555-16m)
ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0"
set_wifi_led "asl26555:green:wlan"
;;
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"
;;
belkin,f9k1109v1)
set_usb_led "$boardname:green:usb1"
ucidef_set_led_netdev "lan" "lan" "$boardname:blue:wps" "eth0"
;;
alfa-network,w502u|\
dlink,dir-300-b1|\
dlink,dir-300-b7|\
dlink,dir-320-b1|\
dlink,dir-600-b1|\
dlink,dir-610-a1|\
dlink,dir-615-d|\
dlink,dir-615-h1|\
dlink,dir-620-a1|\
engenius,esr-9753|\
hilink,hlk-rm04|\
nexx,wt1520-4m|\
nexx,wt1520-8m|\
ralink,v11st-fe|\
skyline,sl-r7205|\
tenda,w306r-v2|\
zyxel,keenetic-start|\
zyxel,keenetic|\
zyxel,nbg-419n-v2)
set_wifi_led "rt2800pci-phy0::radio"
ramips: add support for the HNET C108 The HNET C108 (http://www.szhwtech88.com/Product-product-cid-100-id-4374.html) is a mifi based on MT7602A, which has the following specifications: * CPU: MT7620A * 1x 10/100Mbps Ethernet. * 16 MB Flash. * 64 MB RAM. * 1x USB 2.0 port. Only power is connected, this port is meant for charging other devices. * 1x mini-PCIe slots. * 1x SIM slots. * 1x 2.4Ghz WIFI. * 1x button. * 6000 mAh battery. * 5x controllable LEDs. Works: * Wifi. * Switch. * mini-PCIe slot. Only tested with a USB device (a modem). * SIM slot. * Sysupgrade. * Button (reset). Not working (also applies to the factory firmware): * Wifi LED. It is always switched on, there is no relation to the up/down state or activity of the wireless interface. Not tested: * SD card reader. Notes: * The C108 has no dedicated status LED. I therefore set the LAN LED as status LED. Installation: The router comes pre-installed with OpenWRT, including a variant of Luci. The initial firmware install can be done through this UI, following normal procedure. I.e., access the UI and update the firmware using the sysupgrade-image. Remember to select that you do not want to keep existing settings. Recovery: If you brick the device, the C108 supports recovery using TFTP. Keep the reset button pressed for ~5sec when booting to trigger TFTP. Set the address of the network interface on your machine to 10.10.10.3/24, and rename your image file to Kernal.bin. Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
7 years ago
;;
asus,rt-ac51u|\
kingston,mlw221|\
kingston,mlwg2|\
rakwireless,rak633|\
sanlinking,d240)
set_wifi_led "$boardname:blue:wifi"
;;
belkin,f5d8235-v1)
set_wifi_led "$boardname:blue:wireless"
;;
comfast,cf-wr800n)
ucidef_set_led_netdev "lan" "lan" "$boardname:white:ethernet" eth0.1
set_wifi_led "$boardname:white:wifi"
;;
ramips: add CUDY WR1000 support Cudy WR1200 is an AC1200 AP with 3-port FE and 2 non-detachable antennas Specifications: MT7628 (580 MHz) 64 MB of RAM (DDR2) 8 MB of FLASH 2T2R 2.4 GHz (MT7628) 2T2R 5 GHz (MT7612E) 3x 10/100 Mbps Ethernet (2 LAN + 1 WAN) 2x external, non-detachable antennas (5dbi) UART header on PCB (57600 8n1) 7x LED, 2x button Known issues: The Power LED is always ON, probably because it is connected directly to power. Flash instructions ------------------ Load the ...-factory.bin image via the stock web interface. Openwrt upgrade instructions ---------------------------- Use the ...-sysupgrade.bin image for future upgrades. Revert to stock FW ------------------ Warning! This tutorial will work only with the following OEM FW: WR1000_EU_92.122.2.4987.201806261618.bin WR1000_US_92.122.2.4987.201806261609.bin If in the future these firmwares will not be available anymore, you have to find the new XOR key. 1) Download the original FW from the Cudy website. (For example WR1000_EU_92.122.2.4987.201806261618.bin) 2) Remove the header. dd if="WR1000_EU_92.122.2.4987.201806261618.bin" of="WR1000_EU_92.122.2.4987.201806261618.bin.mod" skip=8 bs=64 3) XOR the new file with the region key. FOR EU: 7B76741E67594351555042461D625F4545514B1B03050208000603020803000D FOR US: 7B76741E675943555D5442461D625F454555431F03050208000603060007010C You can use OpenWrt's tools/firmware-utils/src/xorimage.c tool for this: xorimage -i WR1000..bin.mod -o stock-firmware.bin -x -p 7B767.. Or, you can use this tool (CHANGE THE XOR KEY ACCORDINGLY!): https://gchq.github.io/CyberChef/#recipe=XOR(%7B'option':'Hex','string':''%7D,'',false) 4) Check the resulting decrypted image. Check if bytes from 0x20 to 0x3f are: 4C 69 6E 75 78 20 4B 65 72 6E 65 6C 20 49 6D 61 67 65 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Alternatively, you can use u-boot's tool dumpimage tool to check if the decryption was successful. It should look like: # dumpimage -l stock-firmware.bin Image Name: Linux Kernel Image Created: Tue Jun 26 10:24:54 2018 Image Type: MIPS Linux Kernel Image (lzma compressed) Data Size: 4406635 Bytes = 4303.35 KiB = 4.20 MiB Load Address: 80000000 Entry Point: 8000c150 5) Flash it via forced firmware upgrade and don't "Keep Settings" CLI: sysupgrade -F -n stock-firmware.bin LuCI: make sure to click on the "Keep settings" checkbox to disable it. You'll need to do this !TWICE! because on the first try, LuCI will refuse the image and reset the "Keep settings" to enable. However a new "Force upgrade" checkbox will appear as well. Make sure to do this very carefully! Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com> Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [added wifi compatible, spiffed-up the returned to stock instructions]
5 years ago
cudy,wr1000)
ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10"
ucidef_set_led_switch "lan1" "lan1" "$boardname:blue:lan1" "switch0" "0x08"
ucidef_set_led_switch "lan2" "lan2" "$boardname:blue:lan2" "switch0" "0x04"
;;
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"
;;
d-team,pbr-m1|\
gehua,ghl-r-001)
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2"
;;
dlink,dcs-930l-b1)
ucidef_set_led_netdev "wifi" "WiFi" "$boardname:blue:wps"
;;
dlink,dir-620-d1|\
dlink,dwr-116-a1|\
ramips: Add support for Head Weblink HDRM200 Head Weblink HDRM200 is a dual-sim router based on MT7620A. The detailed specifications are: - MT7620A (580MHz) - 64MB RAM - 16MB of flash (SPI NOR) - 6x 10/100Mbps Ethernet (MT7620A built-in switch) - 1x microSD slot - 1x miniPCIe slot (only USB2.0 bus). Device is shipped with a SIMCOM SIM7100E LTE modem. - 2x SIM slots (standard size) - 1x USB2.0 port - 1x 2.4GHz wifi (rt2800) - 1x 5GHz wifi (mt7612) - 1x reset button - 1x WPS button - 3x GPIO-controllable LEDs - 1x 10 pin terminal block (RS232, RS485, 4 x GPIO) Tested: - Ethernet switch - Wifi - USB slot - SD card slot - miniPCIe-slot - sysupgrade - reset button Installation instructions: Installing OpenWRT for the first time requires a bit of work, as the board does not ship with OpenWRT. In addition, the bootloader automatically reboots when installing an image over tftp. In order to install OpenWRT on the HDRM200, you need to do the following: * Copy the initramfs-image to your tftp-root (default filename is test.bin) and configure networking accordingly (default server IP is 10.10.10.3, client 10.10.10.123). Start your tftp server. * Open the board and connect to UART. The pins are exposed and clearly marked. * Boot the board and press 1. * Either use the default filename and client/server IP-addresses, or specify your own. The image should now be loaded to memory and board boot. If the router reboots while the image is loading, you need to try again. Once the board has booted, copy the sysupgrade-image to the router and run sysupgrade in order to install OpenWRT to the flash. Notes: - You control which SIM slot to use by writing 0/1 to /sys/class/gpio/gpio0/value. In order for the change to take effect, you can either use AT-commands (AT+CFUN) or power-cycle the modem (write 0/1 to /sys/class/gpio/gpio21/value). - RS485 is available on /dev/ttyS0. - RS232 is available on /dev/ttyS1. - The name of the ioX-gpios map to the labels on the casing. Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com> [fixed whitespace issue and merge conflict in target.mk] Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
head-weblink,hdrm200|\
ohyeah,oy-0001|\
planex,mzk-ex300np|\
trendnet,tew-714tru|\
zbtlink,zbt-wr8305rt|\
zyxel,keenetic-omni|\
zyxel,keenetic-omni-ii|\
zyxel,keenetic-viva)
set_wifi_led "$boardname:green:wifi"
;;
dlink,dir-860l-b1)
ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "eth0.2"
;;
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"
;;
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>
6 years ago
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"
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>
6 years ago
ucidef_set_led_netdev "signalstrength" "signalstrength" "$boardname:green:sigstrength" "wwan0" "link"
ucidef_set_led_netdev "4g" "4g" "$boardname:green:4g" "wwan0" "tx rx"
;;
dovado,tiny-ac|\
fon,fonera-20n)
set_wifi_led "$boardname:orange:wifi"
;;
edimax,3g-6200n|\
edimax,br-6475nd|\
planex,mzk-w300nh2)
set_wifi_led "$boardname:amber: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"
;;
ramips: add support for EnGenius ESR600 The EnGenius ESR600 is a dual band wireless router with a 4-port gigabit Ethernet switch, a gigabit Ethernet WAN port and a USB port. Specification: - Bootloader: U-Boot - SoC: MediaTek MT7620A (600 MHz) - Flash: 16MB, Macronix MX25L12845E - RAM: 64MB, Nanya NT5TU32M16DG-AC - Serial: 115200 baud, no header, 3.3V J2: Vcc (arrow), Gnd, Tx, Rx - USB: USB 2, 5V - Ethernet: 5 x 1 Gb/s 4 LAN 1 WAN, Atheros AR8327 - WiFi0: 5 GHz 802.11 b/g/n Ralink RT5592N 300 Mb/s, 2T2R - WiFi1: 2.4 GHz 802.11 b/g/n integrated 300 Mb/s, 2T2R - Antennas: 2 per radio, internal - LEDs: 1 programmable power (amber) 2 programable radio (blue) 1 programable WPS-5G (blue) 1 non-programable WAN activity (blue) 1 unconfigured WPS-2.4G (amber) - Buttons: GPIO: Reset, WPS Installation: Use the OEM web interface to install the ...-factory.dlf image. Use the OpenWRT ...-sysupgrade.bin image for future upgrades. The J2 serial port can be accessed either by soldering in a header, standard 0.1" spacing, or by using pogo-pins against the back side. As configured by the OEM, the U-Boot boot delay is short, however quickly typing "1" leads to the U-Boot "System load Linux to SDRAM via TFTP" prompt. The TFTP client is configured by default with client: 192.168.99.9 server: 192.168.99.8 filename: uImageESR600 It will load an OpenWRT initramfs kernel with this method. Known issues: 1) Only the ports externally labeled WAN, LAN3 and LAN4 are operational. LAN1 and LAN2 do not appear to power up. This issue is also present in the Lava LR25G001. 2) The amber WPS-2.4G LED, in the same lightguide as the blue WPS-5G LED, is not configured in the Device Tree specification. 3) The blue WAN activity LED is not configured in the Device Tree specification as this causes the AR8327 switch to fail to initialize. Signed-off-by: Nick Briggs <nicholas.h.briggs@gmail.com> [merge conflict in 02_network] Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
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"
;;
glinet,gl-mt300n-v2)
set_wifi_led "$boardname:red:wlan"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x1"
;;
gnubee,gb-pc1|\
gnubee,gb-pc2)
ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x01"
ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x10"
;;
hauppauge,broadway)
set_wifi_led "$boardname:red:wps_active"
;;
hiwifi,hc5661)
ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x01"
set_wifi_led "$boardname:blue:wlan2g"
;;
hiwifi,hc5661a|\
hiwifi,hc5761a|\
xzwifi,creativebox-v1)
ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x10"
;;
hiwifi,hc5761)
ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x01"
ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "wlan0"
ucidef_set_led_netdev "wifi2g" "wifi2g" "$boardname:blue:wlan2g" "wlan1"
;;
hiwifi,hc5861)
ucidef_set_led_switch "internet" "internet" "$boardname:blue:internet" "switch0" "0x20"
ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "wlan0"
ucidef_set_led_netdev "wifi2g" "wifi2g" "$boardname:blue:wlan2g" "wlan1"
;;
hnet,c108)
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
ucidef_set_led_netdev "modem" "modem" "$boardname:green:modem" "wwan0"
;;
hootoo,ht-tm02)
ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:lan" "eth0"
set_wifi_led "$boardname:blue:wlan"
;;
huawei,hg255d)
set_wifi_led "$boardname:green:wlan"
ucidef_set_led_netdev "internet" "internet" "$boardname:green:internet" "eth0.2"
;;
intenso,memory2move)
set_wifi_led "$boardname:blue:wifi"
ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:wan" "eth0"
;;
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"
;;
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"
;;
mediatek,linkit-smart-7688)
ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "phy0tpt"
;;
ramips: add support for MikroTik RouterBOARD RBM11g This commit adds support for the MikroTik RouterBOARD RBM11g. =Hardware= The RBM11g is a mt7621 based device featuring one GbE port and one miniPCIe slot with a sim card socket and USB 2.0. ==Switch== The single onboard Ethernet port is connected the CPU directly. The internal switch of the mt7621 SoC is disabled. ==Flash== The device has one spi nor flash chip. It is a 128 Mbit winbond 25Q128FVS connected to CS0. ==PCIe== The board features a single miniPCIe slot. It has a dedicated mini SIM socket and a USB 2.0 port. Power to the miniPCIe slot is controlled via GPIO9. ==USB== There are no external USB ports. ==Power== The board can accept both, passive PoE and external power via a 2.1 mm barrel jack (center-positive). The input voltage range is 11-32 V. ==Serial port== The device does have an onboard UART on an unpopulated header next to the flash chip: GND: pin 2 TX: pin 7 RX: pin 6 Settings: 115200, 8N1 See below illustration for positioning of the header. 0 = screw hole * = some pin T = TX pin R = RX pin G = GND pin Pinout: +--------------- |O | __ | / \ | \__/ | | | | +---+ | |RAM| | +--+ | | | |**| <- unpopulated header with UART | |*T| +---+ | |R*| +--------+ | |**| | | | |G*| | CPU | | +--+ | | | +--+ | | | | | +--------+ | +--+ <- flash chip |O | +-----+ | | | |+--+ | | || | | | +--------------------- =Installation= To install an OpenWRT image to the device two components must be built: 1. A openwrt initramfs image 2. A openwrt sysupgrade image ===initramfs & sysupgrade image=== Select target devices "Mikrotik RBM11G" in openwrt menuconfig and build the images. This will create the images "openwrt-ramips-mt7621-mikrotik_rbm11g-initramfs-kernel.bin" and "openwrt-ramips-mt7621-mikrotik_rbm11g-squashfs-sysupgrade.bin" in the output directory. ==Installing== **Make sure to back up your RouterOS license in case you do ever want to go back to RouterOS using "/system license output" and back up the created license file.** When rebooted the board will try booting via ethernet first. If your board does not boot via ethernet automatically you will have to attach to the serial port and set ethernet as boot device within RouterBOOT. 1. Set up a dhcp server that points the bootfile to tftp server serving the "openwrt-ramips-mt7621-mikrotik_rbm11g-initramfs-kernel.bin" initramfs image 2. Connect to ethernet port on board 3. Power on the board 4. Wait for OpenWrt to boot Right now OpenWrt will be running with a SSH server listening. Now OpenWrt must be flashed to the devices flash: 1. Copy "openwrt-ramips-mt7621-mikrotik_rbm11g-squashfs-sysupgrade.bin" to the device using scp. 2. Write openwrt to flash using "sysupgrade openwrt-ramips-mt7621-mikrotik_rbm11g-squashfs-sysupgrade.bin" Once the flashing completes the board will reboot. Disconnect from the devices ethernet port or stop the DHCP/TFTP server to prevent the device from booting via ethernet again. The device should now boot straight to OpenWrt. Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
6 years ago
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"
;;
ramips: add support for MTC Wireless Router WR1201 MTC Wireless Router WR1201 is the OEM name of the board. It is also sold rebranded as STRONG Dual Band Gigabit Router 1200. Specification: - SoC: MediaTek MT7621A (880 MHz) - Flash: 16 MiB - RAM: 128 MiB - Wireless: 2.4Ghz(MT7602EN) and 5Ghz (MT7612EN) - Ethernet speed: 10/100/1000 - Ethernet ports: 4+1 - 1x USB 3.0 - 1x microSD reader - Serial baud rate of Bootloader and factory firmware: 57600 The OEM webinterface writes only as much bytes as listed in the uImage header field to the flash. Also, the OEM webinterface evaluates the name field of uImage header before flashing (the string "WR1201_8_128") To flash via webinterface, is mandatory to use first initramfs.bin and after (from the OpenWrt) the sysupgrade.bin Some notes: - Some microSD will not work: mtk-sd 1e130000.sdhci: no support for card's volts mmc0: error -22 whilst initialising SDIO card mtk-sd 1e130000.sdhci: no support for card's volts mmc0: error -22 whilst initialising MMC card mtk-sd 1e130000.sdhci: no support for card's volts mmc0: error -22 whilst initialising SDIO card mtk-sd 1e130000.sdhci: card claims to support voltages below defined range mtk-sd 1e130000.sdhci: no support for card's volts mmc0: error -22 whilst initialising MMC card mtk-sd 1e130000.sdhci: no support for card's volts mmc0: error -22 whilst initialising SDIO card mtk-sd 1e130000.sdhci: no support for card's volts mmc0: error -22 whilst initialising MMC card Signed-off-by: Valentín Kivachuk <vk18496@gmail.com>
6 years ago
mtc,wr1201)
ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x0f"
;;
netgear,ex2700|\
netgear,wn3000rp-v3)
set_wifi_led "$boardname:green:router"
;;
netgear,ex3700)
ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "$boardname:green:router" "wlan0"
ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "$boardname:green:device" "wlan1"
;;
netgear,r6120)
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x0f"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
ucidef_set_led_wlan "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g" "phy0tpt"
;;
netgear,r6220|\
netgear,r6260|\
netgear,r6350|\
netgear,r6850|\
netgear,wndr3700-v5)
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x10"
;;
omnima,hpm)
ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0"
set_wifi_led "$boardname:green:wifi"
;;
omnima,miniembplug)
set_wifi_led "$boardname:red:wlan"
;;
phicomm,psg1208)
set_wifi_led "$boardname:white:wlan2g"
;;
planex,mzk-ex750np|\
zbtlink,zbt-we826-e)
set_wifi_led "$boardname:red:wifi"
;;
tama,w06)
ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
;;
tplink,archer-c2-v1)
ramips: add support for TP-Link Archer C2 Specification: - System-On-Chip: MT7620A - CPU/Speed: 580 MHz - Flash-Chip: Winbond 25Q64BVSIG - Flash size: 8192 KiB - RAM: 64 MiB - Wireless No1: SoC-integrated: MT7620A 2.4GHz 802.11bgn - Wireless No2: On-board chip: MT7610EN 5GHz 802.11ac - Switch: RTL8367RB Gigabit Switch - USB: Yes 1 x 2.0 Preparing a TFTP recovery image for initial flashing: Currently the only method to install openwrt for the first time is via TFTP download in u-boot. After first install you can use regular updates. WARNING: This method also overwrites the bootloader partition! Create a TFTP recovery image: 1) Download a stock TP-Link Firmware file here: https://www.tp-link.com/en/download/Archer-C2_V1.html#Firmware 2) Extract u-boot from the binary file: #> dd if=c2v1_stock_firmware.bin of=c2v1_uboot.bin bs=1 skip=512 count=131072 3) Now merge the sysupgrade image and the u-boot into one binary: #> cat c2v1_uboot.bin openwrt-squashfs-sysupgrade.bin > ArcherC2V1_tp_recovery.bin The resulting image can be flashed via TFTP recovery mode. Flash instructions: 1) To flash the recovery image, start a TFTP server from IP address 192.168.0.66 and serve the recovery image named ArcherC2V1_tp_recovery.bin. 2) Connect your device to the LAN port, then press the WPS/Reset button and power it up. Keep pressing the WPS/Reset button for 10 seconds. It will try to download the recovery image and flash it. It can take up to 20-25 minutes to finish. When it reaches 100%, the router will reboot itself. Signed-off-by: Serge Vasilugin <vasilugin@yandex.ru> Signed-off-by: Franz Flasch <franz.flasch@gmx.at>
6 years ago
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"
;;
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"
ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:blue:wlan2g" "wlan0"
;;
tplink,archer-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"
;;
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"
ucidef_set_led_wlan "wlan" "wlan" "$boardname:blue:wlan" "phy0radio"
;;
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"
ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:green:wlan2g" wlan1
set_wifi_led "$boardname:green:wlan5g"
;;
tplink,archer-c50-v3|\
tplink,archer-c50-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_wlan "wlan2g" "wlan2g" "$boardname:green:wlan2g" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "wlan5g" "$boardname:green:wlan5g" "phy1tpt"
;;
tplink,archer-mr200)
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"
;;
tplink,re350-v1|\
tplink,re650-v1)
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"
;;
tplink,tl-mr3020-v3)
set_wifi_led "$boardname:green:wlan"
ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
;;
tplink,tl-mr3420-v5|\
tplink,tl-wr842n-v5)
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
;;
tplink,tl-wa801nd-v5)
ucidef_set_led_wlan "wlan" "wlan" "$boardname:green:wlan" "phy0tpt"
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0"
;;
tplink,tl-wr840n-v4)
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
;;
tplink,tl-wr841n-v13)
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
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"
;;
tplink,tl-wr841n-v14)
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e"
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
;;
tplink,tl-wr902ac-v3)
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:green:wlan" "phy0tpt"
ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x10"
;;
unielec,u7628-01-128m-16m)
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>
7 years ago
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"
;;
vocore,vocore-8m|\
vocore,vocore-16m)
ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0"
;;
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"
;;
wavlink,wl-wn575a3)
ucidef_set_rssimon "wlan1" "200000" "1"
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"
;;
xiaomi,mir3g)
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"
;;
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"
;;
youhua,wr1200js)
ucidef_set_led_switch "internet" "INTERNET" "$boardname:green:wan" "switch0" "0x01"
;;
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"
;;
zbtlink,zbt-we1226)
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"
;;
zorlik,zl5900v2)
ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" eth0
;;
zyxel,keenetic-extra-ii)
set_wifi_led "$boardname:green:wifi"
ucidef_set_led_switch "internet" "internet" "$boardname:green:internet" "switch0" "0x01"
;;
esac
board_config_flush
exit 0