ath79: add support for Atheros DB120 reference board
[openwrt/openwrt.git] / target / linux / ath79 / generic / base-files / etc / hotplug.d / firmware / 10-ath9k-eeprom
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 "ath9k-eeprom-ahb-18100000.wmac.bin")
11 case $board in
12 8dev,lima)
13 caldata_extract "art" 0x1000 0x800
14 ;;
15 avm,fritz1750e|\
16 avm,fritz4020|\
17 avm,fritz450e|\
18 avm,fritzdvbc)
19 caldata_extract_reverse "urlader" 0x1541 0x440
20 ;;
21 dlink,dap-2695-a1)
22 caldata_extract "art" 0x1000 0x440
23 ath9k_patch_mac $(mtd_get_mac_ascii bdcfg "wlanmac")
24 ;;
25 dlink,dir-505|\
26 dlink,dir-825-c1|\
27 dlink,dir-835-a1)
28 caldata_extract "art" 0x1000 0x440
29 ath9k_patch_mac $(mtd_get_mac_text "mac" 0x4)
30 ;;
31 dlink,dir-842-c1|\
32 dlink,dir-842-c2|\
33 dlink,dir-842-c3|\
34 dlink,dir-859-a1|\
35 nec,wf1200cr|\
36 nec,wg1200cr|\
37 wd,mynet-n750)
38 caldata_extract "art" 0x1000 0x440
39 ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac")
40 ;;
41 engenius,ecb1200|\
42 engenius,ecb1750)
43 caldata_extract "art" 0x1000 0x440
44 ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) 1)
45 ;;
46 engenius,epg5000|\
47 iodata,wn-ac1167dgr|\
48 iodata,wn-ac1600dgr|\
49 iodata,wn-ac1600dgr2|\
50 iodata,wn-ag300dgr|\
51 sitecom,wlr-7100|\
52 sitecom,wlr-8100)
53 caldata_extract "art" 0x1000 0x440
54 ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr)
55 ;;
56 enterasys,ws-ap3705i)
57 caldata_extract "calibrate" 0x1000 0x440
58 ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR1)
59 ;;
60 nec,wg800hp)
61 caldata_extract "art" 0x1000 0x440
62 ath9k_patch_mac $(mtd_get_mac_text board_data 0x680)
63 ;;
64 qihoo,c301)
65 caldata_extract "radiocfg" 0x1000 0x440
66 ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan24mac")
67 ;;
68 *)
69 caldata_die "board $board is not supported yet"
70 ;;
71 esac
72 ;;
73 "ath9k-eeprom-pci-0000:00:00.0.bin")
74 case $board in
75 atheros,db120|\
76 engenius,eap600|\
77 engenius,ecb600|\
78 mercury,mw4530r-v1|\
79 ocedo,raccoon|\
80 tplink,tl-wdr3500-v1|\
81 tplink,tl-wdr3600-v1|\
82 tplink,tl-wdr4300-v1|\
83 tplink,tl-wdr4300-v1-il|\
84 tplink,tl-wdr4310-v1|\
85 tplink,tl-wdr4900-v2|\
86 ubnt,unifi-ap-pro|\
87 winchannel,wb2000)
88 caldata_extract "art" 0x5000 0x440
89 ;;
90 avm,fritz300e)
91 caldata_extract_reverse "urloader" 0x1541 0x440
92 ;;
93 buffalo,wzr-hp-g302h-a1a0|\
94 ubnt,unifi-ap-outdoor-plus)
95 caldata_extract "art" 0x1000 0xeb8
96 ;;
97 buffalo,wzr-hp-g450h|\
98 ubnt,unifi)
99 caldata_extract "art" 0x1000 0x440
100 ;;
101 dlink,dir-825-c1|\
102 dlink,dir-835-a1)
103 caldata_extract "art" 0x5000 0x440
104 ath9k_patch_mac $(macaddr_add $(mtd_get_mac_text "mac" 0x18) 1)
105 ;;
106 enterasys,ws-ap3705i)
107 caldata_extract "calibrate" 0x5000 0x440
108 ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR0)
109 ;;
110 meraki,mr12)
111 caldata_extract "art" 0x11000 0xeb8
112 ;;
113 netgear,wnr2200-8m|\
114 netgear,wnr2200-16m|\
115 pcs,cap324|\
116 tplink,tl-wr2543-v1|\
117 tplink,tl-wr842n-v1|\
118 ubnt,airrouter|\
119 ubnt,bullet-m-ar7240|\
120 ubnt,bullet-m-ar7241|\
121 ubnt,nanobridge-m|\
122 ubnt,nanostation-loco-m|\
123 ubnt,nanostation-m|\
124 ubnt,picostation-m|\
125 ubnt,powerbridge-m|\
126 ubnt,rocket-m)
127 caldata_extract "art" 0x1000 0x1000
128 ;;
129 openmesh,mr600-v1|\
130 openmesh,mr600-v2)
131 caldata_extract "ART" 0x5000 0x440
132 ;;
133 wd,mynet-n750)
134 caldata_extract "art" 0x5000 0x440
135 ath9k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac")
136 ;;
137 wd,mynet-wifi-rangeextender)
138 caldata_extract "art" 0x1000 0x1000
139 ath9k_patch_mac $(nvram get wl0_hwaddr)
140 ;;
141 *)
142 caldata_die "board $board is not supported yet"
143 ;;
144 esac
145 ;;
146 "ath9k-eeprom-pci-0000:00:11.0.bin")
147 case $board in
148 buffalo,wzr-600dhp|\
149 buffalo,wzr-hp-ag300h|\
150 netgear,wndr3700|\
151 netgear,wndr3700-v2|\
152 netgear,wndr3800|\
153 netgear,wndr3800ch|\
154 netgear,wndrmac-v1|\
155 netgear,wndrmac-v2)
156 caldata_extract "art" 0x1000 0xeb8
157 ;;
158 dlink,dir-825-b1)
159 caldata_extract "caldata" 0x1000 0xeb8
160 ath9k_patch_mac_crc $(mtd_get_mac_text "caldata" 0xffa0) 0x20c
161 ;;
162 meraki,mr16)
163 caldata_extract "art" 0x11000 0xeb8
164 ;;
165 *)
166 caldata_die "board $board is not supported yet"
167 ;;
168 esac
169 ;;
170 "ath9k-eeprom-pci-0000:00:12.0.bin")
171 case $board in
172 buffalo,wzr-600dhp|\
173 buffalo,wzr-hp-ag300h|\
174 netgear,wndr3700|\
175 netgear,wndr3700-v2|\
176 netgear,wndr3800|\
177 netgear,wndr3800ch|\
178 netgear,wndrmac-v1|\
179 netgear,wndrmac-v2)
180 caldata_extract "art" 0x5000 0xeb8
181 ;;
182 dlink,dir-825-b1)
183 caldata_extract "caldata" 0x5000 0xeb8
184 ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 0xffb4) 1) 0x20c
185 ;;
186 meraki,mr16)
187 caldata_extract "art" 0x15000 0xeb8
188 ;;
189 *)
190 caldata_die "board $board is not supported yet"
191 ;;
192 esac
193 ;;
194 esac