aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGábor Stefanik <netrolller.3d@gmail.com>2009-08-09 14:15:09 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:13:55 -0400
commit3281d95d0535909e28ff16c38a678102e10f0312 (patch)
tree34478e2fa7c688d1b633a5ce8e326c3b17ddd6d5 /drivers
parent3ecee182d68621d1f9a813f15153883ca221dd0b (diff)
b43: LP-PHY: Implement STX synchronization
The v2+ radio init (B2063) is now complete, modulo BCM4325 support. Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/phy_lp.c57
1 files changed, 55 insertions, 2 deletions
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index ed3a52886135..e68644d95024 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -346,9 +346,60 @@ static void lpphy_2063_init(struct b43_wldev *dev)
346 b43_radio_write(dev, B2063_PA_SP2, 0x18); 346 b43_radio_write(dev, B2063_PA_SP2, 0x18);
347} 347}
348 348
349struct lpphy_stx_table_entry {
350 u16 phy_offset;
351 u16 phy_shift;
352 u16 rf_addr;
353 u16 rf_shift;
354 u16 mask;
355};
356
357static const struct lpphy_stx_table_entry lpphy_stx_table[] = {
358 { .phy_offset = 2, .phy_shift = 6, .rf_addr = 0x3d, .rf_shift = 3, .mask = 0x01, },
359 { .phy_offset = 1, .phy_shift = 12, .rf_addr = 0x4c, .rf_shift = 1, .mask = 0x01, },
360 { .phy_offset = 1, .phy_shift = 8, .rf_addr = 0x50, .rf_shift = 0, .mask = 0x7f, },
361 { .phy_offset = 0, .phy_shift = 8, .rf_addr = 0x44, .rf_shift = 0, .mask = 0xff, },
362 { .phy_offset = 1, .phy_shift = 0, .rf_addr = 0x4a, .rf_shift = 0, .mask = 0xff, },
363 { .phy_offset = 0, .phy_shift = 4, .rf_addr = 0x4d, .rf_shift = 0, .mask = 0xff, },
364 { .phy_offset = 1, .phy_shift = 4, .rf_addr = 0x4e, .rf_shift = 0, .mask = 0xff, },
365 { .phy_offset = 0, .phy_shift = 12, .rf_addr = 0x4f, .rf_shift = 0, .mask = 0x0f, },
366 { .phy_offset = 1, .phy_shift = 0, .rf_addr = 0x4f, .rf_shift = 4, .mask = 0x0f, },
367 { .phy_offset = 3, .phy_shift = 0, .rf_addr = 0x49, .rf_shift = 0, .mask = 0x0f, },
368 { .phy_offset = 4, .phy_shift = 3, .rf_addr = 0x46, .rf_shift = 4, .mask = 0x07, },
369 { .phy_offset = 3, .phy_shift = 15, .rf_addr = 0x46, .rf_shift = 0, .mask = 0x01, },
370 { .phy_offset = 4, .phy_shift = 0, .rf_addr = 0x46, .rf_shift = 1, .mask = 0x07, },
371 { .phy_offset = 3, .phy_shift = 8, .rf_addr = 0x48, .rf_shift = 4, .mask = 0x07, },
372 { .phy_offset = 3, .phy_shift = 11, .rf_addr = 0x48, .rf_shift = 0, .mask = 0x0f, },
373 { .phy_offset = 3, .phy_shift = 4, .rf_addr = 0x49, .rf_shift = 4, .mask = 0x0f, },
374 { .phy_offset = 2, .phy_shift = 15, .rf_addr = 0x45, .rf_shift = 0, .mask = 0x01, },
375 { .phy_offset = 5, .phy_shift = 13, .rf_addr = 0x52, .rf_shift = 4, .mask = 0x07, },
376 { .phy_offset = 6, .phy_shift = 0, .rf_addr = 0x52, .rf_shift = 7, .mask = 0x01, },
377 { .phy_offset = 5, .phy_shift = 3, .rf_addr = 0x41, .rf_shift = 5, .mask = 0x07, },
378 { .phy_offset = 5, .phy_shift = 6, .rf_addr = 0x41, .rf_shift = 0, .mask = 0x0f, },
379 { .phy_offset = 5, .phy_shift = 10, .rf_addr = 0x42, .rf_shift = 5, .mask = 0x07, },
380 { .phy_offset = 4, .phy_shift = 15, .rf_addr = 0x42, .rf_shift = 0, .mask = 0x01, },
381 { .phy_offset = 5, .phy_shift = 0, .rf_addr = 0x42, .rf_shift = 1, .mask = 0x07, },
382 { .phy_offset = 4, .phy_shift = 11, .rf_addr = 0x43, .rf_shift = 4, .mask = 0x0f, },
383 { .phy_offset = 4, .phy_shift = 7, .rf_addr = 0x43, .rf_shift = 0, .mask = 0x0f, },
384 { .phy_offset = 4, .phy_shift = 6, .rf_addr = 0x45, .rf_shift = 1, .mask = 0x01, },
385 { .phy_offset = 2, .phy_shift = 7, .rf_addr = 0x40, .rf_shift = 4, .mask = 0x0f, },
386 { .phy_offset = 2, .phy_shift = 11, .rf_addr = 0x40, .rf_shift = 0, .mask = 0x0f, },
387};
388
349static void lpphy_sync_stx(struct b43_wldev *dev) 389static void lpphy_sync_stx(struct b43_wldev *dev)
350{ 390{
351 //TODO 391 const struct lpphy_stx_table_entry *e;
392 unsigned int i;
393 u16 tmp;
394
395 for (i = 0; i < ARRAY_SIZE(lpphy_stx_table); i++) {
396 e = &lpphy_stx_table[i];
397 tmp = b43_radio_read(dev, e->rf_addr);
398 tmp >>= e->rf_shift;
399 tmp <<= e->phy_shift;
400 b43_phy_maskset(dev, B43_PHY_OFDM(0xF2 + e->phy_offset),
401 e->mask << e->phy_shift, tmp);
402 }
352} 403}
353 404
354static void lpphy_radio_init(struct b43_wldev *dev) 405static void lpphy_radio_init(struct b43_wldev *dev)
@@ -366,7 +417,9 @@ static void lpphy_radio_init(struct b43_wldev *dev)
366 lpphy_sync_stx(dev); 417 lpphy_sync_stx(dev);
367 b43_phy_write(dev, B43_PHY_OFDM(0xF0), 0x5F80); 418 b43_phy_write(dev, B43_PHY_OFDM(0xF0), 0x5F80);
368 b43_phy_write(dev, B43_PHY_OFDM(0xF1), 0); 419 b43_phy_write(dev, B43_PHY_OFDM(0xF1), 0);
369 //TODO Do something on the backplane 420 if (dev->dev->bus->chip_id == 0x4325) {
421 // TODO SSB PMU recalibration
422 }
370 } 423 }
371} 424}
372 425