2015-04-07 20:04:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
ath10kcal_die() {
|
|
|
|
echo "ath10cal: " "$*"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
ath10kcal_from_file() {
|
|
|
|
local source=$1
|
|
|
|
local offset=$2
|
2015-07-07 13:47:57 +00:00
|
|
|
local count=$3
|
2015-04-07 20:04:14 +00:00
|
|
|
|
2015-07-07 13:47:57 +00:00
|
|
|
dd if=$source of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
|
2015-04-07 20:04:14 +00:00
|
|
|
ath10kcal_die "failed to extract calibration data from $source"
|
|
|
|
}
|
|
|
|
|
2015-07-07 13:47:57 +00:00
|
|
|
ath10kcal_extract() {
|
|
|
|
local part=$1
|
|
|
|
local offset=$2
|
|
|
|
local count=$3
|
|
|
|
local mtd
|
|
|
|
|
|
|
|
mtd=$(find_mtd_chardev $part)
|
|
|
|
[ -n "$mtd" ] || \
|
|
|
|
ath10kcal_die "no mtd device found for partition $part"
|
|
|
|
|
|
|
|
dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
|
|
|
|
ath10kcal_die "failed to extract calibration data from $mtd"
|
|
|
|
}
|
|
|
|
|
|
|
|
ath10kcal_patch_mac() {
|
|
|
|
local mac=$1
|
|
|
|
|
|
|
|
[ -z "$mac" ] && return
|
|
|
|
|
|
|
|
macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=6 count=6
|
|
|
|
}
|
|
|
|
|
2015-04-07 20:04:14 +00:00
|
|
|
[ -e /lib/firmware/$FIRMWARE ] && exit 0
|
|
|
|
|
|
|
|
. /lib/ar71xx.sh
|
|
|
|
. /lib/functions.sh
|
|
|
|
. /lib/functions/system.sh
|
|
|
|
|
|
|
|
board=$(ar71xx_board_name)
|
|
|
|
|
|
|
|
case "$FIRMWARE" in
|
2015-07-07 13:47:57 +00:00
|
|
|
"ath10k/cal-pci-0000:00:00.0.bin")
|
|
|
|
case $board in
|
ar71xx: add support for COMFAST CF-E380AC v1 and v2
COMFAST CF-E380AC v1/v2 is a ceiling mount AP with PoE
support, based on Qualcomm/Atheros QCA9558+QCA9880+AR8035.
There are two versions of this model, with different RAM
and U-Boot mtd partition sizes:
- v1: 128 MB of RAM, 128 KB U-Boot image size
- v2: 256 MB of RAM, 256 KB U-Boot image size
Version number is available only inside vendor GUI,
hardware and markings are the same.
Short specification:
- 720/600/200 MHz (CPU/DDR/AHB)
- 1x 10/100/1000 Mbps Ethernet, with PoE support
- 128 or 256 MB of RAM (DDR2)
- 16 MB of FLASH
- 3T3R 2.4 GHz, with external PA (SE2576L), up to 28 dBm
- 3T3R 5 GHz, with external PA (SE5003L1), up to 30 dBm
- 6x internal antennas
- 1x RGB LED, 1x button
- UART (T11), LEDs/GPIO (J7) and USB (T12) headers on PCB
- external watchdog (Pericon Technology PT7A7514)
Flash instruction:
Original firmware is based on OpenWrt.
Use sysupgrade image directly in vendor GUI.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2016-11-14 16:38:23 +00:00
|
|
|
cf-e380ac-v1|\
|
|
|
|
cf-e380ac-v2|\
|
ar71xx: add support for YunCore SR3200 and XD3200
YunCore SR3200 is a dual-band AC1200 router, based on Qualcomm/Atheros
QCA9563+QCA9882+QCA8337N.
YunCore XD3200 (FCC ID: 2ADUG-XD3200) is a dual-band AC1200 ceiling mount
AP with PoE support, based on Qualcomm/Atheros QCA9563+QCA9882+QCA8334.
Common specification:
- 775/650/258 MHz (CPU/DDR/AHB)
- 128 MB or RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 2T2R 2.4 GHz, with ext. PA (SKY65174-21), up to 30 dBm
- 2T2R 5 GHz, with ext. PA (SKY85405-11) and LNA (SKY85601-11), up to 30 dBm
SR3200 specification:
- 5x 10/100/1000 Mbps Ethernet
- 6x ext. RP-SMA antennas (actually, only 4 are connected with radio chips)
- 3x LED (+ 5x LED in RJ45 sockets), 1x button
- UART header on PCB
XD3200 specification:
- 2x 10/100/1000 Mbps Ethernet, with 802.3at PoE support (WAN port)
- 4x internal antennas
- 3 sets of LEDs on external PCB (+ 2x LED near RJ45 sockets), 1x button
- UART and JTAG (custom 6-pin, 2 mm pitch) headers on PCB
LED for 5 GHz WLAN is currently not supported on both devices as it is
connected directly to the QCA9882 radio chip.
Flash instruction under vendor firmware, using telnet/SSH:
1. If your firmware does not have root password, go to point 5
2. Connect PC with 192.168.1.x address to LAN or WAN port
3. Power up device, enter failsafe mode with button (no LED indicator!)
4. Change root password and reboot (mount_root, passwd ..., reboot -f)
5. Upload lede-ar71xx-...-sysupgrade.bin to /tmp using SCP
6. Connect PC with 192.168.188.x address to LAN port, SSH to 192.168.188.253
7. Invoke:
- cd /tmp
- fw_setenv bootcmd "bootm 0x9fe80000 || bootm 0x9f050000"
- mtd -e firmware -r write lede-ar71xx-...-sysupgrade.bin firmware
Flash instruction under U-Boot, using UART:
1. tftp 0x80060000 lede-ar71xx-...-sysupgrade.bin
2. erase 0x9f050000 +$filesize
3. cp.b $fileaddr 0x9f050000 $filesize
4. setenv bootcmd "bootm 0x9fe80000 || bootm 0x9f050000"
5. saveenv && reset
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2016-12-02 21:42:41 +00:00
|
|
|
dlan-pro-1200-ac|\
|
|
|
|
sr3200|\
|
|
|
|
xd3200)
|
ar71xx: add support for COMFAST CF-E380AC v1 and v2
COMFAST CF-E380AC v1/v2 is a ceiling mount AP with PoE
support, based on Qualcomm/Atheros QCA9558+QCA9880+AR8035.
There are two versions of this model, with different RAM
and U-Boot mtd partition sizes:
- v1: 128 MB of RAM, 128 KB U-Boot image size
- v2: 256 MB of RAM, 256 KB U-Boot image size
Version number is available only inside vendor GUI,
hardware and markings are the same.
Short specification:
- 720/600/200 MHz (CPU/DDR/AHB)
- 1x 10/100/1000 Mbps Ethernet, with PoE support
- 128 or 256 MB of RAM (DDR2)
- 16 MB of FLASH
- 3T3R 2.4 GHz, with external PA (SE2576L), up to 28 dBm
- 3T3R 5 GHz, with external PA (SE5003L1), up to 30 dBm
- 6x internal antennas
- 1x RGB LED, 1x button
- UART (T11), LEDs/GPIO (J7) and USB (T12) headers on PCB
- external watchdog (Pericon Technology PT7A7514)
Flash instruction:
Original firmware is based on OpenWrt.
Use sysupgrade image directly in vendor GUI.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2016-11-14 16:38:23 +00:00
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
;;
|
2016-07-18 17:39:57 +00:00
|
|
|
dap-2695-a1)
|
|
|
|
ath10kcal_extract "radiocfg" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac_a)
|
|
|
|
;;
|
2016-10-11 18:32:26 +00:00
|
|
|
dir-869-a1 | \
|
2015-07-07 13:47:57 +00:00
|
|
|
qihoo-c301)
|
|
|
|
ath10kcal_extract "radiocfg" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(mtd_get_mac_ascii devdata wlan5mac)
|
|
|
|
;;
|
2016-11-20 22:18:53 +00:00
|
|
|
dw33d)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(mtd_get_mac_binary art 18)
|
|
|
|
;;
|
|
|
|
epg5000 | \
|
|
|
|
esr1750)
|
2015-07-18 21:15:42 +00:00
|
|
|
ath10kcal_extract "caldata" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
|
|
|
|
;;
|
2016-11-20 22:18:53 +00:00
|
|
|
mc-mac1200r)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -1)
|
|
|
|
;;
|
2016-04-09 10:26:31 +00:00
|
|
|
mr1750 | \
|
2016-05-20 15:53:18 +00:00
|
|
|
mr1750v2 | \
|
2016-04-09 10:26:31 +00:00
|
|
|
om5p-acv2)
|
2015-09-14 20:12:00 +00:00
|
|
|
ath10kcal_extract "ART" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
|
|
|
|
;;
|
2016-11-20 22:18:53 +00:00
|
|
|
r6100)
|
|
|
|
ath10kcal_extract "caldata" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) +2)
|
|
|
|
;;
|
|
|
|
tl-wdr6500-v2)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2)
|
|
|
|
;;
|
2016-11-07 14:37:25 +00:00
|
|
|
tl-wpa8630)
|
2016-11-14 20:55:25 +00:00
|
|
|
ath10kcal_extract "art" 20480 2116
|
2016-11-07 14:37:25 +00:00
|
|
|
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
|
|
|
|
;;
|
2016-05-11 07:40:00 +00:00
|
|
|
unifiac-lite | \
|
|
|
|
unifiac-pro)
|
2016-02-12 08:31:32 +00:00
|
|
|
ath10kcal_extract "EEPROM" 20480 2116
|
|
|
|
;;
|
2015-07-07 13:47:57 +00:00
|
|
|
esac
|
|
|
|
;;
|
2015-04-07 20:04:14 +00:00
|
|
|
"ath10k/cal-pci-0000:01:00.0.bin")
|
|
|
|
case $board in
|
2015-07-07 13:47:57 +00:00
|
|
|
archer-c5 | \
|
|
|
|
archer-c7)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2)
|
|
|
|
;;
|
2015-11-07 12:51:39 +00:00
|
|
|
nbg6616 | \
|
2015-07-07 13:47:57 +00:00
|
|
|
nbg6716)
|
|
|
|
ath10kcal_extract "RFdata" 20480 2116
|
2015-11-07 12:51:39 +00:00
|
|
|
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2)
|
2015-07-07 13:47:57 +00:00
|
|
|
;;
|
2016-04-09 10:26:08 +00:00
|
|
|
om5p-ac)
|
|
|
|
ath10kcal_extract "ART" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
|
|
|
|
;;
|
2016-11-20 22:18:53 +00:00
|
|
|
rb-911g-5hpacd)
|
|
|
|
ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116
|
|
|
|
;;
|
2015-04-07 20:04:14 +00:00
|
|
|
esac
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|