diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-12-21 17:57:48 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-22 15:43:29 -0500 |
commit | d4814e69eec24f46a9f0a6d57b80e0a6add594c7 (patch) | |
tree | af467bddb45f02f3b75cb21dc77f9f48ef8ff805 /drivers/net | |
parent | d41446467320b7cbe550a85c44fd9d3cb12c119d (diff) |
b43: N-PHY: update 2056 radio on channel switch on rev3+
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/b43/phy_n.c | 95 |
1 files changed, 94 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index dded2318ddf4..ab81ed8b19d7 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -139,6 +139,99 @@ static void b43_chantab_radio_upload(struct b43_wldev *dev, | |||
139 | b43_radio_write(dev, B2055_C2_TX_MXBGTRIM, e->radio_c2_tx_mxbgtrim); | 139 | b43_radio_write(dev, B2055_C2_TX_MXBGTRIM, e->radio_c2_tx_mxbgtrim); |
140 | } | 140 | } |
141 | 141 | ||
142 | static void b43_chantab_radio_2056_upload(struct b43_wldev *dev, | ||
143 | const struct b43_nphy_channeltab_entry_rev3 *e) | ||
144 | { | ||
145 | b43_radio_write(dev, B2056_SYN_PLL_VCOCAL1, e->radio_syn_pll_vcocal1); | ||
146 | b43_radio_write(dev, B2056_SYN_PLL_VCOCAL2, e->radio_syn_pll_vcocal2); | ||
147 | b43_radio_write(dev, B2056_SYN_PLL_REFDIV, e->radio_syn_pll_refdiv); | ||
148 | b43_radio_write(dev, B2056_SYN_PLL_MMD2, e->radio_syn_pll_mmd2); | ||
149 | b43_radio_write(dev, B2056_SYN_PLL_MMD1, e->radio_syn_pll_mmd1); | ||
150 | b43_radio_write(dev, B2056_SYN_PLL_LOOPFILTER1, | ||
151 | e->radio_syn_pll_loopfilter1); | ||
152 | b43_radio_write(dev, B2056_SYN_PLL_LOOPFILTER2, | ||
153 | e->radio_syn_pll_loopfilter2); | ||
154 | b43_radio_write(dev, B2056_SYN_PLL_LOOPFILTER3, | ||
155 | e->radio_syn_pll_loopfilter3); | ||
156 | b43_radio_write(dev, B2056_SYN_PLL_LOOPFILTER4, | ||
157 | e->radio_syn_pll_loopfilter4); | ||
158 | b43_radio_write(dev, B2056_SYN_PLL_LOOPFILTER5, | ||
159 | e->radio_syn_pll_loopfilter5); | ||
160 | b43_radio_write(dev, B2056_SYN_RESERVED_ADDR27, | ||
161 | e->radio_syn_reserved_addr27); | ||
162 | b43_radio_write(dev, B2056_SYN_RESERVED_ADDR28, | ||
163 | e->radio_syn_reserved_addr28); | ||
164 | b43_radio_write(dev, B2056_SYN_RESERVED_ADDR29, | ||
165 | e->radio_syn_reserved_addr29); | ||
166 | b43_radio_write(dev, B2056_SYN_LOGEN_VCOBUF1, | ||
167 | e->radio_syn_logen_vcobuf1); | ||
168 | b43_radio_write(dev, B2056_SYN_LOGEN_MIXER2, e->radio_syn_logen_mixer2); | ||
169 | b43_radio_write(dev, B2056_SYN_LOGEN_BUF3, e->radio_syn_logen_buf3); | ||
170 | b43_radio_write(dev, B2056_SYN_LOGEN_BUF4, e->radio_syn_logen_buf4); | ||
171 | |||
172 | b43_radio_write(dev, B2056_RX0 | B2056_RX_LNAA_TUNE, | ||
173 | e->radio_rx0_lnaa_tune); | ||
174 | b43_radio_write(dev, B2056_RX0 | B2056_RX_LNAG_TUNE, | ||
175 | e->radio_rx0_lnag_tune); | ||
176 | |||
177 | b43_radio_write(dev, B2056_TX0 | B2056_TX_INTPAA_BOOST_TUNE, | ||
178 | e->radio_tx0_intpaa_boost_tune); | ||
179 | b43_radio_write(dev, B2056_TX0 | B2056_TX_INTPAG_BOOST_TUNE, | ||
180 | e->radio_tx0_intpag_boost_tune); | ||
181 | b43_radio_write(dev, B2056_TX0 | B2056_TX_PADA_BOOST_TUNE, | ||
182 | e->radio_tx0_pada_boost_tune); | ||
183 | b43_radio_write(dev, B2056_TX0 | B2056_TX_PADG_BOOST_TUNE, | ||
184 | e->radio_tx0_padg_boost_tune); | ||
185 | b43_radio_write(dev, B2056_TX0 | B2056_TX_PGAA_BOOST_TUNE, | ||
186 | e->radio_tx0_pgaa_boost_tune); | ||
187 | b43_radio_write(dev, B2056_TX0 | B2056_TX_PGAG_BOOST_TUNE, | ||
188 | e->radio_tx0_pgag_boost_tune); | ||
189 | b43_radio_write(dev, B2056_TX0 | B2056_TX_MIXA_BOOST_TUNE, | ||
190 | e->radio_tx0_mixa_boost_tune); | ||
191 | b43_radio_write(dev, B2056_TX0 | B2056_TX_MIXG_BOOST_TUNE, | ||
192 | e->radio_tx0_mixg_boost_tune); | ||
193 | |||
194 | b43_radio_write(dev, B2056_RX1 | B2056_RX_LNAA_TUNE, | ||
195 | e->radio_rx1_lnaa_tune); | ||
196 | b43_radio_write(dev, B2056_RX1 | B2056_RX_LNAG_TUNE, | ||
197 | e->radio_rx1_lnag_tune); | ||
198 | |||
199 | b43_radio_write(dev, B2056_TX1 | B2056_TX_INTPAA_BOOST_TUNE, | ||
200 | e->radio_tx1_intpaa_boost_tune); | ||
201 | b43_radio_write(dev, B2056_TX1 | B2056_TX_INTPAG_BOOST_TUNE, | ||
202 | e->radio_tx1_intpag_boost_tune); | ||
203 | b43_radio_write(dev, B2056_TX1 | B2056_TX_PADA_BOOST_TUNE, | ||
204 | e->radio_tx1_pada_boost_tune); | ||
205 | b43_radio_write(dev, B2056_TX1 | B2056_TX_PADG_BOOST_TUNE, | ||
206 | e->radio_tx1_padg_boost_tune); | ||
207 | b43_radio_write(dev, B2056_TX1 | B2056_TX_PGAA_BOOST_TUNE, | ||
208 | e->radio_tx1_pgaa_boost_tune); | ||
209 | b43_radio_write(dev, B2056_TX1 | B2056_TX_PGAG_BOOST_TUNE, | ||
210 | e->radio_tx1_pgag_boost_tune); | ||
211 | b43_radio_write(dev, B2056_TX1 | B2056_TX_MIXA_BOOST_TUNE, | ||
212 | e->radio_tx1_mixa_boost_tune); | ||
213 | b43_radio_write(dev, B2056_TX1 | B2056_TX_MIXG_BOOST_TUNE, | ||
214 | e->radio_tx1_mixg_boost_tune); | ||
215 | } | ||
216 | |||
217 | /* http://bcm-v4.sipsolutions.net/802.11/PHY/Radio/2056Setup */ | ||
218 | static void b43_radio_2056_setup(struct b43_wldev *dev, | ||
219 | const struct b43_nphy_channeltab_entry_rev3 *e) | ||
220 | { | ||
221 | B43_WARN_ON(dev->phy.rev < 3); | ||
222 | |||
223 | b43_chantab_radio_2056_upload(dev, e); | ||
224 | /* TODO */ | ||
225 | udelay(50); | ||
226 | /* VCO calibration */ | ||
227 | b43_radio_write(dev, B2056_SYN_PLL_VCOCAL12, 0x00); | ||
228 | b43_radio_write(dev, B2056_TX_INTPAA_PA_MISC, 0x38); | ||
229 | b43_radio_write(dev, B2056_TX_INTPAA_PA_MISC, 0x18); | ||
230 | b43_radio_write(dev, B2056_TX_INTPAA_PA_MISC, 0x38); | ||
231 | b43_radio_write(dev, B2056_TX_INTPAA_PA_MISC, 0x39); | ||
232 | udelay(300); | ||
233 | } | ||
234 | |||
142 | static void b43_chantab_phy_upload(struct b43_wldev *dev, | 235 | static void b43_chantab_phy_upload(struct b43_wldev *dev, |
143 | const struct b43_phy_n_sfo_cfg *e) | 236 | const struct b43_phy_n_sfo_cfg *e) |
144 | { | 237 | { |
@@ -3635,7 +3728,7 @@ static int b43_nphy_set_channel(struct b43_wldev *dev, | |||
3635 | if (dev->phy.rev >= 3) { | 3728 | if (dev->phy.rev >= 3) { |
3636 | tmp = (channel->band == IEEE80211_BAND_5GHZ) ? 4 : 0; | 3729 | tmp = (channel->band == IEEE80211_BAND_5GHZ) ? 4 : 0; |
3637 | b43_radio_maskset(dev, 0x08, 0xFFFB, tmp); | 3730 | b43_radio_maskset(dev, 0x08, 0xFFFB, tmp); |
3638 | /* TODO: PHY Radio2056 Setup (dev, tabent_r3); */ | 3731 | b43_radio_2056_setup(dev, tabent_r3); |
3639 | b43_nphy_channel_setup(dev, &(tabent_r3->phy_regs), channel); | 3732 | b43_nphy_channel_setup(dev, &(tabent_r3->phy_regs), channel); |
3640 | } else { | 3733 | } else { |
3641 | tmp = (channel->band == IEEE80211_BAND_5GHZ) ? 0x0020 : 0x0050; | 3734 | tmp = (channel->band == IEEE80211_BAND_5GHZ) ? 0x0020 : 0x0050; |