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/hotplug.d/firmware/11-ath10k-caldata

163 lines
4.4 KiB
Plaintext

#!/bin/sh
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
. /lib/functions/k2t.sh
board=$(board_name)
case "$FIRMWARE" in
"ath10k/cal-pci-0000:00:00.0.bin")
case $board in
comfast,cf-wr650ac-v1|\
comfast,cf-wr650ac-v2|\
yuncore,a770)
caldata_extract "art" 0x5000 0x844
;;
devolo,dvl1200e|\
devolo,dvl1200i|\
devolo,dvl1750c|\
devolo,dvl1750e|\
devolo,dvl1750i|\
devolo,dvl1750x)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0x0) -1)
;;
dlink,dir-859-a1)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac")
;;
elecom,wrc-1750ghbk2-i)
caldata_extract "art" 0x5000 0x844
;;
engenius,ecb1750)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(mtd_get_mac_ascii u-boot-env athaddr)
;;
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-ac1600dgr2)
caldata_extract "art" 0x5000 0x844
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
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
;;
engenius,ews511ap)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
;;
glinet,gl-ar750|\
glinet,gl-ar750s)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1)
;;
glinet,gl-x750)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2)
;;
nec,wg800hp)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac_crc $(mtd_get_mac_text board_data 0x880)
;;
ocedo,koala|\
ocedo,ursus)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(mtd_get_mac_binary art 0xc)
;;
openmesh,om5p-ac-v2)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
;;
qihoo,c301)
caldata_extract "radiocfg" 0x5000 0x844
ath10kcal_patch_mac_crc $(mtd_get_mac_ascii devdata wlan5mac)
;;
tplink,archer-a7-v5|\
tplink,archer-c2-v3|\
tplink,archer-c7-v4|\
tplink,archer-c7-v5|\
tplink,archer-c25-v1)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) -1)
;;
tplink,archer-c5-v1|\
tplink,archer-c7-v2)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x1fc00) -1)
;;
tplink,archer-d50-v1)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary romfile 0xf100) +2)
;;
tplink,re350k-v1)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary config 0x10008) +2)
;;
tplink,re355-v1|\
tplink,re450-v1)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -2)
;;
tplink,re450-v2)
caldata_extract "art" 0x5000 0x844
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1)
;;
ubnt,unifiac-lite|\
ubnt,unifiac-lr|\
ubnt,unifiac-mesh|\
ubnt,unifiac-mesh-pro|\
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|\
ubnt,nanostation-ac-loco|\
ubnt,unifiac-pro)
caldata_extract "EEPROM" 0x5000 0x844
;;
esac
;;
"ath10k/pre-cal-pci-0000:00:00.0.bin")
case $board in
ath79: add support for COMFAST CF-E313AC This patch adds support for the COMFAST CF-E313AC, an outdoor wireless CPE with two Ethernet ports and a 802.11ac radio. Specifications: - QCA9531 SoC - 650/400/216 MHz (CPU/DDR/AHB) - 1x 10/100 Mbps WAN Ethernet, 48V PoE-in - 1x 10/100 Mbps LAN Ethernet, pass-through 48V PoE-out - 1x manual pass-through PoE switch - 64 MB RAM (DDR2) - 16 MB FLASH - QCA9886 2T2R 5 GHz 802.11ac, 23 dBm - 12 dBi built-in antenna - POWER/LAN/WAN/WLAN green LEDs - 4x RSSI LEDs (2x red, 2x green) - UART (115200 8N1) Flashing instructions: The original firmware is based on OpenWrt so a sysupgrade image can be installed via the stock web GUI. Settings from the original firmware will be saved and restored on the new one, so a factory reset will be needed. To do so, once the new firmware is flashed, enter into failsafe mode by pressing the reset button several times during the boot process, while the WAN LED flashes, until it starts flashing faster. Once in failsafe mode, perform a factory reset as usual. Alternatively, the U-boot bootloader contains a recovery HTTP server to upload the firmware. Push the reset button while powering the device on and keep it pressed for >10 seconds. The device's LEDs will blink several times and the recovery page will be at http://192.168.1.1; use it to upload the sysupgrade image. Note: Four MAC addresses are stored in the "art" partition (read-only): - 0x0000: 40:A5:EF:AA:AA:A0 - 0x0006: 40:A5:EF:AA:AA:A2 - 0x1002: 40:A5:EF:AA:AA:A1 - 0x5006: 40:A5:EF:AA.AA:A3 (inside the 5 GHz calibration data) The stock firmware assigns MAC addresses to physical and virtual interfaces in a very particular way: - eth0 corresponds to the physical Ethernet port labeled as WAN - eth1 corresponds to the physical Ethernet port labeled as LAN - eth0 belongs to the bridge interface br-wan - eth1 belongs to the bridge interface br-lan - eth0 is assigned the MAC from 0x0 (*:A0) - eth1 is assigned the MAC from 0x1002 (*:A1) - br-wan is forced to use the MAC from 0x1002 (*:A1) - br-lan is forced to use the MAC from 0x0 (*:A0) - radio0 uses the calibration data from 0x5000 (which contains a valid MAC address, *:A3). However, it is overwritten by the one at 0x6 (*:A2) This commit preserves the LAN/WAN roles of the physical Ethernet ports (as labeled on the router) and the MAC addresses they expose by default (i.e., *:A0 on LAN, *:A1 on WAN), but swaps the position of the eth0/eth1 compared to the stock firmware: - eth0 corresponds to the physical Ethernet port labeled as LAN - eth1 corresponds to the physical Ethernet port labeled as WAN - eth0 belongs to the bridge interface br-lan - eth1 is the interface at @wan - eth0 is assigned the MAC from 0x0 (*:A0) - eth1 is assigned the MAC from 0x1002 (*:A1) - br-lan inherits the MAC from eth0 (*:A0) - @wan inherits the MAC from eth1 (*:A1) - radio0's MAC is overwritten to the one at 0x6 This way, eth0/eth1's positions differ from the stock firmware, but the weird MAC ressignations in br-lan/br-wan are avoided while the external behaviour of the router is maintained. Additionally, WAN port is connected to the PHY gmac, allowing to monitor the link status (e.g., to restart DHCP negotiation when plugging a cable). Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
5 years ago
comfast,cf-e313ac)
caldata_extract "art" 0x5000 0x2f20
ath79: add support for COMFAST CF-E313AC This patch adds support for the COMFAST CF-E313AC, an outdoor wireless CPE with two Ethernet ports and a 802.11ac radio. Specifications: - QCA9531 SoC - 650/400/216 MHz (CPU/DDR/AHB) - 1x 10/100 Mbps WAN Ethernet, 48V PoE-in - 1x 10/100 Mbps LAN Ethernet, pass-through 48V PoE-out - 1x manual pass-through PoE switch - 64 MB RAM (DDR2) - 16 MB FLASH - QCA9886 2T2R 5 GHz 802.11ac, 23 dBm - 12 dBi built-in antenna - POWER/LAN/WAN/WLAN green LEDs - 4x RSSI LEDs (2x red, 2x green) - UART (115200 8N1) Flashing instructions: The original firmware is based on OpenWrt so a sysupgrade image can be installed via the stock web GUI. Settings from the original firmware will be saved and restored on the new one, so a factory reset will be needed. To do so, once the new firmware is flashed, enter into failsafe mode by pressing the reset button several times during the boot process, while the WAN LED flashes, until it starts flashing faster. Once in failsafe mode, perform a factory reset as usual. Alternatively, the U-boot bootloader contains a recovery HTTP server to upload the firmware. Push the reset button while powering the device on and keep it pressed for >10 seconds. The device's LEDs will blink several times and the recovery page will be at http://192.168.1.1; use it to upload the sysupgrade image. Note: Four MAC addresses are stored in the "art" partition (read-only): - 0x0000: 40:A5:EF:AA:AA:A0 - 0x0006: 40:A5:EF:AA:AA:A2 - 0x1002: 40:A5:EF:AA:AA:A1 - 0x5006: 40:A5:EF:AA.AA:A3 (inside the 5 GHz calibration data) The stock firmware assigns MAC addresses to physical and virtual interfaces in a very particular way: - eth0 corresponds to the physical Ethernet port labeled as WAN - eth1 corresponds to the physical Ethernet port labeled as LAN - eth0 belongs to the bridge interface br-wan - eth1 belongs to the bridge interface br-lan - eth0 is assigned the MAC from 0x0 (*:A0) - eth1 is assigned the MAC from 0x1002 (*:A1) - br-wan is forced to use the MAC from 0x1002 (*:A1) - br-lan is forced to use the MAC from 0x0 (*:A0) - radio0 uses the calibration data from 0x5000 (which contains a valid MAC address, *:A3). However, it is overwritten by the one at 0x6 (*:A2) This commit preserves the LAN/WAN roles of the physical Ethernet ports (as labeled on the router) and the MAC addresses they expose by default (i.e., *:A0 on LAN, *:A1 on WAN), but swaps the position of the eth0/eth1 compared to the stock firmware: - eth0 corresponds to the physical Ethernet port labeled as LAN - eth1 corresponds to the physical Ethernet port labeled as WAN - eth0 belongs to the bridge interface br-lan - eth1 is the interface at @wan - eth0 is assigned the MAC from 0x0 (*:A0) - eth1 is assigned the MAC from 0x1002 (*:A1) - br-lan inherits the MAC from eth0 (*:A0) - @wan inherits the MAC from eth1 (*:A1) - radio0's MAC is overwritten to the one at 0x6 This way, eth0/eth1's positions differ from the stock firmware, but the weird MAC ressignations in br-lan/br-wan are avoided while the external behaviour of the router is maintained. Additionally, WAN port is connected to the PHY gmac, allowing to monitor the link status (e.g., to restart DHCP negotiation when plugging a cable). Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
5 years ago
ath10kcal_patch_mac_crc $(mtd_get_mac_binary art 0x6)
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
rm /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
;;
dlink,dir-842-c1|\
dlink,dir-842-c2|\
dlink,dir-842-c3|\
nec,wg1200cr)
caldata_extract "art" 0x5000 0x2f20
ath10kcal_patch_mac_crc $(mtd_get_mac_ascii devdata wlan5mac)
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
;;
netgear,ex6400|\
netgear,ex7300)
caldata_extract "caldata" 0x5000 0x2f20
ath10kcal_patch_mac $(mtd_get_mac_binary caldata 0xc)
;;
phicomm,k2t)
caldata_extract "art" 0x5000 0x2f20
ath10kcal_patch_mac_crc $(k2t_get_mac "5g_mac")
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
;;
tplink,archer-c58-v1|\
tplink,archer-c59-v1|\
tplink,archer-c59-v2|\
tplink,archer-c60-v1|\
tplink,archer-c60-v2|\
tplink,archer-c6-v2)
caldata_extract "art" 0x5000 0x2f20
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary mac 0x8) -1)
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
;;
esac
;;
*)
exit 1
;;
esac