aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-07-08 09:11:08 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-07-15 15:51:39 -0400
commit162bee1a3e5714abd9a429d85c64830bacaca682 (patch)
treeec5fa8f9a154ff3f54723b7cf1896d99d5025636 /drivers/net/wireless/b43
parent40c68f20e63c9cd589ebfcf672ef912452967caf (diff)
b43: N-PHY: init and channel switching of radio 0x2057 rev 9
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r--drivers/net/wireless/b43/phy_n.c47
-rw-r--r--drivers/net/wireless/b43/radio_2057.c188
2 files changed, 234 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 44349f5b99c6..479cda88ca5e 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -746,10 +746,55 @@ static void b43_radio_2057_setup(struct b43_wldev *dev,
746 b43_radio_write(dev, R2057_RFPLL_LOOPFILTER_C2, 0x8); 746 b43_radio_write(dev, R2057_RFPLL_LOOPFILTER_C2, 0x8);
747 } 747 }
748 break; 748 break;
749 case 9: /* e.g. PHY rev 16 */
750 b43_radio_write(dev, R2057_LOGEN_PTAT_RESETS, 0x20);
751 b43_radio_write(dev, R2057_VCOBUF_IDACS, 0x18);
752 if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) {
753 b43_radio_write(dev, R2057_LOGEN_PTAT_RESETS, 0x38);
754 b43_radio_write(dev, R2057_VCOBUF_IDACS, 0x0f);
755
756 if (b43_is_40mhz(dev)) {
757 /* TODO */
758 } else {
759 b43_radio_write(dev,
760 R2057_PAD_BIAS_FILTER_BWS_CORE0,
761 0x3c);
762 b43_radio_write(dev,
763 R2057_PAD_BIAS_FILTER_BWS_CORE1,
764 0x3c);
765 }
766 }
767 break;
749 /* TODO */ 768 /* TODO */
750 } 769 }
751 770
752 /* TODO */ 771 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
772 u16 txmix2g_tune_boost_pu = 0;
773 u16 pad2g_tune_pus = 0;
774
775 if (b43_nphy_ipa(dev)) {
776 switch (phy->radio_rev) {
777 case 9:
778 txmix2g_tune_boost_pu = 0x0041;
779 /* TODO */
780 break;
781 }
782 /* TODO */
783 }
784
785 if (txmix2g_tune_boost_pu)
786 b43_radio_write(dev, R2057_TXMIX2G_TUNE_BOOST_PU_CORE0,
787 txmix2g_tune_boost_pu);
788 if (pad2g_tune_pus)
789 b43_radio_write(dev, R2057_PAD2G_TUNE_PUS_CORE0,
790 pad2g_tune_pus);
791 if (txmix2g_tune_boost_pu)
792 b43_radio_write(dev, R2057_TXMIX2G_TUNE_BOOST_PU_CORE1,
793 txmix2g_tune_boost_pu);
794 if (pad2g_tune_pus)
795 b43_radio_write(dev, R2057_PAD2G_TUNE_PUS_CORE1,
796 pad2g_tune_pus);
797 }
753 798
754 usleep_range(50, 100); 799 usleep_range(50, 100);
755 800
diff --git a/drivers/net/wireless/b43/radio_2057.c b/drivers/net/wireless/b43/radio_2057.c
index df3574545819..941cf3db5a64 100644
--- a/drivers/net/wireless/b43/radio_2057.c
+++ b/drivers/net/wireless/b43/radio_2057.c
@@ -105,6 +105,18 @@ static u16 r2057_rev8_init[][2] = {
105}; 105};
106*/ 106*/
107 107
108/* Extracted from MMIO dump of 6.30.223.141 */
109static u16 r2057_rev9_init[][2] = {
110 { 0x27, 0x1f }, { 0x28, 0x0a }, { 0x29, 0x2f }, { 0x42, 0x1f },
111 { 0x48, 0x3f }, { 0x5c, 0x41 }, { 0x63, 0x14 }, { 0x64, 0x12 },
112 { 0x66, 0xff }, { 0x74, 0xa3 }, { 0x7b, 0x14 }, { 0x7c, 0x14 },
113 { 0x7d, 0xee }, { 0x86, 0xc0 }, { 0xc4, 0x10 }, { 0xc9, 0x01 },
114 { 0xe1, 0x41 }, { 0xe8, 0x14 }, { 0xe9, 0x12 }, { 0xeb, 0xff },
115 { 0xf5, 0x0a }, { 0xf8, 0x09 }, { 0xf9, 0xa3 }, { 0x100, 0x14 },
116 { 0x101, 0x10 }, { 0x102, 0xee }, { 0x10b, 0xc0 }, { 0x149, 0x10 },
117 { 0x14e, 0x01 }, { 0x1b7, 0x05 }, { 0x1c2, 0xa0 },
118};
119
108#define RADIOREGS7(r00, r01, r02, r03, r04, r05, r06, r07, r08, r09, \ 120#define RADIOREGS7(r00, r01, r02, r03, r04, r05, r06, r07, r08, r09, \
109 r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, \ 121 r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, \
110 r20, r21, r22, r23, r24, r25, r26, r27) \ 122 r20, r21, r22, r23, r24, r25, r26, r27) \
@@ -145,6 +157,170 @@ static u16 r2057_rev8_init[][2] = {
145 .phy_regs.phy_bw5 = r4, \ 157 .phy_regs.phy_bw5 = r4, \
146 .phy_regs.phy_bw6 = r5 158 .phy_regs.phy_bw6 = r5
147 159
160/* Extracted from MMIO dump of 6.30.223.141 */
161static const struct b43_nphy_chantabent_rev7 b43_nphy_chantab_phy_rev16_radio_rev9[] = {
162 {
163 .freq = 2412,
164 RADIOREGS7(0x48, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x6c,
165 0x09, 0x0f, 0x0a, 0x00, 0x0a, 0x00, 0x41, 0x63,
166 0x00, 0x00, 0x00, 0xf0, 0x00, 0x41, 0x63, 0x00,
167 0x00, 0x00, 0xf0, 0x00),
168 PHYREGS(0x03c9, 0x03c5, 0x03c1, 0x043a, 0x043f, 0x0443),
169 },
170 {
171 .freq = 2417,
172 RADIOREGS7(0x4b, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x71,
173 0x09, 0x0f, 0x0a, 0x00, 0x0a, 0x00, 0x41, 0x63,
174 0x00, 0x00, 0x00, 0xf0, 0x00, 0x41, 0x63, 0x00,
175 0x00, 0x00, 0xf0, 0x00),
176 PHYREGS(0x03cb, 0x03c7, 0x03c3, 0x0438, 0x043d, 0x0441),
177 },
178 {
179 .freq = 2422,
180 RADIOREGS7(0x4e, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x76,
181 0x09, 0x0f, 0x09, 0x00, 0x09, 0x00, 0x41, 0x63,
182 0x00, 0x00, 0x00, 0xf0, 0x00, 0x41, 0x63, 0x00,
183 0x00, 0x00, 0xf0, 0x00),
184 PHYREGS(0x03cd, 0x03c9, 0x03c5, 0x0436, 0x043a, 0x043f),
185 },
186 {
187 .freq = 2427,
188 RADIOREGS7(0x52, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x7b,
189 0x09, 0x0f, 0x09, 0x00, 0x09, 0x00, 0x41, 0x63,
190 0x00, 0x00, 0x00, 0xf0, 0x00, 0x41, 0x63, 0x00,
191 0x00, 0x00, 0xf0, 0x00),
192 PHYREGS(0x03cf, 0x03cb, 0x03c7, 0x0434, 0x0438, 0x043d),
193 },
194 {
195 .freq = 2432,
196 RADIOREGS7(0x55, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x80,
197 0x09, 0x0f, 0x08, 0x00, 0x08, 0x00, 0x41, 0x63,
198 0x00, 0x00, 0x00, 0xf0, 0x00, 0x41, 0x63, 0x00,
199 0x00, 0x00, 0xf0, 0x00),
200 PHYREGS(0x03d1, 0x03cd, 0x03c9, 0x0431, 0x0436, 0x043a),
201 },
202 {
203 .freq = 2437,
204 RADIOREGS7(0x58, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x85,
205 0x09, 0x0f, 0x08, 0x00, 0x08, 0x00, 0x41, 0x63,
206 0x00, 0x00, 0x00, 0xf0, 0x00, 0x41, 0x63, 0x00,
207 0x00, 0x00, 0xf0, 0x00),
208 PHYREGS(0x03d3, 0x03cf, 0x03cb, 0x042f, 0x0434, 0x0438),
209 },
210 {
211 .freq = 2442,
212 RADIOREGS7(0x5c, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x8a,
213 0x09, 0x0f, 0x07, 0x00, 0x07, 0x00, 0x41, 0x63,
214 0x00, 0x00, 0x00, 0xf0, 0x00, 0x41, 0x63, 0x00,
215 0x00, 0x00, 0xf0, 0x00),
216 PHYREGS(0x03d5, 0x03d1, 0x03cd, 0x042d, 0x0431, 0x0436),
217 },
218 {
219 .freq = 2447,
220 RADIOREGS7(0x5f, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x8f,
221 0x09, 0x0f, 0x07, 0x00, 0x07, 0x00, 0x41, 0x63,
222 0x00, 0x00, 0x00, 0xf0, 0x00, 0x41, 0x63, 0x00,
223 0x00, 0x00, 0xf0, 0x00),
224 PHYREGS(0x03d7, 0x03d3, 0x03cf, 0x042b, 0x042f, 0x0434),
225 },
226 {
227 .freq = 2452,
228 RADIOREGS7(0x62, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x94,
229 0x09, 0x0f, 0x07, 0x00, 0x07, 0x00, 0x41, 0x63,
230 0x00, 0x00, 0x00, 0xf0, 0x00, 0x41, 0x63, 0x00,
231 0x00, 0x00, 0xf0, 0x00),
232 PHYREGS(0x03d9, 0x03d5, 0x03d1, 0x0429, 0x042d, 0x0431),
233 },
234 {
235 .freq = 2457,
236 RADIOREGS7(0x66, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x99,
237 0x09, 0x0f, 0x06, 0x00, 0x06, 0x00, 0x41, 0x63,
238 0x00, 0x00, 0x00, 0xf0, 0x00, 0x41, 0x63, 0x00,
239 0x00, 0x00, 0xf0, 0x00),
240 PHYREGS(0x03db, 0x03d7, 0x03d3, 0x0427, 0x042b, 0x042f),
241 },
242 {
243 .freq = 2462,
244 RADIOREGS7(0x69, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x9e,
245 0x09, 0x0f, 0x06, 0x00, 0x06, 0x00, 0x41, 0x63,
246 0x00, 0x00, 0x00, 0xf0, 0x00, 0x41, 0x63, 0x00,
247 0x00, 0x00, 0xf0, 0x00),
248 PHYREGS(0x03dd, 0x03d9, 0x03d5, 0x0424, 0x0429, 0x042d),
249 },
250 {
251 .freq = 5180,
252 RADIOREGS7(0xbe, 0x16, 0x10, 0x1f, 0x08, 0x08, 0x3f, 0x06,
253 0x02, 0x0e, 0x00, 0x0e, 0x00, 0x9e, 0x00, 0x00,
254 0x9f, 0x2f, 0xa3, 0x00, 0xfc, 0x00, 0x00, 0x4f,
255 0x3a, 0x83, 0x00, 0xfc),
256 PHYREGS(0x081c, 0x0818, 0x0814, 0x01f9, 0x01fa, 0x01fb),
257 },
258 {
259 .freq = 5200,
260 RADIOREGS7(0xc5, 0x16, 0x10, 0x1f, 0x08, 0x08, 0x3f, 0x08,
261 0x02, 0x0e, 0x00, 0x0e, 0x00, 0x9e, 0x00, 0x00,
262 0x7f, 0x2f, 0x83, 0x00, 0xf8, 0x00, 0x00, 0x4c,
263 0x4a, 0x83, 0x00, 0xf8),
264 PHYREGS(0x0824, 0x0820, 0x081c, 0x01f7, 0x01f8, 0x01f9),
265 },
266 {
267 .freq = 5220,
268 RADIOREGS7(0xcc, 0x16, 0x10, 0x1f, 0x08, 0x08, 0x3f, 0x0a,
269 0x02, 0x0e, 0x00, 0x0e, 0x00, 0x9e, 0x00, 0x00,
270 0x6d, 0x3d, 0x83, 0x00, 0xf8, 0x00, 0x00, 0x2d,
271 0x2a, 0x73, 0x00, 0xf8),
272 PHYREGS(0x082c, 0x0828, 0x0824, 0x01f5, 0x01f6, 0x01f7),
273 },
274 {
275 .freq = 5240,
276 RADIOREGS7(0xd2, 0x16, 0x10, 0x1f, 0x08, 0x08, 0x3f, 0x0c,
277 0x02, 0x0d, 0x00, 0x0d, 0x00, 0x8d, 0x00, 0x00,
278 0x4d, 0x1c, 0x73, 0x00, 0xf8, 0x00, 0x00, 0x4d,
279 0x2b, 0x73, 0x00, 0xf8),
280 PHYREGS(0x0834, 0x0830, 0x082c, 0x01f3, 0x01f4, 0x01f5),
281 },
282 {
283 .freq = 5745,
284 RADIOREGS7(0x7b, 0x17, 0x20, 0x1f, 0x08, 0x08, 0x3f, 0x7d,
285 0x04, 0x08, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00,
286 0x08, 0x03, 0x03, 0x00, 0x30, 0x00, 0x00, 0x06,
287 0x02, 0x03, 0x00, 0x30),
288 PHYREGS(0x08fe, 0x08fa, 0x08f6, 0x01c8, 0x01c8, 0x01c9),
289 },
290 {
291 .freq = 5765,
292 RADIOREGS7(0x81, 0x17, 0x20, 0x1f, 0x08, 0x08, 0x3f, 0x81,
293 0x04, 0x08, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00,
294 0x06, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05,
295 0x02, 0x03, 0x00, 0x00),
296 PHYREGS(0x0906, 0x0902, 0x08fe, 0x01c6, 0x01c7, 0x01c8),
297 },
298 {
299 .freq = 5785,
300 RADIOREGS7(0x88, 0x17, 0x20, 0x1f, 0x08, 0x08, 0x3f, 0x85,
301 0x04, 0x08, 0x00, 0x06, 0x00, 0x15, 0x00, 0x00,
302 0x08, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x05,
303 0x21, 0x03, 0x00, 0x00),
304 PHYREGS(0x090e, 0x090a, 0x0906, 0x01c4, 0x01c5, 0x01c6),
305 },
306 {
307 .freq = 5805,
308 RADIOREGS7(0x8f, 0x17, 0x20, 0x1f, 0x08, 0x08, 0x3f, 0x89,
309 0x04, 0x07, 0x00, 0x06, 0x00, 0x04, 0x00, 0x00,
310 0x06, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x03,
311 0x00, 0x03, 0x00, 0x00),
312 PHYREGS(0x0916, 0x0912, 0x090e, 0x01c3, 0x01c4, 0x01c4),
313 },
314 {
315 .freq = 5825,
316 RADIOREGS7(0x95, 0x17, 0x20, 0x1f, 0x08, 0x08, 0x3f, 0x8d,
317 0x04, 0x07, 0x00, 0x05, 0x00, 0x03, 0x00, 0x00,
318 0x05, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x03,
319 0x00, 0x03, 0x00, 0x00),
320 PHYREGS(0x091e, 0x091a, 0x0916, 0x01c1, 0x01c2, 0x01c3),
321 },
322};
323
148void r2057_upload_inittabs(struct b43_wldev *dev) 324void r2057_upload_inittabs(struct b43_wldev *dev)
149{ 325{
150 struct b43_phy *phy = &dev->phy; 326 struct b43_phy *phy = &dev->phy;
@@ -171,6 +347,12 @@ void r2057_upload_inittabs(struct b43_wldev *dev)
171 size = ARRAY_SIZE(r2057_rev5a_init); 347 size = ARRAY_SIZE(r2057_rev5a_init);
172 } 348 }
173 break; 349 break;
350 case 16:
351 if (phy->radio_rev == 9) {
352 table = r2057_rev9_init[0];
353 size = ARRAY_SIZE(r2057_rev9_init);
354 }
355 break;
174 } 356 }
175 357
176 B43_WARN_ON(!table); 358 B43_WARN_ON(!table);
@@ -195,6 +377,12 @@ void r2057_get_chantabent_rev7(struct b43_wldev *dev, u16 freq,
195 377
196 /* TODO */ 378 /* TODO */
197 switch (phy->rev) { 379 switch (phy->rev) {
380 case 16:
381 if (phy->radio_rev == 9) {
382 e_r7 = b43_nphy_chantab_phy_rev16_radio_rev9;
383 len = ARRAY_SIZE(b43_nphy_chantab_phy_rev16_radio_rev9);
384 }
385 break;
198 default: 386 default:
199 break; 387 break;
200 } 388 }