diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-12-10 20:55:34 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-13 15:33:56 -0500 |
commit | 38646ebae710da024bdf6e9dcac733bfdb6dd3e1 (patch) | |
tree | 806c75b4b8de1d4d14236242b12676db1acf5652 /drivers/net/wireless/b43 | |
parent | c7d6431035089565eec9f5138943498fa60f875c (diff) |
b43: N-PHY: finish 2.4GHz 0x2056 radio setup
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.c | 90 | ||||
-rw-r--r-- | drivers/net/wireless/b43/radio_2056.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/b43/radio_2056.h | 1 |
3 files changed, 105 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 4bd94dfef1eb..114c413db482 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -228,10 +228,98 @@ static void b43_chantab_radio_2056_upload(struct b43_wldev *dev, | |||
228 | static void b43_radio_2056_setup(struct b43_wldev *dev, | 228 | static void b43_radio_2056_setup(struct b43_wldev *dev, |
229 | const struct b43_nphy_channeltab_entry_rev3 *e) | 229 | const struct b43_nphy_channeltab_entry_rev3 *e) |
230 | { | 230 | { |
231 | struct ssb_sprom *sprom = dev->dev->bus_sprom; | ||
232 | enum ieee80211_band band = b43_current_band(dev->wl); | ||
233 | u16 offset; | ||
234 | u8 i; | ||
235 | u16 bias, cbias, pag_boost, pgag_boost, mixg_boost, padg_boost; | ||
236 | |||
231 | B43_WARN_ON(dev->phy.rev < 3); | 237 | B43_WARN_ON(dev->phy.rev < 3); |
232 | 238 | ||
233 | b43_chantab_radio_2056_upload(dev, e); | 239 | b43_chantab_radio_2056_upload(dev, e); |
234 | /* TODO */ | 240 | b2056_upload_syn_pll_cp2(dev, band == IEEE80211_BAND_5GHZ); |
241 | |||
242 | if (sprom->boardflags2_lo & B43_BFL2_GPLL_WAR && | ||
243 | b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) { | ||
244 | b43_radio_write(dev, B2056_SYN_PLL_LOOPFILTER1, 0x1F); | ||
245 | b43_radio_write(dev, B2056_SYN_PLL_LOOPFILTER2, 0x1F); | ||
246 | if (dev->dev->chip_id == 0x4716) { | ||
247 | b43_radio_write(dev, B2056_SYN_PLL_LOOPFILTER4, 0x14); | ||
248 | b43_radio_write(dev, B2056_SYN_PLL_CP2, 0); | ||
249 | } else { | ||
250 | b43_radio_write(dev, B2056_SYN_PLL_LOOPFILTER4, 0x0B); | ||
251 | b43_radio_write(dev, B2056_SYN_PLL_CP2, 0x14); | ||
252 | } | ||
253 | } | ||
254 | if (sprom->boardflags2_lo & B43_BFL2_APLL_WAR && | ||
255 | b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) { | ||
256 | b43_radio_write(dev, B2056_SYN_PLL_LOOPFILTER1, 0x1F); | ||
257 | b43_radio_write(dev, B2056_SYN_PLL_LOOPFILTER2, 0x1F); | ||
258 | b43_radio_write(dev, B2056_SYN_PLL_LOOPFILTER4, 0x05); | ||
259 | b43_radio_write(dev, B2056_SYN_PLL_CP2, 0x0C); | ||
260 | } | ||
261 | |||
262 | if (dev->phy.n->ipa2g_on && band == IEEE80211_BAND_2GHZ) { | ||
263 | for (i = 0; i < 2; i++) { | ||
264 | offset = i ? B2056_TX1 : B2056_TX0; | ||
265 | if (dev->phy.rev >= 5) { | ||
266 | b43_radio_write(dev, | ||
267 | offset | B2056_TX_PADG_IDAC, 0xcc); | ||
268 | |||
269 | if (dev->dev->chip_id == 0x4716) { | ||
270 | bias = 0x40; | ||
271 | cbias = 0x45; | ||
272 | pag_boost = 0x5; | ||
273 | pgag_boost = 0x33; | ||
274 | mixg_boost = 0x55; | ||
275 | } else { | ||
276 | bias = 0x25; | ||
277 | cbias = 0x20; | ||
278 | pag_boost = 0x4; | ||
279 | pgag_boost = 0x03; | ||
280 | mixg_boost = 0x65; | ||
281 | } | ||
282 | padg_boost = 0x77; | ||
283 | |||
284 | b43_radio_write(dev, | ||
285 | offset | B2056_TX_INTPAG_IMAIN_STAT, | ||
286 | bias); | ||
287 | b43_radio_write(dev, | ||
288 | offset | B2056_TX_INTPAG_IAUX_STAT, | ||
289 | bias); | ||
290 | b43_radio_write(dev, | ||
291 | offset | B2056_TX_INTPAG_CASCBIAS, | ||
292 | cbias); | ||
293 | b43_radio_write(dev, | ||
294 | offset | B2056_TX_INTPAG_BOOST_TUNE, | ||
295 | pag_boost); | ||
296 | b43_radio_write(dev, | ||
297 | offset | B2056_TX_PGAG_BOOST_TUNE, | ||
298 | pgag_boost); | ||
299 | b43_radio_write(dev, | ||
300 | offset | B2056_TX_PADG_BOOST_TUNE, | ||
301 | padg_boost); | ||
302 | b43_radio_write(dev, | ||
303 | offset | B2056_TX_MIXG_BOOST_TUNE, | ||
304 | mixg_boost); | ||
305 | } else { | ||
306 | bias = dev->phy.is_40mhz ? 0x40 : 0x20; | ||
307 | b43_radio_write(dev, | ||
308 | offset | B2056_TX_INTPAG_IMAIN_STAT, | ||
309 | bias); | ||
310 | b43_radio_write(dev, | ||
311 | offset | B2056_TX_INTPAG_IAUX_STAT, | ||
312 | bias); | ||
313 | b43_radio_write(dev, | ||
314 | offset | B2056_TX_INTPAG_CASCBIAS, | ||
315 | 0x30); | ||
316 | } | ||
317 | b43_radio_write(dev, offset | B2056_TX_PA_SPARE1, 0xee); | ||
318 | } | ||
319 | } else if (dev->phy.n->ipa5g_on && band == IEEE80211_BAND_5GHZ) { | ||
320 | /* TODO */ | ||
321 | } | ||
322 | |||
235 | udelay(50); | 323 | udelay(50); |
236 | /* VCO calibration */ | 324 | /* VCO calibration */ |
237 | b43_radio_write(dev, B2056_SYN_PLL_VCOCAL12, 0x00); | 325 | b43_radio_write(dev, B2056_SYN_PLL_VCOCAL12, 0x00); |
diff --git a/drivers/net/wireless/b43/radio_2056.c b/drivers/net/wireless/b43/radio_2056.c index 4a42994f4933..ce037fb6789a 100644 --- a/drivers/net/wireless/b43/radio_2056.c +++ b/drivers/net/wireless/b43/radio_2056.c | |||
@@ -9055,6 +9055,21 @@ void b2056_upload_inittabs(struct b43_wldev *dev, | |||
9055 | B2056_RX1, pts->rx, pts->rx_length); | 9055 | B2056_RX1, pts->rx, pts->rx_length); |
9056 | } | 9056 | } |
9057 | 9057 | ||
9058 | void b2056_upload_syn_pll_cp2(struct b43_wldev *dev, bool ghz5) | ||
9059 | { | ||
9060 | struct b2056_inittabs_pts *pts; | ||
9061 | const struct b2056_inittab_entry *e; | ||
9062 | |||
9063 | if (dev->phy.rev >= ARRAY_SIZE(b2056_inittabs)) { | ||
9064 | B43_WARN_ON(1); | ||
9065 | return; | ||
9066 | } | ||
9067 | pts = &b2056_inittabs[dev->phy.rev]; | ||
9068 | e = &pts->syn[B2056_SYN_PLL_CP2]; | ||
9069 | |||
9070 | b43_radio_write(dev, B2056_SYN_PLL_CP2, ghz5 ? e->ghz5 : e->ghz2); | ||
9071 | } | ||
9072 | |||
9058 | const struct b43_nphy_channeltab_entry_rev3 * | 9073 | const struct b43_nphy_channeltab_entry_rev3 * |
9059 | b43_nphy_get_chantabent_rev3(struct b43_wldev *dev, u16 freq) | 9074 | b43_nphy_get_chantabent_rev3(struct b43_wldev *dev, u16 freq) |
9060 | { | 9075 | { |
diff --git a/drivers/net/wireless/b43/radio_2056.h b/drivers/net/wireless/b43/radio_2056.h index a7159d8578be..5b86673459fa 100644 --- a/drivers/net/wireless/b43/radio_2056.h +++ b/drivers/net/wireless/b43/radio_2056.h | |||
@@ -1090,6 +1090,7 @@ struct b43_nphy_channeltab_entry_rev3 { | |||
1090 | 1090 | ||
1091 | void b2056_upload_inittabs(struct b43_wldev *dev, | 1091 | void b2056_upload_inittabs(struct b43_wldev *dev, |
1092 | bool ghz5, bool ignore_uploadflag); | 1092 | bool ghz5, bool ignore_uploadflag); |
1093 | void b2056_upload_syn_pll_cp2(struct b43_wldev *dev, bool ghz5); | ||
1093 | 1094 | ||
1094 | /* Get the NPHY Channel Switch Table entry for a channel. | 1095 | /* Get the NPHY Channel Switch Table entry for a channel. |
1095 | * Returns NULL on failure to find an entry. */ | 1096 | * Returns NULL on failure to find an entry. */ |