ath79: add support for Ubiquiti LiteBeam AC Gen2
[openwrt/openwrt.git] / target / linux / ath79 / generic / base-files / etc / hotplug.d / firmware / 11-ath10k-caldata
1 #!/bin/sh
2
3 [ -e /lib/firmware/$FIRMWARE ] && exit 0
4
5 . /lib/functions/caldata.sh
6 . /lib/functions/k2t.sh
7
8 board=$(board_name)
9
10 case "$FIRMWARE" in
11 "ath10k/cal-pci-0000:00:00.0.bin")
12 case $board in
13 comfast,cf-wr650ac-v1|\
14 comfast,cf-wr650ac-v2|\
15 ubnt,unifiac-lite|\
16 ubnt,unifiac-lr|\
17 ubnt,unifiac-mesh|\
18 ubnt,unifiac-mesh-pro|\
19 ubnt,lap-120|\
20 ubnt,litebeam-ac-gen2|\
21 ubnt,nanobeam-ac|\
22 ubnt,nanostation-ac|\
23 ubnt,nanostation-ac-loco|\
24 ubnt,unifiac-pro|\
25 yuncore,a770)
26 caldata_extract "art" 0x5000 0x844
27 ;;
28 devolo,dvl1200e|\
29 devolo,dvl1200i|\
30 devolo,dvl1750c|\
31 devolo,dvl1750e|\
32 devolo,dvl1750i|\
33 devolo,dvl1750x)
34 caldata_extract "art" 0x5000 0x844
35 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) -1)
36 ;;
37 dlink,dir-859-a1)
38 caldata_extract "art" 0x5000 0x844
39 ath10k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac")
40 ;;
41 elecom,wrc-1750ghbk2-i)
42 caldata_extract "art" 0x5000 0x844
43 ;;
44 engenius,ecb1750)
45 caldata_extract "art" 0x5000 0x844
46 ath10k_patch_mac $(mtd_get_mac_ascii u-boot-env athaddr)
47 ;;
48 engenius,epg5000|\
49 iodata,wn-ac1167dgr|\
50 iodata,wn-ac1600dgr2|\
51 sitecom,wlr-7100)
52 caldata_extract "art" 0x5000 0x844
53 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
54 ;;
55 engenius,ews511ap)
56 caldata_extract "art" 0x5000 0x844
57 ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
58 ;;
59 glinet,gl-ar750)
60 caldata_extract "art" 0x5000 0x844
61 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1)
62 ;;
63 glinet,gl-x750)
64 caldata_extract "art" 0x5000 0x844
65 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2)
66 ;;
67 nec,wg800hp)
68 caldata_extract "art" 0x5000 0x844
69 ath10k_patch_mac $(mtd_get_mac_text board_data 0x880)
70 ;;
71 ocedo,koala|\
72 ocedo,ursus)
73 caldata_extract "art" 0x5000 0x844
74 ath10k_patch_mac $(mtd_get_mac_binary art 0xc)
75 ;;
76 openmesh,om5p-ac-v2)
77 caldata_extract "art" 0x5000 0x844
78 ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
79 ;;
80 qihoo,c301)
81 caldata_extract "radiocfg" 0x5000 0x844
82 ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac)
83 ;;
84 tplink,archer-a7-v5|\
85 tplink,archer-c2-v3|\
86 tplink,archer-c7-v4|\
87 tplink,archer-c7-v5|\
88 tplink,archer-c25-v1)
89 caldata_extract "art" 0x5000 0x844
90 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) -1)
91 ;;
92 tplink,archer-c5-v1|\
93 tplink,archer-c7-v2)
94 caldata_extract "art" 0x5000 0x844
95 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x1fc00) -1)
96 ;;
97 tplink,archer-d50-v1)
98 caldata_extract "art" 0x5000 0x844
99 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary romfile 0xf100) +2)
100 ;;
101 tplink,re350k-v1)
102 caldata_extract "art" 0x5000 0x844
103 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary config 0x10008) +2)
104 ;;
105 tplink,re355-v1|\
106 tplink,re450-v1)
107 caldata_extract "art" 0x5000 0x844
108 ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -2)
109 ;;
110 tplink,re450-v2)
111 caldata_extract "art" 0x5000 0x844
112 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1)
113 ;;
114 esac
115 ;;
116 "ath10k/pre-cal-pci-0000:00:00.0.bin")
117 case $board in
118 comfast,cf-e313ac)
119 caldata_extract "art" 0x5000 0x2f20
120 ath10k_patch_mac $(mtd_get_mac_binary art 0x6)
121 ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
122 /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
123 rm /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
124 ;;
125 dlink,dir-842-c1|\
126 dlink,dir-842-c2|\
127 dlink,dir-842-c3|\
128 nec,wg1200cr)
129 caldata_extract "art" 0x5000 0x2f20
130 ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac)
131 ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
132 /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
133 ;;
134 netgear,ex6400|\
135 netgear,ex7300)
136 caldata_extract "caldata" 0x5000 0x2f20
137 ath10k_patch_mac $(mtd_get_mac_binary caldata 0xc)
138 ;;
139 phicomm,k2t)
140 caldata_extract "art" 0x5000 0x2f20
141 ath10k_patch_mac $(k2t_get_mac "5g_mac")
142 ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
143 /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
144 ;;
145 tplink,archer-c58-v1|\
146 tplink,archer-c59-v1|\
147 tplink,archer-c59-v2|\
148 tplink,archer-c60-v1|\
149 tplink,archer-c60-v2|\
150 tplink,archer-c6-v2|\
151 tplink,archer-c6-v2-us)
152 caldata_extract "art" 0x5000 0x2f20
153 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mac 0x8) -1)
154 ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
155 /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
156 ;;
157 yuncore,a782|\
158 yuncore,xd4200)
159 caldata_extract "art" 0x5000 0x2f20
160 ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
161 /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
162 ;;
163 esac
164 ;;
165 *)
166 exit 1
167 ;;
168 esac