xref: /openbsd/sys/dev/ic/ar9380reg.h (revision 5e32cd22)
1 /*	$OpenBSD: ar9380reg.h,v 1.21 2016/01/05 18:41:15 stsp Exp $	*/
2 
3 /*-
4  * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
5  * Copyright (c) 2010 Atheros Communications Inc.
6  *
7  * Permission to use, copy, modify, and/or distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #define AR9380_MAX_CHAINS	3
21 
22 #define AR9380_PHY_CCA_NOM_VAL_2GHZ		(-110)
23 #define AR9380_PHY_CCA_NOM_VAL_5GHZ		(-115)
24 #define AR9380_PHY_CCA_MIN_GOOD_VAL_2GHZ	(-125)
25 #define AR9380_PHY_CCA_MIN_GOOD_VAL_5GHZ	(-125)
26 #define AR9380_PHY_CCA_MAX_GOOD_VAL_2GHZ	( -95)
27 #define AR9380_PHY_CCA_MAX_GOOD_VAL_5GHZ	(-100)
28 
29 /*
30  * ROM layout used by AR9380.
31  */
32 #define AR9380_NUM_5G_CAL_PIERS		8
33 #define AR9380_NUM_2G_CAL_PIERS		3
34 #define AR9380_NUM_5G_20_TARGET_POWERS	8
35 #define AR9380_NUM_5G_40_TARGET_POWERS	8
36 #define AR9380_NUM_2G_CCK_TARGET_POWERS	2
37 #define AR9380_NUM_2G_20_TARGET_POWERS	3
38 #define AR9380_NUM_2G_40_TARGET_POWERS	3
39 #define AR9380_NUM_CTLS_5G		9
40 #define AR9380_NUM_CTLS_2G		12
41 #define AR9380_NUM_BAND_EDGES_5G	8
42 #define AR9380_NUM_BAND_EDGES_2G	4
43 #define AR9380_NUM_PD_GAINS		4
44 #define AR9380_PD_GAINS_IN_MASK		4
45 #define AR9380_PD_GAIN_ICEPTS		5
46 #define AR9380_EEPROM_MODAL_SPURS	5
47 #define AR9380_CUSTOMER_DATA_SIZE	20
48 
49 struct ar9380_cal_ctl_data_2g {
50 	uint8_t	ctlEdges[AR9380_NUM_BAND_EDGES_2G];
51 } __packed;
52 
53 struct ar9380_cal_ctl_data_5g {
54 	uint8_t	ctlEdges[AR9380_NUM_BAND_EDGES_5G];
55 } __packed;
56 
57 struct ar9380_base_eep_hdr {
58 	uint16_t	regDmn[2];
59 	uint8_t		txrxMask;
60 #define AR_EEP_TX_MASK_M	0xf0
61 #define AR_EEP_TX_MASK_S	4
62 #define AR_EEP_RX_MASK_M	0x0f
63 #define AR_EEP_RX_MASK_S	0
64 
65 	uint8_t		opFlags;
66 #define AR_OPFLAGS_11A			0x01
67 #define AR_OPFLAGS_11G			0x02
68 #define AR_OPFLAGS_11N_5G40		0x04
69 #define AR_OPFLAGS_11N_2G40		0x08
70 #define AR_OPFLAGS_11N_5G20		0x10
71 #define AR_OPFLAGS_11N_2G20		0x20
72 /* Shortcut. */
73 #define AR_OPFLAGS_11N			0x3c
74 
75 	uint8_t		eepMisc;
76 	uint8_t		rfSilent;
77 #define AR_EEP_RFSILENT_ENABLED		0x0001
78 #define AR_EEP_RFSILENT_GPIO_SEL_M	0x001c
79 #define AR_EEP_RFSILENT_GPIO_SEL_S	2
80 #define AR_EEP_RFSILENT_POLARITY	0x0002
81 
82 	uint8_t		blueToothOptions;
83 	uint8_t		deviceCap;
84 	uint8_t		deviceType;
85 	int8_t		pwrTableOffset;
86 	uint8_t		params_for_tuning_caps[2];
87 	uint8_t		featureEnable;
88 #define AR_EEP_TX_TEMP_COMP_EN		0x01
89 #define AR_EEP_TX_VOLT_COMP_EN		0x02
90 #define AR_EEP_FAST_CLOCK_EN		0x04
91 #define AR_EEP_DOUBLING_EN		0x08
92 #define AR_EEP_INTERNAL_REGULATOR	0x10
93 #define AR_EEP_PAPRD			0x20
94 #define AR_EEP_TUNING_CAPS		0x40
95 
96 	uint8_t		miscConfiguration;
97 #define AR_EEP_DRIVE_STRENGTH		0x01
98 #define AR_EEP_CHAIN_MASK_REDUCE	0x08
99 
100 	uint8_t		eepromWriteEnableGpio;
101 	uint8_t		wlanDisableGpio;
102 	uint8_t		wlanLedGpio;
103 	uint8_t		rxBandSelectGpio;
104 	uint8_t		txrxgain;
105 #define AR_EEP_TX_GAIN_M		0xf0
106 #define AR_EEP_TX_GAIN_S		4
107 #define AR_EEP_TX_GAIN_HIGH_OB_DB	1
108 #define AR_EEP_TX_GAIN_LOW_OB_DB	2
109 #define AR_EEP_TX_GAIN_HIGH_POWER	3
110 #define AR_EEP_RX_GAIN_M		0x0f
111 #define AR_EEP_RX_GAIN_S		0
112 #define AR_EEP_RX_GAIN_WO_XLNA		1
113 
114 	uint32_t	swreg;
115 } __packed;
116 
117 struct ar9380_modal_eep_header {
118 	uint32_t	antCtrlCommon;
119 	uint32_t	antCtrlCommon2;
120 	uint16_t	antCtrlChain[AR9380_MAX_CHAINS];
121 	uint8_t		xatten1DB[AR9380_MAX_CHAINS];
122 	uint8_t		xatten1Margin[AR9380_MAX_CHAINS];
123 	int8_t		tempSlope;
124 	int8_t		voltSlope;
125 	uint8_t		spurChans[AR9380_EEPROM_MODAL_SPURS];
126 	int8_t		noiseFloorThreshCh[AR9380_MAX_CHAINS];
127 	uint8_t		ob[AR9380_MAX_CHAINS];
128 	uint8_t		db_stage2[AR9380_MAX_CHAINS];
129 	uint8_t		db_stage3[AR9380_MAX_CHAINS];
130 	uint8_t		db_stage4[AR9380_MAX_CHAINS];
131 	uint8_t		xpaBiasLvl;
132 	uint8_t		txFrameToDataStart;
133 	uint8_t		txFrameToPaOn;
134 	uint8_t		txClip;
135 	int8_t		antennaGain;
136 	uint8_t		switchSettling;
137 	int8_t		adcDesiredSize;
138 	uint8_t		txEndToXpaOff;
139 	uint8_t		txEndToRxOn;
140 	uint8_t		txFrameToXpaOn;
141 	uint8_t		thresh62;
142 	uint32_t	papdRateMaskHt20;
143 	uint32_t	papdRateMaskHt40;
144 	uint8_t		futureModal[10];
145 } __packed;
146 
147 struct ar9380_cal_data_per_freq_op_loop {
148 	int8_t	refPower;
149 	uint8_t	voltMeas;
150 	uint8_t	tempMeas;
151 	int8_t	rxNoisefloorCal;
152 	int8_t	rxNoisefloorPower;
153 	uint8_t	rxTempMeas;
154 } __packed;
155 
156 struct ar9380_base_extension_1 {
157 	uint8_t	ant_div_control;
158 #define AR_EEP_ANT_DIV_CTRL_ALL_M	0x3f
159 #define AR_EEP_ANT_DIV_CTRL_ALL_S	0
160 #define AR_EEP_ANT_DIV_CTRL_ANT_DIV	0x40
161 #define AR_EEP_ANT_DIV_CTRL_FAST_DIV	0x80
162 
163 	uint8_t	future[13];
164 } __packed;
165 
166 struct ar9380_base_extension_2 {
167 	int8_t	tempSlopeLow;
168 	int8_t	tempSlopeHigh;
169 	uint8_t	xatten1DBLow[AR9380_MAX_CHAINS];
170 	uint8_t	xatten1MarginLow[AR9380_MAX_CHAINS];
171 	uint8_t	xatten1DBHigh[AR9380_MAX_CHAINS];
172 	uint8_t	xatten1MarginHigh[AR9380_MAX_CHAINS];
173 } __packed;
174 
175 struct ar9380_eeprom {
176 	uint8_t	eepromVersion;
177 	uint8_t	templateVersion;
178 	uint8_t	macAddr[6];
179 	uint8_t	custData[AR9380_CUSTOMER_DATA_SIZE];
180 	struct	ar9380_base_eep_hdr baseEepHeader;
181 	struct	ar9380_modal_eep_header modalHeader2G;
182 	struct	ar9380_base_extension_1 base_ext1;
183 	uint8_t	calFreqPier2G[AR9380_NUM_2G_CAL_PIERS];
184 	struct	ar9380_cal_data_per_freq_op_loop
185 	    calPierData2G[AR9380_MAX_CHAINS][AR9380_NUM_2G_CAL_PIERS];
186 	uint8_t	calTargetFbinCck[AR9380_NUM_2G_CCK_TARGET_POWERS];
187 	uint8_t	calTargetFbin2G[AR9380_NUM_2G_20_TARGET_POWERS];
188 	uint8_t	calTargetFbin2GHT20[AR9380_NUM_2G_20_TARGET_POWERS];
189 	uint8_t	calTargetFbin2GHT40[AR9380_NUM_2G_40_TARGET_POWERS];
190 	struct	ar_cal_target_power_leg
191 	    calTargetPowerCck[AR9380_NUM_2G_CCK_TARGET_POWERS];
192 	struct	ar_cal_target_power_leg
193 	    calTargetPower2G[AR9380_NUM_2G_20_TARGET_POWERS];
194 	struct	ar_cal_target_power_ht
195 	    calTargetPower2GHT20[AR9380_NUM_2G_20_TARGET_POWERS];
196 	struct	ar_cal_target_power_ht
197 	    calTargetPower2GHT40[AR9380_NUM_2G_40_TARGET_POWERS];
198 	uint8_t	ctlIndex_2G[AR9380_NUM_CTLS_2G];
199 	uint8_t	ctl_freqbin_2G[AR9380_NUM_CTLS_2G][AR9380_NUM_BAND_EDGES_2G];
200 	struct	ar9380_cal_ctl_data_2g ctlPowerData_2G[AR9380_NUM_CTLS_2G];
201 	struct	ar9380_modal_eep_header modalHeader5G;
202 	struct	ar9380_base_extension_2 base_ext2;
203 	uint8_t	calFreqPier5G[AR9380_NUM_5G_CAL_PIERS];
204 	struct	ar9380_cal_data_per_freq_op_loop
205 	    calPierData5G[AR9380_MAX_CHAINS][AR9380_NUM_5G_CAL_PIERS];
206 	uint8_t	calTargetFbin5G[AR9380_NUM_5G_20_TARGET_POWERS];
207 	uint8_t	calTargetFbin5GHT20[AR9380_NUM_5G_20_TARGET_POWERS];
208 	uint8_t	calTargetFbin5GHT40[AR9380_NUM_5G_40_TARGET_POWERS];
209 	struct	ar_cal_target_power_leg
210 	    calTargetPower5G[AR9380_NUM_5G_20_TARGET_POWERS];
211 	struct	ar_cal_target_power_ht
212 	    calTargetPower5GHT20[AR9380_NUM_5G_20_TARGET_POWERS];
213 	struct	ar_cal_target_power_ht
214 	    calTargetPower5GHT40[AR9380_NUM_5G_40_TARGET_POWERS];
215 	uint8_t	ctlIndex_5G[AR9380_NUM_CTLS_5G];
216 	uint8_t	ctl_freqbin_5G[AR9380_NUM_CTLS_5G][AR9380_NUM_BAND_EDGES_5G];
217 	struct	ar9380_cal_ctl_data_5g ctlPowerData_5G[AR9380_NUM_CTLS_5G];
218 } __packed;
219 
220 /*
221  * ROM templates (little endian).
222  */
223 static const uint8_t ar9380_def_rom[] = {
224 	0x02, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x00, 0x00,
225 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
226 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
227 	0x1f, 0x00, 0x77, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00,
228 	0x00, 0x00, 0x0c, 0x00, 0x03, 0x00, 0x08, 0xff, 0x00, 0x00,
229 	0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x22, 0x22, 0x02,
230 	0x00, 0x50, 0x01, 0x50, 0x01, 0x50, 0x01, 0x00, 0x00, 0x00,
231 	0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
232 	0xff, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
233 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x0e, 0x03, 0x00,
234 	0x2c, 0xe2, 0x00, 0x02, 0x0e, 0x1c, 0xe0, 0xe0, 0xf0, 0x0c,
235 	0xe0, 0xe0, 0xf0, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
236 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
237 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x89,
238 	0xac, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
239 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
240 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
241 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
242 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
243 	0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xb8, 0x70, 0x89, 0xac,
244 	0x70, 0x89, 0xac, 0x70, 0x89, 0xac, 0x24, 0x24, 0x24, 0x24,
245 	0x24, 0x24, 0x24, 0x24, 0x20, 0x20, 0x1c, 0x18, 0x20, 0x20,
246 	0x1c, 0x18, 0x20, 0x20, 0x1c, 0x18, 0x20, 0x20, 0x20, 0x20,
247 	0x1c, 0x14, 0x20, 0x20, 0x1c, 0x14, 0x20, 0x20, 0x1c, 0x14,
248 	0x20, 0x20, 0x20, 0x20, 0x1c, 0x14, 0x20, 0x20, 0x1c, 0x14,
249 	0x20, 0x20, 0x1c, 0x14, 0x20, 0x20, 0x20, 0x20, 0x1c, 0x14,
250 	0x20, 0x20, 0x1c, 0x14, 0x20, 0x20, 0x1c, 0x14, 0x20, 0x20,
251 	0x20, 0x20, 0x1c, 0x14, 0x20, 0x20, 0x1c, 0x14, 0x20, 0x20,
252 	0x1c, 0x14, 0x20, 0x20, 0x20, 0x20, 0x1c, 0x14, 0x20, 0x20,
253 	0x1c, 0x14, 0x20, 0x20, 0x1c, 0x14, 0x20, 0x20, 0x20, 0x20,
254 	0x1c, 0x14, 0x20, 0x20, 0x1c, 0x14, 0x20, 0x20, 0x1c, 0x14,
255 	0x11, 0x12, 0x15, 0x17, 0x41, 0x42, 0x45, 0x47, 0x31, 0x32,
256 	0x35, 0x37, 0x70, 0x75, 0x9d, 0xa2, 0x70, 0x75, 0xa2, 0xff,
257 	0x70, 0x75, 0xa2, 0xff, 0x7a, 0x7f, 0x93, 0x98, 0x70, 0x75,
258 	0xac, 0xb8, 0x70, 0x75, 0xac, 0x00, 0x70, 0x75, 0xac, 0x00,
259 	0x7a, 0x7f, 0x93, 0xa2, 0x70, 0x75, 0xac, 0x00, 0x70, 0x75,
260 	0xac, 0x00, 0x70, 0x75, 0xac, 0x00, 0x7a, 0x7f, 0x93, 0xa2,
261 	0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c, 0x7c, 0x3c,
262 	0x3c, 0x7c, 0x7c, 0x3c, 0x00, 0x00, 0x3c, 0x7c, 0x3c, 0x3c,
263 	0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x3c, 0x3c, 0x7c,
264 	0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c,
265 	0x3c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x10, 0x01,
266 	0x00, 0x00, 0x22, 0x22, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
267 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00,
268 	0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x03, 0x03,
269 	0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
270 	0x00, 0x0e, 0x0e, 0x03, 0x00, 0x2d, 0xe2, 0x00, 0x02, 0x0e,
271 	0x1c, 0x80, 0xc0, 0x80, 0x0c, 0x80, 0xc0, 0x80, 0x00, 0x00,
272 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
273 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
274 	0x00, 0x00, 0x00, 0x4c, 0x54, 0x68, 0x78, 0x8c, 0xa0, 0xb9,
275 	0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
276 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
277 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
278 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
279 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
280 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
281 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
282 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
283 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
284 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
285 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
286 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
287 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
288 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
289 	0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x54, 0x68, 0x78, 0x8c,
290 	0xa0, 0xb9, 0xcd, 0x4c, 0x58, 0x68, 0x8c, 0xb4, 0xbd, 0xb9,
291 	0xcd, 0x4c, 0x58, 0x68, 0x8c, 0xb4, 0xbd, 0xb9, 0xcd, 0x14,
292 	0x14, 0x14, 0x0a, 0x14, 0x14, 0x14, 0x0a, 0x14, 0x14, 0x14,
293 	0x0a, 0x14, 0x14, 0x14, 0x0a, 0x14, 0x14, 0x14, 0x0a, 0x14,
294 	0x14, 0x14, 0x0a, 0x14, 0x14, 0x14, 0x0a, 0x14, 0x14, 0x14,
295 	0x0a, 0x14, 0x14, 0x0a, 0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00,
296 	0x00, 0x0a, 0x0a, 0x00, 0x00, 0x14, 0x14, 0x0a, 0x0a, 0x00,
297 	0x00, 0x0a, 0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, 0x14,
298 	0x14, 0x0a, 0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, 0x0a,
299 	0x0a, 0x00, 0x00, 0x14, 0x14, 0x0a, 0x0a, 0x00, 0x00, 0x0a,
300 	0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, 0x14, 0x14, 0x0a,
301 	0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00,
302 	0x00, 0x14, 0x14, 0x0a, 0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00,
303 	0x00, 0x0a, 0x0a, 0x00, 0x00, 0x14, 0x14, 0x0a, 0x0a, 0x00,
304 	0x00, 0x0a, 0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, 0x14,
305 	0x14, 0x0a, 0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, 0x0a,
306 	0x0a, 0x00, 0x00, 0x14, 0x14, 0x0a, 0x0a, 0x00, 0x00, 0x0a,
307 	0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, 0x14, 0x14, 0x0a,
308 	0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00,
309 	0x00, 0x14, 0x14, 0x0a, 0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00,
310 	0x00, 0x0a, 0x0a, 0x00, 0x00, 0x14, 0x14, 0x0a, 0x0a, 0x00,
311 	0x00, 0x0a, 0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, 0x14,
312 	0x14, 0x0a, 0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, 0x0a,
313 	0x0a, 0x00, 0x00, 0x14, 0x14, 0x0a, 0x0a, 0x00, 0x00, 0x0a,
314 	0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, 0x14, 0x14, 0x0a,
315 	0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00,
316 	0x00, 0x14, 0x14, 0x0a, 0x0a, 0x00, 0x00, 0x0a, 0x0a, 0x00,
317 	0x00, 0x0a, 0x0a, 0x00, 0x00, 0x10, 0x16, 0x18, 0x40, 0x46,
318 	0x48, 0x30, 0x36, 0x38, 0x4c, 0x5c, 0x60, 0x8c, 0xa0, 0xb4,
319 	0xbd, 0xcd, 0x4c, 0x5c, 0x60, 0x8c, 0x90, 0xb4, 0xbd, 0xcd,
320 	0x4e, 0x56, 0x5e, 0x66, 0x8e, 0x96, 0xae, 0xbf, 0x4c, 0x50,
321 	0x5c, 0x68, 0x8c, 0xb4, 0xff, 0xff, 0x4c, 0x5c, 0x8c, 0xb4,
322 	0xff, 0xff, 0xff, 0xff, 0x4e, 0x5e, 0x66, 0x8e, 0x9e, 0xae,
323 	0xff, 0xff, 0x4c, 0x50, 0x54, 0x5c, 0x8c, 0xa0, 0xb4, 0xbd,
324 	0x4c, 0x5c, 0x68, 0x8c, 0x98, 0xb4, 0xbd, 0xcd, 0x4e, 0x56,
325 	0x5e, 0x8e, 0x96, 0xae, 0xbf, 0xc7, 0x7c, 0x7c, 0x7c, 0x7c,
326 	0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
327 	0x7c, 0x3c, 0x3c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
328 	0x3c, 0x7c, 0x7c, 0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c,
329 	0x7c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c,
330 	0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
331 	0x7c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x3c,
332 	0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c
333 };
334 
335 static const uint8_t ar9380_def_rom_h112[] = {
336 	0x02, 0x03, 0x00, 0x03, 0x7f, 0x00, 0x00, 0x00, 0x68, 0x31,
337 	0x31, 0x32, 0x2d, 0x32, 0x34, 0x31, 0x2d, 0x66, 0x30, 0x30,
338 	0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
339 	0x1f, 0x00, 0x77, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00,
340 	0x00, 0x00, 0x0d, 0x00, 0x06, 0x00, 0x08, 0xff, 0x10, 0x00,
341 	0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x44, 0x44, 0x04,
342 	0x00, 0x50, 0x01, 0x50, 0x01, 0x50, 0x01, 0x00, 0x00, 0x00,
343 	0x00, 0x00, 0x00, 0x19, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00,
344 	0xff, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
345 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x0e, 0x03, 0x00,
346 	0x2c, 0xe2, 0x00, 0x02, 0x0e, 0x1c, 0x80, 0xc0, 0x80, 0x00,
347 	0x80, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
348 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
349 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x89,
350 	0xac, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
351 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
352 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
353 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
354 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
355 	0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xb8, 0x70, 0x89, 0xac,
356 	0x70, 0x89, 0xac, 0x70, 0x89, 0xac, 0x22, 0x22, 0x22, 0x22,
357 	0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x20, 0x20, 0x22, 0x22,
358 	0x20, 0x20, 0x22, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
359 	0x20, 0x1e, 0x20, 0x20, 0x1e, 0x1c, 0x1c, 0x1c, 0x1c, 0x18,
360 	0x20, 0x20, 0x20, 0x20, 0x20, 0x1e, 0x20, 0x20, 0x1e, 0x1c,
361 	0x1c, 0x1c, 0x1c, 0x18, 0x20, 0x20, 0x20, 0x20, 0x20, 0x1e,
362 	0x20, 0x20, 0x1e, 0x1c, 0x1c, 0x1c, 0x1c, 0x18, 0x1e, 0x1e,
363 	0x1e, 0x1e, 0x1e, 0x1c, 0x1e, 0x1e, 0x1c, 0x1a, 0x1a, 0x1a,
364 	0x1a, 0x16, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1c, 0x1e, 0x1e,
365 	0x1c, 0x1a, 0x1a, 0x1a, 0x1a, 0x16, 0x1e, 0x1e, 0x1e, 0x1e,
366 	0x1e, 0x1c, 0x1e, 0x1e, 0x1c, 0x1a, 0x1a, 0x1a, 0x1a, 0x16,
367 	0x11, 0x12, 0x15, 0x17, 0x41, 0x42, 0x45, 0x47, 0x31, 0x32,
368 	0x35, 0x37, 0x70, 0x75, 0x9d, 0xa2, 0x70, 0x75, 0xa2, 0xff,
369 	0x70, 0x75, 0xa2, 0xff, 0x7a, 0x7f, 0x93, 0x98, 0x70, 0x75,
370 	0xac, 0xb8, 0x70, 0x75, 0xac, 0x00, 0x70, 0x75, 0xac, 0x00,
371 	0x7a, 0x7f, 0x93, 0xa2, 0x70, 0x75, 0xac, 0x00, 0x70, 0x75,
372 	0xac, 0x00, 0x70, 0x75, 0xac, 0x00, 0x7a, 0x7f, 0x93, 0xa2,
373 	0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c, 0x7c, 0x3c,
374 	0x3c, 0x7c, 0x7c, 0x3c, 0x00, 0x00, 0x3c, 0x7c, 0x3c, 0x3c,
375 	0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x3c, 0x3c, 0x7c,
376 	0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c,
377 	0x3c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x20, 0x02,
378 	0x00, 0x00, 0x44, 0x44, 0x04, 0x00, 0x50, 0x01, 0x50, 0x01,
379 	0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00,
380 	0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x03, 0x03,
381 	0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
382 	0x00, 0x0e, 0x0e, 0x03, 0x00, 0x2d, 0xe2, 0x00, 0x02, 0x0e,
383 	0x1c, 0xe0, 0xe0, 0xf0, 0x0c, 0xe0, 0xe0, 0xf0, 0x6c, 0x00,
384 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28,
385 	0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
386 	0x00, 0x00, 0x00, 0x4c, 0x54, 0x68, 0x78, 0x8c, 0xa0, 0xb4,
387 	0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
388 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
389 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
390 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
391 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
392 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
393 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
394 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
395 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
396 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
397 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
398 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
399 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
400 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
401 	0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x58, 0x68, 0x78, 0x8c,
402 	0xa0, 0xb4, 0xcd, 0x4c, 0x58, 0x68, 0x78, 0x8c, 0xb4, 0xbd,
403 	0xcd, 0x4c, 0x58, 0x68, 0x78, 0x8c, 0xb4, 0xbd, 0xcd, 0x1e,
404 	0x1e, 0x1c, 0x18, 0x1e, 0x1e, 0x1c, 0x18, 0x1e, 0x1e, 0x1c,
405 	0x18, 0x1e, 0x1e, 0x1c, 0x18, 0x1e, 0x1e, 0x1c, 0x18, 0x1e,
406 	0x1e, 0x1c, 0x18, 0x1e, 0x1e, 0x1c, 0x18, 0x1e, 0x1e, 0x1c,
407 	0x18, 0x1e, 0x1e, 0x1e, 0x1c, 0x18, 0x14, 0x1e, 0x1c, 0x18,
408 	0x14, 0x14, 0x14, 0x14, 0x10, 0x1e, 0x1e, 0x1e, 0x1c, 0x18,
409 	0x14, 0x1e, 0x1c, 0x18, 0x14, 0x14, 0x14, 0x14, 0x10, 0x1e,
410 	0x1e, 0x1e, 0x1a, 0x16, 0x12, 0x1e, 0x1a, 0x16, 0x12, 0x12,
411 	0x12, 0x12, 0x10, 0x1e, 0x1e, 0x1e, 0x1a, 0x16, 0x12, 0x1e,
412 	0x1a, 0x16, 0x12, 0x12, 0x12, 0x12, 0x10, 0x1e, 0x1e, 0x1e,
413 	0x18, 0x14, 0x10, 0x1e, 0x18, 0x14, 0x10, 0x10, 0x10, 0x10,
414 	0x0e, 0x1e, 0x1e, 0x1e, 0x18, 0x14, 0x10, 0x1e, 0x18, 0x14,
415 	0x10, 0x10, 0x10, 0x10, 0x0e, 0x1e, 0x1e, 0x1e, 0x16, 0x12,
416 	0x0e, 0x1e, 0x16, 0x12, 0x0e, 0x0e, 0x0e, 0x0e, 0x0c, 0x1e,
417 	0x1e, 0x1e, 0x16, 0x12, 0x0e, 0x1e, 0x16, 0x12, 0x0e, 0x0e,
418 	0x0e, 0x0e, 0x0c, 0x1c, 0x1c, 0x1c, 0x1a, 0x16, 0x12, 0x1c,
419 	0x1a, 0x16, 0x12, 0x12, 0x12, 0x12, 0x0e, 0x1c, 0x1c, 0x1c,
420 	0x1a, 0x16, 0x12, 0x1c, 0x1a, 0x16, 0x12, 0x12, 0x12, 0x12,
421 	0x0e, 0x1c, 0x1c, 0x1c, 0x18, 0x14, 0x10, 0x1c, 0x18, 0x14,
422 	0x10, 0x10, 0x10, 0x10, 0x0c, 0x1c, 0x1c, 0x1c, 0x18, 0x14,
423 	0x10, 0x1c, 0x18, 0x14, 0x10, 0x10, 0x10, 0x10, 0x0c, 0x1c,
424 	0x1c, 0x1c, 0x16, 0x12, 0x0e, 0x1c, 0x16, 0x12, 0x0e, 0x0e,
425 	0x0e, 0x0e, 0x0a, 0x1c, 0x1c, 0x1c, 0x16, 0x12, 0x0e, 0x1c,
426 	0x16, 0x12, 0x0e, 0x0e, 0x0e, 0x0e, 0x0a, 0x1c, 0x1c, 0x1c,
427 	0x14, 0x10, 0x0c, 0x1c, 0x14, 0x10, 0x0c, 0x0c, 0x0c, 0x0c,
428 	0x08, 0x1c, 0x1c, 0x1c, 0x14, 0x10, 0x0c, 0x1c, 0x14, 0x10,
429 	0x0c, 0x0c, 0x0c, 0x0c, 0x08, 0x10, 0x16, 0x18, 0x40, 0x46,
430 	0x48, 0x30, 0x36, 0x38, 0x4c, 0x5c, 0x60, 0x8c, 0xa0, 0xb4,
431 	0xbd, 0xcd, 0x4c, 0x5c, 0x60, 0x8c, 0x90, 0xb4, 0xbd, 0xcd,
432 	0x4e, 0x56, 0x5e, 0x66, 0x8e, 0x96, 0xae, 0xbf, 0x4c, 0x50,
433 	0x5c, 0x68, 0x8c, 0xb4, 0xff, 0xff, 0x4c, 0x5c, 0x8c, 0xb4,
434 	0xff, 0xff, 0xff, 0xff, 0x4e, 0x5e, 0x66, 0x8e, 0x9e, 0xae,
435 	0xff, 0xff, 0x4c, 0x50, 0x54, 0x5c, 0x8c, 0xa0, 0xb4, 0xbd,
436 	0x4c, 0x5c, 0x68, 0x8c, 0x98, 0xb4, 0xbd, 0xcd, 0x4e, 0x56,
437 	0x5e, 0x8e, 0x96, 0xae, 0xbf, 0xc7, 0x7c, 0x7c, 0x7c, 0x7c,
438 	0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
439 	0x7c, 0x3c, 0x3c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
440 	0x3c, 0x7c, 0x7c, 0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c,
441 	0x7c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c,
442 	0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
443 	0x7c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x3c,
444 	0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c
445 };
446 
447 static const uint8_t ar9380_def_rom_h116[] = {
448 	0x02, 0x04, 0x00, 0x03, 0x7f, 0x00, 0x00, 0x00, 0x68, 0x31,
449 	0x31, 0x36, 0x2d, 0x30, 0x34, 0x31, 0x2d, 0x66, 0x30, 0x30,
450 	0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
451 	0x1f, 0x00, 0x33, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00,
452 	0x00, 0x00, 0x0d, 0x00, 0x06, 0x00, 0x08, 0xff, 0x10, 0x00,
453 	0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x44, 0x44, 0x04,
454 	0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x1f, 0x1f, 0x1f,
455 	0x12, 0x12, 0x12, 0x19, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00,
456 	0xff, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
457 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x0e, 0x03, 0x00,
458 	0x2c, 0xe2, 0x00, 0x02, 0x0e, 0x1c, 0x80, 0xc0, 0x80, 0x0c,
459 	0x80, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
460 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
461 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x89,
462 	0xac, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
463 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
464 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
465 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
466 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
467 	0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xac, 0x70, 0x89, 0xac,
468 	0x70, 0x89, 0xac, 0x70, 0x89, 0xac, 0x22, 0x22, 0x22, 0x22,
469 	0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x20, 0x20, 0x22, 0x22,
470 	0x20, 0x20, 0x22, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
471 	0x20, 0x1e, 0x20, 0x20, 0x1e, 0x1c, 0x00, 0x00, 0x00, 0x00,
472 	0x20, 0x20, 0x20, 0x20, 0x20, 0x1e, 0x20, 0x20, 0x1e, 0x1c,
473 	0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x1e,
474 	0x20, 0x20, 0x1e, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e,
475 	0x1e, 0x1e, 0x1e, 0x1c, 0x1e, 0x1e, 0x1c, 0x1a, 0x00, 0x00,
476 	0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1c, 0x1e, 0x1e,
477 	0x1c, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x1e,
478 	0x1e, 0x1c, 0x1e, 0x1e, 0x1c, 0x1a, 0x00, 0x00, 0x00, 0x00,
479 	0x11, 0x12, 0x15, 0x17, 0x41, 0x42, 0x45, 0x47, 0x31, 0x32,
480 	0x35, 0x37, 0x70, 0x75, 0x9d, 0xa2, 0x70, 0x75, 0xa2, 0xff,
481 	0x70, 0x75, 0xa2, 0xff, 0x7a, 0x7f, 0x93, 0x98, 0x70, 0x75,
482 	0xac, 0xb8, 0x70, 0x75, 0xac, 0x00, 0x70, 0x75, 0xac, 0x00,
483 	0x7a, 0x7f, 0x93, 0xa2, 0x70, 0x75, 0xac, 0x00, 0x70, 0x75,
484 	0xac, 0x00, 0x70, 0x75, 0xac, 0x00, 0x7a, 0x7f, 0x93, 0xa2,
485 	0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c, 0x7c, 0x3c,
486 	0x3c, 0x7c, 0x7c, 0x3c, 0x00, 0x00, 0x3c, 0x7c, 0x3c, 0x3c,
487 	0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x3c, 0x3c, 0x7c,
488 	0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c,
489 	0x3c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x20, 0x02,
490 	0x00, 0x00, 0x44, 0x44, 0x04, 0x00, 0x50, 0x01, 0x50, 0x01,
491 	0x50, 0x01, 0x19, 0x19, 0x19, 0x14, 0x14, 0x14, 0x46, 0x00,
492 	0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x03, 0x03,
493 	0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
494 	0x00, 0x0e, 0x0e, 0x03, 0x00, 0x2d, 0xe2, 0x00, 0x02, 0x0e,
495 	0x1c, 0xe0, 0xe0, 0xf0, 0x0c, 0xe0, 0xe0, 0xf0, 0x6c, 0x00,
496 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23,
497 	0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
498 	0x00, 0x00, 0x00, 0x4c, 0x54, 0x68, 0x78, 0x8c, 0xa0, 0xb4,
499 	0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
500 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
501 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
502 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
503 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
504 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
505 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
506 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
507 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
508 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
509 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
510 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
511 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
512 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
513 	0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x58, 0x68, 0x78, 0x8c,
514 	0xa0, 0xb4, 0xcd, 0x4c, 0x58, 0x68, 0x78, 0x8c, 0xb4, 0xbd,
515 	0xcd, 0x4c, 0x58, 0x68, 0x78, 0x8c, 0xb4, 0xbd, 0xcd, 0x1e,
516 	0x1e, 0x1c, 0x18, 0x1e, 0x1e, 0x1c, 0x18, 0x1e, 0x1e, 0x1c,
517 	0x18, 0x1e, 0x1e, 0x1c, 0x18, 0x1e, 0x1e, 0x1c, 0x18, 0x1e,
518 	0x1e, 0x1c, 0x18, 0x1e, 0x1e, 0x1c, 0x18, 0x1e, 0x1e, 0x1c,
519 	0x18, 0x1e, 0x1e, 0x1e, 0x1c, 0x18, 0x14, 0x1e, 0x1c, 0x18,
520 	0x14, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x1c, 0x18,
521 	0x14, 0x1e, 0x1c, 0x18, 0x14, 0x00, 0x00, 0x00, 0x00, 0x1e,
522 	0x1e, 0x1e, 0x1a, 0x16, 0x12, 0x1e, 0x1a, 0x16, 0x12, 0x00,
523 	0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x1a, 0x16, 0x12, 0x1e,
524 	0x1a, 0x16, 0x12, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e,
525 	0x18, 0x14, 0x10, 0x1e, 0x18, 0x14, 0x10, 0x00, 0x00, 0x00,
526 	0x00, 0x1e, 0x1e, 0x1e, 0x18, 0x14, 0x10, 0x1e, 0x18, 0x14,
527 	0x10, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x16, 0x12,
528 	0x0e, 0x1e, 0x16, 0x12, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x1e,
529 	0x1e, 0x1e, 0x16, 0x12, 0x0e, 0x1e, 0x16, 0x12, 0x0e, 0x00,
530 	0x00, 0x00, 0x00, 0x1c, 0x1c, 0x1c, 0x1a, 0x16, 0x12, 0x1c,
531 	0x1a, 0x16, 0x12, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x1c, 0x1c,
532 	0x1a, 0x16, 0x12, 0x1c, 0x1a, 0x16, 0x12, 0x00, 0x00, 0x00,
533 	0x00, 0x1c, 0x1c, 0x1c, 0x18, 0x14, 0x10, 0x1c, 0x18, 0x14,
534 	0x10, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x1c, 0x1c, 0x18, 0x14,
535 	0x10, 0x1c, 0x18, 0x14, 0x10, 0x00, 0x00, 0x00, 0x00, 0x1c,
536 	0x1c, 0x1c, 0x16, 0x12, 0x0e, 0x1c, 0x16, 0x12, 0x0e, 0x00,
537 	0x00, 0x00, 0x00, 0x1c, 0x1c, 0x1c, 0x16, 0x12, 0x0e, 0x1c,
538 	0x16, 0x12, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x1c, 0x1c,
539 	0x14, 0x10, 0x0c, 0x1c, 0x14, 0x10, 0x0c, 0x00, 0x00, 0x00,
540 	0x00, 0x1c, 0x1c, 0x1c, 0x14, 0x10, 0x0c, 0x1c, 0x14, 0x10,
541 	0x0c, 0x00, 0x00, 0x00, 0x00, 0x10, 0x16, 0x18, 0x40, 0x46,
542 	0x48, 0x30, 0x36, 0x38, 0x4c, 0x5c, 0x60, 0x8c, 0xa0, 0xb4,
543 	0xbd, 0xcd, 0x4c, 0x5c, 0x60, 0x8c, 0x90, 0xb4, 0xbd, 0xcd,
544 	0x4e, 0x56, 0x5e, 0x66, 0x8e, 0x96, 0xae, 0xbf, 0x4c, 0x50,
545 	0x5c, 0x68, 0x8c, 0xb4, 0xff, 0xff, 0x4c, 0x5c, 0x8c, 0xb4,
546 	0xff, 0xff, 0xff, 0xff, 0x4e, 0x5e, 0x66, 0x8e, 0x9e, 0xae,
547 	0xff, 0xff, 0x4c, 0x50, 0x54, 0x5c, 0x8c, 0xa0, 0xb4, 0xbd,
548 	0x4c, 0x5c, 0x68, 0x8c, 0x98, 0xb4, 0xbd, 0xcd, 0x4e, 0x56,
549 	0x5e, 0x8e, 0x96, 0xae, 0xbf, 0xc7, 0x7c, 0x7c, 0x7c, 0x7c,
550 	0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
551 	0x7c, 0x3c, 0x3c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
552 	0x3c, 0x7c, 0x7c, 0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c,
553 	0x7c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c,
554 	0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
555 	0x7c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x3c,
556 	0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c
557 };
558 
559 static const uint8_t ar9380_def_rom_x112[] = {
560 	0x02, 0x05, 0x00, 0x03, 0x7f, 0x00, 0x00, 0x00, 0x78, 0x31,
561 	0x31, 0x32, 0x2d, 0x30, 0x34, 0x31, 0x2d, 0x66, 0x30, 0x30,
562 	0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
563 	0x1f, 0x00, 0x77, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00,
564 	0x00, 0x00, 0x0d, 0x00, 0x06, 0x00, 0x08, 0xff, 0x00, 0x00,
565 	0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x22, 0x22, 0x02,
566 	0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x1b, 0x1b, 0x1b,
567 	0x15, 0x15, 0x15, 0x32, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00,
568 	0xff, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
569 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x0e, 0x03, 0x00,
570 	0x2c, 0xe2, 0x00, 0x02, 0x0e, 0x1c, 0x80, 0xc0, 0x80, 0x0c,
571 	0x80, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
572 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
573 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x89,
574 	0xac, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
575 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
576 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
577 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
578 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
579 	0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xac, 0x70, 0x89, 0xac,
580 	0x70, 0x89, 0xac, 0x70, 0x89, 0xac, 0x26, 0x26, 0x26, 0x26,
581 	0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x24, 0x22, 0x26, 0x26,
582 	0x24, 0x22, 0x26, 0x26, 0x22, 0x20, 0x24, 0x24, 0x24, 0x24,
583 	0x24, 0x22, 0x22, 0x20, 0x1e, 0x1c, 0x1c, 0x1c, 0x1c, 0x1a,
584 	0x24, 0x24, 0x24, 0x24, 0x24, 0x22, 0x24, 0x22, 0x20, 0x1e,
585 	0x1e, 0x1e, 0x1c, 0x1a, 0x24, 0x24, 0x24, 0x24, 0x24, 0x22,
586 	0x22, 0x20, 0x1e, 0x1c, 0x1c, 0x1c, 0x1c, 0x1a, 0x24, 0x24,
587 	0x24, 0x24, 0x22, 0x20, 0x20, 0x1e, 0x1c, 0x1a, 0x1a, 0x1a,
588 	0x1a, 0x18, 0x24, 0x24, 0x24, 0x24, 0x22, 0x20, 0x22, 0x20,
589 	0x1e, 0x1c, 0x1c, 0x1c, 0x1c, 0x18, 0x24, 0x24, 0x24, 0x24,
590 	0x22, 0x20, 0x20, 0x1e, 0x1c, 0x1a, 0x1a, 0x1a, 0x1a, 0x18,
591 	0x11, 0x12, 0x15, 0x17, 0x41, 0x42, 0x45, 0x47, 0x31, 0x32,
592 	0x35, 0x37, 0x70, 0x75, 0x9d, 0xa2, 0x70, 0x75, 0xa2, 0xff,
593 	0x70, 0x75, 0xa2, 0xff, 0x7a, 0x7f, 0x93, 0x98, 0x70, 0x75,
594 	0xac, 0xb8, 0x70, 0x75, 0xac, 0x00, 0x70, 0x75, 0xac, 0x00,
595 	0x7a, 0x7f, 0x93, 0xa2, 0x70, 0x75, 0xac, 0x00, 0x70, 0x75,
596 	0xac, 0x00, 0x70, 0x75, 0xac, 0x00, 0x7a, 0x7f, 0x93, 0xa2,
597 	0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c, 0x7c, 0x3c,
598 	0x3c, 0x7c, 0x7c, 0x3c, 0x00, 0x00, 0x3c, 0x7c, 0x3c, 0x3c,
599 	0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x3c, 0x3c, 0x7c,
600 	0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c,
601 	0x3c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x10, 0x01,
602 	0x00, 0x00, 0x22, 0x22, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
603 	0x00, 0x00, 0x13, 0x19, 0x17, 0x19, 0x19, 0x19, 0x46, 0x0f,
604 	0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x03, 0x03,
605 	0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
606 	0x00, 0x0e, 0x0e, 0x03, 0x00, 0x2d, 0xe2, 0x00, 0x02, 0x0e,
607 	0x1c, 0xe0, 0xe0, 0xf0, 0x0c, 0xe0, 0xe0, 0xf0, 0x6c, 0x00,
608 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48,
609 	0x69, 0x10, 0x14, 0x10, 0x19, 0x19, 0x19, 0x1d, 0x20, 0x24,
610 	0x10, 0x10, 0x10, 0x4c, 0x54, 0x68, 0x78, 0x8c, 0xa0, 0xb4,
611 	0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
612 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
613 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
614 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
615 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
616 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
617 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
618 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
619 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
620 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
621 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
622 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
623 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
624 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
625 	0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x54, 0x68, 0x78, 0x8c,
626 	0xa0, 0xb9, 0xcd, 0x4c, 0x54, 0x68, 0x78, 0x8c, 0xa0, 0xb9,
627 	0xcd, 0x4c, 0x54, 0x68, 0x78, 0x8c, 0xa0, 0xb9, 0xcd, 0x20,
628 	0x20, 0x1c, 0x1a, 0x20, 0x20, 0x1c, 0x1a, 0x20, 0x20, 0x1c,
629 	0x1a, 0x20, 0x20, 0x1a, 0x18, 0x20, 0x20, 0x1a, 0x18, 0x20,
630 	0x20, 0x18, 0x16, 0x1e, 0x1e, 0x18, 0x16, 0x1e, 0x1e, 0x18,
631 	0x16, 0x20, 0x20, 0x20, 0x20, 0x1c, 0x1a, 0x20, 0x1c, 0x1a,
632 	0x18, 0x18, 0x18, 0x16, 0x16, 0x20, 0x20, 0x20, 0x20, 0x1c,
633 	0x1a, 0x20, 0x1c, 0x1a, 0x18, 0x18, 0x18, 0x16, 0x16, 0x20,
634 	0x20, 0x20, 0x20, 0x1c, 0x1a, 0x20, 0x1c, 0x1a, 0x18, 0x18,
635 	0x18, 0x16, 0x16, 0x20, 0x20, 0x20, 0x20, 0x1c, 0x1a, 0x20,
636 	0x1a, 0x18, 0x16, 0x16, 0x16, 0x14, 0x14, 0x20, 0x20, 0x20,
637 	0x20, 0x1c, 0x1a, 0x20, 0x1a, 0x18, 0x16, 0x14, 0x12, 0x10,
638 	0x10, 0x20, 0x20, 0x20, 0x20, 0x1c, 0x1a, 0x20, 0x18, 0x14,
639 	0x10, 0x12, 0x10, 0x0e, 0x0e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1c,
640 	0x1a, 0x1e, 0x18, 0x14, 0x10, 0x12, 0x10, 0x0e, 0x0e, 0x1e,
641 	0x1e, 0x1e, 0x1e, 0x1c, 0x1a, 0x1e, 0x18, 0x14, 0x10, 0x12,
642 	0x10, 0x0e, 0x0e, 0x20, 0x20, 0x20, 0x1e, 0x1c, 0x1a, 0x1e,
643 	0x1c, 0x1a, 0x18, 0x18, 0x18, 0x16, 0x16, 0x20, 0x20, 0x20,
644 	0x1e, 0x1c, 0x1a, 0x1e, 0x1c, 0x1a, 0x18, 0x18, 0x18, 0x16,
645 	0x16, 0x20, 0x20, 0x20, 0x1e, 0x1c, 0x1a, 0x1e, 0x1c, 0x1a,
646 	0x18, 0x18, 0x18, 0x16, 0x16, 0x20, 0x20, 0x20, 0x1e, 0x1c,
647 	0x1a, 0x1e, 0x1a, 0x18, 0x16, 0x16, 0x16, 0x14, 0x14, 0x20,
648 	0x20, 0x20, 0x1e, 0x1c, 0x1a, 0x1e, 0x1a, 0x18, 0x16, 0x14,
649 	0x12, 0x10, 0x10, 0x20, 0x20, 0x20, 0x1e, 0x1c, 0x1a, 0x1e,
650 	0x16, 0x14, 0x10, 0x12, 0x10, 0x0e, 0x0e, 0x1e, 0x1e, 0x1e,
651 	0x1e, 0x1c, 0x1a, 0x1e, 0x16, 0x14, 0x10, 0x12, 0x10, 0x0e,
652 	0x0e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1c, 0x1a, 0x1e, 0x16, 0x14,
653 	0x10, 0x12, 0x10, 0x0e, 0x0e, 0x10, 0x16, 0x18, 0x40, 0x46,
654 	0x48, 0x30, 0x36, 0x38, 0x4c, 0x5c, 0x60, 0x8c, 0xa0, 0xb4,
655 	0xbd, 0xcd, 0x4c, 0x5c, 0x60, 0x8c, 0x90, 0xb4, 0xbd, 0xcd,
656 	0x4e, 0x56, 0x5e, 0x66, 0x8e, 0x96, 0xae, 0xbf, 0x4c, 0x50,
657 	0x5c, 0x68, 0x8c, 0xb4, 0xff, 0xff, 0x4c, 0x5c, 0x8c, 0xb4,
658 	0xff, 0xff, 0xff, 0xff, 0x4e, 0x5e, 0x66, 0x8e, 0x9e, 0xae,
659 	0xff, 0xff, 0x4c, 0x50, 0x54, 0x5c, 0x8c, 0xa0, 0xb4, 0xbd,
660 	0x4c, 0x5c, 0x68, 0x8c, 0x98, 0xb4, 0xbd, 0xcd, 0x4e, 0x56,
661 	0x5e, 0x8e, 0x96, 0xae, 0xbf, 0xc7, 0x7c, 0x7c, 0x7c, 0x7c,
662 	0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
663 	0x7c, 0x3c, 0x3c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
664 	0x3c, 0x7c, 0x7c, 0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c,
665 	0x7c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c,
666 	0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
667 	0x7c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x3c,
668 	0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c
669 };
670 
671 static const uint8_t ar9380_def_rom_x113[] = {
672 	0x02, 0x06, 0x00, 0x03, 0x7f, 0x00, 0x00, 0x00, 0x78, 0x31,
673 	0x31, 0x33, 0x2d, 0x30, 0x32, 0x33, 0x2d, 0x66, 0x30, 0x30,
674 	0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
675 	0x1f, 0x00, 0x77, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00,
676 	0x00, 0x00, 0x0d, 0x00, 0x06, 0x00, 0x08, 0xff, 0x21, 0x00,
677 	0x00, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x44, 0x44, 0x04,
678 	0x00, 0x50, 0x01, 0x50, 0x01, 0x50, 0x01, 0x00, 0x00, 0x00,
679 	0x00, 0x00, 0x00, 0x19, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00,
680 	0xff, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
681 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x0e, 0x03, 0x00,
682 	0x2c, 0xe2, 0x00, 0x02, 0x0e, 0x1c, 0x80, 0xc0, 0x80, 0x0c,
683 	0x80, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
684 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
685 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x89,
686 	0xac, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
687 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
688 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
689 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
690 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
691 	0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xac, 0x70, 0x89, 0xac,
692 	0x70, 0x89, 0xac, 0x70, 0x89, 0xac, 0x22, 0x22, 0x22, 0x22,
693 	0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x20, 0x20, 0x22, 0x22,
694 	0x20, 0x20, 0x22, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
695 	0x20, 0x1c, 0x20, 0x20, 0x1e, 0x1c, 0x00, 0x00, 0x00, 0x00,
696 	0x20, 0x20, 0x20, 0x20, 0x20, 0x1c, 0x20, 0x20, 0x1e, 0x1c,
697 	0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x1c,
698 	0x20, 0x20, 0x1e, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e,
699 	0x1e, 0x1e, 0x1e, 0x1c, 0x1e, 0x1e, 0x1c, 0x1a, 0x00, 0x00,
700 	0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1c, 0x1e, 0x1e,
701 	0x1c, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x1e,
702 	0x1e, 0x1c, 0x1e, 0x1e, 0x1c, 0x1a, 0x00, 0x00, 0x00, 0x00,
703 	0x11, 0x12, 0x15, 0x17, 0x41, 0x42, 0x45, 0x47, 0x31, 0x32,
704 	0x35, 0x37, 0x70, 0x75, 0x9d, 0xa2, 0x70, 0x75, 0xa2, 0xff,
705 	0x70, 0x75, 0xa2, 0xff, 0x7a, 0x7f, 0x93, 0x98, 0x70, 0x75,
706 	0xac, 0xb8, 0x70, 0x75, 0xac, 0x00, 0x70, 0x75, 0xac, 0x00,
707 	0x7a, 0x7f, 0x93, 0xa2, 0x70, 0x75, 0xac, 0x00, 0x70, 0x75,
708 	0xac, 0x00, 0x70, 0x75, 0xac, 0x00, 0x7a, 0x7f, 0x93, 0xa2,
709 	0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c, 0x7c, 0x3c,
710 	0x3c, 0x7c, 0x7c, 0x3c, 0x00, 0x00, 0x3c, 0x7c, 0x3c, 0x3c,
711 	0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x3c, 0x3c, 0x7c,
712 	0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x3c, 0x3c,
713 	0x3c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x20, 0x02,
714 	0x00, 0x00, 0x11, 0x11, 0x01, 0x00, 0x50, 0x01, 0x50, 0x01,
715 	0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00,
716 	0x8c, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x03, 0x03,
717 	0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
718 	0x00, 0x0e, 0x0e, 0x03, 0x00, 0x2d, 0xe2, 0x00, 0x02, 0x0e,
719 	0x1c, 0xe0, 0xe0, 0xf0, 0x0c, 0xe0, 0xe0, 0xf0, 0x6c, 0x00,
720 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48,
721 	0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
722 	0x00, 0x00, 0x00, 0x4c, 0x58, 0x68, 0x78, 0x8c, 0xa0, 0xbd,
723 	0xc5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
724 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
725 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
726 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
727 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
728 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
729 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
730 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
731 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
732 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
733 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
734 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
735 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
736 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
737 	0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x54, 0x68, 0x78, 0x8c,
738 	0xa0, 0xbd, 0xc5, 0x4c, 0x58, 0x68, 0x78, 0x8c, 0xb4, 0xbd,
739 	0xcd, 0x4e, 0x56, 0x68, 0x7a, 0x8e, 0xae, 0xbf, 0xcd, 0x2a,
740 	0x28, 0x28, 0x22, 0x2a, 0x28, 0x28, 0x22, 0x2a, 0x28, 0x28,
741 	0x22, 0x2a, 0x28, 0x28, 0x22, 0x2a, 0x28, 0x28, 0x22, 0x2a,
742 	0x28, 0x28, 0x22, 0x2a, 0x28, 0x28, 0x22, 0x2a, 0x28, 0x28,
743 	0x22, 0x28, 0x28, 0x28, 0x28, 0x20, 0x1c, 0x28, 0x28, 0x20,
744 	0x1c, 0x28, 0x28, 0x20, 0x14, 0x28, 0x28, 0x28, 0x28, 0x20,
745 	0x1c, 0x28, 0x28, 0x20, 0x1c, 0x28, 0x28, 0x20, 0x14, 0x28,
746 	0x28, 0x28, 0x28, 0x20, 0x1c, 0x28, 0x28, 0x20, 0x1c, 0x28,
747 	0x28, 0x20, 0x14, 0x28, 0x28, 0x28, 0x28, 0x20, 0x1c, 0x28,
748 	0x28, 0x20, 0x1c, 0x28, 0x28, 0x20, 0x14, 0x28, 0x28, 0x28,
749 	0x28, 0x20, 0x1c, 0x28, 0x28, 0x20, 0x1c, 0x28, 0x28, 0x20,
750 	0x14, 0x28, 0x28, 0x28, 0x28, 0x20, 0x1c, 0x28, 0x28, 0x20,
751 	0x1c, 0x28, 0x28, 0x20, 0x14, 0x26, 0x26, 0x26, 0x26, 0x20,
752 	0x1c, 0x26, 0x26, 0x20, 0x1c, 0x26, 0x26, 0x20, 0x1a, 0x24,
753 	0x24, 0x24, 0x24, 0x20, 0x1c, 0x24, 0x24, 0x20, 0x1c, 0x24,
754 	0x24, 0x20, 0x1a, 0x28, 0x28, 0x28, 0x26, 0x1e, 0x1a, 0x28,
755 	0x28, 0x1e, 0x1a, 0x28, 0x28, 0x1e, 0x18, 0x28, 0x28, 0x28,
756 	0x26, 0x1e, 0x1a, 0x28, 0x28, 0x1e, 0x1a, 0x28, 0x28, 0x1e,
757 	0x18, 0x28, 0x28, 0x28, 0x26, 0x1e, 0x1a, 0x28, 0x28, 0x1e,
758 	0x1a, 0x28, 0x28, 0x1e, 0x18, 0x28, 0x28, 0x28, 0x26, 0x1e,
759 	0x1a, 0x28, 0x28, 0x1e, 0x1a, 0x28, 0x28, 0x1e, 0x18, 0x28,
760 	0x28, 0x28, 0x26, 0x1e, 0x1a, 0x28, 0x28, 0x1e, 0x1a, 0x28,
761 	0x28, 0x1e, 0x18, 0x28, 0x28, 0x28, 0x26, 0x1e, 0x1a, 0x28,
762 	0x28, 0x1e, 0x1a, 0x28, 0x28, 0x1e, 0x18, 0x24, 0x24, 0x24,
763 	0x24, 0x1e, 0x1a, 0x24, 0x24, 0x1e, 0x1a, 0x24, 0x24, 0x1e,
764 	0x18, 0x22, 0x22, 0x22, 0x22, 0x1e, 0x1a, 0x22, 0x22, 0x1e,
765 	0x1a, 0x22, 0x22, 0x1e, 0x18, 0x10, 0x16, 0x18, 0x40, 0x46,
766 	0x48, 0x30, 0x36, 0x38, 0x4c, 0x5c, 0x60, 0x8c, 0xa0, 0xb4,
767 	0xbd, 0xcd, 0x4c, 0x5c, 0x60, 0x8c, 0x90, 0xb4, 0xbd, 0xcd,
768 	0x4e, 0x56, 0x5e, 0x66, 0x8e, 0x96, 0xae, 0xbf, 0x4c, 0x50,
769 	0x5c, 0x68, 0x8c, 0xb4, 0xff, 0xff, 0x4c, 0x5c, 0x8c, 0xb4,
770 	0xff, 0xff, 0xff, 0xff, 0x4e, 0x5e, 0x66, 0x8e, 0x9e, 0xae,
771 	0xff, 0xff, 0x4c, 0x50, 0x54, 0x5c, 0x8c, 0xa0, 0xb4, 0xbd,
772 	0x4c, 0x5c, 0x68, 0x8c, 0x98, 0xb4, 0xbd, 0xcd, 0x4e, 0x56,
773 	0x5e, 0x8e, 0x96, 0xae, 0xbf, 0xc7, 0x7c, 0x7c, 0x7c, 0x7c,
774 	0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
775 	0x7c, 0x3c, 0x3c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
776 	0x3c, 0x7c, 0x7c, 0x3c, 0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c,
777 	0x7c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c,
778 	0x7c, 0x3c, 0x3c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c,
779 	0x7c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x3c,
780 	0x7c, 0x3c, 0x7c, 0x7c, 0x7c, 0x7c, 0x3c, 0x7c
781 };
782 
783 static const uint8_t *ar9380_rom_templates[] = {
784 	ar9380_def_rom,
785 	ar9380_def_rom_h112,
786 	ar9380_def_rom_h116,
787 	ar9380_def_rom_x112,
788 	ar9380_def_rom_x113
789 };
790 
791 /* Macro to "pack" registers to 16-bit to save some .rodata space. */
792 #define P(x)	((x) >> 2)
793 
794 /*
795  * AR9380 2.2 programming.
796  */
797 static const uint16_t ar9380_2_2_regs[] = {
798 	P(0x07010), P(0x01030), P(0x01070), P(0x010b0), P(0x08014),
799 	P(0x0801c), P(0x08120), P(0x081d0), P(0x08318), P(0x1609c),
800 	P(0x160ac), P(0x160b0), P(0x1610c), P(0x16140), P(0x1650c),
801 	P(0x16540), P(0x1690c), P(0x16940), P(0x09810), P(0x09820),
802 	P(0x09824), P(0x09828), P(0x0982c), P(0x09830), P(0x09c00),
803 	P(0x09e00), P(0x09e04), P(0x09e0c), P(0x09e10), P(0x09e14),
804 	P(0x09e18), P(0x09e1c), P(0x09e20), P(0x09e2c), P(0x09e3c),
805 	P(0x09e44), P(0x09e48), P(0x09fc8), P(0x0a204), P(0x0a208),
806 	P(0x0a22c), P(0x0a230), P(0x0a234), P(0x0a238), P(0x0a250),
807 	P(0x0a254), P(0x0a258), P(0x0a25c), P(0x0a260), P(0x0a264),
808 	P(0x0a280), P(0x0a284), P(0x0a288), P(0x0a28c), P(0x0a2c4),
809 	P(0x0a2d0), P(0x0a2d8), P(0x0a358), P(0x0a830), P(0x0ae04),
810 	P(0x0ae18), P(0x0ae1c), P(0x0ae20), P(0x0b284), P(0x0b830),
811 	P(0x0be04), P(0x0be18), P(0x0be1c), P(0x0be20), P(0x0c284)
812 };
813 
814 static const uint32_t ar9380_2_2_vals_5g20[] = {
815 	0x00000023, 0x00000230, 0x00000168, 0x00000e60, 0x03e803e8,
816 	0x128d8027, 0x08f04800, 0x00003210, 0x00003e80, 0x0dd08f29,
817 	0xa4653c00, 0x03284f3e, 0x08000000, 0x10804008, 0x08000000,
818 	0x10804008, 0x08000000, 0x10804008, 0xd00a8005, 0x206a022e,
819 	0x5ac640d0, 0x06903081, 0x05eea6d4, 0x0000059c, 0x000000c4,
820 	0x0372111a, 0x001c2020, 0x6c4000e2, 0x7ec88d2e, 0x37b95d5e,
821 	0x00000000, 0x0001cf9c, 0x000003b5, 0x0000001c, 0xcf946220,
822 	0x02321e27, 0x5030201a, 0x0003f000, 0x000037c0, 0x00000104,
823 	0x01026a2f, 0x0000000a, 0x00000fff, 0xffb81018, 0x00000000,
824 	0x000007d0, 0x02020002, 0x01000e0e, 0x0a021501, 0x00000e0e,
825 	0x00000007, 0x00000000, 0x00000110, 0x00022222, 0x00158d18,
826 	0x00071981, 0x7999a83a, 0x00000000, 0x0000019c, 0x001c0000,
827 	0x00000000, 0x0000019c, 0x000001b5, 0x00000000, 0x0000019c,
828 	0x001c0000, 0x00000000, 0x0000019c, 0x000001b5, 0x00000000
829 };
830 
831 static const uint32_t ar9380_2_2_vals_5g40[] = {
832 	0x00000023, 0x00000460, 0x000002d0, 0x00001cc0, 0x07d007d0,
833 	0x128d804f, 0x08f04800, 0x00003210, 0x00007d00, 0x0dd08f29,
834 	0xa4653c00, 0x03284f3e, 0x00000000, 0x10804008, 0x00000000,
835 	0x10804008, 0x00000000, 0x10804008, 0xd00a8005, 0x206a022e,
836 	0x5ac640d0, 0x06903081, 0x05eea6d4, 0x0000059c, 0x000000c4,
837 	0x0372111a, 0x001c2020, 0x6d4000e2, 0x7ec88d2e, 0x37b9605e,
838 	0x00000000, 0x0001cf9c, 0x000003b5, 0x0000001c, 0xcf946220,
839 	0x02321e27, 0x5030201a, 0x0003f000, 0x000037c4, 0x00000104,
840 	0x01026a2f, 0x00000014, 0x10000fff, 0xffb81018, 0x00000000,
841 	0x00000fa0, 0x02020002, 0x01000e0e, 0x0a021501, 0x00000e0e,
842 	0x00000007, 0x00000000, 0x00000110, 0x00022222, 0x00158d18,
843 	0x00071981, 0x7999a83a, 0x00000000, 0x0000019c, 0x001c0000,
844 	0x00000000, 0x0000019c, 0x000001b5, 0x00000000, 0x0000019c,
845 	0x001c0000, 0x00000000, 0x0000019c, 0x000001b5, 0x00000000
846 };
847 
848 static const uint32_t ar9380_2_2_vals_2g40[] = {
849 	0x00000023, 0x000002c0, 0x00000318, 0x00007c70, 0x10801600,
850 	0x12e00057, 0x08f04810, 0x0000320a, 0x00006880, 0x0b283f31,
851 	0x24652800, 0x05d08f20, 0x00000000, 0x50804008, 0x00000000,
852 	0x50804008, 0x00000000, 0x50804008, 0xd00a8011, 0x206a012e,
853 	0x5ac640d0, 0x06903881, 0x05eea6d4, 0x0000119c, 0x000000c4,
854 	0x037216a0, 0x001c2020, 0x6d4000e2, 0x7ec84d2e, 0x3379605e,
855 	0x00000000, 0x00021f9c, 0x000003ce, 0x00000021, 0xcf946222,
856 	0x02291e27, 0x50302012, 0x0001a000, 0x000037c4, 0x00000004,
857 	0x01026a2f, 0x00000016, 0x10000fff, 0xffb81018, 0x00000210,
858 	0x00001130, 0x02020002, 0x01000e0e, 0x3a021501, 0x00000e0e,
859 	0x0000000b, 0x00000150, 0x00000110, 0x00022222, 0x00158d18,
860 	0x00071981, 0x7999a83a, 0x00000000, 0x0000019c, 0x001c0000,
861 	0x00000000, 0x0000019c, 0x000001ce, 0x00000150, 0x0000019c,
862 	0x001c0000, 0x00000000, 0x0000019c, 0x000001ce, 0x00000150
863 };
864 
865 static const uint32_t ar9380_2_2_vals_2g20[] = {
866 	0x00000023, 0x00000160, 0x0000018c, 0x00003e38, 0x08400b00,
867 	0x12e0002b, 0x08f04810, 0x0000320a, 0x00003440, 0x0b283f31,
868 	0x24652800, 0x05d08f20, 0x00000000, 0x50804008, 0x00000000,
869 	0x50804008, 0x00000000, 0x50804008, 0xd00a8011, 0x206a012e,
870 	0x5ac640d0, 0x06903881, 0x05eea6d4, 0x0000119c, 0x000000c4,
871 	0x037216a0, 0x001c2020, 0x6c4000e2, 0x7ec84d2e, 0x33795d5e,
872 	0x00000000, 0x00021f9c, 0x000003ce, 0x00000021, 0xcf946222,
873 	0x02291e27, 0x50302012, 0x0001a000, 0x000037c0, 0x00000004,
874 	0x01026a2f, 0x0000000b, 0x00000fff, 0xffb81018, 0x00000108,
875 	0x00000898, 0x02020002, 0x01000e0e, 0x3a021501, 0x00000e0e,
876 	0x0000000b, 0x00000150, 0x00000110, 0x00022222, 0x00158d18,
877 	0x00071982, 0x7999a83a, 0x00000000, 0x0000019c, 0x001c0000,
878 	0x00000000, 0x0000019c, 0x000001ce, 0x00000150, 0x0000019c,
879 	0x001c0000, 0x00000000, 0x0000019c, 0x000001ce, 0x00000150
880 };
881 
882 static const uint16_t ar9380_2_2_cm_regs[] = {
883 	P(0x040a4), P(0x07008), P(0x07020), P(0x07034), P(0x07038),
884 	P(0x07048), P(0x00008), P(0x00030), P(0x00034), P(0x00040),
885 	P(0x00044), P(0x00048), P(0x0004c), P(0x00050), P(0x01040),
886 	P(0x01044), P(0x01048), P(0x0104c), P(0x01050), P(0x01054),
887 	P(0x01058), P(0x0105c), P(0x01060), P(0x01064), P(0x010f0),
888 	P(0x01270), P(0x012b0), P(0x012f0), P(0x0143c), P(0x0147c),
889 	P(0x08000), P(0x08004), P(0x08008), P(0x0800c), P(0x08018),
890 	P(0x08020), P(0x08038), P(0x0803c), P(0x08040), P(0x08044),
891 	P(0x08048), P(0x0804c), P(0x08054), P(0x08058), P(0x0805c),
892 	P(0x08060), P(0x08064), P(0x08070), P(0x08074), P(0x08078),
893 	P(0x0809c), P(0x080a0), P(0x080a4), P(0x080a8), P(0x080ac),
894 	P(0x080b0), P(0x080b4), P(0x080b8), P(0x080bc), P(0x080c0),
895 	P(0x080c4), P(0x080c8), P(0x080cc), P(0x080d0), P(0x080d4),
896 	P(0x080d8), P(0x080dc), P(0x080e0), P(0x080e4), P(0x080e8),
897 	P(0x080ec), P(0x080f0), P(0x080f4), P(0x080fc), P(0x08100),
898 	P(0x08108), P(0x0810c), P(0x08110), P(0x08114), P(0x08118),
899 	P(0x0811c), P(0x08124), P(0x08128), P(0x0812c), P(0x08130),
900 	P(0x08134), P(0x08138), P(0x0813c), P(0x08144), P(0x08168),
901 	P(0x0816c), P(0x081c0), P(0x081c4), P(0x081c8), P(0x081cc),
902 	P(0x081ec), P(0x081f0), P(0x081f4), P(0x081f8), P(0x081fc),
903 	P(0x08240), P(0x08244), P(0x08248), P(0x0824c), P(0x08250),
904 	P(0x08254), P(0x08258), P(0x0825c), P(0x08260), P(0x08264),
905 	P(0x08268), P(0x0826c), P(0x08270), P(0x08274), P(0x08278),
906 	P(0x0827c), P(0x08284), P(0x08288), P(0x0828c), P(0x08294),
907 	P(0x08298), P(0x0829c), P(0x08300), P(0x08314), P(0x0831c),
908 	P(0x08328), P(0x0832c), P(0x08330), P(0x08334), P(0x08338),
909 	P(0x0833c), P(0x08340), P(0x08344), P(0x08348), P(0x0835c),
910 	P(0x08360), P(0x08364), P(0x08368), P(0x08370), P(0x08374),
911 	P(0x08378), P(0x0837c), P(0x08380), P(0x08384), P(0x08390),
912 	P(0x08394), P(0x08398), P(0x0839c), P(0x083a0), P(0x083a4),
913 	P(0x083a8), P(0x083ac), P(0x083b0), P(0x083b4), P(0x083b8),
914 	P(0x083bc), P(0x083c0), P(0x083c4), P(0x083c8), P(0x083cc),
915 	P(0x083d0), P(0x09800), P(0x09804), P(0x09808), P(0x0980c),
916 	P(0x09814), P(0x09818), P(0x0981c), P(0x09834), P(0x09838),
917 	P(0x0983c), P(0x09880), P(0x09884), P(0x098a4), P(0x098b0),
918 	P(0x098d0), P(0x098d4), P(0x098dc), P(0x098f0), P(0x098f4),
919 	P(0x09c04), P(0x09c08), P(0x09c0c), P(0x09c10), P(0x09c14),
920 	P(0x09c18), P(0x09c1c), P(0x09d00), P(0x09d04), P(0x09d08),
921 	P(0x09d0c), P(0x09d10), P(0x09d14), P(0x09d18), P(0x09e08),
922 	P(0x09e24), P(0x09e28), P(0x09e30), P(0x09e34), P(0x09e38),
923 	P(0x09e40), P(0x09e4c), P(0x09e50), P(0x09e54), P(0x09fc0),
924 	P(0x09fc4), P(0x09fcc), P(0x09fd0), P(0x0a20c), P(0x0a220),
925 	P(0x0a224), P(0x0a228), P(0x0a23c), P(0x0a244), P(0x0a2a0),
926 	P(0x0a2c0), P(0x0a2c8), P(0x0a2cc), P(0x0a2d4), P(0x0a2ec),
927 	P(0x0a2f0), P(0x0a2f4), P(0x0a2f8), P(0x0a344), P(0x0a34c),
928 	P(0x0a350), P(0x0a364), P(0x0a370), P(0x0a390), P(0x0a394),
929 	P(0x0a398), P(0x0a39c), P(0x0a3a0), P(0x0a3a4), P(0x0a3a8),
930 	P(0x0a3ac), P(0x0a3c0), P(0x0a3c4), P(0x0a3c8), P(0x0a3cc),
931 	P(0x0a3d0), P(0x0a3d4), P(0x0a3d8), P(0x0a3dc), P(0x0a3e0),
932 	P(0x0a3e4), P(0x0a3e8), P(0x0a3ec), P(0x0a3f0), P(0x0a3f4),
933 	P(0x0a3f8), P(0x0a3fc), P(0x0a400), P(0x0a404), P(0x0a408),
934 	P(0x0a40c), P(0x0a414), P(0x0a418), P(0x0a41c), P(0x0a420),
935 	P(0x0a424), P(0x0a428), P(0x0a42c), P(0x0a430), P(0x0a434),
936 	P(0x0a438), P(0x0a43c), P(0x0a440), P(0x0a444), P(0x0a448),
937 	P(0x0a44c), P(0x0a450), P(0x0a458), P(0x0a640), P(0x0a644),
938 	P(0x0a648), P(0x0a64c), P(0x0a670), P(0x0a674), P(0x0a678),
939 	P(0x0a67c), P(0x0a680), P(0x0a684), P(0x0a688), P(0x0a690),
940 	P(0x0a7c0), P(0x0a7c4), P(0x0a7c8), P(0x0a7cc), P(0x0a7d0),
941 	P(0x0a7d4), P(0x0a7dc), P(0x0a8d0), P(0x0a8d4), P(0x0a8dc),
942 	P(0x0a8f0), P(0x0a8f4), P(0x0b2d0), P(0x0b2d4), P(0x0b2ec),
943 	P(0x0b2f0), P(0x0b2f4), P(0x0b2f8), P(0x0b408), P(0x0b40c),
944 	P(0x0b420), P(0x0b8d0), P(0x0b8d4), P(0x0b8dc), P(0x0b8f0),
945 	P(0x0b8f4), P(0x0c2d0), P(0x0c2d4), P(0x0c2ec), P(0x0c2f0),
946 	P(0x0c2f4), P(0x0c2f8), P(0x0c408), P(0x0c40c), P(0x0c420),
947 	P(0x16000), P(0x16004), P(0x16008), P(0x1600c), P(0x16040),
948 	P(0x1604c), P(0x16050), P(0x16054), P(0x16058), P(0x1605c),
949 	P(0x16060), P(0x16064), P(0x1606c), P(0x16080), P(0x16084),
950 	P(0x16088), P(0x1608c), P(0x16090), P(0x16098), P(0x160a0),
951 	P(0x160a4), P(0x160a8), P(0x160b4), P(0x160c0), P(0x160c4),
952 	P(0x160c8), P(0x160cc), P(0x16100), P(0x16104), P(0x16108),
953 	P(0x16144), P(0x16148), P(0x16280), P(0x16284), P(0x16288),
954 	P(0x1628c), P(0x16290), P(0x16294), P(0x16380), P(0x16384),
955 	P(0x16388), P(0x1638c), P(0x16390), P(0x16394), P(0x16398),
956 	P(0x1639c), P(0x163a0), P(0x163a4), P(0x163a8), P(0x163ac),
957 	P(0x163b0), P(0x163b4), P(0x163b8), P(0x163bc), P(0x163c0),
958 	P(0x163c4), P(0x163c8), P(0x163cc), P(0x163d0), P(0x163d4),
959 	P(0x16400), P(0x16404), P(0x16408), P(0x1640c), P(0x16440),
960 	P(0x1644c), P(0x16450), P(0x16454), P(0x16458), P(0x1645c),
961 	P(0x16460), P(0x16464), P(0x1646c), P(0x16500), P(0x16504),
962 	P(0x16508), P(0x16544), P(0x16548), P(0x16780), P(0x16784),
963 	P(0x16788), P(0x1678c), P(0x16790), P(0x16794), P(0x16798),
964 	P(0x1679c), P(0x167a0), P(0x167a4), P(0x167a8), P(0x167ac),
965 	P(0x167b0), P(0x167b4), P(0x167b8), P(0x167bc), P(0x167c0),
966 	P(0x167c4), P(0x167c8), P(0x167cc), P(0x167d0), P(0x167d4),
967 	P(0x16800), P(0x16804), P(0x16808), P(0x1680c), P(0x16840),
968 	P(0x1684c), P(0x16850), P(0x16854), P(0x16858), P(0x1685c),
969 	P(0x16860), P(0x16864), P(0x1686c), P(0x16900), P(0x16904),
970 	P(0x16908), P(0x16944), P(0x16948), P(0x16b80), P(0x16b84),
971 	P(0x16b88), P(0x16b8c), P(0x16b90), P(0x16b94), P(0x16b98),
972 	P(0x16b9c), P(0x16ba0), P(0x16ba4), P(0x16ba8), P(0x16bac),
973 	P(0x16bb0), P(0x16bb4), P(0x16bb8), P(0x16bbc), P(0x16bc0),
974 	P(0x16bc4), P(0x16bc8), P(0x16bcc), P(0x16bd0), P(0x16bd4)
975 };
976 
977 static const uint32_t ar9380_2_2_cm_vals[] = {
978 	0x00a0c1c9, 0x00000000, 0x00000000, 0x00000002, 0x000004c2,
979 	0x00000008, 0x00000000, 0x00020085, 0x00000005, 0x00000000,
980 	0x00000000, 0x00000008, 0x00000010, 0x00000000, 0x002ffc0f,
981 	0x002ffc0f, 0x002ffc0f, 0x002ffc0f, 0x002ffc0f, 0x002ffc0f,
982 	0x002ffc0f, 0x002ffc0f, 0x002ffc0f, 0x002ffc0f, 0x00000100,
983 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
984 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
985 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
986 	0x00000000, 0xffffffff, 0x00000000, 0x00000000, 0x000fc78f,
987 	0x0000000f, 0x00000000, 0x00000310, 0x00000020, 0x00000000,
988 	0x0000000f, 0x00000000, 0x02ff0000, 0x0e070605, 0x0000000d,
989 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x2a800000,
990 	0x06900168, 0x13881c20, 0x01f40000, 0x00252500, 0x00a00000,
991 	0x00400000, 0x00000000, 0xffffffff, 0x0000ffff, 0x3f3f3f3f,
992 	0x00000000, 0x00000000, 0x00000000, 0x00020000, 0x00000000,
993 	0x00000052, 0x00000000, 0x00000000, 0x000007ff, 0x000000aa,
994 	0x00003210, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
995 	0x00000000, 0x00000000, 0x0000ffff, 0xffffffff, 0x00000000,
996 	0x00000000, 0x00000000, 0x33332210, 0x00000000, 0x00000000,
997 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
998 	0x00100000, 0x0010f424, 0x00000800, 0x0001e848, 0x00000000,
999 	0x00000000, 0x00000000, 0x40000000, 0x00080922, 0x9bc00010,
1000 	0xffffffff, 0x0000ffff, 0x00000000, 0x40000000, 0x003e4180,
1001 	0x00000004, 0x0000002c, 0x0000002c, 0x000000ff, 0x00000000,
1002 	0x00000000, 0x00000000, 0x00000140, 0x00000000, 0x0000010d,
1003 	0x00000000, 0x00000007, 0x00000302, 0x00000700, 0x00ff0000,
1004 	0x02400000, 0x000107ff, 0xaa48105b, 0x008f0000, 0x00000000,
1005 	0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x000000ff,
1006 	0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff,
1007 	0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x0000fa14,
1008 	0x000f0c00, 0x33332210, 0x33332210, 0x33332210, 0x33332210,
1009 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200,
1010 	0x000301ff, 0xafe68e30, 0xfd14e000, 0x9c0a9f6b, 0x04900000,
1011 	0x9280c00a, 0x00000000, 0x00020028, 0x6400a290, 0x0108ecff,
1012 	0x0d000600, 0x201fff00, 0x00001042, 0x00200400, 0x32840bbe,
1013 	0x004b6a8e, 0x00000820, 0x00000000, 0x00000000, 0x00000000,
1014 	0xff55ff55, 0x0320ff55, 0x00000000, 0x00000000, 0x00046384,
1015 	0x05b6b440, 0x00b6b440, 0xc080a333, 0x40206c10, 0x009c4060,
1016 	0x9883800a, 0x01834061, 0x00c0040b, 0x00000000, 0x0038230c,
1017 	0x990bb515, 0x0c6f0000, 0x06336f77, 0x6af6532f, 0x0cc80c00,
1018 	0x0d261820, 0x00001004, 0x00ff03f1, 0x00000000, 0x803e4788,
1019 	0x0001efb5, 0x40000014, 0x01193b93, 0x00000000, 0x00000000,
1020 	0x00000000, 0x10002310, 0x00000000, 0x0c000000, 0x00000001,
1021 	0x00000001, 0x00000000, 0x18c43433, 0x00000000, 0x00000000,
1022 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1023 	0x0000a000, 0x00000000, 0x00000000, 0x00000001, 0x00000444,
1024 	0x001f0e0f, 0x0075393f, 0xb79f6427, 0x00000000, 0xaaaaaaaa,
1025 	0x3c466478, 0x20202020, 0x22222220, 0x20200020, 0x20202020,
1026 	0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
1027 	0x20202020, 0x20202020, 0x20202020, 0x00000000, 0x00000246,
1028 	0x0cdbd380, 0x000f0f01, 0x8fa91f01, 0x00000000, 0x0e79e5c6,
1029 	0x00820820, 0x1ce739ce, 0x2d001dce, 0x1ce739ce, 0x000001ce,
1030 	0x1ce739ce, 0x000001ce, 0x1ce739ce, 0x1ce739ce, 0x00000000,
1031 	0x00001801, 0x00100000, 0x00000000, 0x00000000, 0x06000080,
1032 	0x00000001, 0x00010000, 0x00000000, 0x00000000, 0x3fad9d74,
1033 	0x0048060a, 0x00003c37, 0x03020100, 0x09080504, 0x0d0c0b0a,
1034 	0x13121110, 0x31301514, 0x35343332, 0x00000036, 0x00000838,
1035 	0x00000000, 0xfffffffc, 0x00000000, 0x00000000, 0x00000000,
1036 	0x00000004, 0x00000001, 0x004b6a8e, 0x00000820, 0x00000000,
1037 	0x00000000, 0x00000000, 0x00000080, 0x00000000, 0x00000000,
1038 	0x00000000, 0x00000000, 0x00000000, 0x0e79e5c0, 0x00820820,
1039 	0x00000000, 0x004b6a8e, 0x00000820, 0x00000000, 0x00000000,
1040 	0x00000000, 0x00000080, 0x00000000, 0x00000000, 0x00000000,
1041 	0x00000000, 0x00000000, 0x0e79e5c0, 0x00820820, 0x00000000,
1042 	0x36db6db6, 0x6db6db40, 0x73f00000, 0x00000000, 0x7f80fff8,
1043 	0x76d005b5, 0x556cf031, 0x13449440, 0x0c51c92c, 0x3db7fffc,
1044 	0xfffffffc, 0x000f0278, 0x6db60000, 0x00000000, 0x0e48048c,
1045 	0x54214514, 0x119f481e, 0x24926490, 0xd2888888, 0x0a108ffe,
1046 	0x812fc370, 0x423c8000, 0x92480080, 0x00adb6d0, 0x6db6db60,
1047 	0x6db6db6c, 0x01e6c000, 0x3fffbe01, 0xfff80000, 0x00080010,
1048 	0x02084080, 0x00000000, 0x058a0001, 0x3d840208, 0x05a20408,
1049 	0x00038c07, 0x00000004, 0x458aa14f, 0x00000000, 0x00000000,
1050 	0x00800700, 0x00800700, 0x00800700, 0x00000000, 0x00000000,
1051 	0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000,
1052 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000a0,
1053 	0x000c0000, 0x14021402, 0x00001402, 0x00000000, 0x00000000,
1054 	0x36db6db6, 0x6db6db40, 0x73f00000, 0x00000000, 0x7f80fff8,
1055 	0x76d005b5, 0x556cf031, 0x13449440, 0x0c51c92c, 0x3db7fffc,
1056 	0xfffffffc, 0x000f0278, 0x6db60000, 0x3fffbe01, 0xfff80000,
1057 	0x00080010, 0x02084080, 0x00000000, 0x00000000, 0x00000000,
1058 	0x00800700, 0x00800700, 0x00800700, 0x00000000, 0x00000000,
1059 	0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000,
1060 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000a0,
1061 	0x000c0000, 0x14021402, 0x00001402, 0x00000000, 0x00000000,
1062 	0x36db6db6, 0x6db6db40, 0x73f00000, 0x00000000, 0x7f80fff8,
1063 	0x76d005b5, 0x556cf031, 0x13449440, 0x0c51c92c, 0x3db7fffc,
1064 	0xfffffffc, 0x000f0278, 0x6db60000, 0x3fffbe01, 0xfff80000,
1065 	0x00080010, 0x02084080, 0x00000000, 0x00000000, 0x00000000,
1066 	0x00800700, 0x00800700, 0x00800700, 0x00000000, 0x00000000,
1067 	0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000000,
1068 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000000a0,
1069 	0x000c0000, 0x14021402, 0x00001402, 0x00000000, 0x00000000
1070 };
1071 
1072 static const uint16_t ar9380_2_2_fast_clock_regs[] = {
1073 	P(0x01030), P(0x01070), P(0x010b0), P(0x08014), P(0x0801c),
1074 	P(0x08318), P(0x09e00), P(0x0a230), P(0x0a254)
1075 };
1076 
1077 static const uint32_t ar9380_2_2_fast_clock_vals_5g20[] = {
1078 	0x00000268, 0x0000018c, 0x00000fd0, 0x044c044c, 0x148ec02b,
1079 	0x000044c0, 0x0372131c, 0x0000000b, 0x00000898
1080 };
1081 
1082 static const uint32_t ar9380_2_2_fast_clock_vals_5g40[] = {
1083 	0x000004d0, 0x00000318, 0x00001fa0, 0x08980898, 0x148ec057,
1084 	0x00008980, 0x0372131c, 0x00000016, 0x00001130
1085 };
1086 
1087 static const struct athn_ini ar9380_2_2_ini = {
1088 	nitems(ar9380_2_2_regs),
1089 	ar9380_2_2_regs,
1090 	ar9380_2_2_vals_5g20,
1091 	ar9380_2_2_vals_5g40,
1092 	ar9380_2_2_vals_2g40,
1093 	ar9380_2_2_vals_2g20,
1094 	nitems(ar9380_2_2_cm_regs),
1095 	ar9380_2_2_cm_regs,
1096 	ar9380_2_2_cm_vals,
1097 	nitems(ar9380_2_2_fast_clock_regs),
1098 	ar9380_2_2_fast_clock_regs,
1099 	ar9380_2_2_fast_clock_vals_5g20,
1100 	ar9380_2_2_fast_clock_vals_5g40
1101 };
1102 
1103 /*
1104  * AR9485 1.1 programming.
1105  */
1106 
1107 static const uint16_t ar9485_1_1_regs[] = {
1108 	P(0x01030), P(0x01070), P(0x010b0), P(0x08014), P(0x0801c),
1109 	P(0x08120), P(0x081d0), P(0x08318), P(0x09810), P(0x09820),
1110 	P(0x09824), P(0x09828), P(0x0982c), P(0x09830), P(0x09c00),
1111 	P(0x09e00), P(0x09e04), P(0x09e0c), P(0x09e10), P(0x09e14),
1112 	P(0x09e18), P(0x09e1c), P(0x09e20), P(0x09e2c), P(0x09e3c),
1113 	P(0x09e44), P(0x09e48), P(0x09fc8), P(0x0a204), P(0x0a208),
1114 	P(0x0a230), P(0x0a234), P(0x0a238), P(0x0a250), P(0x0a254),
1115 	P(0x0a258), P(0x0a25c), P(0x0a260), P(0x0a264), P(0x0a280),
1116 	P(0x0a284), P(0x0a288), P(0x0a28c), P(0x0a2c4), P(0x0a2d0),
1117 	P(0x0a2d8), P(0x0a358), P(0x0be04), P(0x0be18), P(0x1609c),
1118 	P(0x160ac), P(0x160b0), P(0x1610c), P(0x16140)
1119 };
1120 
1121 static const uint32_t ar9485_1_1_vals_2g40[] = {
1122 	0x000002c0, 0x00000318, 0x00007c70, 0x10801600, 0x12e00057,
1123 	0x08f04810, 0x0000320a, 0x00006880, 0xd00a8005, 0x206a002e,
1124 	0x5ac640d0, 0x06903881, 0x05eea6d4, 0x0000059c, 0x00000044,
1125 	0x037216a0, 0x00182020, 0x6d4000e2, 0x7ec80d2e, 0x3139605e,
1126 	0x00000000, 0x00021f9c, 0x000003ce, 0x00000021, 0xcf946222,
1127 	0x02282324, 0x50302010, 0x0001a000, 0x01303fc4, 0x00000004,
1128 	0x00004016, 0x10000fff, 0xffb81018, 0x00000210, 0x00001130,
1129 	0x02020002, 0x01000e0e, 0x3a021501, 0x00000e0e, 0x0000000b,
1130 	0x000002a0, 0x00000000, 0x00000000, 0x00158d18, 0x00071982,
1131 	0xf999a83a, 0x00000000, 0x00802020, 0x00000000, 0x0b283f31,
1132 	0x24611800, 0x03284f3e, 0x00170000, 0x50804008
1133 };
1134 
1135 static const uint32_t ar9485_1_1_vals_2g20[] = {
1136 	0x00000160, 0x0000018c, 0x00003e38, 0x08400b00, 0x12e0002b,
1137 	0x08f04810, 0x0000320a, 0x00003440, 0xd00a8005, 0x206a002e,
1138 	0x5ac640d0, 0x06903881, 0x05eea6d4, 0x0000059c, 0x00000044,
1139 	0x037216a0, 0x00182020, 0x6c4000e2, 0x7ec80d2e, 0x31395d5e,
1140 	0x00000000, 0x00021f9c, 0x000003ce, 0x00000021, 0xcf946222,
1141 	0x02282324, 0x50302010, 0x0001a000, 0x01303fc0, 0x00000004,
1142 	0x0000400b, 0x10000fff, 0xffb81018, 0x00000108, 0x00000898,
1143 	0x02020002, 0x01000e0e, 0x3a021501, 0x00000e0e, 0x0000000b,
1144 	0x000002a0, 0x00000000, 0x00000000, 0x00158d18, 0x00071982,
1145 	0xf999a83a, 0x00000000, 0x00802020, 0x00000000, 0x0b283f31,
1146 	0x24611800, 0x03284f3e, 0x00170000, 0x50804008
1147 };
1148 
1149 static const uint16_t ar9485_1_1_cm_regs[] = {
1150 	P(0x04014), P(0x04090), P(0x040a4), P(0x07010), P(0x07020),
1151 	P(0x07034), P(0x07038), P(0x07048), P(0x0a580), P(0x0a584),
1152 	P(0x0a588), P(0x0a58c), P(0x0a590), P(0x0a594), P(0x0a598),
1153 	P(0x0a59c), P(0x0a5a0), P(0x0a5a4), P(0x0a5a8), P(0x0a5ac),
1154 	P(0x0a5b0), P(0x0a5b4), P(0x0a5b8), P(0x0a5bc), P(0x00008),
1155 	P(0x00030), P(0x00034), P(0x00040), P(0x00044), P(0x00048),
1156 	P(0x0004c), P(0x00050), P(0x01040), P(0x01044), P(0x01048),
1157 	P(0x0104c), P(0x01050), P(0x01054), P(0x01058), P(0x0105c),
1158 	P(0x01060), P(0x01064), P(0x010f0), P(0x01270), P(0x012b0),
1159 	P(0x012f0), P(0x0143c), P(0x0147c), P(0x08000), P(0x08004),
1160 	P(0x08008), P(0x0800c), P(0x08018), P(0x08020), P(0x08038),
1161 	P(0x0803c), P(0x08040), P(0x08044), P(0x08048), P(0x0804c),
1162 	P(0x08054), P(0x08058), P(0x0805c), P(0x08060), P(0x08064),
1163 	P(0x08070), P(0x08074), P(0x08078), P(0x0809c), P(0x080a0),
1164 	P(0x080a4), P(0x080a8), P(0x080ac), P(0x080b0), P(0x080b4),
1165 	P(0x080b8), P(0x080bc), P(0x080c0), P(0x080c4), P(0x080c8),
1166 	P(0x080cc), P(0x080d0), P(0x080d4), P(0x080d8), P(0x080dc),
1167 	P(0x080e0), P(0x080e4), P(0x080e8), P(0x080ec), P(0x080f0),
1168 	P(0x080f4), P(0x080fc), P(0x08100), P(0x08108), P(0x0810c),
1169 	P(0x08110), P(0x08114), P(0x08118), P(0x0811c), P(0x08124),
1170 	P(0x08128), P(0x0812c), P(0x08130), P(0x08134), P(0x08138),
1171 	P(0x0813c), P(0x08144), P(0x08168), P(0x0816c), P(0x08170),
1172 	P(0x08174), P(0x08178), P(0x0817c), P(0x081c0), P(0x081c4),
1173 	P(0x081d4), P(0x081ec), P(0x081f0), P(0x081f4), P(0x081f8),
1174 	P(0x081fc), P(0x08240), P(0x08244), P(0x08248), P(0x0824c),
1175 	P(0x08250), P(0x08254), P(0x08258), P(0x0825c), P(0x08260),
1176 	P(0x08264), P(0x08268), P(0x0826c), P(0x08270), P(0x08274),
1177 	P(0x08278), P(0x0827c), P(0x08284), P(0x08288), P(0x0828c),
1178 	P(0x08294), P(0x08298), P(0x0829c), P(0x08300), P(0x08314),
1179 	P(0x0831c), P(0x08328), P(0x0832c), P(0x08330), P(0x08334),
1180 	P(0x08338), P(0x0833c), P(0x08340), P(0x08344), P(0x08348),
1181 	P(0x0835c), P(0x08360), P(0x08364), P(0x08368), P(0x08370),
1182 	P(0x08374), P(0x08378), P(0x0837c), P(0x08380), P(0x08384),
1183 	P(0x08390), P(0x08394), P(0x08398), P(0x0839c), P(0x083a0),
1184 	P(0x083a4), P(0x083a8), P(0x083ac), P(0x083b0), P(0x083b4),
1185 	P(0x083b8), P(0x083bc), P(0x083c0), P(0x083c4), P(0x083c8),
1186 	P(0x083cc), P(0x083d0), P(0x09800), P(0x09804), P(0x09808),
1187 	P(0x0980c), P(0x09814), P(0x09818), P(0x0981c), P(0x09834),
1188 	P(0x09838), P(0x0983c), P(0x09880), P(0x09884), P(0x098a4),
1189 	P(0x098b0), P(0x098d0), P(0x098d4), P(0x098dc), P(0x098f0),
1190 	P(0x098f4), P(0x09c04), P(0x09c08), P(0x09c0c), P(0x09c10),
1191 	P(0x09c14), P(0x09c18), P(0x09c1c), P(0x09d00), P(0x09d04),
1192 	P(0x09d08), P(0x09d0c), P(0x09d10), P(0x09d14), P(0x09d18),
1193 	P(0x09d1c), P(0x09e08), P(0x09e24), P(0x09e28), P(0x09e30),
1194 	P(0x09e34), P(0x09e38), P(0x09e40), P(0x09e4c), P(0x09e50),
1195 	P(0x09fc0), P(0x09fc4), P(0x09fcc), P(0x0a20c), P(0x0a210),
1196 	P(0x0a220), P(0x0a224), P(0x0a228), P(0x0a23c), P(0x0a244),
1197 	P(0x0a2a0), P(0x0a2c0), P(0x0a2c8), P(0x0a2cc), P(0x0a2d4),
1198 	P(0x0a2dc), P(0x0a2e0), P(0x0a2e4), P(0x0a2e8), P(0x0a2ec),
1199 	P(0x0a2f0), P(0x0a2f4), P(0x0a2f8), P(0x0a344), P(0x0a34c),
1200 	P(0x0a350), P(0x0a364), P(0x0a370), P(0x0a390), P(0x0a394),
1201 	P(0x0a398), P(0x0a39c), P(0x0a3a0), P(0x0a3a4), P(0x0a3a8),
1202 	P(0x0a3ac), P(0x0a3c0), P(0x0a3c4), P(0x0a3c8), P(0x0a3cc),
1203 	P(0x0a3d0), P(0x0a3d4), P(0x0a3d8), P(0x0a3dc), P(0x0a3e0),
1204 	P(0x0a3e4), P(0x0a3e8), P(0x0a3ec), P(0x0a3f0), P(0x0a3f4),
1205 	P(0x0a3f8), P(0x0a3fc), P(0x0a400), P(0x0a404), P(0x0a408),
1206 	P(0x0a40c), P(0x0a414), P(0x0a418), P(0x0a41c), P(0x0a420),
1207 	P(0x0a424), P(0x0a428), P(0x0a42c), P(0x0a430), P(0x0a434),
1208 	P(0x0a438), P(0x0a43c), P(0x0a440), P(0x0a444), P(0x0a448),
1209 	P(0x0a44c), P(0x0a450), P(0x0a5c4), P(0x0a5c8), P(0x0a5cc),
1210 	P(0x0a760), P(0x0a764), P(0x0a768), P(0x0a76c), P(0x0a770),
1211 	P(0x0a774), P(0x0a778), P(0x0a780), P(0x0a7c0), P(0x0a7c4),
1212 	P(0x0a7c8), P(0x0a7cc), P(0x0a7d0), P(0x0a7d4), P(0x0a7dc),
1213 	P(0x16000), P(0x16004), P(0x16008), P(0x1600c), P(0x16040),
1214 	P(0x1604c), P(0x16050), P(0x16054), P(0x16080), P(0x16084),
1215 	P(0x16088), P(0x1608c), P(0x16090), P(0x16098), P(0x160a0),
1216 	P(0x160a4), P(0x160a8), P(0x160b4), P(0x160c0), P(0x160c4),
1217 	P(0x160c8), P(0x160cc), P(0x160d0), P(0x16100), P(0x16104),
1218 	P(0x16108), P(0x16144), P(0x16148), P(0x16240), P(0x16244),
1219 	P(0x16248), P(0x1624c), P(0x16280), P(0x16284), P(0x16288),
1220 	P(0x1628c), P(0x16290), P(0x16380), P(0x16384), P(0x16388),
1221 	P(0x1638c), P(0x16390), P(0x16394), P(0x16398), P(0x1639c),
1222 	P(0x163a0), P(0x163a4), P(0x163a8), P(0x163ac), P(0x163b0),
1223 	P(0x163b4), P(0x163b8), P(0x163bc), P(0x163c0), P(0x163c4),
1224 	P(0x163c8), P(0x163cc), P(0x163d0), P(0x163d4), P(0x16c40),
1225 	P(0x16c44)
1226 };
1227 
1228 static const uint32_t ar9485_1_1_cm_vals[] = {
1229 	0xba280400, 0x00aa10aa, 0x00a0c9c9, 0x00000022, 0x00000000,
1230 	0x00000002, 0x000004c2, 0x00000002, 0x00000000, 0x00000000,
1231 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1232 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1233 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1234 	0x00020085, 0x00000005, 0x00000000, 0x00000000, 0x00000008,
1235 	0x00000010, 0x00000000, 0x002ffc0f, 0x002ffc0f, 0x002ffc0f,
1236 	0x002ffc0f, 0x002ffc0f, 0x002ffc0f, 0x002ffc0f, 0x002ffc0f,
1237 	0x002ffc0f, 0x002ffc0f, 0x00000100, 0x00000000, 0x00000000,
1238 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1239 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1240 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
1241 	0x00000000, 0x00000000, 0x000fc78f, 0x0000000f, 0x00000000,
1242 	0x00000310, 0x00000020, 0x00000000, 0x0000000f, 0x00000000,
1243 	0x02ff0000, 0x0e070605, 0x0000000d, 0x00000000, 0x00000000,
1244 	0x00000000, 0x00000000, 0x2a800000, 0x06900168, 0x13881c22,
1245 	0x01f40000, 0x00252500, 0x00a00000, 0x00400000, 0x00000000,
1246 	0xffffffff, 0x0000ffff, 0x3f3f3f3f, 0x00000000, 0x00000000,
1247 	0x00000000, 0x00020000, 0x00000000, 0x00000052, 0x00000000,
1248 	0x00000000, 0x000007ff, 0x000000aa, 0x00003210, 0x00000000,
1249 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1250 	0x0000ffff, 0xffffffff, 0x00000000, 0x00000000, 0x18486200,
1251 	0x33332210, 0x00000000, 0x00020000, 0x00000000, 0x33332210,
1252 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1253 	0x00000000, 0x00100000, 0x0010f400, 0x00000800, 0x0001e800,
1254 	0x00000000, 0x00000000, 0x00000000, 0x40000000, 0x00080922,
1255 	0x9ca00010, 0xffffffff, 0x0000ffff, 0x00000000, 0x40000000,
1256 	0x003e4180, 0x00000004, 0x0000002c, 0x0000002c, 0x000000ff,
1257 	0x00000000, 0x00000000, 0x00000000, 0x00000140, 0x00000000,
1258 	0x0000010d, 0x00000000, 0x00000007, 0x00000302, 0x00000700,
1259 	0x00ff0000, 0x02400000, 0x000107ff, 0xa248105b, 0x008f0000,
1260 	0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
1261 	0x000000ff, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff,
1262 	0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
1263 	0x0000fa14, 0x000f0c00, 0x33332210, 0x33332210, 0x33332210,
1264 	0x33332210, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1265 	0x00000200, 0x000301ff, 0xafe68e30, 0xfd14e000, 0x9c0a8f6b,
1266 	0x04800000, 0x9280c00a, 0x00000000, 0x00020028, 0x5f3ca3de,
1267 	0x0108ecff, 0x14750600, 0x201fff00, 0x00001042, 0x00200400,
1268 	0x52440bbe, 0x004b6a8e, 0x00000820, 0x00000000, 0x00000000,
1269 	0x00000000, 0x00000000, 0x03200000, 0x00000000, 0x00000000,
1270 	0x00046384, 0x05b6b440, 0x00b6b440, 0xc080a333, 0x40206c10,
1271 	0x009c4060, 0x1883800a, 0x01834061, 0x00c00400, 0x00000000,
1272 	0x00000000, 0x0038233c, 0x9927b515, 0x12ef0200, 0x06336f77,
1273 	0x6af6532f, 0x0cc80c00, 0x0d261820, 0x00001004, 0x00ff03f1,
1274 	0x80be4788, 0x0001efb5, 0x40000014, 0x00000000, 0x00000000,
1275 	0x00000000, 0x00000000, 0x10002310, 0x00000000, 0x0c000000,
1276 	0x00000001, 0x00000001, 0x00000000, 0x18c43433, 0x00000000,
1277 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1278 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1279 	0x0000a000, 0x00000000, 0x00000000, 0x00000001, 0x00000444,
1280 	0x001f0e0f, 0x0075393f, 0xb79f6427, 0x000000ff, 0x3b3b3b3b,
1281 	0x2f2f2f2f, 0x20202020, 0x22222220, 0x20200020, 0x20202020,
1282 	0x20202020, 0x20202020, 0x20202020, 0x20202020, 0x20202020,
1283 	0x20202020, 0x20202020, 0x20202020, 0x00000000, 0x00000006,
1284 	0x0cdbd380, 0x000f0f01, 0x8fa91f01, 0x00000000, 0x0e79e5c6,
1285 	0x00820820, 0x1ce739cf, 0x2d0019ce, 0x1ce739ce, 0x000001ce,
1286 	0x1ce739ce, 0x000001ce, 0x1ce739ce, 0x1ce739ce, 0x00000000,
1287 	0x00001801, 0x00000000, 0x00000000, 0x00000000, 0x04000000,
1288 	0x00000001, 0x00010000, 0xbfad9d74, 0x0048060a, 0x00000637,
1289 	0x03020100, 0x09080504, 0x0d0c0b0a, 0x13121110, 0x31301514,
1290 	0x35343332, 0x00000036, 0x00000838, 0x00000000, 0xfffffffc,
1291 	0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000000,
1292 	0x36db6db6, 0x6db6db40, 0x73800000, 0x00000000, 0x7f80fff8,
1293 	0x000f0278, 0x4db6db8c, 0x6db60000, 0x00080000, 0x0e48048c,
1294 	0x14214514, 0x119f081e, 0x24926490, 0xd28b3330, 0xc2108ffe,
1295 	0x812fc370, 0x423c8000, 0x92480040, 0x006db6db, 0x0186db60,
1296 	0x6db6db6c, 0x6de6fbe0, 0xf7dfcf3c, 0x04cb0001, 0xfff80015,
1297 	0x00080010, 0x01884080, 0x00008040, 0x08400000, 0x1bf90f00,
1298 	0x00000000, 0x00000000, 0x01000015, 0x00d30000, 0x00318000,
1299 	0x50000000, 0x4b96210f, 0x00000000, 0x00000000, 0x00800700,
1300 	0x00800700, 0x00800700, 0x00000000, 0x00000000, 0x00000000,
1301 	0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
1302 	0x00000000, 0x00000000, 0x00000000, 0x000000a0, 0x000c0000,
1303 	0x14021402, 0x00001402, 0x00000000, 0x00000000, 0x13188278,
1304 	0x12000000
1305 };
1306 
1307 static const struct athn_ini ar9485_1_1_ini = {
1308 	nitems(ar9485_1_1_regs),
1309 	ar9485_1_1_regs,
1310 	NULL,	/* 2GHz only. */
1311 	NULL,	/* 2GHz only. */
1312 	ar9485_1_1_vals_2g40,
1313 	ar9485_1_1_vals_2g20,
1314 	nitems(ar9485_1_1_cm_regs),
1315 	ar9485_1_1_cm_regs,
1316 	ar9485_1_1_cm_vals
1317 };
1318 
1319 /*
1320  * AR9380 2.2 Tx gains.
1321  */
1322 static const uint16_t ar9380_2_2_tx_gain_regs[] = {
1323 	P(0x0a2dc), P(0x0a2e0), P(0x0a2e4), P(0x0a2e8), P(0x0a410),
1324 	P(0x0a500), P(0x0a504), P(0x0a508), P(0x0a50c), P(0x0a510),
1325 	P(0x0a514), P(0x0a518), P(0x0a51c), P(0x0a520), P(0x0a524),
1326 	P(0x0a528), P(0x0a52c), P(0x0a530), P(0x0a534), P(0x0a538),
1327 	P(0x0a53c), P(0x0a540), P(0x0a544), P(0x0a548), P(0x0a54c),
1328 	P(0x0a550), P(0x0a554), P(0x0a558), P(0x0a55c), P(0x0a560),
1329 	P(0x0a564), P(0x0a568), P(0x0a56c), P(0x0a570), P(0x0a574),
1330 	P(0x0a578), P(0x0a57c), P(0x0a580), P(0x0a584), P(0x0a588),
1331 	P(0x0a58c), P(0x0a590), P(0x0a594), P(0x0a598), P(0x0a59c),
1332 	P(0x0a5a0), P(0x0a5a4), P(0x0a5a8), P(0x0a5ac), P(0x0a5b0),
1333 	P(0x0a5b4), P(0x0a5b8), P(0x0a5bc), P(0x0a5c0), P(0x0a5c4),
1334 	P(0x0a5c8), P(0x0a5cc), P(0x0a5d0), P(0x0a5d4), P(0x0a5d8),
1335 	P(0x0a5dc), P(0x0a5e0), P(0x0a5e4), P(0x0a5e8), P(0x0a5ec),
1336 	P(0x0a5f0), P(0x0a5f4), P(0x0a5f8), P(0x0a5fc), P(0x0a600),
1337 	P(0x0a604), P(0x0a608), P(0x0a60c), P(0x0a610), P(0x0a614),
1338 	P(0x0a618), P(0x0a61c), P(0x0a620), P(0x0a624), P(0x0a628),
1339 	P(0x0a62c), P(0x0a630), P(0x0a634), P(0x0a638), P(0x0a63c),
1340 	P(0x0b2dc), P(0x0b2e0), P(0x0b2e4), P(0x0b2e8), P(0x0c2dc),
1341 	P(0x0c2e0), P(0x0c2e4), P(0x0c2e8), P(0x16044), P(0x16048),
1342 	P(0x16068), P(0x16444), P(0x16448), P(0x16468), P(0x16844),
1343 	P(0x16848), P(0x16868)
1344 };
1345 
1346 static const uint32_t ar9380_2_2_tx_gain_vals_5g[] = {
1347 	0x00033800, 0x0003c000, 0x03fc0000, 0x00000000, 0x000050d9,
1348 	0x00000000, 0x06000003, 0x0a000020, 0x10000023, 0x16000220,
1349 	0x1c000223, 0x21002220, 0x27002223, 0x2b022220, 0x2f022222,
1350 	0x34022225, 0x3a02222a, 0x3e02222c, 0x4202242a, 0x4702244a,
1351 	0x4b02244c, 0x4e02246c, 0x52022470, 0x55022490, 0x59022492,
1352 	0x5d022692, 0x61022892, 0x65024890, 0x69024892, 0x6e024c92,
1353 	0x74026e92, 0x74026e92, 0x74026e92, 0x74026e92, 0x74026e92,
1354 	0x74026e92, 0x74026e92, 0x00800000, 0x06800003, 0x0a800020,
1355 	0x10800023, 0x16800220, 0x1c800223, 0x21802220, 0x27802223,
1356 	0x2b822220, 0x2f822222, 0x34822225, 0x3a82222a, 0x3e82222c,
1357 	0x4282242a, 0x4782244a, 0x4b82244c, 0x4e82246c, 0x52822470,
1358 	0x55822490, 0x59822492, 0x5d822692, 0x61822892, 0x65824890,
1359 	0x69824892, 0x6e824c92, 0x74826e92, 0x74826e92, 0x74826e92,
1360 	0x74826e92, 0x74826e92, 0x74826e92, 0x74826e92, 0x00000000,
1361 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x02004000,
1362 	0x02004801, 0x02808a02, 0x0380ce03, 0x04411104, 0x04411104,
1363 	0x04411104, 0x04411104, 0x04411104, 0x04411104, 0x04411104,
1364 	0x00033800, 0x0003c000, 0x03fc0000, 0x00000000, 0x00033800,
1365 	0x0003c000, 0x03fc0000, 0x00000000, 0x012492d4, 0x62480001,
1366 	0x6db6db6c, 0x012492d4, 0x62480001, 0x6db6db6c, 0x012492d4,
1367 	0x62480001, 0x6db6db6c
1368 };
1369 
1370 static const uint32_t ar9380_2_2_tx_gain_vals_2g[] = {
1371 	0x00637800, 0x03838000, 0x03fc0000, 0x00000000, 0x000050d9,
1372 	0x00000000, 0x04000002, 0x08000004, 0x0b000200, 0x0f000202,
1373 	0x12000400, 0x16000402, 0x19000404, 0x1c000603, 0x21000a02,
1374 	0x25000a04, 0x28000a20, 0x2c000e20, 0x30000e22, 0x34000e24,
1375 	0x38001640, 0x3c001660, 0x3f001861, 0x43001a81, 0x47001a83,
1376 	0x4a001c84, 0x4e001ce3, 0x52001ce5, 0x56001ce9, 0x5a001ceb,
1377 	0x5d001eec, 0x5d001eec, 0x5d001eec, 0x5d001eec, 0x5d001eec,
1378 	0x5d001eec, 0x5d001eec, 0x00800000, 0x04800002, 0x08800004,
1379 	0x0b800200, 0x0f800202, 0x12800400, 0x16800402, 0x19800404,
1380 	0x1c800603, 0x21800a02, 0x25800a04, 0x28800a20, 0x2c800e20,
1381 	0x30800e22, 0x34800e24, 0x38801640, 0x3c801660, 0x3f801861,
1382 	0x43801a81, 0x47801a83, 0x4a801c84, 0x4e801ce3, 0x52801ce5,
1383 	0x56801ce9, 0x5a801ceb, 0x5d801eec, 0x5d801eec, 0x5d801eec,
1384 	0x5d801eec, 0x5d801eec, 0x5d801eec, 0x5d801eec, 0x00000000,
1385 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01404000,
1386 	0x01404501, 0x02008501, 0x0280ca03, 0x03010c04, 0x04014c04,
1387 	0x04015005, 0x04015005, 0x04015005, 0x04015005, 0x04015005,
1388 	0x00637800, 0x03838000, 0x03fc0000, 0x00000000, 0x00637800,
1389 	0x03838000, 0x03fc0000, 0x00000000, 0x012492d4, 0x62480001,
1390 	0x6db6db6c, 0x012492d4, 0x62480001, 0x6db6db6c, 0x012492d4,
1391 	0x62480001, 0x6db6db6c
1392 };
1393 
1394 static const struct athn_gain ar9380_2_2_tx_gain = {
1395 	nitems(ar9380_2_2_tx_gain_regs),
1396 	ar9380_2_2_tx_gain_regs,
1397 	ar9380_2_2_tx_gain_vals_5g,
1398 	ar9380_2_2_tx_gain_vals_2g
1399 };
1400 
1401 /*
1402  * AR9380 2.2 high ob/db Tx gains.
1403  */
1404 static const uint32_t ar9380_2_2_tx_gain_high_ob_db_vals_5g[] = {
1405 	0x01feee00, 0x0000f000, 0x01ff0000, 0x00000000, 0x000050d8,
1406 	0x00002220, 0x04002222, 0x09002421, 0x0d002621, 0x13004620,
1407 	0x19004a20, 0x1d004e20, 0x21005420, 0x26005e20, 0x2b005e40,
1408 	0x2f005e42, 0x33005e44, 0x38005e65, 0x3c005e69, 0x40005e6b,
1409 	0x44005e6d, 0x49005e72, 0x4e005eb2, 0x53005f12, 0x59025eb2,
1410 	0x5e025f12, 0x61027f12, 0x6702bf12, 0x6b02bf14, 0x6f02bf16,
1411 	0x6f02bf16, 0x6f02bf16, 0x6f02bf16, 0x6f02bf16, 0x6f02bf16,
1412 	0x6f02bf16, 0x6f02bf16, 0x00802220, 0x04802222, 0x09802421,
1413 	0x0d802621, 0x13804620, 0x19804a20, 0x1d804e20, 0x21805420,
1414 	0x26805e20, 0x2b805e40, 0x2f805e42, 0x33805e44, 0x38805e65,
1415 	0x3c805e69, 0x40805e6b, 0x44805e6d, 0x49805e72, 0x4e805eb2,
1416 	0x53805f12, 0x59825eb2, 0x5e825f12, 0x61827f12, 0x6782bf12,
1417 	0x6b82bf14, 0x6f82bf16, 0x6f82bf16, 0x6f82bf16, 0x6f82bf16,
1418 	0x6f82bf16, 0x6f82bf16, 0x6f82bf16, 0x6f82bf16, 0x00000000,
1419 	0x00000000, 0x00000000, 0x00000000, 0x00804000, 0x00804201,
1420 	0x0280c802, 0x0280ca03, 0x04c15104, 0x04c15305, 0x04c15305,
1421 	0x04c15305, 0x04c15305, 0x04c15305, 0x04c15305, 0x04c15305,
1422 	0x01feee00, 0x0000f000, 0x01ff0000, 0x00000000, 0x01feee00,
1423 	0x0000f000, 0x01ff0000, 0x00000000, 0x056db2e4, 0x8e480001,
1424 	0x6db6db6c, 0x056db2e4, 0x8e480001, 0x6db6db6c, 0x056db2e4,
1425 	0x8e480001, 0x6db6db6c
1426 };
1427 
1428 static const uint32_t ar9380_2_2_tx_gain_high_ob_db_vals_2g[] = {
1429 	0x00637800, 0x03838000, 0x03fc0000, 0x00000000, 0x000050d9,
1430 	0x00000000, 0x04000002, 0x08000004, 0x0b000200, 0x0f000202,
1431 	0x11000400, 0x15000402, 0x19000404, 0x1b000603, 0x1f000a02,
1432 	0x23000a04, 0x26000a20, 0x2a000e20, 0x2e000e22, 0x31000e24,
1433 	0x34001640, 0x38001660, 0x3b001861, 0x3e001a81, 0x42001a83,
1434 	0x44001c84, 0x48001ce3, 0x4c001ce5, 0x50001ce9, 0x54001ceb,
1435 	0x56001eec, 0x56001eec, 0x56001eec, 0x56001eec, 0x56001eec,
1436 	0x56001eec, 0x56001eec, 0x00800000, 0x04800002, 0x08800004,
1437 	0x0b800200, 0x0f800202, 0x11800400, 0x15800402, 0x19800404,
1438 	0x1b800603, 0x1f800a02, 0x23800a04, 0x26800a20, 0x2a800e20,
1439 	0x2e800e22, 0x31800e24, 0x34801640, 0x38801660, 0x3b801861,
1440 	0x3e801a81, 0x42801a83, 0x44801c84, 0x48801ce3, 0x4c801ce5,
1441 	0x50801ce9, 0x54801ceb, 0x56801eec, 0x56801eec, 0x56801eec,
1442 	0x56801eec, 0x56801eec, 0x56801eec, 0x56801eec, 0x00000000,
1443 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01404000,
1444 	0x01404501, 0x02008501, 0x0280ca03, 0x03010c04, 0x04014c04,
1445 	0x04015005, 0x04015005, 0x04015005, 0x04015005, 0x04015005,
1446 	0x00637800, 0x03838000, 0x03fc0000, 0x00000000, 0x00637800,
1447 	0x03838000, 0x03fc0000, 0x00000000, 0x056db2e4, 0x8e480001,
1448 	0x6db6db6c, 0x056db2e4, 0x8e480001, 0x6db6db6c, 0x056db2e4,
1449 	0x8e480001, 0x6db6db6c
1450 };
1451 
1452 static const struct athn_gain ar9380_2_2_tx_gain_high_ob_db = {
1453 	nitems(ar9380_2_2_tx_gain_regs),
1454 	ar9380_2_2_tx_gain_regs,
1455 	ar9380_2_2_tx_gain_high_ob_db_vals_5g,
1456 	ar9380_2_2_tx_gain_high_ob_db_vals_2g
1457 };
1458 
1459 /*
1460  * AR9380 2.2 low ob/db Tx gains.
1461  */
1462 static const uint32_t ar9380_2_2_tx_gain_low_ob_db_vals_5g[] = {
1463 	0x0380c7fc, 0x0000f800, 0x03ff0000, 0x00000000, 0x000050d9,
1464 	0x00000000, 0x06000003, 0x0a000020, 0x10000023, 0x16000220,
1465 	0x1c000223, 0x21002220, 0x27002223, 0x2b022220, 0x2f022222,
1466 	0x34022225, 0x3a02222a, 0x3e02222c, 0x4202242a, 0x4702244a,
1467 	0x4b02244c, 0x4e02246c, 0x5302266c, 0x5702286c, 0x5c02486b,
1468 	0x61024a6c, 0x66026a6c, 0x6b026e6c, 0x7002708c, 0x7302b08a,
1469 	0x7702b08c, 0x7702b08c, 0x7702b08c, 0x7702b08c, 0x7702b08c,
1470 	0x7702b08c, 0x7702b08c, 0x00800000, 0x06800003, 0x0a800020,
1471 	0x10800023, 0x16800220, 0x1c800223, 0x21802220, 0x27802223,
1472 	0x2b822220, 0x2f822222, 0x34822225, 0x3a82222a, 0x3e82222c,
1473 	0x4282242a, 0x4782244a, 0x4b82244c, 0x4e82246c, 0x5382266c,
1474 	0x5782286c, 0x5c82486b, 0x61824a6c, 0x66826a6c, 0x6b826e6c,
1475 	0x7082708c, 0x7382b08a, 0x7782b08c, 0x7782b08c, 0x7782b08c,
1476 	0x7782b08c, 0x7782b08c, 0x7782b08c, 0x7782b08c, 0x00000000,
1477 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01404000,
1478 	0x01404501, 0x02008802, 0x0300cc03, 0x0300cc03, 0x0300cc03,
1479 	0x03810c03, 0x03810e04, 0x03810e04, 0x03810e04, 0x03810e04,
1480 	0x0380c7fc, 0x0000f800, 0x03ff0000, 0x00000000, 0x0380c7fc,
1481 	0x0000f800, 0x03ff0000, 0x00000000, 0x012492d4, 0x66480001,
1482 	0x6db6db6c, 0x012492d4, 0x66480001, 0x6db6db6c, 0x012492d4,
1483 	0x66480001, 0x6db6db6c
1484 };
1485 
1486 static const uint32_t ar9380_2_2_tx_gain_low_ob_db_vals_2g[] = {
1487 	0x00637800, 0x03838000, 0x03fc0000, 0x00000000, 0x000050d9,
1488 	0x00000000, 0x04000002, 0x08000004, 0x0b000200, 0x0f000202,
1489 	0x12000400, 0x16000402, 0x19000404, 0x1c000603, 0x21000a02,
1490 	0x25000a04, 0x28000a20, 0x2c000e20, 0x30000e22, 0x34000e24,
1491 	0x38001640, 0x3c001660, 0x3f001861, 0x43001a81, 0x47001a83,
1492 	0x4a001c84, 0x4e001ce3, 0x52001ce5, 0x56001ce9, 0x5a001ceb,
1493 	0x5d001eec, 0x5d001eec, 0x5d001eec, 0x5d001eec, 0x5d001eec,
1494 	0x5d001eec, 0x5d001eec, 0x00800000, 0x04800002, 0x08800004,
1495 	0x0b800200, 0x0f800202, 0x12800400, 0x16800402, 0x19800404,
1496 	0x1c800603, 0x21800a02, 0x25800a04, 0x28800a20, 0x2c800e20,
1497 	0x30800e22, 0x34800e24, 0x38801640, 0x3c801660, 0x3f801861,
1498 	0x43801a81, 0x47801a83, 0x4a801c84, 0x4e801ce3, 0x52801ce5,
1499 	0x56801ce9, 0x5a801ceb, 0x5d801eec, 0x5d801eec, 0x5d801eec,
1500 	0x5d801eec, 0x5d801eec, 0x5d801eec, 0x5d801eec, 0x00000000,
1501 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01404000,
1502 	0x01404501, 0x02008501, 0x0280ca03, 0x03010c04, 0x04014c04,
1503 	0x04015005, 0x04015005, 0x04015005, 0x04015005, 0x04015005,
1504 	0x00637800, 0x03838000, 0x03fc0000, 0x00000000, 0x00637800,
1505 	0x03838000, 0x03fc0000, 0x00000000, 0x012492d4, 0x66480001,
1506 	0x6db6db6c, 0x012492d4, 0x66480001, 0x6db6db6c, 0x012492d4,
1507 	0x66480001, 0x6db6db6c
1508 };
1509 
1510 static const struct athn_gain ar9380_2_2_tx_gain_low_ob_db = {
1511 	nitems(ar9380_2_2_tx_gain_regs),
1512 	ar9380_2_2_tx_gain_regs,
1513 	ar9380_2_2_tx_gain_low_ob_db_vals_5g,
1514 	ar9380_2_2_tx_gain_low_ob_db_vals_2g
1515 };
1516 
1517 /*
1518  * AR9380 2.2 high power Tx gains.
1519  */
1520 static const uint32_t ar9380_2_2_tx_gain_high_power_vals_5g[] = {
1521 	0x0380c7fc, 0x0000f800, 0x03ff0000, 0x00000000, 0x000050d8,
1522 	0x00002220, 0x04002222, 0x09002421, 0x0d002621, 0x13004620,
1523 	0x19004a20, 0x1d004e20, 0x21005420, 0x26005e20, 0x2b005e40,
1524 	0x2f005e42, 0x33005e44, 0x38005e65, 0x3c005e69, 0x40005e6b,
1525 	0x44005e6d, 0x49005e72, 0x4e005eb2, 0x53005f12, 0x59025eb2,
1526 	0x5e025f12, 0x61027f12, 0x6702bf12, 0x6b02bf14, 0x6f02bf16,
1527 	0x6f02bf16, 0x6f02bf16, 0x6f02bf16, 0x6f02bf16, 0x6f02bf16,
1528 	0x6f02bf16, 0x6f02bf16, 0x00802220, 0x04802222, 0x09802421,
1529 	0x0d802621, 0x13804620, 0x19804a20, 0x1d804e20, 0x21805420,
1530 	0x26805e20, 0x2b805e40, 0x2f805e42, 0x33805e44, 0x38805e65,
1531 	0x3c805e69, 0x40805e6b, 0x44805e6d, 0x49805e72, 0x4e805eb2,
1532 	0x53805f12, 0x59825eb2, 0x5e825f12, 0x61827f12, 0x6782bf12,
1533 	0x6b82bf14, 0x6f82bf16, 0x6f82bf16, 0x6f82bf16, 0x6f82bf16,
1534 	0x6f82bf16, 0x6f82bf16, 0x6f82bf16, 0x6f82bf16, 0x00000000,
1535 	0x00000000, 0x00000000, 0x00000000, 0x00804000, 0x00804201,
1536 	0x0280c802, 0x0280ca03, 0x04c15104, 0x04c15305, 0x04c15305,
1537 	0x04c15305, 0x04c15305, 0x04c15305, 0x04c15305, 0x04c15305,
1538 	0x0380c7fc, 0x0000f800, 0x03ff0000, 0x00000000, 0x0380c7fc,
1539 	0x0000f800, 0x03ff0000, 0x00000000, 0x056db2e6, 0xae480001,
1540 	0x6eb6db6c, 0x056db2e6, 0xae480001, 0x6eb6db6c, 0x056db2e6,
1541 	0xae480001, 0x6eb6db6c
1542 };
1543 
1544 static const uint32_t ar9380_2_2_tx_gain_high_power_vals_2g[] = {
1545 	0x00637800, 0x03838000, 0x03fc0000, 0x00000000, 0x000050d9,
1546 	0x00000000, 0x04000002, 0x08000004, 0x0b000200, 0x0f000202,
1547 	0x11000400, 0x15000402, 0x19000404, 0x1b000603, 0x1f000a02,
1548 	0x23000a04, 0x26000a20, 0x2a000e20, 0x2e000e22, 0x31000e24,
1549 	0x34001640, 0x38001660, 0x3b001861, 0x3e001a81, 0x42001a83,
1550 	0x44001c84, 0x48001ce3, 0x4c001ce5, 0x50001ce9, 0x54001ceb,
1551 	0x56001eec, 0x56001eec, 0x56001eec, 0x56001eec, 0x56001eec,
1552 	0x56001eec, 0x56001eec, 0x00800000, 0x04800002, 0x08800004,
1553 	0x0b800200, 0x0f800202, 0x11800400, 0x15800402, 0x19800404,
1554 	0x1b800603, 0x1f800a02, 0x23800a04, 0x26800a20, 0x2a800e20,
1555 	0x2e800e22, 0x31800e24, 0x34801640, 0x38801660, 0x3b801861,
1556 	0x3e801a81, 0x42801a83, 0x44801c84, 0x48801ce3, 0x4c801ce5,
1557 	0x50801ce9, 0x54801ceb, 0x56801eec, 0x56801eec, 0x56801eec,
1558 	0x56801eec, 0x56801eec, 0x56801eec, 0x56801eec, 0x00000000,
1559 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x01404000,
1560 	0x01404501, 0x02008501, 0x0280ca03, 0x03010c04, 0x04014c04,
1561 	0x04015005, 0x04015005, 0x04015005, 0x04015005, 0x04015005,
1562 	0x00637800, 0x03838000, 0x03fc0000, 0x00000000, 0x00637800,
1563 	0x03838000, 0x03fc0000, 0x00000000, 0x056db2e6, 0xae480001,
1564 	0x6eb6db6c, 0x056db2e6, 0xae480001, 0x6eb6db6c, 0x056db2e6,
1565 	0xae480001, 0x6eb6db6c
1566 };
1567 
1568 static const struct athn_gain ar9380_2_2_tx_gain_high_power = {
1569 	nitems(ar9380_2_2_tx_gain_regs),
1570 	ar9380_2_2_tx_gain_regs,
1571 	ar9380_2_2_tx_gain_high_power_vals_5g,
1572 	ar9380_2_2_tx_gain_high_power_vals_2g
1573 };
1574 
1575 /*
1576  * AR9485 1.1 Tx gains.
1577  */
1578 static const uint16_t ar9485_1_1_tx_gain_regs[] = {
1579 	P(0x098bc), P(0x0a410), P(0x0a458), P(0x0a500), P(0x0a504),
1580 	P(0x0a508), P(0x0a50c), P(0x0a510), P(0x0a514), P(0x0a518),
1581 	P(0x0a51c), P(0x0a520), P(0x0a524), P(0x0a528), P(0x0a52c),
1582 	P(0x0a530), P(0x0a534), P(0x0a538), P(0x0a53c), P(0x0a540),
1583 	P(0x0a544), P(0x0a548), P(0x0a54c), P(0x0a550), P(0x0a554),
1584 	P(0x0a558), P(0x0a55c), P(0x0a560), P(0x0a564), P(0x0a568),
1585 	P(0x0a56c), P(0x0a570), P(0x0a574), P(0x0a578), P(0x0a57c),
1586 	P(0x0b500), P(0x0b504), P(0x0b508), P(0x0b50c), P(0x0b510),
1587 	P(0x0b514), P(0x0b518), P(0x0b51c), P(0x0b520), P(0x0b524),
1588 	P(0x0b528), P(0x0b52c), P(0x0b530), P(0x0b534), P(0x0b538),
1589 	P(0x0b53c), P(0x0b540), P(0x0b544), P(0x0b548), P(0x0b54c),
1590 	P(0x0b550), P(0x0b554), P(0x0b558), P(0x0b55c), P(0x0b560),
1591 	P(0x0b564), P(0x0b568), P(0x0b56c), P(0x0b570), P(0x0b574),
1592 	P(0x0b578), P(0x0b57c), P(0x16044), P(0x16048),
1593 };
1594 
1595 static const uint32_t ar9485_1_1_tx_gain_vals_2g[] = {
1596 	0x00000002, 0x000050d8, 0x00000000, 0x00000000, 0x04000002,
1597 	0x08000004, 0x0d000200, 0x11000202, 0x15000400, 0x19000402,
1598 	0x1d000404, 0x21000603, 0x25000605, 0x2a000a03, 0x2c000a04,
1599 	0x34000e20, 0x35000e21, 0x43000e62, 0x45000e63, 0x49000e65,
1600 	0x4b000e66, 0x4d001645, 0x51001865, 0x55001a86, 0x57001ce9,
1601 	0x5a001ceb, 0x5e001eeb, 0x5e001eeb, 0x5e001eeb, 0x5e001eeb,
1602 	0x5e001eeb, 0x5e001eeb, 0x5e001eeb, 0x5e001eeb, 0x5e001eeb,
1603 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1604 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1605 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1606 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1607 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1608 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1609 	0x00000000, 0x00000000, 0x05d6b2db, 0x6c924260
1610 };
1611 
1612 static const struct athn_gain ar9485_1_1_tx_gain = {
1613 	nitems(ar9485_1_1_tx_gain_regs),
1614 	ar9485_1_1_tx_gain_regs,
1615 	NULL,	/* 2GHz only. */
1616 	ar9485_1_1_tx_gain_vals_2g
1617 };
1618 
1619 /*
1620  * AR9380 2.2 Rx gains.
1621  */
1622 static const uint16_t ar9380_2_2_rx_gain_regs[] = {
1623 	P(0x0a000), P(0x0a004), P(0x0a008), P(0x0a00c), P(0x0a010),
1624 	P(0x0a014), P(0x0a018), P(0x0a01c), P(0x0a020), P(0x0a024),
1625 	P(0x0a028), P(0x0a02c), P(0x0a030), P(0x0a034), P(0x0a038),
1626 	P(0x0a03c), P(0x0a040), P(0x0a044), P(0x0a048), P(0x0a04c),
1627 	P(0x0a050), P(0x0a054), P(0x0a058), P(0x0a05c), P(0x0a060),
1628 	P(0x0a064), P(0x0a068), P(0x0a06c), P(0x0a070), P(0x0a074),
1629 	P(0x0a078), P(0x0a07c), P(0x0a080), P(0x0a084), P(0x0a088),
1630 	P(0x0a08c), P(0x0a090), P(0x0a094), P(0x0a098), P(0x0a09c),
1631 	P(0x0a0a0), P(0x0a0a4), P(0x0a0a8), P(0x0a0ac), P(0x0a0b0),
1632 	P(0x0a0b4), P(0x0a0b8), P(0x0a0bc), P(0x0a0c0), P(0x0a0c4),
1633 	P(0x0a0c8), P(0x0a0cc), P(0x0a0d0), P(0x0a0d4), P(0x0a0d8),
1634 	P(0x0a0dc), P(0x0a0e0), P(0x0a0e4), P(0x0a0e8), P(0x0a0ec),
1635 	P(0x0a0f0), P(0x0a0f4), P(0x0a0f8), P(0x0a0fc), P(0x0a100),
1636 	P(0x0a104), P(0x0a108), P(0x0a10c), P(0x0a110), P(0x0a114),
1637 	P(0x0a118), P(0x0a11c), P(0x0a120), P(0x0a124), P(0x0a128),
1638 	P(0x0a12c), P(0x0a130), P(0x0a134), P(0x0a138), P(0x0a13c),
1639 	P(0x0a140), P(0x0a144), P(0x0a148), P(0x0a14c), P(0x0a150),
1640 	P(0x0a154), P(0x0a158), P(0x0a15c), P(0x0a160), P(0x0a164),
1641 	P(0x0a168), P(0x0a16c), P(0x0a170), P(0x0a174), P(0x0a178),
1642 	P(0x0a17c), P(0x0a180), P(0x0a184), P(0x0a188), P(0x0a18c),
1643 	P(0x0a190), P(0x0a194), P(0x0a198), P(0x0a19c), P(0x0a1a0),
1644 	P(0x0a1a4), P(0x0a1a8), P(0x0a1ac), P(0x0a1b0), P(0x0a1b4),
1645 	P(0x0a1b8), P(0x0a1bc), P(0x0a1c0), P(0x0a1c4), P(0x0a1c8),
1646 	P(0x0a1cc), P(0x0a1d0), P(0x0a1d4), P(0x0a1d8), P(0x0a1dc),
1647 	P(0x0a1e0), P(0x0a1e4), P(0x0a1e8), P(0x0a1ec), P(0x0a1f0),
1648 	P(0x0a1f4), P(0x0a1f8), P(0x0a1fc), P(0x0b000), P(0x0b004),
1649 	P(0x0b008), P(0x0b00c), P(0x0b010), P(0x0b014), P(0x0b018),
1650 	P(0x0b01c), P(0x0b020), P(0x0b024), P(0x0b028), P(0x0b02c),
1651 	P(0x0b030), P(0x0b034), P(0x0b038), P(0x0b03c), P(0x0b040),
1652 	P(0x0b044), P(0x0b048), P(0x0b04c), P(0x0b050), P(0x0b054),
1653 	P(0x0b058), P(0x0b05c), P(0x0b060), P(0x0b064), P(0x0b068),
1654 	P(0x0b06c), P(0x0b070), P(0x0b074), P(0x0b078), P(0x0b07c),
1655 	P(0x0b080), P(0x0b084), P(0x0b088), P(0x0b08c), P(0x0b090),
1656 	P(0x0b094), P(0x0b098), P(0x0b09c), P(0x0b0a0), P(0x0b0a4),
1657 	P(0x0b0a8), P(0x0b0ac), P(0x0b0b0), P(0x0b0b4), P(0x0b0b8),
1658 	P(0x0b0bc), P(0x0b0c0), P(0x0b0c4), P(0x0b0c8), P(0x0b0cc),
1659 	P(0x0b0d0), P(0x0b0d4), P(0x0b0d8), P(0x0b0dc), P(0x0b0e0),
1660 	P(0x0b0e4), P(0x0b0e8), P(0x0b0ec), P(0x0b0f0), P(0x0b0f4),
1661 	P(0x0b0f8), P(0x0b0fc), P(0x0b100), P(0x0b104), P(0x0b108),
1662 	P(0x0b10c), P(0x0b110), P(0x0b114), P(0x0b118), P(0x0b11c),
1663 	P(0x0b120), P(0x0b124), P(0x0b128), P(0x0b12c), P(0x0b130),
1664 	P(0x0b134), P(0x0b138), P(0x0b13c), P(0x0b140), P(0x0b144),
1665 	P(0x0b148), P(0x0b14c), P(0x0b150), P(0x0b154), P(0x0b158),
1666 	P(0x0b15c), P(0x0b160), P(0x0b164), P(0x0b168), P(0x0b16c),
1667 	P(0x0b170), P(0x0b174), P(0x0b178), P(0x0b17c), P(0x0b180),
1668 	P(0x0b184), P(0x0b188), P(0x0b18c), P(0x0b190), P(0x0b194),
1669 	P(0x0b198), P(0x0b19c), P(0x0b1a0), P(0x0b1a4), P(0x0b1a8),
1670 	P(0x0b1ac), P(0x0b1b0), P(0x0b1b4), P(0x0b1b8), P(0x0b1bc),
1671 	P(0x0b1c0), P(0x0b1c4), P(0x0b1c8), P(0x0b1cc), P(0x0b1d0),
1672 	P(0x0b1d4), P(0x0b1d8), P(0x0b1dc), P(0x0b1e0), P(0x0b1e4),
1673 	P(0x0b1e8), P(0x0b1ec), P(0x0b1f0), P(0x0b1f4), P(0x0b1f8),
1674 	P(0x0b1fc)
1675 };
1676 
1677 static const uint32_t ar9380_2_2_rx_gain_vals[] = {
1678 	0x00010000, 0x00030002, 0x00050004, 0x00810080, 0x00830082,
1679 	0x01810180, 0x01830182, 0x01850184, 0x01890188, 0x018b018a,
1680 	0x018d018c, 0x01910190, 0x01930192, 0x01950194, 0x038a0196,
1681 	0x038c038b, 0x0390038d, 0x03920391, 0x03940393, 0x03960395,
1682 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1683 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1684 	0x00000000, 0x00000000, 0x22222229, 0x1d1d1d1d, 0x1d1d1d1d,
1685 	0x1d1d1d1d, 0x171d1d1d, 0x11111717, 0x00030311, 0x00000000,
1686 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1687 	0x00000000, 0x00000000, 0x00000000, 0x001f0000, 0x01000101,
1688 	0x011e011f, 0x011c011d, 0x02030204, 0x02010202, 0x021f0200,
1689 	0x0302021e, 0x03000301, 0x031e031f, 0x0402031d, 0x04000401,
1690 	0x041e041f, 0x0502041d, 0x05000501, 0x051e051f, 0x06010602,
1691 	0x061f0600, 0x061d061e, 0x07020703, 0x07000701, 0x00000000,
1692 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1693 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1694 	0x001f0000, 0x01000101, 0x011e011f, 0x011c011d, 0x02030204,
1695 	0x02010202, 0x021f0200, 0x0302021e, 0x03000301, 0x031e031f,
1696 	0x0402031d, 0x04000401, 0x041e041f, 0x0502041d, 0x05000501,
1697 	0x051e051f, 0x06010602, 0x061f0600, 0x061d061e, 0x07020703,
1698 	0x07000701, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1699 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1700 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1701 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1702 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000396,
1703 	0x00000396, 0x00000396, 0x00000196, 0x00010000, 0x00030002,
1704 	0x00050004, 0x00810080, 0x00830082, 0x01810180, 0x01830182,
1705 	0x01850184, 0x02810280, 0x02830282, 0x02850284, 0x02890288,
1706 	0x028b028a, 0x0388028c, 0x038a0389, 0x038c038b, 0x0390038d,
1707 	0x03920391, 0x03940393, 0x03960395, 0x00000000, 0x00000000,
1708 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1709 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1710 	0x2a2d2f32, 0x21232328, 0x19191c1e, 0x12141417, 0x07070e0e,
1711 	0x03030305, 0x00000003, 0x00000000, 0x00000000, 0x00000000,
1712 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1713 	0x00000000, 0x003f0020, 0x00400041, 0x0140005f, 0x0160015f,
1714 	0x017e017f, 0x02410242, 0x025f0240, 0x027f0260, 0x0341027e,
1715 	0x035f0340, 0x037f0360, 0x04400441, 0x0460045f, 0x0541047f,
1716 	0x055f0540, 0x057f0560, 0x06400641, 0x0660065f, 0x067e067f,
1717 	0x07410742, 0x075f0740, 0x077f0760, 0x07800781, 0x07a0079f,
1718 	0x07c107bf, 0x000007c0, 0x00000000, 0x00000000, 0x00000000,
1719 	0x00000000, 0x00000000, 0x00000000, 0x003f0020, 0x00400041,
1720 	0x0140005f, 0x0160015f, 0x017e017f, 0x02410242, 0x025f0240,
1721 	0x027f0260, 0x0341027e, 0x035f0340, 0x037f0360, 0x04400441,
1722 	0x0460045f, 0x0541047f, 0x055f0540, 0x057f0560, 0x06400641,
1723 	0x0660065f, 0x067e067f, 0x07410742, 0x075f0740, 0x077f0760,
1724 	0x07800781, 0x07a0079f, 0x07c107bf, 0x000007c0, 0x00000000,
1725 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1726 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1727 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1728 	0x00000000, 0x00000000, 0x00000396, 0x00000396, 0x00000396,
1729 	0x00000196
1730 };
1731 
1732 static const struct athn_gain ar9380_2_2_rx_gain = {
1733 	nitems(ar9380_2_2_rx_gain_regs),
1734 	ar9380_2_2_rx_gain_regs,
1735 	ar9380_2_2_rx_gain_vals,
1736 	ar9380_2_2_rx_gain_vals
1737 };
1738 
1739 /*
1740  * AR9380 2.2 without external low-noise amplifier Rx gains.
1741  */
1742 static const uint32_t ar9380_2_2_rx_gain_wo_xlna_vals[] = {
1743 	0x00010000, 0x00030002, 0x00050004, 0x00810080, 0x00830082,
1744 	0x01810180, 0x01830182, 0x01850184, 0x01890188, 0x018b018a,
1745 	0x018d018c, 0x03820190, 0x03840383, 0x03880385, 0x038a0389,
1746 	0x038c038b, 0x0390038d, 0x03920391, 0x03940393, 0x03960395,
1747 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1748 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1749 	0x00000000, 0x00000000, 0x29292929, 0x29292929, 0x29292929,
1750 	0x29292929, 0x22292929, 0x1d1d2222, 0x0c111117, 0x00030303,
1751 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1752 	0x00000000, 0x00000000, 0x00000000, 0x001f0000, 0x01000101,
1753 	0x011e011f, 0x011c011d, 0x02030204, 0x02010202, 0x021f0200,
1754 	0x0302021e, 0x03000301, 0x031e031f, 0x0402031d, 0x04000401,
1755 	0x041e041f, 0x0502041d, 0x05000501, 0x051e051f, 0x06010602,
1756 	0x061f0600, 0x061d061e, 0x07020703, 0x07000701, 0x00000000,
1757 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1758 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1759 	0x001f0000, 0x01000101, 0x011e011f, 0x011c011d, 0x02030204,
1760 	0x02010202, 0x021f0200, 0x0302021e, 0x03000301, 0x031e031f,
1761 	0x0402031d, 0x04000401, 0x041e041f, 0x0502041d, 0x05000501,
1762 	0x051e051f, 0x06010602, 0x061f0600, 0x061d061e, 0x07020703,
1763 	0x07000701, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1764 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1765 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1766 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1767 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000396,
1768 	0x00000396, 0x00000396, 0x00000196, 0x00010000, 0x00030002,
1769 	0x00050004, 0x00810080, 0x00830082, 0x01810180, 0x01830182,
1770 	0x01850184, 0x02810280, 0x02830282, 0x02850284, 0x02890288,
1771 	0x028b028a, 0x0388028c, 0x038a0389, 0x038c038b, 0x0390038d,
1772 	0x03920391, 0x03940393, 0x03960395, 0x00000000, 0x00000000,
1773 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1774 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1775 	0x32323232, 0x2f2f3232, 0x23282a2d, 0x1c1e2123, 0x14171919,
1776 	0x0e0e1214, 0x03050707, 0x00030303, 0x00000000, 0x00000000,
1777 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1778 	0x00000000, 0x003f0020, 0x00400041, 0x0140005f, 0x0160015f,
1779 	0x017e017f, 0x02410242, 0x025f0240, 0x027f0260, 0x0341027e,
1780 	0x035f0340, 0x037f0360, 0x04400441, 0x0460045f, 0x0541047f,
1781 	0x055f0540, 0x057f0560, 0x06400641, 0x0660065f, 0x067e067f,
1782 	0x07410742, 0x075f0740, 0x077f0760, 0x07800781, 0x07a0079f,
1783 	0x07c107bf, 0x000007c0, 0x00000000, 0x00000000, 0x00000000,
1784 	0x00000000, 0x00000000, 0x00000000, 0x003f0020, 0x00400041,
1785 	0x0140005f, 0x0160015f, 0x017e017f, 0x02410242, 0x025f0240,
1786 	0x027f0260, 0x0341027e, 0x035f0340, 0x037f0360, 0x04400441,
1787 	0x0460045f, 0x0541047f, 0x055f0540, 0x057f0560, 0x06400641,
1788 	0x0660065f, 0x067e067f, 0x07410742, 0x075f0740, 0x077f0760,
1789 	0x07800781, 0x07a0079f, 0x07c107bf, 0x000007c0, 0x00000000,
1790 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1791 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1792 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1793 	0x00000000, 0x00000000, 0x00000396, 0x00000396, 0x00000396,
1794 	0x00000196
1795 };
1796 
1797 static const struct athn_gain ar9380_2_2_rx_gain_wo_xlna = {
1798 	nitems(ar9380_2_2_rx_gain_regs),
1799 	ar9380_2_2_rx_gain_regs,
1800 	ar9380_2_2_rx_gain_wo_xlna_vals,
1801 	ar9380_2_2_rx_gain_wo_xlna_vals
1802 };
1803 
1804 /*
1805  * AR9485 1.1 Rx gains.
1806  */
1807 static const uint16_t ar9485_1_1_rx_gain_regs[] = {
1808 	P(0x0a000), P(0x0a004), P(0x0a008), P(0x0a00c), P(0x0a010),
1809 	P(0x0a014), P(0x0a018), P(0x0a01c), P(0x0a020), P(0x0a024),
1810 	P(0x0a028), P(0x0a02c), P(0x0a030), P(0x0a034), P(0x0a038),
1811 	P(0x0a03c), P(0x0a040), P(0x0a044), P(0x0a048), P(0x0a04c),
1812 	P(0x0a050), P(0x0a054), P(0x0a058), P(0x0a05c), P(0x0a060),
1813 	P(0x0a064), P(0x0a068), P(0x0a06c), P(0x0a070), P(0x0a074),
1814 	P(0x0a078), P(0x0a07c), P(0x0a080), P(0x0a084), P(0x0a088),
1815 	P(0x0a08c), P(0x0a090), P(0x0a094), P(0x0a098), P(0x0a09c),
1816 	P(0x0a0a0), P(0x0a0a4), P(0x0a0a8), P(0x0a0ac), P(0x0a0b0),
1817 	P(0x0a0b4), P(0x0a0b8), P(0x0a0bc), P(0x0a0c0), P(0x0a0c4),
1818 	P(0x0a0c8), P(0x0a0cc), P(0x0a0d0), P(0x0a0d4), P(0x0a0d8),
1819 	P(0x0a0dc), P(0x0a0e0), P(0x0a0e4), P(0x0a0e8), P(0x0a0ec),
1820 	P(0x0a0f0), P(0x0a0f4), P(0x0a0f8), P(0x0a0fc), P(0x0a100),
1821 	P(0x0a104), P(0x0a108), P(0x0a10c), P(0x0a110), P(0x0a114),
1822 	P(0x0a118), P(0x0a11c), P(0x0a120), P(0x0a124), P(0x0a128),
1823 	P(0x0a12c), P(0x0a130), P(0x0a134), P(0x0a138), P(0x0a13c),
1824 	P(0x0a140), P(0x0a144), P(0x0a148), P(0x0a14c), P(0x0a150),
1825 	P(0x0a154), P(0x0a158), P(0x0a15c), P(0x0a160), P(0x0a164),
1826 	P(0x0a168), P(0x0a16c), P(0x0a170), P(0x0a174), P(0x0a178),
1827 	P(0x0a17c), P(0x0a180), P(0x0a184), P(0x0a188), P(0x0a18c),
1828 	P(0x0a190), P(0x0a194), P(0x0a198), P(0x0a19c), P(0x0a1a0),
1829 	P(0x0a1a4), P(0x0a1a8), P(0x0a1ac), P(0x0a1b0), P(0x0a1b4),
1830 	P(0x0a1b8), P(0x0a1bc), P(0x0a1c0), P(0x0a1c4), P(0x0a1c8),
1831 	P(0x0a1cc), P(0x0a1d0), P(0x0a1d4), P(0x0a1d8), P(0x0a1dc),
1832 	P(0x0a1e0), P(0x0a1e4), P(0x0a1e8), P(0x0a1ec), P(0x0a1f0),
1833 	P(0x0a1f4), P(0x0a1f8), P(0x0a1fc)
1834 };
1835 
1836 static const uint32_t ar9485_1_1_rx_gain_vals[] = {
1837 	0x00060005, 0x00810080, 0x00830082, 0x00850084, 0x01820181,
1838 	0x01840183, 0x01880185, 0x018a0189, 0x02850284, 0x02890288,
1839 	0x028b028a, 0x03850384, 0x03890388, 0x038b038a, 0x038d038c,
1840 	0x03910390, 0x03930392, 0x03950394, 0x00000396, 0x00000000,
1841 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1842 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1843 	0x00000000, 0x00000000, 0x28282828, 0x28282828, 0x28282828,
1844 	0x28282828, 0x28282828, 0x24242428, 0x171e1e1e, 0x02020b0b,
1845 	0x02020202, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1846 	0x00000000, 0x00000000, 0x00000000, 0x22072208, 0x22052206,
1847 	0x22032204, 0x22012202, 0x221f2200, 0x221d221e, 0x33023303,
1848 	0x33003301, 0x331e331f, 0x4402331d, 0x44004401, 0x441e441f,
1849 	0x55025503, 0x55005501, 0x551e551f, 0x6602551d, 0x66006601,
1850 	0x661e661f, 0x7703661d, 0x77017702, 0x00007700, 0x00000000,
1851 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1852 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1853 	0x001f0000, 0x111f1100, 0x111d111e, 0x111b111c, 0x22032204,
1854 	0x22012202, 0x221f2200, 0x221d221e, 0x33013302, 0x331f3300,
1855 	0x4402331e, 0x44004401, 0x441e441f, 0x55015502, 0x551f5500,
1856 	0x6602551e, 0x66006601, 0x661e661f, 0x7703661d, 0x77017702,
1857 	0x00007700, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1858 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1859 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1860 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
1861 	0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000396,
1862 	0x00000396, 0x00000396, 0x00000296
1863 };
1864 
1865 static const struct athn_gain ar9485_1_1_rx_gain = {
1866 	nitems(ar9485_1_1_rx_gain_regs),
1867 	ar9485_1_1_rx_gain_regs,
1868 	NULL,	/* 2GHz only. */
1869 	ar9485_1_1_rx_gain_vals
1870 };
1871 
1872 /*
1873  * Serializer/Deserializer programming.
1874  */
1875 
1876 static const uint32_t ar9380_2_2_serdes_regs[] = {
1877 	AR_PCIE_SERDES,
1878 	AR_PCIE_SERDES,
1879 	AR_PCIE_SERDES2
1880 };
1881 
1882 static const uint32_t ar9380_2_2_serdes_vals[] = {
1883 	0x08212e5e,
1884 	0x0008003b,
1885 	0x00000000
1886 };
1887 
1888 static const struct athn_serdes ar9380_2_2_serdes = {
1889 	nitems(ar9380_2_2_serdes_vals),
1890 	ar9380_2_2_serdes_regs,
1891 	ar9380_2_2_serdes_vals
1892 };
1893 
1894 static const uint32_t ar9485_1_1_serdes_regs[] = {
1895 	0x00018c00,
1896 	0x00018c04,
1897 	0x00018c08
1898 };
1899 
1900 static const uint32_t ar9485_1_1_serdes_vals[] = {
1901 	0x18013e5e,
1902 	0x000801d8,
1903 	0x0000080c
1904 };
1905 
1906 static const struct athn_serdes ar9485_1_1_serdes = {
1907 	nitems(ar9485_1_1_serdes_vals),
1908 	ar9485_1_1_serdes_regs,
1909 	ar9485_1_1_serdes_vals
1910 };
1911