2018-05-06 08:20:11 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2018-06-13 13:14:49 +00:00
|
|
|
. /lib/functions/k2t.sh
|
|
|
|
|
|
|
|
# xor multiple hex values of the same length
|
|
|
|
xor() {
|
|
|
|
local val
|
|
|
|
local ret="0x$1"
|
|
|
|
local retlen=${#1}
|
|
|
|
|
|
|
|
shift
|
|
|
|
while [ -n "$1" ]; do
|
|
|
|
val="0x$1"
|
|
|
|
ret=$((ret ^ val))
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
printf "%0${retlen}x" "$ret"
|
|
|
|
}
|
|
|
|
|
2018-05-06 08:20:11 +00:00
|
|
|
ath10kcal_die() {
|
|
|
|
echo "ath10cal: " "$*"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
ath10kcal_from_file() {
|
|
|
|
local source=$1
|
|
|
|
local offset=$2
|
|
|
|
local count=$3
|
|
|
|
|
2019-03-07 08:40:07 +00:00
|
|
|
dd if=$source of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
|
2018-05-06 08:20:11 +00:00
|
|
|
ath10kcal_die "failed to extract calibration data from $source"
|
|
|
|
}
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
2019-03-07 08:40:07 +00:00
|
|
|
dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
|
2018-05-06 08:20:11 +00:00
|
|
|
ath10kcal_die "failed to extract calibration data from $mtd"
|
|
|
|
}
|
|
|
|
|
|
|
|
ath10kcal_patch_mac() {
|
|
|
|
local mac=$1
|
|
|
|
|
|
|
|
[ -z "$mac" ] && return
|
|
|
|
|
2019-03-07 08:40:07 +00:00
|
|
|
macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc oflag=seek_bytes bs=6 seek=6 count=1
|
2018-05-06 08:20:11 +00:00
|
|
|
}
|
|
|
|
|
2018-06-13 13:14:49 +00:00
|
|
|
ath10kcal_patch_mac_crc() {
|
|
|
|
local mac=$1
|
|
|
|
local mac_offset=6
|
|
|
|
local chksum_offset=2
|
|
|
|
local xor_mac
|
|
|
|
local xor_fw_mac
|
|
|
|
local xor_fw_chksum
|
|
|
|
|
|
|
|
xor_fw_mac=$(hexdump -v -n 6 -s $mac_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
|
|
|
|
xor_fw_mac="${xor_fw_mac:0:4} ${xor_fw_mac:4:4} ${xor_fw_mac:8:4}"
|
|
|
|
|
|
|
|
ath10kcal_patch_mac "$mac" && {
|
|
|
|
xor_mac=${mac//:/}
|
|
|
|
xor_mac="${xor_mac:0:4} ${xor_mac:4:4} ${xor_mac:8:4}"
|
|
|
|
|
|
|
|
xor_fw_chksum=$(hexdump -v -n 2 -s $chksum_offset -e '/1 "%02x"' /lib/firmware/$FIRMWARE)
|
|
|
|
xor_fw_chksum=$(xor $xor_fw_chksum $xor_fw_mac $xor_mac)
|
|
|
|
|
|
|
|
printf "%b" "\x${xor_fw_chksum:0:2}\x${xor_fw_chksum:2:2}" | \
|
|
|
|
dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=$chksum_offset count=2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-05-06 08:20:11 +00:00
|
|
|
[ -e /lib/firmware/$FIRMWARE ] && exit 0
|
|
|
|
|
|
|
|
. /lib/functions.sh
|
|
|
|
. /lib/functions/system.sh
|
|
|
|
|
|
|
|
board=$(board_name)
|
|
|
|
|
|
|
|
case "$FIRMWARE" in
|
|
|
|
"ath10k/cal-pci-0000:00:00.0.bin")
|
|
|
|
case $board in
|
2018-12-27 01:32:39 +00:00
|
|
|
devolo,dvl1200e|\
|
2019-01-01 18:17:23 +00:00
|
|
|
devolo,dvl1200i|\
|
2019-01-01 18:17:22 +00:00
|
|
|
devolo,dvl1750c|\
|
2019-01-20 16:46:42 +00:00
|
|
|
devolo,dvl1750e|\
|
2019-01-01 18:17:22 +00:00
|
|
|
devolo,dvl1750i)
|
2018-12-27 01:32:38 +00:00
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0) -1)
|
|
|
|
;;
|
2018-12-29 09:22:32 +00:00
|
|
|
dlink,dir-859-a1)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac")
|
|
|
|
;;
|
2018-12-29 15:55:35 +00:00
|
|
|
elecom,wrc-1750ghbk2-i)
|
2019-06-05 13:59:30 +00:00
|
|
|
ath10kcal_extract "art" 20480 2116
|
2018-12-29 15:55:35 +00:00
|
|
|
;;
|
2019-03-26 21:35:05 +00:00
|
|
|
engenius,ecb1750)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
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>
2019-03-04 14:18:53 +00:00
|
|
|
engenius,epg5000|\
|
|
|
|
iodata,wn-ac1167dgr|\
|
|
|
|
iodata,wn-ac1600dgr2)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
|
|
|
|
;;
|
2019-06-05 13:31:32 +00:00
|
|
|
engenius,ews511ap)
|
2018-11-05 02:03:05 +00:00
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
|
|
|
|
;;
|
2019-06-05 13:31:32 +00:00
|
|
|
glinet,gl-ar750s)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0) +1)
|
|
|
|
;;
|
|
|
|
glinet,gl-x750)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0) +2)
|
|
|
|
;;
|
2018-12-08 06:18:17 +00:00
|
|
|
nec,wg800hp)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
ath10kcal_patch_mac_crc $(mtd_get_mac_text board_data 2176)
|
|
|
|
;;
|
2019-03-21 15:43:27 +00:00
|
|
|
ocedo,koala|\
|
|
|
|
ocedo,ursus)
|
2018-08-08 20:13:44 +00:00
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(mtd_get_mac_binary art 12)
|
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
openmesh,om5p-ac-v2)
|
2019-06-05 13:59:30 +00:00
|
|
|
ath10kcal_extract "art" 20480 2116
|
2018-05-06 08:20:11 +00:00
|
|
|
ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
|
|
|
|
;;
|
2019-06-05 13:31:32 +00:00
|
|
|
tplink,archer-a7-v5|\
|
2019-06-05 13:59:30 +00:00
|
|
|
tplink,archer-c2-v3|\
|
2019-06-05 13:31:32 +00:00
|
|
|
tplink,archer-c7-v4|\
|
|
|
|
tplink,archer-c7-v5)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary info 8) -1)
|
|
|
|
;;
|
2019-02-25 18:27:28 +00:00
|
|
|
tplink,archer-c5-v1|\
|
2018-08-02 07:14:10 +00:00
|
|
|
tplink,archer-c7-v2)
|
2018-06-29 03:44:58 +00:00
|
|
|
ath10kcal_extract "art" 20480 2116
|
2019-06-05 13:31:32 +00:00
|
|
|
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x1fc00) -1)
|
2018-12-24 02:36:59 +00:00
|
|
|
;;
|
2019-05-05 20:35:00 +00:00
|
|
|
tplink,archer-d50-v1)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
2019-06-05 13:31:32 +00:00
|
|
|
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary romfile 0xf100) +2)
|
2019-05-05 20:35:00 +00:00
|
|
|
;;
|
2019-03-11 17:50:42 +00:00
|
|
|
tplink,re350k-v1)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
2019-06-05 13:31:32 +00:00
|
|
|
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary config 0x10008) +2)
|
|
|
|
;;
|
|
|
|
tplink,re450-v2)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary info 8) +1)
|
2019-03-11 17:50:42 +00:00
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
ubnt,unifiac-lite|\
|
|
|
|
ubnt,unifiac-mesh|\
|
|
|
|
ubnt,unifiac-mesh-pro|\
|
2018-09-19 12:17:35 +00:00
|
|
|
ubnt,lap-120|\
|
2019-01-08 14:27:57 +00:00
|
|
|
ubnt,nanobeam-ac|\
|
2018-09-04 00:08:01 +00:00
|
|
|
ubnt,nanostation-ac|\
|
2018-01-23 10:36:41 +00:00
|
|
|
ubnt,nanostation-ac-loco|\
|
2018-08-02 07:14:10 +00:00
|
|
|
ubnt,unifiac-pro)
|
2018-06-05 12:38:02 +00:00
|
|
|
ath10kcal_extract "EEPROM" 20480 2116
|
|
|
|
;;
|
ath79: add support for YunCore A770
YunCore A770 is a ceiling AC750 AP with 2 Fast Ethernet ports, PoE
(802.3at) support, based on QCA9531 + QCA9887.
Specification:
- 650/597/216 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of flash (SPI NOR)
- 2x 10/100 Mbps Ethernet (PoE 802.3at support in WAN port)
- 2T2R 2.4 GHz (QCA9531), with ext. PA and LNA
- 1T1R 5 GHz (QCA9887), with ext. FEM (SKY85728-11)
- 2x regular LED, 1x RGB LED (all driven by GPIO)
- 1x button (reset)
- DC jack for main power input (12 V)
- UART header on PCB
Flash instruction:
1. First, gain root access to the device, following below steps:
- Login into web gui (default password/IP: admin/192.168.188.253).
- Go to 'Advanced' -> 'Management' -> 'System' and download backup of
configuration (bakfile.bin).
- Open the file as tar.gz archive, edit/update 'shadow' file and change
hash of root password to something known.
- Repack the archive, rename it back to 'bakfile.bin' and use to
restore configuration of the device.
- After that, device will reboot and can be accessed over SSH.
2. Then, install OpenWrt:
- Login over SSH and issue command:
fw_setenv bootcmd "bootm 0x9f050000 || bootm 0x9fe80000"
- Upload 'sysupgrade' image and install it (only if previous command
succeeded) with command: 'sysupgrade -n -F openwrt-...'.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2019-03-09 15:31:17 +00:00
|
|
|
yuncore,a770)
|
|
|
|
ath10kcal_extract "art" 20480 2116
|
|
|
|
;;
|
2018-05-06 08:20:11 +00:00
|
|
|
esac
|
|
|
|
;;
|
2018-06-13 13:14:49 +00:00
|
|
|
"ath10k/pre-cal-pci-0000:00:00.0.bin")
|
|
|
|
case $board in
|
2019-03-16 04:27:32 +00:00
|
|
|
nec,wg1200cr)
|
|
|
|
ath10kcal_extract "art" 20480 12064
|
|
|
|
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
|
|
|
|
;;
|
ath79: add support for Netgear EX6400 and EX7300
This is sold as a dual-band 802.11ac range extender. It has a sliding
switch for Extender mode or Access Point mode, a WPS button, a recessed
Reset button, a hard-power button, and a multitude of LED's, some
multiplexed via an NXP 74AHC164D chip. The internal serial header pinout is
Vcc, Tx, Rx, GND, with GND closest to the corner of the board. You may
connect at 115200 bps, 8 data bits, no parity, 1 stop bit.
Specification:
- System-On-Chip: QCA9558
- CPU/Speed: 720 MHz
- Flash-Chip: Winbond 25Q128FVSG
- Flash size: 16 MiB
- RAM: 128 MiB
- Wireless No1: QCA9558 on-chip 2.4GHz 802.11bgn, 3x3
- Wireless No2: QCA99x0 chip 5GHz 802.11an+ac, 4x4
- PHY: Atheros AR8035-A
Installation:
If you can get to the stock firmware's firmware upgrade option, just feed
it the factory.img and boot as usual. As an alternative, TFTP the
factory.img to the bootloader.
Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
[whitespace fix in DTS and reorder of make variables]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2018-09-14 04:08:51 +00:00
|
|
|
netgear,ex6400|\
|
|
|
|
netgear,ex7300)
|
|
|
|
ath10kcal_extract "caldata" 20480 12064
|
|
|
|
ath10kcal_patch_mac $(mtd_get_mac_binary caldata 12)
|
|
|
|
;;
|
2018-06-13 13:14:49 +00:00
|
|
|
phicomm,k2t)
|
|
|
|
ath10kcal_extract "art" 20480 12064
|
|
|
|
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
|
|
|
|
;;
|
ath79: add support for Archer C58/C59 v1
This commit adds support for the Archer C58 v1 and C59 v1, previously
supported in the ar71xx target.
CPU: Qualcomm QCA9561
RAM: 64M (C58) / 128M (C59)
FLASH: 8M (C58) / 16M (C59)
WiFi: QCA9561 bgn 3x3:3
QCA9888 nac 2x2:2
LED: Power, WiFi 2.4, WiFi 5, WAN green, WAN amber, LAN, WPS
Only C59: USB
BTN: WPS, WiFi, Reset
Installation
------------
Via Web-UI:
Update factory image via Web-UI.
Via TFTP:
Rename factory image to "tp_recovery.bin" and place it in the root-dir
of your tftp server. Configure to listen on 192.168.0.66. Power up the
router while holding down the reset-button. The router will flash itself
and reboot.
Note: For TFTP, you might need a switch between router and computer, as
link establishment might take to long.
Signed-off-by: David Bauer <mail@david-bauer.net>
2018-10-31 19:19:49 +00:00
|
|
|
tplink,archer-c58-v1|\
|
2018-12-28 08:24:01 +00:00
|
|
|
tplink,archer-c59-v1|\
|
|
|
|
tplink,archer-c6-v2)
|
ath79: add support for Archer C58/C59 v1
This commit adds support for the Archer C58 v1 and C59 v1, previously
supported in the ar71xx target.
CPU: Qualcomm QCA9561
RAM: 64M (C58) / 128M (C59)
FLASH: 8M (C58) / 16M (C59)
WiFi: QCA9561 bgn 3x3:3
QCA9888 nac 2x2:2
LED: Power, WiFi 2.4, WiFi 5, WAN green, WAN amber, LAN, WPS
Only C59: USB
BTN: WPS, WiFi, Reset
Installation
------------
Via Web-UI:
Update factory image via Web-UI.
Via TFTP:
Rename factory image to "tp_recovery.bin" and place it in the root-dir
of your tftp server. Configure to listen on 192.168.0.66. Power up the
router while holding down the reset-button. The router will flash itself
and reboot.
Note: For TFTP, you might need a switch between router and computer, as
link establishment might take to long.
Signed-off-by: David Bauer <mail@david-bauer.net>
2018-10-31 19:19:49 +00:00
|
|
|
ath10kcal_extract "art" 20480 12064
|
2018-12-30 21:28:42 +00:00
|
|
|
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary mac 8) -1)
|
ath79: add support for Archer C58/C59 v1
This commit adds support for the Archer C58 v1 and C59 v1, previously
supported in the ar71xx target.
CPU: Qualcomm QCA9561
RAM: 64M (C58) / 128M (C59)
FLASH: 8M (C58) / 16M (C59)
WiFi: QCA9561 bgn 3x3:3
QCA9888 nac 2x2:2
LED: Power, WiFi 2.4, WiFi 5, WAN green, WAN amber, LAN, WPS
Only C59: USB
BTN: WPS, WiFi, Reset
Installation
------------
Via Web-UI:
Update factory image via Web-UI.
Via TFTP:
Rename factory image to "tp_recovery.bin" and place it in the root-dir
of your tftp server. Configure to listen on 192.168.0.66. Power up the
router while holding down the reset-button. The router will flash itself
and reboot.
Note: For TFTP, you might need a switch between router and computer, as
link establishment might take to long.
Signed-off-by: David Bauer <mail@david-bauer.net>
2018-10-31 19:19:49 +00:00
|
|
|
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
|
|
|
|
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
|
|
|
|
;;
|
2018-06-13 13:14:49 +00:00
|
|
|
esac
|
|
|
|
;;
|
2018-05-06 08:20:11 +00:00
|
|
|
*)
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|