diff options
author | Michael Buesch <mb@bu3sch.de> | 2009-01-31 13:34:53 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-09 15:03:48 -0500 |
commit | 24b5bcc6aef46346edd69becf62d2125c0b3208e (patch) | |
tree | 28e7d0168fd3383c00f3e46c42609af7d243ad4a /drivers/net/wireless/b43 | |
parent | 6c1bb9276c492c803611e63fa6fab8276c02ee70 (diff) |
b43: Add LP 2062 radio init
This adds initialization code for the 2062 radio.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r-- | drivers/net/wireless/b43/phy_lp.c | 111 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_lp.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/b43/tables_lpphy.c | 244 | ||||
-rw-r--r-- | drivers/net/wireless/b43/tables_lpphy.h | 2 |
4 files changed, 355 insertions, 4 deletions
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c index 3c7be8308587..99cc9739aced 100644 --- a/drivers/net/wireless/b43/phy_lp.c +++ b/drivers/net/wireless/b43/phy_lp.c | |||
@@ -91,7 +91,7 @@ static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev) | |||
91 | b43_phy_set(dev, B43_PHY_OFDM(0x10A), 0x1); | 91 | b43_phy_set(dev, B43_PHY_OFDM(0x10A), 0x1); |
92 | b43_phy_maskset(dev, B43_LPPHY_CCKLMSSTEPSIZE, 0xFF01, 0x10); | 92 | b43_phy_maskset(dev, B43_LPPHY_CCKLMSSTEPSIZE, 0xFF01, 0x10); |
93 | b43_phy_maskset(dev, B43_PHY_OFDM(0xDF), 0xFF00, 0xF4); | 93 | b43_phy_maskset(dev, B43_PHY_OFDM(0xDF), 0xFF00, 0xF4); |
94 | b43_phy_maskset(dev, B43_PHY_OFDM(0xDF), 0x00FF, 0xF100);//FIXME specs are different | 94 | b43_phy_maskset(dev, B43_PHY_OFDM(0xDF), 0x00FF, 0xF100); |
95 | b43_phy_write(dev, B43_LPPHY_CLIPTHRESH, 0x48); | 95 | b43_phy_write(dev, B43_LPPHY_CLIPTHRESH, 0x48); |
96 | b43_phy_maskset(dev, B43_LPPHY_HIGAINDB, 0xFF00, 0x46); | 96 | b43_phy_maskset(dev, B43_LPPHY_HIGAINDB, 0xFF00, 0x46); |
97 | b43_phy_maskset(dev, B43_PHY_OFDM(0xE4), 0xFF00, 0x10); | 97 | b43_phy_maskset(dev, B43_PHY_OFDM(0xE4), 0xFF00, 0x10); |
@@ -155,11 +155,114 @@ static void lpphy_baseband_init(struct b43_wldev *dev) | |||
155 | lpphy_baseband_rev0_1_init(dev); | 155 | lpphy_baseband_rev0_1_init(dev); |
156 | } | 156 | } |
157 | 157 | ||
158 | static void lpphy_radio_init(struct b43_wldev *dev) | 158 | struct b2062_freqdata { |
159 | u16 freq; | ||
160 | u8 data[6]; | ||
161 | }; | ||
162 | |||
163 | /* Initialize the 2062 radio. */ | ||
164 | static void lpphy_2062_init(struct b43_wldev *dev) | ||
165 | { | ||
166 | u32 crystalfreq, pdiv, tmp, ref; | ||
167 | unsigned int i; | ||
168 | const struct b2062_freqdata *fd = NULL; | ||
169 | |||
170 | static const struct b2062_freqdata freqdata_tab[] = { | ||
171 | { .freq = 12000, .data[0] = 6, .data[1] = 6, .data[2] = 6, | ||
172 | .data[3] = 6, .data[4] = 10, .data[5] = 6, }, | ||
173 | { .freq = 13000, .data[0] = 4, .data[1] = 4, .data[2] = 4, | ||
174 | .data[3] = 4, .data[4] = 11, .data[5] = 7, }, | ||
175 | { .freq = 14400, .data[0] = 3, .data[1] = 3, .data[2] = 3, | ||
176 | .data[3] = 3, .data[4] = 12, .data[5] = 7, }, | ||
177 | { .freq = 16200, .data[0] = 3, .data[1] = 3, .data[2] = 3, | ||
178 | .data[3] = 3, .data[4] = 13, .data[5] = 8, }, | ||
179 | { .freq = 18000, .data[0] = 2, .data[1] = 2, .data[2] = 2, | ||
180 | .data[3] = 2, .data[4] = 14, .data[5] = 8, }, | ||
181 | { .freq = 19200, .data[0] = 1, .data[1] = 1, .data[2] = 1, | ||
182 | .data[3] = 1, .data[4] = 14, .data[5] = 9, }, | ||
183 | }; | ||
184 | |||
185 | b2062_upload_init_table(dev); | ||
186 | |||
187 | b43_radio_write(dev, B2062_N_TX_CTL3, 0); | ||
188 | b43_radio_write(dev, B2062_N_TX_CTL4, 0); | ||
189 | b43_radio_write(dev, B2062_N_TX_CTL5, 0); | ||
190 | b43_radio_write(dev, B2062_N_PDN_CTL0, 0x40); | ||
191 | b43_radio_write(dev, B2062_N_PDN_CTL0, 0); | ||
192 | b43_radio_write(dev, B2062_N_CALIB_TS, 0x10); | ||
193 | b43_radio_write(dev, B2062_N_CALIB_TS, 0); | ||
194 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) | ||
195 | b43_radio_set(dev, B2062_N_TSSI_CTL0, 0x1); | ||
196 | else | ||
197 | b43_radio_mask(dev, B2062_N_TSSI_CTL0, ~0x1); | ||
198 | |||
199 | crystalfreq = 0;//FIXME | ||
200 | |||
201 | if (crystalfreq >= 30000000) { | ||
202 | pdiv = 1; | ||
203 | b43_radio_mask(dev, B2062_S_RFPLL_CTL1, 0xFFFB); | ||
204 | } else { | ||
205 | pdiv = 2; | ||
206 | b43_radio_set(dev, B2062_S_RFPLL_CTL1, 0x4); | ||
207 | } | ||
208 | |||
209 | tmp = (800000000 * pdiv + crystalfreq) / (32000000 * pdiv); | ||
210 | tmp = (tmp - 1) & 0xFF; | ||
211 | b43_radio_write(dev, B2062_S_RFPLL_CTL18, tmp); | ||
212 | |||
213 | tmp = (2 * crystalfreq + 1000000 * pdiv) / (2000000 * pdiv); | ||
214 | tmp = ((tmp & 0xFF) - 1) & 0xFFFF; | ||
215 | b43_radio_write(dev, B2062_S_RFPLL_CTL19, tmp); | ||
216 | |||
217 | ref = (1000 * pdiv + 2 * crystalfreq) / (2000 * pdiv); | ||
218 | ref &= 0xFFFF; | ||
219 | for (i = 0; i < ARRAY_SIZE(freqdata_tab); i++) { | ||
220 | if (ref < freqdata_tab[i].freq) { | ||
221 | fd = &freqdata_tab[i]; | ||
222 | break; | ||
223 | } | ||
224 | } | ||
225 | if (B43_WARN_ON(!fd)) | ||
226 | return; | ||
227 | |||
228 | b43_radio_write(dev, B2062_S_RFPLL_CTL8, | ||
229 | ((u16)(fd->data[1]) << 4) | fd->data[0]); | ||
230 | b43_radio_write(dev, B2062_S_RFPLL_CTL9, | ||
231 | ((u16)(fd->data[3]) << 4) | fd->data[2]);//FIXME specs are different | ||
232 | b43_radio_write(dev, B2062_S_RFPLL_CTL10, fd->data[4]); | ||
233 | b43_radio_write(dev, B2062_S_RFPLL_CTL11, fd->data[5]); | ||
234 | } | ||
235 | |||
236 | /* Initialize the 2063 radio. */ | ||
237 | static void lpphy_2063_init(struct b43_wldev *dev) | ||
159 | { | 238 | { |
160 | //TODO | 239 | //TODO |
161 | } | 240 | } |
162 | 241 | ||
242 | static void lpphy_sync_stx(struct b43_wldev *dev) | ||
243 | { | ||
244 | //TODO | ||
245 | } | ||
246 | |||
247 | static void lpphy_radio_init(struct b43_wldev *dev) | ||
248 | { | ||
249 | /* The radio is attached through the 4wire bus. */ | ||
250 | b43_phy_set(dev, B43_LPPHY_FOURWIRE_CTL, 0x2); | ||
251 | udelay(1); | ||
252 | b43_phy_mask(dev, B43_LPPHY_FOURWIRE_CTL, 0xFFFD); | ||
253 | udelay(1); | ||
254 | |||
255 | if (dev->phy.rev < 2) { | ||
256 | lpphy_2062_init(dev); | ||
257 | } else { | ||
258 | lpphy_2063_init(dev); | ||
259 | lpphy_sync_stx(dev); | ||
260 | b43_phy_write(dev, B43_PHY_OFDM(0xF0), 0x5F80); | ||
261 | b43_phy_write(dev, B43_PHY_OFDM(0xF1), 0); | ||
262 | //TODO Do something on the backplane | ||
263 | } | ||
264 | } | ||
265 | |||
163 | static int b43_lpphy_op_init(struct b43_wldev *dev) | 266 | static int b43_lpphy_op_init(struct b43_wldev *dev) |
164 | { | 267 | { |
165 | /* TODO: band SPROM */ | 268 | /* TODO: band SPROM */ |
@@ -222,7 +325,9 @@ static int b43_lpphy_op_switch_channel(struct b43_wldev *dev, | |||
222 | 325 | ||
223 | static unsigned int b43_lpphy_op_get_default_chan(struct b43_wldev *dev) | 326 | static unsigned int b43_lpphy_op_get_default_chan(struct b43_wldev *dev) |
224 | { | 327 | { |
225 | return 1; /* Default to channel 1 */ | 328 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) |
329 | return 1; | ||
330 | return 36; | ||
226 | } | 331 | } |
227 | 332 | ||
228 | static void b43_lpphy_op_set_rx_antenna(struct b43_wldev *dev, int antenna) | 333 | static void b43_lpphy_op_set_rx_antenna(struct b43_wldev *dev, int antenna) |
diff --git a/drivers/net/wireless/b43/phy_lp.h b/drivers/net/wireless/b43/phy_lp.h index 1e30a55d2f25..80703c58102e 100644 --- a/drivers/net/wireless/b43/phy_lp.h +++ b/drivers/net/wireless/b43/phy_lp.h | |||
@@ -273,7 +273,7 @@ | |||
273 | #define B43_LPPHY_TRLOOKUP4 B43_PHY_OFDM(0xBC) /* TRLookup4 */ | 273 | #define B43_LPPHY_TRLOOKUP4 B43_PHY_OFDM(0xBC) /* TRLookup4 */ |
274 | #define B43_LPPHY_RADAR_FIFO_STAT B43_PHY_OFDM(0xBD) /* Radar FIFO Status */ | 274 | #define B43_LPPHY_RADAR_FIFO_STAT B43_PHY_OFDM(0xBD) /* Radar FIFO Status */ |
275 | #define B43_LPPHY_GPIO_OUTEN B43_PHY_OFDM(0xBE) /* GPIO Out enable */ | 275 | #define B43_LPPHY_GPIO_OUTEN B43_PHY_OFDM(0xBE) /* GPIO Out enable */ |
276 | #define B43_LPPHY_GPOI_SELECT B43_PHY_OFDM(0xBF) /* GPOI Select */ | 276 | #define B43_LPPHY_GPIO_SELECT B43_PHY_OFDM(0xBF) /* GPIO Select */ |
277 | #define B43_LPPHY_GPIO_OUT B43_PHY_OFDM(0xC0) /* GPIO Out */ | 277 | #define B43_LPPHY_GPIO_OUT B43_PHY_OFDM(0xC0) /* GPIO Out */ |
278 | 278 | ||
279 | 279 | ||
diff --git a/drivers/net/wireless/b43/tables_lpphy.c b/drivers/net/wireless/b43/tables_lpphy.c index c9cff8b6827e..18f6e3256766 100644 --- a/drivers/net/wireless/b43/tables_lpphy.c +++ b/drivers/net/wireless/b43/tables_lpphy.c | |||
@@ -28,6 +28,250 @@ | |||
28 | #include "phy_lp.h" | 28 | #include "phy_lp.h" |
29 | 29 | ||
30 | 30 | ||
31 | /* Entry of the 2062 radio init table */ | ||
32 | struct b2062_init_tab_entry { | ||
33 | u16 offset; | ||
34 | u16 value_a; | ||
35 | u16 value_g; | ||
36 | u8 flags; | ||
37 | }; | ||
38 | #define B2062_FLAG_A 0x01 /* Flag: Init in A mode */ | ||
39 | #define B2062_FLAG_G 0x02 /* Flag: Init in G mode */ | ||
40 | |||
41 | static const struct b2062_init_tab_entry b2062_init_tab[] = { | ||
42 | /* { .offset = B2062_N_COMM1, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
43 | /* { .offset = 0x0001, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
44 | /* { .offset = B2062_N_COMM2, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
45 | /* { .offset = B2062_N_COMM3, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
46 | { .offset = B2062_N_COMM4, .value_a = 0x0001, .value_g = 0x0000, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
47 | /* { .offset = B2062_N_COMM5, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
48 | /* { .offset = B2062_N_COMM6, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
49 | /* { .offset = B2062_N_COMM7, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
50 | /* { .offset = B2062_N_COMM8, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
51 | /* { .offset = B2062_N_COMM9, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
52 | /* { .offset = B2062_N_COMM10, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
53 | /* { .offset = B2062_N_COMM11, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
54 | /* { .offset = B2062_N_COMM12, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
55 | /* { .offset = B2062_N_COMM13, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
56 | /* { .offset = B2062_N_COMM14, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
57 | /* { .offset = B2062_N_COMM15, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
58 | /* { .offset = B2062_N_PDN_CTL0, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
59 | { .offset = B2062_N_PDN_CTL1, .value_a = 0x0000, .value_g = 0x00CA, .flags = B2062_FLAG_G, }, | ||
60 | /* { .offset = B2062_N_PDN_CTL2, .value_a = 0x0018, .value_g = 0x0018, .flags = 0, }, */ | ||
61 | { .offset = B2062_N_PDN_CTL3, .value_a = 0x0000, .value_g = 0x0000, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
62 | { .offset = B2062_N_PDN_CTL4, .value_a = 0x0015, .value_g = 0x002A, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
63 | /* { .offset = B2062_N_GEN_CTL0, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
64 | /* { .offset = B2062_N_IQ_CALIB, .value_a = 0x0001, .value_g = 0x0001, .flags = 0, }, */ | ||
65 | { .offset = B2062_N_LGENC, .value_a = 0x00DB, .value_g = 0x00FF, .flags = B2062_FLAG_A, }, | ||
66 | /* { .offset = B2062_N_LGENA_LPF, .value_a = 0x0001, .value_g = 0x0001, .flags = 0, }, */ | ||
67 | /* { .offset = B2062_N_LGENA_BIAS0, .value_a = 0x0041, .value_g = 0x0041, .flags = 0, }, */ | ||
68 | /* { .offset = B2062_N_LGNEA_BIAS1, .value_a = 0x0002, .value_g = 0x0002, .flags = 0, }, */ | ||
69 | /* { .offset = B2062_N_LGENA_CTL0, .value_a = 0x0032, .value_g = 0x0032, .flags = 0, }, */ | ||
70 | /* { .offset = B2062_N_LGENA_CTL1, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
71 | /* { .offset = B2062_N_LGENA_CTL2, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
72 | { .offset = B2062_N_LGENA_TUNE0, .value_a = 0x00DD, .value_g = 0x0000, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
73 | /* { .offset = B2062_N_LGENA_TUNE1, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
74 | { .offset = B2062_N_LGENA_TUNE2, .value_a = 0x00DD, .value_g = 0x0000, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
75 | { .offset = B2062_N_LGENA_TUNE3, .value_a = 0x0077, .value_g = 0x00B5, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
76 | { .offset = B2062_N_LGENA_CTL3, .value_a = 0x0000, .value_g = 0x00FF, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
77 | /* { .offset = B2062_N_LGENA_CTL4, .value_a = 0x001F, .value_g = 0x001F, .flags = 0, }, */ | ||
78 | /* { .offset = B2062_N_LGENA_CTL5, .value_a = 0x0032, .value_g = 0x0032, .flags = 0, }, */ | ||
79 | /* { .offset = B2062_N_LGENA_CTL6, .value_a = 0x0032, .value_g = 0x0032, .flags = 0, }, */ | ||
80 | { .offset = B2062_N_LGENA_CTL7, .value_a = 0x0033, .value_g = 0x0033, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
81 | /* { .offset = B2062_N_RXA_CTL0, .value_a = 0x0009, .value_g = 0x0009, .flags = 0, }, */ | ||
82 | { .offset = B2062_N_RXA_CTL1, .value_a = 0x0000, .value_g = 0x0000, .flags = B2062_FLAG_G, }, | ||
83 | /* { .offset = B2062_N_RXA_CTL2, .value_a = 0x0018, .value_g = 0x0018, .flags = 0, }, */ | ||
84 | /* { .offset = B2062_N_RXA_CTL3, .value_a = 0x0027, .value_g = 0x0027, .flags = 0, }, */ | ||
85 | /* { .offset = B2062_N_RXA_CTL4, .value_a = 0x0028, .value_g = 0x0028, .flags = 0, }, */ | ||
86 | /* { .offset = B2062_N_RXA_CTL5, .value_a = 0x0007, .value_g = 0x0007, .flags = 0, }, */ | ||
87 | /* { .offset = B2062_N_RXA_CTL6, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
88 | /* { .offset = B2062_N_RXA_CTL7, .value_a = 0x0008, .value_g = 0x0008, .flags = 0, }, */ | ||
89 | { .offset = B2062_N_RXBB_CTL0, .value_a = 0x0082, .value_g = 0x0080, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
90 | /* { .offset = B2062_N_RXBB_CTL1, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
91 | /* { .offset = B2062_N_RXBB_CTL2, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
92 | /* { .offset = B2062_N_RXBB_GAIN0, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
93 | { .offset = B2062_N_RXBB_GAIN1, .value_a = 0x0004, .value_g = 0x0004, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
94 | { .offset = B2062_N_RXBB_GAIN2, .value_a = 0x0000, .value_g = 0x0000, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
95 | /* { .offset = B2062_N_RXBB_GAIN3, .value_a = 0x0011, .value_g = 0x0011, .flags = 0, }, */ | ||
96 | /* { .offset = B2062_N_RXBB_RSSI0, .value_a = 0x0043, .value_g = 0x0043, .flags = 0, }, */ | ||
97 | /* { .offset = B2062_N_RXBB_RSSI1, .value_a = 0x0033, .value_g = 0x0033, .flags = 0, }, */ | ||
98 | /* { .offset = B2062_N_RXBB_CALIB0, .value_a = 0x0010, .value_g = 0x0010, .flags = 0, }, */ | ||
99 | /* { .offset = B2062_N_RXBB_CALIB1, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
100 | /* { .offset = B2062_N_RXBB_CALIB2, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
101 | /* { .offset = B2062_N_RXBB_BIAS0, .value_a = 0x0006, .value_g = 0x0006, .flags = 0, }, */ | ||
102 | /* { .offset = B2062_N_RXBB_BIAS1, .value_a = 0x002A, .value_g = 0x002A, .flags = 0, }, */ | ||
103 | /* { .offset = B2062_N_RXBB_BIAS2, .value_a = 0x00AA, .value_g = 0x00AA, .flags = 0, }, */ | ||
104 | /* { .offset = B2062_N_RXBB_BIAS3, .value_a = 0x0021, .value_g = 0x0021, .flags = 0, }, */ | ||
105 | /* { .offset = B2062_N_RXBB_BIAS4, .value_a = 0x00AA, .value_g = 0x00AA, .flags = 0, }, */ | ||
106 | /* { .offset = B2062_N_RXBB_BIAS5, .value_a = 0x0022, .value_g = 0x0022, .flags = 0, }, */ | ||
107 | /* { .offset = B2062_N_RXBB_RSSI2, .value_a = 0x0001, .value_g = 0x0001, .flags = 0, }, */ | ||
108 | /* { .offset = B2062_N_RXBB_RSSI3, .value_a = 0x0055, .value_g = 0x0055, .flags = 0, }, */ | ||
109 | /* { .offset = B2062_N_RXBB_RSSI4, .value_a = 0x0001, .value_g = 0x0001, .flags = 0, }, */ | ||
110 | /* { .offset = B2062_N_RXBB_RSSI5, .value_a = 0x0055, .value_g = 0x0055, .flags = 0, }, */ | ||
111 | /* { .offset = B2062_N_TX_CTL0, .value_a = 0x0001, .value_g = 0x0001, .flags = 0, }, */ | ||
112 | /* { .offset = B2062_N_TX_CTL1, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
113 | /* { .offset = B2062_N_TX_CTL2, .value_a = 0x0084, .value_g = 0x0084, .flags = 0, }, */ | ||
114 | /* { .offset = B2062_N_TX_CTL3, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
115 | { .offset = B2062_N_TX_CTL4, .value_a = 0x0003, .value_g = 0x0003, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
116 | { .offset = B2062_N_TX_CTL5, .value_a = 0x0002, .value_g = 0x0002, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
117 | /* { .offset = B2062_N_TX_CTL6, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
118 | /* { .offset = B2062_N_TX_CTL7, .value_a = 0x0058, .value_g = 0x0058, .flags = 0, }, */ | ||
119 | /* { .offset = B2062_N_TX_CTL8, .value_a = 0x0082, .value_g = 0x0082, .flags = 0, }, */ | ||
120 | /* { .offset = B2062_N_TX_CTL9, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
121 | /* { .offset = B2062_N_TX_CTL_A, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
122 | /* { .offset = B2062_N_TX_GC2G, .value_a = 0x00FF, .value_g = 0x00FF, .flags = 0, }, */ | ||
123 | /* { .offset = B2062_N_TX_GC5G, .value_a = 0x00FF, .value_g = 0x00FF, .flags = 0, }, */ | ||
124 | { .offset = B2062_N_TX_TUNE, .value_a = 0x0088, .value_g = 0x001B, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
125 | /* { .offset = B2062_N_TX_PAD, .value_a = 0x0088, .value_g = 0x0088, .flags = 0, }, */ | ||
126 | /* { .offset = B2062_N_TX_PGA, .value_a = 0x0088, .value_g = 0x0088, .flags = 0, }, */ | ||
127 | /* { .offset = B2062_N_TX_PADAUX, .value_a = 0x0033, .value_g = 0x0033, .flags = 0, }, */ | ||
128 | /* { .offset = B2062_N_TX_PGAAUX, .value_a = 0x0033, .value_g = 0x0033, .flags = 0, }, */ | ||
129 | /* { .offset = B2062_N_TSSI_CTL0, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
130 | /* { .offset = B2062_N_TSSI_CTL1, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
131 | /* { .offset = B2062_N_TSSI_CTL2, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
132 | /* { .offset = B2062_N_IQ_CALIB_CTL0, .value_a = 0x0033, .value_g = 0x0033, .flags = 0, }, */ | ||
133 | /* { .offset = B2062_N_IQ_CALIB_CTL1, .value_a = 0x0055, .value_g = 0x0055, .flags = 0, }, */ | ||
134 | /* { .offset = B2062_N_IQ_CALIB_CTL2, .value_a = 0x0032, .value_g = 0x0032, .flags = 0, }, */ | ||
135 | /* { .offset = B2062_N_CALIB_TS, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
136 | /* { .offset = B2062_N_CALIB_CTL0, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
137 | /* { .offset = B2062_N_CALIB_CTL1, .value_a = 0x0015, .value_g = 0x0015, .flags = 0, }, */ | ||
138 | /* { .offset = B2062_N_CALIB_CTL2, .value_a = 0x000F, .value_g = 0x000F, .flags = 0, }, */ | ||
139 | /* { .offset = B2062_N_CALIB_CTL3, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
140 | /* { .offset = B2062_N_CALIB_CTL4, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
141 | /* { .offset = B2062_N_CALIB_DBG0, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
142 | /* { .offset = B2062_N_CALIB_DBG1, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
143 | /* { .offset = B2062_N_CALIB_DBG2, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
144 | /* { .offset = B2062_N_CALIB_DBG3, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
145 | /* { .offset = B2062_N_PSENSE_CTL0, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
146 | /* { .offset = B2062_N_PSENSE_CTL1, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
147 | /* { .offset = B2062_N_PSENSE_CTL2, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
148 | /* { .offset = B2062_N_TEST_BUF0, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
149 | /* { .offset = B2062_S_COMM1, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
150 | /* { .offset = B2062_S_RADIO_ID_CODE, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
151 | /* { .offset = B2062_S_COMM2, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
152 | /* { .offset = B2062_S_COMM3, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
153 | { .offset = B2062_S_COMM4, .value_a = 0x0001, .value_g = 0x0000, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
154 | /* { .offset = B2062_S_COMM5, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
155 | /* { .offset = B2062_S_COMM6, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
156 | /* { .offset = B2062_S_COMM7, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
157 | /* { .offset = B2062_S_COMM8, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
158 | /* { .offset = B2062_S_COMM9, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
159 | /* { .offset = B2062_S_COMM10, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
160 | /* { .offset = B2062_S_COMM11, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
161 | /* { .offset = B2062_S_COMM12, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
162 | /* { .offset = B2062_S_COMM13, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
163 | /* { .offset = B2062_S_COMM14, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
164 | /* { .offset = B2062_S_COMM15, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
165 | { .offset = B2062_S_PDS_CTL0, .value_a = 0x00FF, .value_g = 0x00FF, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
166 | /* { .offset = B2062_S_PDS_CTL1, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
167 | /* { .offset = B2062_S_PDS_CTL2, .value_a = 0x008E, .value_g = 0x008E, .flags = 0, }, */ | ||
168 | /* { .offset = B2062_S_PDS_CTL3, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
169 | /* { .offset = B2062_S_BG_CTL0, .value_a = 0x0006, .value_g = 0x0006, .flags = 0, }, */ | ||
170 | /* { .offset = B2062_S_BG_CTL1, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
171 | /* { .offset = B2062_S_BG_CTL2, .value_a = 0x0011, .value_g = 0x0011, .flags = 0, }, */ | ||
172 | { .offset = B2062_S_LGENG_CTL0, .value_a = 0x00F8, .value_g = 0x00D8, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
173 | { .offset = B2062_S_LGENG_CTL1, .value_a = 0x003C, .value_g = 0x0024, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
174 | /* { .offset = B2062_S_LGENG_CTL2, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
175 | /* { .offset = B2062_S_LGENG_CTL3, .value_a = 0x0041, .value_g = 0x0041, .flags = 0, }, */ | ||
176 | /* { .offset = B2062_S_LGENG_CTL4, .value_a = 0x0002, .value_g = 0x0002, .flags = 0, }, */ | ||
177 | /* { .offset = B2062_S_LGENG_CTL5, .value_a = 0x0033, .value_g = 0x0033, .flags = 0, }, */ | ||
178 | /* { .offset = B2062_S_LGENG_CTL6, .value_a = 0x0022, .value_g = 0x0022, .flags = 0, }, */ | ||
179 | /* { .offset = B2062_S_LGENG_CTL7, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
180 | { .offset = B2062_S_LGENG_CTL8, .value_a = 0x0088, .value_g = 0x0080, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
181 | /* { .offset = B2062_S_LGENG_CTL9, .value_a = 0x0088, .value_g = 0x0088, .flags = 0, }, */ | ||
182 | { .offset = B2062_S_LGENG_CTL10, .value_a = 0x0088, .value_g = 0x0080, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
183 | /* { .offset = B2062_S_LGENG_CTL11, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
184 | /* { .offset = B2062_S_REFPLL_CTL0, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
185 | /* { .offset = B2062_S_REFPLL_CTL1, .value_a = 0x0007, .value_g = 0x0007, .flags = 0, }, */ | ||
186 | /* { .offset = B2062_S_REFPLL_CTL2, .value_a = 0x00AF, .value_g = 0x00AF, .flags = 0, }, */ | ||
187 | /* { .offset = B2062_S_REFPLL_CTL3, .value_a = 0x0012, .value_g = 0x0012, .flags = 0, }, */ | ||
188 | /* { .offset = B2062_S_REFPLL_CTL4, .value_a = 0x000B, .value_g = 0x000B, .flags = 0, }, */ | ||
189 | /* { .offset = B2062_S_REFPLL_CTL5, .value_a = 0x005F, .value_g = 0x005F, .flags = 0, }, */ | ||
190 | /* { .offset = B2062_S_REFPLL_CTL6, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
191 | /* { .offset = B2062_S_REFPLL_CTL7, .value_a = 0x0040, .value_g = 0x0040, .flags = 0, }, */ | ||
192 | /* { .offset = B2062_S_REFPLL_CTL8, .value_a = 0x0052, .value_g = 0x0052, .flags = 0, }, */ | ||
193 | /* { .offset = B2062_S_REFPLL_CTL9, .value_a = 0x0026, .value_g = 0x0026, .flags = 0, }, */ | ||
194 | /* { .offset = B2062_S_REFPLL_CTL10, .value_a = 0x0003, .value_g = 0x0003, .flags = 0, }, */ | ||
195 | /* { .offset = B2062_S_REFPLL_CTL11, .value_a = 0x0036, .value_g = 0x0036, .flags = 0, }, */ | ||
196 | /* { .offset = B2062_S_REFPLL_CTL12, .value_a = 0x0057, .value_g = 0x0057, .flags = 0, }, */ | ||
197 | /* { .offset = B2062_S_REFPLL_CTL13, .value_a = 0x0011, .value_g = 0x0011, .flags = 0, }, */ | ||
198 | /* { .offset = B2062_S_REFPLL_CTL14, .value_a = 0x0075, .value_g = 0x0075, .flags = 0, }, */ | ||
199 | /* { .offset = B2062_S_REFPLL_CTL15, .value_a = 0x00B4, .value_g = 0x00B4, .flags = 0, }, */ | ||
200 | /* { .offset = B2062_S_REFPLL_CTL16, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
201 | { .offset = B2062_S_RFPLL_CTL0, .value_a = 0x0098, .value_g = 0x0098, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
202 | { .offset = B2062_S_RFPLL_CTL1, .value_a = 0x0010, .value_g = 0x0010, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
203 | /* { .offset = B2062_S_RFPLL_CTL2, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
204 | /* { .offset = B2062_S_RFPLL_CTL3, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
205 | /* { .offset = B2062_S_RFPLL_CTL4, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
206 | { .offset = B2062_S_RFPLL_CTL5, .value_a = 0x0043, .value_g = 0x0043, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
207 | { .offset = B2062_S_RFPLL_CTL6, .value_a = 0x0047, .value_g = 0x0047, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
208 | { .offset = B2062_S_RFPLL_CTL7, .value_a = 0x000C, .value_g = 0x000C, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
209 | { .offset = B2062_S_RFPLL_CTL8, .value_a = 0x0011, .value_g = 0x0011, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
210 | { .offset = B2062_S_RFPLL_CTL9, .value_a = 0x0011, .value_g = 0x0011, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
211 | { .offset = B2062_S_RFPLL_CTL10, .value_a = 0x000E, .value_g = 0x000E, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
212 | { .offset = B2062_S_RFPLL_CTL11, .value_a = 0x0008, .value_g = 0x0008, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
213 | { .offset = B2062_S_RFPLL_CTL12, .value_a = 0x0033, .value_g = 0x0033, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
214 | { .offset = B2062_S_RFPLL_CTL13, .value_a = 0x000A, .value_g = 0x000A, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
215 | { .offset = B2062_S_RFPLL_CTL14, .value_a = 0x0006, .value_g = 0x0006, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
216 | /* { .offset = B2062_S_RFPLL_CTL15, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
217 | /* { .offset = B2062_S_RFPLL_CTL16, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
218 | /* { .offset = B2062_S_RFPLL_CTL17, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
219 | { .offset = B2062_S_RFPLL_CTL18, .value_a = 0x003E, .value_g = 0x003E, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
220 | { .offset = B2062_S_RFPLL_CTL19, .value_a = 0x0013, .value_g = 0x0013, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
221 | /* { .offset = B2062_S_RFPLL_CTL20, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
222 | { .offset = B2062_S_RFPLL_CTL21, .value_a = 0x0062, .value_g = 0x0062, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
223 | { .offset = B2062_S_RFPLL_CTL22, .value_a = 0x0007, .value_g = 0x0007, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
224 | { .offset = B2062_S_RFPLL_CTL23, .value_a = 0x0016, .value_g = 0x0016, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
225 | { .offset = B2062_S_RFPLL_CTL24, .value_a = 0x005C, .value_g = 0x005C, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
226 | { .offset = B2062_S_RFPLL_CTL25, .value_a = 0x0095, .value_g = 0x0095, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
227 | /* { .offset = B2062_S_RFPLL_CTL26, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
228 | /* { .offset = B2062_S_RFPLL_CTL27, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
229 | /* { .offset = B2062_S_RFPLL_CTL28, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
230 | /* { .offset = B2062_S_RFPLL_CTL29, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
231 | { .offset = B2062_S_RFPLL_CTL30, .value_a = 0x00A0, .value_g = 0x00A0, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
232 | { .offset = B2062_S_RFPLL_CTL31, .value_a = 0x0004, .value_g = 0x0004, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
233 | /* { .offset = B2062_S_RFPLL_CTL32, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
234 | { .offset = B2062_S_RFPLL_CTL33, .value_a = 0x00CC, .value_g = 0x00CC, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
235 | { .offset = B2062_S_RFPLL_CTL34, .value_a = 0x0007, .value_g = 0x0007, .flags = B2062_FLAG_A | B2062_FLAG_G, }, | ||
236 | /* { .offset = B2062_S_RXG_CNT0, .value_a = 0x0010, .value_g = 0x0010, .flags = 0, }, */ | ||
237 | /* { .offset = B2062_S_RXG_CNT1, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
238 | /* { .offset = B2062_S_RXG_CNT2, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
239 | /* { .offset = B2062_S_RXG_CNT3, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
240 | /* { .offset = B2062_S_RXG_CNT4, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
241 | /* { .offset = B2062_S_RXG_CNT5, .value_a = 0x0055, .value_g = 0x0055, .flags = 0, }, */ | ||
242 | /* { .offset = B2062_S_RXG_CNT6, .value_a = 0x0055, .value_g = 0x0055, .flags = 0, }, */ | ||
243 | /* { .offset = B2062_S_RXG_CNT7, .value_a = 0x0005, .value_g = 0x0005, .flags = 0, }, */ | ||
244 | { .offset = B2062_S_RXG_CNT8, .value_a = 0x000F, .value_g = 0x000F, .flags = B2062_FLAG_A, }, | ||
245 | /* { .offset = B2062_S_RXG_CNT9, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
246 | /* { .offset = B2062_S_RXG_CNT10, .value_a = 0x0055, .value_g = 0x0055, .flags = 0, }, */ | ||
247 | /* { .offset = B2062_S_RXG_CNT11, .value_a = 0x0066, .value_g = 0x0066, .flags = 0, }, */ | ||
248 | /* { .offset = B2062_S_RXG_CNT12, .value_a = 0x0055, .value_g = 0x0055, .flags = 0, }, */ | ||
249 | /* { .offset = B2062_S_RXG_CNT13, .value_a = 0x0044, .value_g = 0x0044, .flags = 0, }, */ | ||
250 | /* { .offset = B2062_S_RXG_CNT14, .value_a = 0x00A0, .value_g = 0x00A0, .flags = 0, }, */ | ||
251 | /* { .offset = B2062_S_RXG_CNT15, .value_a = 0x0004, .value_g = 0x0004, .flags = 0, }, */ | ||
252 | /* { .offset = B2062_S_RXG_CNT16, .value_a = 0x0000, .value_g = 0x0000, .flags = 0, }, */ | ||
253 | /* { .offset = B2062_S_RXG_CNT17, .value_a = 0x0055, .value_g = 0x0055, .flags = 0, }, */ | ||
254 | }; | ||
255 | |||
256 | void b2062_upload_init_table(struct b43_wldev *dev) | ||
257 | { | ||
258 | const struct b2062_init_tab_entry *e; | ||
259 | unsigned int i; | ||
260 | |||
261 | for (i = 0; i < ARRAY_SIZE(b2062_init_tab); i++) { | ||
262 | e = &b2062_init_tab[i]; | ||
263 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) { | ||
264 | if (!(e->flags & B2062_FLAG_G)) | ||
265 | continue; | ||
266 | b43_radio_write(dev, e->offset, e->value_g); | ||
267 | } else { | ||
268 | if (!(e->flags & B2062_FLAG_A)) | ||
269 | continue; | ||
270 | b43_radio_write(dev, e->offset, e->value_a); | ||
271 | } | ||
272 | } | ||
273 | } | ||
274 | |||
31 | u32 b43_lptab_read(struct b43_wldev *dev, u32 offset) | 275 | u32 b43_lptab_read(struct b43_wldev *dev, u32 offset) |
32 | { | 276 | { |
33 | u32 type, value; | 277 | u32 type, value; |
diff --git a/drivers/net/wireless/b43/tables_lpphy.h b/drivers/net/wireless/b43/tables_lpphy.h index d32e7450680b..03ea2ff5d13a 100644 --- a/drivers/net/wireless/b43/tables_lpphy.h +++ b/drivers/net/wireless/b43/tables_lpphy.h | |||
@@ -17,5 +17,7 @@ | |||
17 | u32 b43_lptab_read(struct b43_wldev *dev, u32 offset); | 17 | u32 b43_lptab_read(struct b43_wldev *dev, u32 offset); |
18 | void b43_lptab_write(struct b43_wldev *dev, u32 offset, u32 value); | 18 | void b43_lptab_write(struct b43_wldev *dev, u32 offset, u32 value); |
19 | 19 | ||
20 | void b2062_upload_init_table(struct b43_wldev *dev); | ||
21 | |||
20 | 22 | ||
21 | #endif /* B43_TABLES_LPPHY_H_ */ | 23 | #endif /* B43_TABLES_LPPHY_H_ */ |