openwrt/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
Yanase Yuki 3bb1618573 ipq806x: add support for NEC Platforms Aterm WG2600HP3
NEC Platforms Aterm WG2600HP3 is a dual-band router based on Qualcomm IPQ8062.

Specification
-------------
- SoC: Qualcomm IPQ8062
- RAM: 512MiB
- Flash memory: SPI-NOR 32MiB (Cypress S25FL256S)
- Wi-Fi: Qualcomm QCA9984 (2.4GHz, 1ch - 13ch)
- Wi-Fi: Qualcomm QCA9984 (5GHz, 36ch - 64ch, 100ch - 140ch)
- Ethernet: 4x 100/1000 Mbps (1x WAN, 4x LAN)
- LED: 6x green LED, 6x red LED
- Input: 2x tactile switch, 1x SP3T slide switch
- Serial console: 115200bps, through-hole J3
  - [  ] [GND] [  ] [TX] [RX] ----> DC jack
- Power: DC 12V 1.5A

This device does not support VHT160 and VHT80+80.
Custom BDFs are required to limit VHT capabilities.

Flash instructions
------------------
1. Setup TFTP server (IP address: 192.168.1.2)
2. Put initramfs image into TFTP server directory
3. Connect WG2600HP3 lan port and computer that runs TFTP server
4. Connect to the serial console
5. Interrupt booting by Esc key (password: chiron)
6. Execute the following commands
    # setenv bootcmd "nboot 0x44000000 1 0x860000"
    # saveenv
    # setenv ipaddr 192.168.1.1
    # setenv serverip 192.168.1.2
    # tftpboot 0x44000000 openwrt-ipq806x-generic-nec_wg2600hp3-initramfs-uImage
7. After booting OpenWrt initramfs image, backup SPI-NOR flash memory
8. Erase firmware partition
    # mtd erase firmware
9. Run sysupgrade

Signed-off-by: Yanase Yuki <dev@zpc.sakura.ne.jp>
2020-12-25 10:38:13 +01:00

102 lines
2.4 KiB
Bash

#!/bin/sh
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
board=$(board_name)
case "$FIRMWARE" in
"ath10k/pre-cal-pci-0000:01:00.0.bin")
case $board in
asrock,g10)
caldata_extract "0:ART" 0x1000 0x2f20
;;
buffalo,wxr-2533dhp)
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary ART 0x1e)
;;
edgecore,ecw5410)
caldata_extract "0:ART" 0x1000 0x2f20
;;
linksys,ea7500-v1 |\
linksys,ea8500)
caldata_extract "art" 0x1000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +1)
;;
nec,wg2600hp |\
nec,wg2600hp3)
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0x12)
;;
netgear,d7800 |\
netgear,r7500v2 |\
netgear,r7800)
caldata_extract "art" 0x1000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) +1)
;;
tplink,c2600)
caldata_extract "radio" 0x1000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 0x8) -1)
;;
tplink,vr2600v)
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 0x0) -1)
;;
zyxel,nbg6817)
caldata_extract "0:ART" 0x1000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) +1)
;;
esac
;;
"ath10k/pre-cal-pci-0001:01:00.0.bin")
case $board in
asrock,g10)
caldata_extract "0:ART" 0x5000 0x2f20
;;
buffalo,wxr-2533dhp)
caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary ART 0x18)
;;
linksys,ea7500-v1 |\
linksys,ea8500)
caldata_extract "art" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +2)
;;
nec,wg2600hp |\
nec,wg2600hp3)
caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0xc)
;;
netgear,d7800 |\
netgear,r7500v2 |\
netgear,r7800)
caldata_extract "art" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) +2)
;;
tplink,c2600)
caldata_extract "radio" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary default-mac 0x8)
;;
tplink,vr2600v)
caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary default-mac 0x0)
;;
zyxel,nbg6817)
caldata_extract "0:ART" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
;;
esac
;;
"ath10k/pre-cal-pci-0002:01:00.0.bin")
case $board in
edgecore,ecw5410)
caldata_extract "0:ART" 0x5000 0x2f20
;;
esac
;;
*)
exit 1
;;
esac