ramips: minew g1-c: Allow dynamic RAM sizes
[openwrt/openwrt.git] / target / linux / ipq806x / 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
7 board=$(board_name)
8
9 case "$FIRMWARE" in
10 "ath10k/pre-cal-pci-0000:01:00.0.bin")
11 case $board in
12 askey,rt4230w-rev6)
13 caldata_extract "0:ART" 0x1000 0x2f20
14 ;;
15 asrock,g10)
16 if [ -b "$(find_mtd_part 0:art)" ]; then
17 caldata_extract "0:art" 0x1000 0x2f20
18 else
19 # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
20 caldata_extract "0:ART" 0x1000 0x2f20
21 fi
22 ;;
23 buffalo,wxr-2533dhp)
24 caldata_extract "ART" 0x1000 0x2f20
25 ath10k_patch_mac $(mtd_get_mac_binary ART 0x1e)
26 ;;
27 edgecore,ecw5410)
28 if [ -b "$(find_mtd_part 0:art)" ]; then
29 caldata_extract "0:art" 0x1000 0x2f20
30 else
31 # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
32 caldata_extract "0:ART" 0x1000 0x2f20
33 fi
34 ;;
35 linksys,ea7500-v1 |\
36 linksys,ea8500)
37 caldata_extract "art" 0x1000 0x2f20
38 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 1)
39 ;;
40 nec,wg2600hp |\
41 nec,wg2600hp3)
42 caldata_extract "ART" 0x1000 0x2f20
43 ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0x12)
44 ;;
45 netgear,d7800 |\
46 netgear,r7500v2 |\
47 netgear,r7800)
48 caldata_extract "art" 0x1000 0x2f20
49 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) 1)
50 ;;
51 tplink,ad7200 |\
52 tplink,c2600)
53 caldata_extract "radio" 0x1000 0x2f20
54 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 0x8) -1)
55 ;;
56 tplink,vr2600v)
57 caldata_extract "ART" 0x1000 0x2f20
58 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 0x0) -1)
59 ;;
60 zyxel,nbg6817)
61 if [ -b "$(find_mtd_part 0:art)" ]; then
62 caldata_extract "0:art" 0x1000 0x2f20
63 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) 1)
64 else
65 # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
66 caldata_extract "0:ART" 0x1000 0x2f20
67 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) 1)
68 fi
69 ;;
70 esac
71 ;;
72 "ath10k/pre-cal-pci-0001:01:00.0.bin")
73 case $board in
74 askey,rt4230w-rev6)
75 caldata_extract "0:ART" 0x5000 0x2f20
76 ;;
77 asrock,g10)
78 if [ -b "$(find_mtd_part 0:art)" ]; then
79 caldata_extract "0:art" 0x5000 0x2f20
80 else
81 # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
82 caldata_extract "0:ART" 0x5000 0x2f20
83 fi
84 ;;
85 buffalo,wxr-2533dhp)
86 caldata_extract "ART" 0x5000 0x2f20
87 ath10k_patch_mac $(mtd_get_mac_binary ART 0x18)
88 ;;
89 linksys,ea7500-v1 |\
90 linksys,ea8500)
91 caldata_extract "art" 0x5000 0x2f20
92 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 2)
93 ;;
94 nec,wg2600hp |\
95 nec,wg2600hp3)
96 caldata_extract "ART" 0x5000 0x2f20
97 ath10k_patch_mac $(mtd_get_mac_binary PRODUCTDATA 0xc)
98 ;;
99 netgear,d7800 |\
100 netgear,r7500v2 |\
101 netgear,r7800)
102 caldata_extract "art" 0x5000 0x2f20
103 ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) 2)
104 ;;
105 tplink,ad7200 |\
106 tplink,c2600)
107 caldata_extract "radio" 0x5000 0x2f20
108 ath10k_patch_mac $(mtd_get_mac_binary default-mac 0x8)
109 ;;
110 tplink,vr2600v)
111 caldata_extract "ART" 0x5000 0x2f20
112 ath10k_patch_mac $(mtd_get_mac_binary default-mac 0x0)
113 ;;
114 zyxel,nbg6817)
115 if [ -b "$(find_mtd_part 0:art)" ]; then
116 caldata_extract "0:art" 0x5000 0x2f20
117 ath10k_patch_mac $(mtd_get_mac_ascii 0:appsblenv ethaddr)
118 else
119 # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
120 caldata_extract "0:ART" 0x5000 0x2f20
121 ath10k_patch_mac $(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
122 fi
123 ;;
124 esac
125 ;;
126 "ath10k/pre-cal-pci-0002:01:00.0.bin")
127 case $board in
128 edgecore,ecw5410)
129 if [ -b "$(find_mtd_part 0:art)" ]; then
130 caldata_extract "0:art" 0x5000 0x2f20
131 else
132 # XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
133 caldata_extract "0:ART" 0x5000 0x2f20
134 fi
135 ;;
136 esac
137 ;;
138 *)
139 exit 1
140 ;;
141 esac