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.
openwrt/target/linux/ath79/base-files/etc/board.d/02_network

387 lines
9.4 KiB
Plaintext

#!/bin/sh
. /lib/functions/system.sh
. /lib/functions/uci-defaults.sh
. /lib/functions/k2t.sh
ath79_setup_interfaces()
{
local board="$1"
case "$board" in
aruba,ap-105|\
avm,fritz300e|\
devolo,dvl1200i|\
devolo,dvl1750c|\
devolo,dvl1750i|\
devolo,dvl1750x|\
engenius,ecb1750|\
glinet,gl-ar300m-lite|\
netgear,ex6400|\
netgear,ex7300|\
ocedo,koala|\
ocedo,raccoon|\
pcs,cap324|\
pisen,wmm003n|\
pqi,air-pen|\
tplink,cpe210-v2|\
tplink,cpe210-v3|\
tplink,re350k-v1|\
tplink,re450-v2|\
tplink,tl-mr10u|\
tplink,tl-mr3020-v1|\
tplink,tl-mr3040-v2|\
tplink,tl-wa901nd-v2|\
tplink,tl-wr703n|\
ubnt,bullet-m|\
ubnt,bullet-m-xw|\
ubnt,lap-120|\
ath79: Add support for Ubiquiti NanoBeam AC The NanoBeam is a small AR9342 based directional 5 GHz AC CPE with hardware almost identical to the Ubiquiti NanoStation AC loco. Over the NanoStation AC loco it has 5 additional LEDs. Four of those LEDs are used as rssi indicators, the fifth LED is used as an ethernet link/activity indicator. CPU: Atheros AR9342 SoC RAM: 64 MB DDR2 Flash: 16 MB NOR SPI WLAN: QCA988X Ports: 1x GbE Flashing procedure is identical to the NanoStation AC loco and can be performed either via serial or the factory firmware upgrade. Serial flashing: 1. Connect to serial header on device (8N1 115200) 2. Power on device and enter uboot console 3. Set up tftp server serving an openwrt initramfs build 4. Load initramfs build using the command tftpboot in the uboot cli 5. Boot the loaded image using the command bootm 6. Copy squashfs openwrt sysupgrade build to the booted device 7. Use mtd to write sysupgrade to partition "firmware" 8. Reboot and enjoy Flashing through factory firmware: 1. Ensure firmware version v8.5.0.36727 is installed. Up/downgrade to this exact version. 2. Patch fwupdate.real binary using `hexdump -Cv /bin/ubntbox | sed 's/14 40 fe fe/00 00 00 00/g' | hexdump -R > /tmp/fwupdate.real` 3. Make the patched fwupdate.real binary executable using `chmod +x /tmp/fwupdate.real` 4. Copy the squashfs factory image to /tmp on the device 5. Flash OpenWRT using `/tmp/fwupdate.real -m <squashfs-factory image>` 6. Wait for the device to reboot Thanks to @cybermaus for testing! Tested-by: Maurits van Dueren den Hollander <cybermaus@gmail.com> Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
5 years ago
ubnt,nanobeam-ac|\
ubnt,nanostation-ac-loco|\
ubnt,rocket-m|\
ubnt,unifiac-lite|\
ubnt,unifiac-lr|\
ubnt,unifiac-mesh|\
ubnt,unifi|\
wd,mynet-wifi-rangeextender|\
winchannel,wb2000)
ucidef_set_interface_lan "eth0"
;;
avm,fritz4020|\
pcs,cr3000|\
tplink,archer-c58-v1|\
tplink,archer-c59-v1)
ucidef_set_interface_wan "eth1"
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
;;
buffalo,bhr-4grv|\
buffalo,wzr-hp-g450h)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
;;
buffalo,bhr-4grv2)
ucidef_add_switch "switch0" \
"0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth0"
;;
buffalo,whr-g301n)
ucidef_set_interface_wan "eth0"
ucidef_add_switch "switch0" \
"0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
;;
buffalo,wzr-hp-ag300h|\
tplink,archer-c25-v1|\
tplink,tl-mr3220-v1|\
tplink,tl-mr3420-v1|\
tplink,tl-wr841-v7|\
tplink,tl-wr841-v9|\
tplink,tl-wr841-v10|\
tplink,tl-wr841-v11|\
tplink,tl-wr841-v12|\
tplink,tl-wr842n-v1|\
tplink,tl-wr842n-v3|\
ubnt,airrouter)
ucidef_set_interface_wan "eth1"
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
;;
buffalo,wzr-hp-g302h-a1a0)
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:1" "3:lan:4" "4:lan:3" "5:lan:2" "2:wan"
;;
comfast,cf-e110n-v2|\
comfast,cf-e120a-v3|\
tplink,cpe220-v3|\
ubnt,nanostation-m|\
ubnt,routerstation)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
devolo,dvl1200e|\
devolo,dvl1750e|\
ocedo,ursus)
ucidef_set_interface_lan "eth0 eth1"
;;
dlink,dir-825-b1)
ucidef_set_interface_wan "eth1"
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
;;
dlink,dir-825-c1|\
dlink,dir-835-a1|\
dlink,dir-859-a1|\
ath79: add suport for EnGenius EPG5000 EnGenius EPG5000 (v1.0.0, marketed as IoT Gateway) is a dual band wireless router. Specification SoC: Qualcomm Atheros QCA9558 RAM: 256 MB DDR2 Flash: 16 MB SPI NOR WIFI: 2.4 GHz 3T3R integrated 5 GHz 3T3R QCA9880 Mini PCIe card Ethernet: 5x 10/100/1000 Mbps QCA8337N USB: 1x 2.0 LEDS: 4x GPIO controlled Buttons: 2x GPIO controlled UART: 4 pin header, starting count from white triangle on PCB 1. VCC 3.3V, 2. GND, 3. TX, 4. RX baud: 115200, parity: none, flow control: none Installation 1. Connect to one of LAN (yellow) ethernet ports, 2. Open router configuration interface, 3. Go to Tools > Firmware, 4. Select OpenWrt factory image with dlf extension and hit Apply, 5. Wait few minutes, after the Power LED will stop blinking, the router is ready for configuration. Alternative installation 1. Prepare TFTP server with OpenWrt sysupgrade image, 2. Connect to one of LAN (yellow) ethernet ports, 3. Connect to UART port (leaving out VCC pin!), 4. Power on router, 5. When asked to enter a number 1 or 3 hit 2, this will select flashing image from TFTP server option, 6. You'll be prompted to enter TFTP server ip (default is 192.168.99.8), then router ip (default is 192.168.99.9) and for last, image name downloaded from TFTP server (default is uImageESR1200_1750), 7. After providing all information U-Boot will start flashing the image, You can observe progress on console, it'll take few minutes and when the Power LED will stop blinking, router is ready for configuration. Additional information If connected to UART, when prompted for number on boot, one can enter number 4 to open bootloader (U-Boot) command line. OEM firmware shell password is: aigo3d0a0tdagr useful for creating backup of original firmware. When doing upgrade from OpenWrt ar71xx image, it is recomended to not keep the old configuration. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
engenius,epg5000|\
tplink,archer-c2-v3|\
tplink,tl-wr1043nd-v4|\
tplink,tl-wr1043n-v5)
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
;;
elecom,wrc-1750ghbk2-i|\
elecom,wrc-300ghbk2-i)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:4" "3:lan:3" "4:lan:2" "5:lan:1" "1:wan"
;;
embeddedwireless,dorin)
ucidef_add_switch "switch0" \
"0@eth0" "1:wan" "2:lan:3" "3:lan:2"
;;
engenius,ews511ap)
ucidef_set_interface_lan "eth0 eth1" "dhcp"
;;
etactica,eg200)
ucidef_set_interface_lan "eth0" "dhcp"
;;
glinet,gl-ar750s)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:2" "3:lan:1" "1:wan"
;;
iodata,etg3-r|\
iodata,wn-ac1167dgr|\
ath79: add support for I-O DATA WN-AC1600DGR I-O DATA WN-AC1600DGR is a 2.4/5 GHz band 11ac router, based on Qualcomm Atheros QCA9557. Specification: - SoC: Qualcomm Atheros QCA9557 - RAM: 128 MB - Flash: 16 MB - WLAN: 2.4/5 GHz - 2.4 GHz: 2T2R (SoC internal) - 5 GHz: 3T3R (QCA9880) - Ethernet: 5x 10/100/1000 Mbps - Switch: QCA8337N - LED/key: 6x/6x(4x buttons, 1x slide switch) - UART: through-hole on PCB - Vcc, GND, TX, RX from ethernet port side - 115200n8 Flash instruction using factory image: 1. Connect the computer to the LAN port of WN-AC1600DGR 2. Connect power cable to WN-AC1600DGR and turn on it 3. Access to "http://192.168.0.1/" and open firmware update page ("ファームウェア") 4. Select the OpenWrt factory image and click update ("更新") button 5. Wait ~150 seconds to complete flashing Alternative flash instruction using initramfs image: 1. Prepare a computer and TFTP server software with the IP address "192.168.99.8" and renamed OpenWrt initramfs image "uImageWN-AC1600DGR" 2. Connect between WN-AC1600DGR and the computer with UART 3. Connect power cable to WN-AC1600DGR, press "4" on the serial console and enter the U-Boot console 4. execute "tftpboot" command on the console and download initramfs image from the TFTP server 5. execute "bootm" command and boot OpenWrt 6. On initramfs image, download the sysupgrade image to the device and perform sysupgrade with it 7. Wait ~150 seconds to complete flashing This commit also removes unnecessary "qca,no-eeprom" property from the ath10k wifi node. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years ago
iodata,wn-ac1600dgr|\
iodata,wn-ac1600dgr2|\
iodata,wn-ag300dgr|\
pcs,cr5000|\
wd,mynet-n750)
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
;;
librerouter,librerouter-v1)
ucidef_add_switch "switch0" \
"0@eth0" "5:wan" "6@eth1" "4:lan"
;;
nec,wg1200cr|\
ubnt,nanostation-ac|\
ubnt,unifiac-mesh-pro|\
ath79: add support for YunCore XD4200 and A782 YunCore XD4200 ('XD4200_W6.0' marking on PCB) is Qualcomm/Atheros based (QCA9563, QCA9886, QCA8334) dual-band, Wave-2 AC1200 ceiling AP with PoE (802.3at) support. A782 model ('T750_V5.1' marking on PCB) is a smaller version of the XD4200, with similar specification but lower TX power. Specification: - QCA9563 (775 MHz) - 128 MB of RAM (DDR2) - 16 MB of FLASH (SPI NOR) - 2x 10/100/1000 Mbps Ethernet (QCA8334), with 802.3at PoE support (WAN) - Wi-Fi 2.4 GHz: - XD4200: 2T2R (QCA9563), with ext. PA (SKY65174-21) and LNA - A782: 2T2R (QCA9563), with ext. FEM (SKY85329-11) - Wi-Fi 5 GHz: - XD4200: 2T2R (QCA9886), with ext. FEM (SKY85728-11) - A782: 2T2R (QCA9886), with ext. FEM (SKY85735-11) - LEDs: - XD4200: 5x (2x driven by SOC, 1x driven by AC radio, 2x Ethernet) - A782: 3x (1x RGB, driven by SOC and radio, 2x Ethernet) - 1x button (reset) - 1x UART (4-pin, 2.54 mm pitch) header on PCB - 1x DC jack (12 V) Flash instructions: If your device comes with generic QSDK based firmware, you can login over telnet (login: root, empty password, default IP: 192.168.188.253), issue first (important!) 'fw_setenv' command and then perform regular upgrade, using 'sysupgrade -n -F ...' (you can use 'wget' to download image to the device, SSH server is not available): fw_setenv bootcmd "bootm 0x9f050000 || bootm 0x9fe80000" sysupgrade -n -F openwrt-...-yuncore_...-squashfs-sysupgrade.bin In case your device runs firmware with YunCore custom GUI, you can use U-Boot recovery mode: 1. Set a static IP 192.168.0.141/24 on PC and start TFTP server with 'tftp' image renamed to 'upgrade.bin' 2. Power the device with reset button pressed and release it after 5-7 seconds, recovery mode should start downloading image from server (unfortunately, there is no visible indication that recovery got enabled - in case of problems check TFTP server logs) Signed-off-by: Piotr Dymacz <pepe2k@gmail.com> (backported from commit e5d4c0966736287c7ade29c5ccaf6f1ad841b7db)
5 years ago
ubnt,unifiac-pro|\
yuncore,a782|\
yuncore,xd4200)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan" "3:wan"
;;
nec,wg800hp)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan" "3:lan" "4:lan" "1:wan"
;;
netgear,wndr3700|\
netgear,wndr3700v2|\
netgear,wndr3800)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5u@eth0"
ucidef_add_switch_attr "switch0" "blinkrate" 2
ucidef_add_switch_port_attr "switch0" 1 led 6
ucidef_add_switch_port_attr "switch0" 2 led 9
ucidef_add_switch_port_attr "switch0" 5 led 2
;;
netgear,wnr612-v2|\
on,n150r|\
tplink,tl-wr740n-v1|\
tplink,tl-wr740n-v3|\
tplink,tl-wr741-v1|\
tplink,tl-wr743nd-v1|\
tplink,tl-wr841-v5|\
tplink,tl-wr941-v4)
ucidef_set_interface_wan "eth0"
ucidef_add_switch "switch0" \
"0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
;;
phicomm,k2t)
ucidef_add_switch "switch0" \
"0@eth0" "3:lan:1" "5:lan:2" "4:wan"
;;
rosinson,wr818)
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan" "3:wan"
;;
ath79: add support for TP-Link Archer A7 This patch adds support for TP-Link Archer A7 Specification: - SOC: QCA9563 - Flash: 16 MiB (SPI) - RAM: 128 MiB (DDR2) - Ethernet: 4x 1Gbps LAN + 1x 1Gbps WAN - Wireless: - 2.4GHz (bgn) SoC internal - 5GHz (ac) QCA988x - USB: 1x USB 2.0 port - Button: 1x power, 1x reset, 1x wps - LED: 10x LEDs - UART: holes in PCB - Vcc, GND, RX, TX from ethernet port side - 115200n8 Flash instructions: Upload openwrt-ath79-generic-tplink_archer-a7-v5-squashfs-factory.bin via the Webinterface. Flash instruction using tftp recovery: 1. Connect the computer to one of the LAN ports of the Archer A7 2. Set the computer IP to 192.168.0.66 3. Start a tftp server with the OpenWrt factory image in the tftp root directory renamed to ArcherC7v5_tp_recovery.bin 2. Connect power cable to Archer A7, press and hold the reset button and turn the router on 3. Keep the reset button pressed for ~5 seconds 4. Wait ~150 seconds to complete flashing Changes since first revision: - Flash instructions using stock image webinterface - Changed "Version 5" in model string to "v5" - Split DTS file in qca9563_tplink_archer-x7-v5.dtsi and qca9563_tplink_archer-a7-v5.dts - Firmware image is now build with dynamic partitioning - Default to ath10k-ct Changes since second revision: - Changed uboot@0 to uboot@20000 in DTS file - Fixed ordering issue in board led script - Specify firmware partition format in DTS file - Rebased Makefile device definition on common Device/tplink-safeloader-uimage definition - Merged switch section in network script (same configuration as tplink,tl-wdr3600 and tplink,tl-wdr4300) Signed-off-by: Karl-Felix Glatzer <karl.glatzer@gmx.de>
5 years ago
tplink,archer-a7-v5|\
tplink,archer-c6-v2|\
tplink,archer-c7-v4|\
tplink,archer-c7-v5|\
tplink,tl-wdr3600-v1|\
tplink,tl-wdr4300-v1|\
tplink,tl-wdr4300-v1-il|\
tplink,tl-wr941n-v7-cn)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
;;
tplink,archer-c5-v1|\
tplink,archer-c7-v1|\
tplink,archer-c7-v2|\
tplink,tl-wdr4900-v2)
ucidef_add_switch "switch0" \
"0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
;;
tplink,archer-c60-v1|\
tplink,archer-c60-v2)
ucidef_set_interface_wan "eth1"
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
;;
tplink,archer-d50-v1)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "1:wan"
;;
tplink,tl-wr1043nd-v1)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
;;
tplink,tl-wr1043nd-v2|\
tplink,tl-wr1043nd-v3)
ucidef_add_switch "switch0" \
"0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
;;
tplink,tl-wr2543-v1)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
;;
tplink,tl-wr740n-v4|\
tplink,tl-wr741nd-v4|\
tplink,tl-wr841-v8|\
tplink,tl-wr842n-v2)
ucidef_set_interface_wan "eth1"
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
;;
tplink,tl-wr941-v2)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;
ath79: add support for Ubiquiti airCube ISP The Ubiquiti Network airCube ISP is a cube shaped 2.4 GHz with internal 2x2 MIMO antennas. It can be supplied via a USB connector or via PoE. There are for 10/100 Mbps ports (1 * WAN + 3 * LAN). There is an optional PoE passthrough from the first LAN port to the WAN port. SoC: Qualcomm / Atheros QCA9533-BL3A RAM: 64 MB DDR2 Flash: 16 MB SPI NOR Ethernet: 4x 10/100 Mbps (1 WAN + 3 LAN) LEDS: 1x via a SPI controller (not yet supported) Buttons: 1x Reset Serial: 1x (only RX and TX); 115200 baud, 8N1 Missing points: - LED not yet supported - Factory upgrade via web IF or TFTP recovery not yet supported (Needs RSA signed images, for details see PR#1958) The serial port is on a four pin connextor labeled J1 and located between Ethernet and USB connector. The pinout is: 1. 3V3 (out) 2. Rx (in) 3. Tx (out) 4. GND Upgrading via serial port / U-Boot: - Connect the serial port via a level converter - Power the system and stop U-Boot with pressing any key when `Hit any key to stop autoboot` is displayed. Note: Pressing space multiple times untill U-Boot reaches that location works well. - Connect a PC with the IP 192.168.1.100 (or some other in that net) running a TFTP-Server to one of the LAN ports. Copy the sysupgrade image to the server. - Set the U-Boot server IP with setenv serverip 192.168.1.100 - Load the flash image to RAM with tftpboot 0x81000000 sysupgrade.bin - Erase the flash with erase 0x9f050000 0x9ffaffff - Write the new flash content with cp 0x81000000 0x9f050000 ${filesize} - Reset the device with reset Signed-off-by: Christian Mauderer <oss@c-mauderer.de> [removed full stop in subject and added lockdown note to commit message] Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
ubnt,acb-isp)
ucidef_set_interface_wan "eth1"
ath79: add support for Ubiquiti airCube ISP The Ubiquiti Network airCube ISP is a cube shaped 2.4 GHz with internal 2x2 MIMO antennas. It can be supplied via a USB connector or via PoE. There are for 10/100 Mbps ports (1 * WAN + 3 * LAN). There is an optional PoE passthrough from the first LAN port to the WAN port. SoC: Qualcomm / Atheros QCA9533-BL3A RAM: 64 MB DDR2 Flash: 16 MB SPI NOR Ethernet: 4x 10/100 Mbps (1 WAN + 3 LAN) LEDS: 1x via a SPI controller (not yet supported) Buttons: 1x Reset Serial: 1x (only RX and TX); 115200 baud, 8N1 Missing points: - LED not yet supported - Factory upgrade via web IF or TFTP recovery not yet supported (Needs RSA signed images, for details see PR#1958) The serial port is on a four pin connextor labeled J1 and located between Ethernet and USB connector. The pinout is: 1. 3V3 (out) 2. Rx (in) 3. Tx (out) 4. GND Upgrading via serial port / U-Boot: - Connect the serial port via a level converter - Power the system and stop U-Boot with pressing any key when `Hit any key to stop autoboot` is displayed. Note: Pressing space multiple times untill U-Boot reaches that location works well. - Connect a PC with the IP 192.168.1.100 (or some other in that net) running a TFTP-Server to one of the LAN ports. Copy the sysupgrade image to the server. - Set the U-Boot server IP with setenv serverip 192.168.1.100 - Load the flash image to RAM with tftpboot 0x81000000 sysupgrade.bin - Erase the flash with erase 0x9f050000 0x9ffaffff - Write the new flash content with cp 0x81000000 0x9f050000 ${filesize} - Reset the device with reset Signed-off-by: Christian Mauderer <oss@c-mauderer.de> [removed full stop in subject and added lockdown note to commit message] Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:1" "3:lan:3" "4:lan:2"
ath79: add support for Ubiquiti airCube ISP The Ubiquiti Network airCube ISP is a cube shaped 2.4 GHz with internal 2x2 MIMO antennas. It can be supplied via a USB connector or via PoE. There are for 10/100 Mbps ports (1 * WAN + 3 * LAN). There is an optional PoE passthrough from the first LAN port to the WAN port. SoC: Qualcomm / Atheros QCA9533-BL3A RAM: 64 MB DDR2 Flash: 16 MB SPI NOR Ethernet: 4x 10/100 Mbps (1 WAN + 3 LAN) LEDS: 1x via a SPI controller (not yet supported) Buttons: 1x Reset Serial: 1x (only RX and TX); 115200 baud, 8N1 Missing points: - LED not yet supported - Factory upgrade via web IF or TFTP recovery not yet supported (Needs RSA signed images, for details see PR#1958) The serial port is on a four pin connextor labeled J1 and located between Ethernet and USB connector. The pinout is: 1. 3V3 (out) 2. Rx (in) 3. Tx (out) 4. GND Upgrading via serial port / U-Boot: - Connect the serial port via a level converter - Power the system and stop U-Boot with pressing any key when `Hit any key to stop autoboot` is displayed. Note: Pressing space multiple times untill U-Boot reaches that location works well. - Connect a PC with the IP 192.168.1.100 (or some other in that net) running a TFTP-Server to one of the LAN ports. Copy the sysupgrade image to the server. - Set the U-Boot server IP with setenv serverip 192.168.1.100 - Load the flash image to RAM with tftpboot 0x81000000 sysupgrade.bin - Erase the flash with erase 0x9f050000 0x9ffaffff - Write the new flash content with cp 0x81000000 0x9f050000 ${filesize} - Reset the device with reset Signed-off-by: Christian Mauderer <oss@c-mauderer.de> [removed full stop in subject and added lockdown note to commit message] Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
;;
ath79: initial support for Ubiquiti RouterStation and RouterStation Pro This adds a shared ar7161_ubnt_routerstation.dtsi as well as two other .dts files that utilize it, ar7161_ubnt_routerstation.dts and ar7161_ubnt_routerstation-pro.dts. The modifications to generic-ubnt.mk, config-default, and base-files necessary for image generation, parsing RedBoot FIS partitions, network configuration, and sysupgrade are also included. This reintroduces vital bits from platform_do_upgrade_combined() and its supporting functions to /lib/upgrade/platform.sh, which were previously removed from ath79 in 3e9d9f62258f80298710441e0db557e59e152dcf "ath79: sysupgrade: drop unused platform checks". The new function is called "routerstation_do_upgrade" and will *only* work for the RouterStation series of boards. It does however retain the ability to downgrade (e.g. from master -> 17.01.x using sysupgrade -F). All hardware is functional including the AR8216 switch (for the Pro), wireless via ath5k/ath9k using the miniPCI slots, flash, USB, button, and LED. Switch and LAN/WAN configuration is the same as it is with the equivalent ar71xx targets. MAC addresses are assigned based upon the content stored in the RedBoot config partition. Flashing via both sysupgrade and TFTP has been confirmed to work. Also, the initramfs images are now raw .bin files instead of being wrapped in a uImage (as they currently are in ar71xx), which makes them bootable with RedBoot. One notable difference to ar71xx is the inclusion of the RedBoot "fconfig" utility (analogous to U-Boot’s fw_printenv/fw_setenv) in DEVICE_PACKAGES. The FIS partitions are probed using the RedBoot MTD parser’s DT binding, whose proper usage is mutually exclusive to defining a separate fixed-partitions node for "RedBoot config". This config partition contains the board's base MAC address. The lack of a hard-coded flash location means that the mtd-mac-address property cannot be used in the .dts, so instead fconfig is used to read the MAC addresses from flash in userspace during first boot. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl> Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
6 years ago
ubnt,routerstation-pro)
ucidef_set_interface_wan "eth0"
ucidef_add_switch "switch0" \
"0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
;;
ubnt,nanostation-m-xw)
ucidef_add_switch "switch0" \
"0@eth0" "5:lan" "1:wan"
;;
ath79: Add support for ZBT-WD323 ZBT-WD323 is a dual-LTE router based on AR9344. The detailed specifications are: * AR9344 560MHz/450MHz/225MHz (CPU/DDR/AHN). * 128 MB RAM * 16MB of flash(SPI-NOR, 22MHz) * 1x 2.4GHz wifi (Atheros AR9340) * 3x 10/100Mbos Ethernet (AR8229) * 1x USB2.0 port * 2x miniPCIe-slots (USB2.0 only) * 2x SIM slots (standard size) * 4x LEDs (1 gpio controlled) * 1x reset button * 1x 10 pin terminal block (RS232, RS485, 4x GPIO) * 2x CP210x UART bridge controllers (used for RS232 and RS485) * 1x 2 pin 5mm industrial interface (input voltage 12V~36V) * 1x DC jack * 1x RTC (PCF8563) Tested: - Ethernet switch - Wifi - USB port - MiniPCIe-slots (+ SIM slots) - Sysupgrade - Reset button - RS232 Intallation and recovery: The board ships with OpenWRT, but sysupgrade does not work as a different firmware format than what is expected is generated. The easiest way to install (and recover) the router, is to use the web-interface provided by the bootloader (Breed). While the interface is in Chinese, it is easy to use. First, in order to access the interface, you need to hold down the reset button for around five seconds. Then, go to 192.168.1.1 in your browser. Click on the second item in the list on the left to access the recovery page. The second item on the next page is where you select the firmware. Select the menu item containing "Atheros SDK" and "16MB" in the dropdown close to the buttom, and click on the button at the bottom to start installation/recovery. Notes: * RS232 is available on /dev/ttyUSB0 and RS485 on /dev/ttyUSB1 Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com> [removed unused poll-interval from gpio-keys, i2c-gpio 4.19 compat] Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
zbtlink,zbt-wd323|\
xiaomi,mi-router-4q)
ucidef_set_interface_wan "eth1"
ucidef_add_switch "switch0" \
"0@eth0" "3:lan:1" "4:lan:2"
;;
*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
esac
}
ath79_setup_macs()
{
local board="$1"
case "$board" in
avm,fritz300e)
lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
;;
ath79: add support for Fritz!Box 4020 This commit adds support for the AVM Fritz!Box 4020 WiFi-router. SoC: Qualcomm Atheros QCA9561 (Dragonfly) 750MHz RAM: Winbond W971GG6KB-25 FLASH: Macronix MX25L12835F WiFi: QCA9561 b/g/n 3x3 450Mbit/s USB: 1x USB 2.0 IN: WPS button, WiFi button OUT: Power LED green, Internet LED green, WLAN LED green, LAN LED green, INFO LED green, INFO LED red UART: Header Next to Black metal shield Pinout is 3.3V - RX - TX - GND (Square Pad is 3.3V) The Serial setting is 115200-8-N-1. Tested and working: - Ethernet (LAN + WAN) - WiFi (correct MAC) - Installation via EVA bootloader - OpenWRT sysupgrade - Buttons - LEDs The USB port doesn't work. Both Root Hubs are detected as having 0 Ports: [ 3.670807] kmodloader: loading kernel modules from /etc/modules-boot.d/* [ 3.723267] usbcore: registered new interface driver usbfs [ 3.729058] usbcore: registered new interface driver hub [ 3.734616] usbcore: registered new device driver usb [ 3.744181] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 3.758357] SCSI subsystem initialized [ 3.766026] ehci-platform: EHCI generic platform driver [ 3.771548] ehci-platform ehci-platform.0: EHCI Host Controller [ 3.777708] ehci-platform ehci-platform.0: new USB bus registered, assigned bus number 1 [ 3.788169] ehci-platform ehci-platform.0: irq 48, io mem 0x1b000000 [ 3.816647] ehci-platform ehci-platform.0: USB 2.0 started, EHCI 0.00 [ 3.824001] hub 1-0:1.0: USB hub found [ 3.828219] hub 1-0:1.0: config failed, hub doesn't have any ports! (err -19) [ 3.835825] ehci-platform ehci-platform.1: EHCI Host Controller [ 3.842009] ehci-platform ehci-platform.1: new USB bus registered, assigned bus number 2 [ 3.852481] ehci-platform ehci-platform.1: irq 49, io mem 0x1b400000 [ 3.886631] ehci-platform ehci-platform.1: USB 2.0 started, EHCI 0.00 [ 3.894011] hub 2-0:1.0: USB hub found [ 3.898190] hub 2-0:1.0: config failed, hub doesn't have any ports! (err -19) [ 3.908928] usbcore: registered new interface driver usb-storage [ 3.915634] kmodloader: done loading kernel modules from /etc/modules-boot.d/* A few words about the shift-register: AVM used a trick to control the shift-register for the LEDs with only 2 pins, SERCLK and MOSI. Q7S, normally used for daisy-chaining multiple shift-registers, pulls the latch, moving the shift register-state to the storage register. It also pulls down MR (normally pulled up) to clear the storage register, so the latch gets released and will not be pulled by the remaining bits in the shift-register. Shift register is all-zero after this. For that we need to make sure output 7 is set to high on driver probe. We accomplish this by using gpio-hogging. Installation via EVA: In the first seconds after Power is connected, the bootloader will listen for FTP connections on 169.254.157.1 (Might also be 192.168.178.1). Firmware can be uploaded like following: ftp> quote USER adam2 ftp> quote PASS adam2 ftp> binary ftp> debug ftp> passive ftp> quote MEDIA FLSH ftp> put openwrt-sysupgrade.bin mtd1 Note that this procedure might take up to two minutes. After transfer is complete you need to powercycle the device to boot OpenWRT. Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
avm,fritz4020)
lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
wan_mac=$(fritz_tffs -n macb -i $(find_mtd_part "tffs (1)"))
;;
dlink,dir-825-b1)
lan_mac=$(mtd_get_mac_text "caldata" 65440)
wan_mac=$(mtd_get_mac_text "caldata" 65460)
;;
dlink,dir-825-c1|\
dlink,dir-835-a1)
lan_mac=$(mtd_get_mac_text "mac" 4)
wan_mac=$(mtd_get_mac_text "mac" 24)
;;
dlink,dir-859-a1|\
nec,wg1200cr|\
wd,mynet-n750)
lan_mac=$(mtd_get_mac_ascii devdata "lanmac")
wan_mac=$(mtd_get_mac_ascii devdata "wanmac")
;;
elecom,wrc-1750ghbk2-i|\
elecom,wrc-300ghbk2-i)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary art 4098)" -2)
;;
engenius,ecb1750)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
;;
ath79: add suport for EnGenius EPG5000 EnGenius EPG5000 (v1.0.0, marketed as IoT Gateway) is a dual band wireless router. Specification SoC: Qualcomm Atheros QCA9558 RAM: 256 MB DDR2 Flash: 16 MB SPI NOR WIFI: 2.4 GHz 3T3R integrated 5 GHz 3T3R QCA9880 Mini PCIe card Ethernet: 5x 10/100/1000 Mbps QCA8337N USB: 1x 2.0 LEDS: 4x GPIO controlled Buttons: 2x GPIO controlled UART: 4 pin header, starting count from white triangle on PCB 1. VCC 3.3V, 2. GND, 3. TX, 4. RX baud: 115200, parity: none, flow control: none Installation 1. Connect to one of LAN (yellow) ethernet ports, 2. Open router configuration interface, 3. Go to Tools > Firmware, 4. Select OpenWrt factory image with dlf extension and hit Apply, 5. Wait few minutes, after the Power LED will stop blinking, the router is ready for configuration. Alternative installation 1. Prepare TFTP server with OpenWrt sysupgrade image, 2. Connect to one of LAN (yellow) ethernet ports, 3. Connect to UART port (leaving out VCC pin!), 4. Power on router, 5. When asked to enter a number 1 or 3 hit 2, this will select flashing image from TFTP server option, 6. You'll be prompted to enter TFTP server ip (default is 192.168.99.8), then router ip (default is 192.168.99.9) and for last, image name downloaded from TFTP server (default is uImageESR1200_1750), 7. After providing all information U-Boot will start flashing the image, You can observe progress on console, it'll take few minutes and when the Power LED will stop blinking, router is ready for configuration. Additional information If connected to UART, when prompted for number on boot, one can enter number 4 to open bootloader (U-Boot) command line. OEM firmware shell password is: aigo3d0a0tdagr useful for creating backup of original firmware. When doing upgrade from OpenWrt ar71xx image, it is recomended to not keep the old configuration. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
engenius,epg5000|\
iodata,wn-ac1167dgr|\
iodata,wn-ac1600dgr|\
iodata,wn-ac1600dgr2|\
iodata,wn-ag300dgr)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
;;
engenius,ews511ap)
lan_mac=$(mtd_get_mac_text "u-boot-env" 233)
eth1_mac=$(macaddr_add "$lan_mac" 1)
ucidef_set_interface "eth0" ifname "eth0" protocol "none" macaddr "$lan_mac"
ucidef_set_interface "eth1" ifname "eth1" protocol "none" macaddr "$eth1_mac"
;;
iodata,etg3-r)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
wan_mac=$(macaddr_add "$lan_mac" -1)
;;
ath79: add support for jjPlus JA76PF2 jjPlus JA76PF2 (marketed as IntellusPro2) is a network embedded board. Specification SoC: Atheros AR7161 RAM: 64 MB DDR Flash: 16 MB SPI NOR Ethernet: 2x 10/100/1000 Mbps AR8316 LAN (CN11), WAN/PoE (CN6 - close to power barrel connector, 48 V) MiniPCI: 2x LEDS: 4x, which 3 are GPIO controlled Buttons: 2x GPIO controlled Reset (SW1, closer to ethernet ports), WPS (SW2) Serial: 1x (only RX and TX are wired) baud: 115200, parity: none, flow control: none Currently there is one caveat compared to ar71xx target images as the MAC addresses are random on every reboot. To remedy this one needs to store the WAN MAC address in RedBoot configuration. OpenWrt on first boot, after flashing, will read out the address and assign proper ones to both WAN and LAN ports. It is iportant to NOT keep the old configuration when doing sysupgrade from ar71xx. Upgrading from OpenWrt ar71xx image 1. Connect to serial port, 2. Download OpenWrt sysupgrade image to /tmp directory and flash it with: sysupgrade -n <openwrt_sysupgrade_image_name> 3. After writing new image OpenWrt will reboot, now interrupt boot process and enter RedBoot (bootloader) command line by pressing Ctrl+C, 4. Enter following commands (replace variable accordingly), set_mac (to view MAC addresses) alias ethaddr <wan_port_mac_adress> (confirm storing the value by inputting y and pressing Enter) reset 5. Now board should restart and boot OpenWrt with proper MAC addresses. Installation 1. Prepare TFTP server with OpenWrt initramfs image, 2. Connect to WAN ethernet port, 3. Connect to serial port, 4. Power on the board and enter RedBoot (bootloader) command line by pressing Ctrl+C, 5. Enter following commands (replace variables accordingly): set_mac (to view MAC addresses) alias ethaddr <wan_port_mac_address> (confirm storing the value by inputting y and pressing Enter) ip_adress -l <board_ip_adress>/24 -h <tftp_server_ip_adress> load -r -b 0x80060000 <openwrt_initramfs_image_name> exec -c "" 6. Now board should boot OpenWrt initramfs image, 7. Download OpenWrt sysupgrade image to /tmp directory and flash it with: sysupgrade <openwrt_sysupgrade_image_name> 8. Wait few minutes, after the D2 LED will stop blinking, the board is ready for configuration. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
jjplus,ja76pf2)
wan_mac=$(fconfig -s -r -d $(find_mtd_part "RedBoot config") -n alias/ethaddr)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
nec,wg800hp)
lan_mac=$(mtd_get_mac_text board_data 640)
wan_mac=$(mtd_get_mac_text board_data 1152)
;;
netgear,wndr3700|\
netgear,wndr3700v2|\
netgear,wndr3800)
lan_mac=$(macaddr_setbit_la "$(mtd_get_mac_binary art 0)")
;;
phicomm,k2t)
lan_mac=$(k2t_get_mac "lan_mac")
wan_mac=$(k2t_get_mac "wan_mac")
;;
rosinson,wr818)
wan_mac=$(mtd_get_mac_binary factory 0)
lan_mac=$(macaddr_setbit_la "$wan_mac")
;;
tplink,archer-a7-v5|\
tplink,archer-c7-v4|\
tplink,archer-c7-v5|\
tplink,tl-wr1043nd-v4|\
tplink,tl-wr1043n-v5)
base_mac=$(mtd_get_mac_binary info 8)
wan_mac=$(macaddr_add "$base_mac" 1)
;;
tplink,tl-wdr3600-v1|\
tplink,tl-wdr4300-v1|\
tplink,tl-wdr4300-v1-il)
base_mac=$(mtd_get_mac_binary u-boot 0x1fc00)
wan_mac=$(macaddr_add "$base_mac" 1)
;;
tplink,tl-wr941-v2|\
tplink,tl-wr941n-v7-cn)
base_mac=$(mtd_get_mac_binary u-boot 130048)
wan_mac=$(macaddr_add "$base_mac" 1)
;;
ath79: initial support for Ubiquiti RouterStation and RouterStation Pro This adds a shared ar7161_ubnt_routerstation.dtsi as well as two other .dts files that utilize it, ar7161_ubnt_routerstation.dts and ar7161_ubnt_routerstation-pro.dts. The modifications to generic-ubnt.mk, config-default, and base-files necessary for image generation, parsing RedBoot FIS partitions, network configuration, and sysupgrade are also included. This reintroduces vital bits from platform_do_upgrade_combined() and its supporting functions to /lib/upgrade/platform.sh, which were previously removed from ath79 in 3e9d9f62258f80298710441e0db557e59e152dcf "ath79: sysupgrade: drop unused platform checks". The new function is called "routerstation_do_upgrade" and will *only* work for the RouterStation series of boards. It does however retain the ability to downgrade (e.g. from master -> 17.01.x using sysupgrade -F). All hardware is functional including the AR8216 switch (for the Pro), wireless via ath5k/ath9k using the miniPCI slots, flash, USB, button, and LED. Switch and LAN/WAN configuration is the same as it is with the equivalent ar71xx targets. MAC addresses are assigned based upon the content stored in the RedBoot config partition. Flashing via both sysupgrade and TFTP has been confirmed to work. Also, the initramfs images are now raw .bin files instead of being wrapped in a uImage (as they currently are in ar71xx), which makes them bootable with RedBoot. One notable difference to ar71xx is the inclusion of the RedBoot "fconfig" utility (analogous to U-Boot’s fw_printenv/fw_setenv) in DEVICE_PACKAGES. The FIS partitions are probed using the RedBoot MTD parser’s DT binding, whose proper usage is mutually exclusive to defining a separate fixed-partitions node for "RedBoot config". This config partition contains the board's base MAC address. The lack of a hard-coded flash location means that the mtd-mac-address property cannot be used in the .dts, so instead fconfig is used to read the MAC addresses from flash in userspace during first boot. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl> Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
6 years ago
ubnt,routerstation|\
ubnt,routerstation-pro)
wan_mac=$(fconfig -s -r -d $(find_mtd_part "RedBoot config") -n ar7100_esa)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
wd,mynet-wifi-rangeextender)
lan_mac=$(nvram get et0macaddr)
;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
}
board_config_update
board=$(board_name)
ath79_setup_interfaces $board
ath79_setup_macs $board
board_config_flush
exit 0