Commit d66be829 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville

b43: N-PHY: check for bustype before touching BCMA CC PLLs

Reported-by: default avatarJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent aa1f2f0a
...@@ -4048,60 +4048,71 @@ int b43_phy_initn(struct b43_wldev *dev) ...@@ -4048,60 +4048,71 @@ int b43_phy_initn(struct b43_wldev *dev)
/* http://bcm-v4.sipsolutions.net/802.11/PmuSpurAvoid */ /* http://bcm-v4.sipsolutions.net/802.11/PmuSpurAvoid */
static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid) static void b43_nphy_pmu_spur_avoid(struct b43_wldev *dev, bool avoid)
{ {
#ifdef CONFIG_B43_BCMA struct bcma_drv_cc *cc;
struct bcma_drv_cc *cc = &dev->dev->bdev->bus->drv_cc;
u32 pmu_ctl; u32 pmu_ctl;
if (dev->dev->chip_id == 43224 || dev->dev->chip_id == 43225) {
if (avoid) { switch (dev->dev->bus_type) {
bcma_chipco_pll_write(cc, 0x0, 0x11500010); #ifdef CONFIG_B43_BCMA
bcma_chipco_pll_write(cc, 0x1, 0x000C0C06); case B43_BUS_BCMA:
bcma_chipco_pll_write(cc, 0x2, 0x0F600a08); cc = &dev->dev->bdev->bus->drv_cc;
bcma_chipco_pll_write(cc, 0x3, 0x00000000); if (dev->dev->chip_id == 43224 || dev->dev->chip_id == 43225) {
bcma_chipco_pll_write(cc, 0x4, 0x2001E920); if (avoid) {
bcma_chipco_pll_write(cc, 0x5, 0x88888815); bcma_chipco_pll_write(cc, 0x0, 0x11500010);
} else { bcma_chipco_pll_write(cc, 0x1, 0x000C0C06);
bcma_chipco_pll_write(cc, 0x0, 0x11100010); bcma_chipco_pll_write(cc, 0x2, 0x0F600a08);
bcma_chipco_pll_write(cc, 0x1, 0x000c0c06); bcma_chipco_pll_write(cc, 0x3, 0x00000000);
bcma_chipco_pll_write(cc, 0x2, 0x03000a08); bcma_chipco_pll_write(cc, 0x4, 0x2001E920);
bcma_chipco_pll_write(cc, 0x3, 0x00000000); bcma_chipco_pll_write(cc, 0x5, 0x88888815);
bcma_chipco_pll_write(cc, 0x4, 0x200005c0); } else {
bcma_chipco_pll_write(cc, 0x5, 0x88888815); bcma_chipco_pll_write(cc, 0x0, 0x11100010);
} bcma_chipco_pll_write(cc, 0x1, 0x000c0c06);
pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD; bcma_chipco_pll_write(cc, 0x2, 0x03000a08);
} else if (dev->dev->chip_id == 0x4716) { bcma_chipco_pll_write(cc, 0x3, 0x00000000);
if (avoid) { bcma_chipco_pll_write(cc, 0x4, 0x200005c0);
bcma_chipco_pll_write(cc, 0x0, 0x11500060); bcma_chipco_pll_write(cc, 0x5, 0x88888815);
bcma_chipco_pll_write(cc, 0x1, 0x080C0C06); }
bcma_chipco_pll_write(cc, 0x2, 0x0F600000); pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD;
bcma_chipco_pll_write(cc, 0x3, 0x00000000); } else if (dev->dev->chip_id == 0x4716) {
bcma_chipco_pll_write(cc, 0x4, 0x2001E924); if (avoid) {
bcma_chipco_pll_write(cc, 0x5, 0x88888815); bcma_chipco_pll_write(cc, 0x0, 0x11500060);
bcma_chipco_pll_write(cc, 0x1, 0x080C0C06);
bcma_chipco_pll_write(cc, 0x2, 0x0F600000);
bcma_chipco_pll_write(cc, 0x3, 0x00000000);
bcma_chipco_pll_write(cc, 0x4, 0x2001E924);
bcma_chipco_pll_write(cc, 0x5, 0x88888815);
} else {
bcma_chipco_pll_write(cc, 0x0, 0x11100060);
bcma_chipco_pll_write(cc, 0x1, 0x080c0c06);
bcma_chipco_pll_write(cc, 0x2, 0x03000000);
bcma_chipco_pll_write(cc, 0x3, 0x00000000);
bcma_chipco_pll_write(cc, 0x4, 0x200005c0);
bcma_chipco_pll_write(cc, 0x5, 0x88888815);
}
pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD |
BCMA_CC_PMU_CTL_NOILPONW;
} else if (dev->dev->chip_id == 0x4322 ||
dev->dev->chip_id == 0x4340 ||
dev->dev->chip_id == 0x4341) {
bcma_chipco_pll_write(cc, 0x0, 0x11100070);
bcma_chipco_pll_write(cc, 0x1, 0x1014140a);
bcma_chipco_pll_write(cc, 0x5, 0x88888854);
if (avoid)
bcma_chipco_pll_write(cc, 0x2, 0x05201828);
else
bcma_chipco_pll_write(cc, 0x2, 0x05001828);
pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD;
} else { } else {
bcma_chipco_pll_write(cc, 0x0, 0x11100060); return;
bcma_chipco_pll_write(cc, 0x1, 0x080c0c06);
bcma_chipco_pll_write(cc, 0x2, 0x03000000);
bcma_chipco_pll_write(cc, 0x3, 0x00000000);
bcma_chipco_pll_write(cc, 0x4, 0x200005c0);
bcma_chipco_pll_write(cc, 0x5, 0x88888815);
} }
pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD | BCMA_CC_PMU_CTL_NOILPONW; bcma_cc_set32(cc, BCMA_CC_PMU_CTL, pmu_ctl);
} else if (dev->dev->chip_id == 0x4322 || dev->dev->chip_id == 0x4340 || break;
dev->dev->chip_id == 0x4341) {
bcma_chipco_pll_write(cc, 0x0, 0x11100070);
bcma_chipco_pll_write(cc, 0x1, 0x1014140a);
bcma_chipco_pll_write(cc, 0x5, 0x88888854);
if (avoid)
bcma_chipco_pll_write(cc, 0x2, 0x05201828);
else
bcma_chipco_pll_write(cc, 0x2, 0x05001828);
pmu_ctl = BCMA_CC_PMU_CTL_PLL_UPD;
} else {
return;
}
bcma_cc_set32(cc, BCMA_CC_PMU_CTL, pmu_ctl);
#else
return;
#endif #endif
#ifdef CONFIG_B43_SSB
case B43_BUS_SSB:
/* FIXME */
break;
#endif
}
} }
/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ChanspecSetup */ /* http://bcm-v4.sipsolutions.net/802.11/PHY/N/ChanspecSetup */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment