aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/phy_lp.c
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-01-31 10:52:29 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-09 15:03:48 -0500
commit6c1bb9276c492c803611e63fa6fab8276c02ee70 (patch)
treeeae1cd342a8572defd60c7da814135a82ad6cea8 /drivers/net/wireless/b43/phy_lp.c
parent3302e44dcdb8aff99769921af12b916a914b6317 (diff)
b43: Add LP-PHY baseband init for >=rev2
This adds code for the baseband init of LP-PHY >=2. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/phy_lp.c')
-rw-r--r--drivers/net/wireless/b43/phy_lp.c78
1 files changed, 76 insertions, 2 deletions
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index ec83b8cd2f2e..3c7be8308587 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -3,7 +3,7 @@
3 Broadcom B43 wireless driver 3 Broadcom B43 wireless driver
4 IEEE 802.11g LP-PHY driver 4 IEEE 802.11g LP-PHY driver
5 5
6 Copyright (c) 2008 Michael Buesch <mb@bu3sch.de> 6 Copyright (c) 2008-2009 Michael Buesch <mb@bu3sch.de>
7 7
8 This program is free software; you can redistribute it and/or modify 8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
@@ -25,6 +25,7 @@
25#include "b43.h" 25#include "b43.h"
26#include "phy_lp.h" 26#include "phy_lp.h"
27#include "phy_common.h" 27#include "phy_common.h"
28#include "tables_lpphy.h"
28 29
29 30
30static int b43_lpphy_op_allocate(struct b43_wldev *dev) 31static int b43_lpphy_op_allocate(struct b43_wldev *dev)
@@ -69,7 +70,80 @@ static void lpphy_baseband_rev0_1_init(struct b43_wldev *dev)
69 70
70static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev) 71static void lpphy_baseband_rev2plus_init(struct b43_wldev *dev)
71{ 72{
72 //TODO 73 struct b43_phy_lp *lpphy = dev->phy.lp;
74
75 b43_phy_write(dev, B43_LPPHY_AFE_DAC_CTL, 0x50);
76 b43_phy_write(dev, B43_LPPHY_AFE_CTL, 0x8800);
77 b43_phy_write(dev, B43_LPPHY_AFE_CTL_OVR, 0);
78 b43_phy_write(dev, B43_LPPHY_AFE_CTL_OVRVAL, 0);
79 b43_phy_write(dev, B43_LPPHY_RF_OVERRIDE_0, 0);
80 b43_phy_write(dev, B43_LPPHY_RF_OVERRIDE_2, 0);
81 b43_phy_write(dev, B43_PHY_OFDM(0xF9), 0);
82 b43_phy_write(dev, B43_LPPHY_TR_LOOKUP_1, 0);
83 b43_phy_set(dev, B43_LPPHY_ADC_COMPENSATION_CTL, 0x10);
84 b43_phy_maskset(dev, B43_LPPHY_OFDMSYNCTHRESH0, 0xFF00, 0x78);
85 b43_phy_maskset(dev, B43_LPPHY_DCOFFSETTRANSIENT, 0xF8FF, 0x200);
86 b43_phy_maskset(dev, B43_LPPHY_DCOFFSETTRANSIENT, 0xFF00, 0x7F);
87 b43_phy_maskset(dev, B43_LPPHY_GAINDIRECTMISMATCH, 0xFF0F, 0x40);
88 b43_phy_maskset(dev, B43_LPPHY_PREAMBLECONFIRMTO, 0xFF00, 0x2);
89 b43_phy_mask(dev, B43_LPPHY_CRSGAIN_CTL, ~0x4000);
90 b43_phy_mask(dev, B43_LPPHY_CRSGAIN_CTL, ~0x2000);
91 b43_phy_set(dev, B43_PHY_OFDM(0x10A), 0x1);
92 b43_phy_maskset(dev, B43_LPPHY_CCKLMSSTEPSIZE, 0xFF01, 0x10);
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
95 b43_phy_write(dev, B43_LPPHY_CLIPTHRESH, 0x48);
96 b43_phy_maskset(dev, B43_LPPHY_HIGAINDB, 0xFF00, 0x46);
97 b43_phy_maskset(dev, B43_PHY_OFDM(0xE4), 0xFF00, 0x10);
98 b43_phy_maskset(dev, B43_LPPHY_PWR_THRESH1, 0xFFF0, 0x9);
99 b43_phy_mask(dev, B43_LPPHY_GAINDIRECTMISMATCH, ~0xF);
100 b43_phy_maskset(dev, B43_LPPHY_VERYLOWGAINDB, 0x00FF, 0x5500);
101 b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xF81F, 0xA0);
102 b43_phy_maskset(dev, B43_LPPHY_GAINDIRECTMISMATCH, 0xE0FF, 0x300);
103 b43_phy_maskset(dev, B43_LPPHY_HIGAINDB, 0x00FF, 0x2A00);
104 b43_phy_maskset(dev, B43_LPPHY_LOWGAINDB, 0x00FF, 0x1E00);
105 b43_phy_maskset(dev, B43_LPPHY_VERYLOWGAINDB, 0xFF00, 0xD);
106 b43_phy_maskset(dev, B43_PHY_OFDM(0xFE), 0xFFE0, 0x1F);
107 b43_phy_maskset(dev, B43_PHY_OFDM(0xFF), 0xFFE0, 0xC);
108 b43_phy_maskset(dev, B43_PHY_OFDM(0x100), 0xFF00, 0x19);
109 b43_phy_maskset(dev, B43_PHY_OFDM(0xFF), 0x03FF, 0x3C00);
110 b43_phy_maskset(dev, B43_PHY_OFDM(0xFE), 0xFC1F, 0x3E0);
111 b43_phy_maskset(dev, B43_PHY_OFDM(0xFF), 0xFFE0, 0xC);
112 b43_phy_maskset(dev, B43_PHY_OFDM(0x100), 0x00FF, 0x1900);
113 b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0x83FF, 0x5800);
114 b43_phy_maskset(dev, B43_LPPHY_CLIPCTRTHRESH, 0xFFE0, 0x12);
115 b43_phy_maskset(dev, B43_LPPHY_GAINMISMATCH, 0x0FFF, 0x9000);
116
117 if (dev->phy.rev < 2) {
118 //FIXME this will never execute.
119
120 //FIXME 32bit?
121 b43_lptab_write(dev, B43_LPTAB32(0x11, 0x14), 0);
122 b43_lptab_write(dev, B43_LPTAB32(0x08, 0x12), 0x40);
123 } else {
124 //FIXME 32bit?
125 b43_lptab_write(dev, B43_LPTAB32(0x08, 0x14), 0);
126 b43_lptab_write(dev, B43_LPTAB32(0x08, 0x12), 0x40);
127 }
128
129 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
130 b43_phy_set(dev, B43_LPPHY_CRSGAIN_CTL, 0x40);
131 b43_phy_maskset(dev, B43_LPPHY_CRSGAIN_CTL, 0xF0FF, 0xB00);
132 b43_phy_maskset(dev, B43_LPPHY_SYNCPEAKCNT, 0xFFF8, 0x6);
133 b43_phy_maskset(dev, B43_LPPHY_MINPWR_LEVEL, 0x00FF, 0x9D00);
134 b43_phy_maskset(dev, B43_LPPHY_MINPWR_LEVEL, 0xFF00, 0xA1);
135 } else /* 5GHz */
136 b43_phy_mask(dev, B43_LPPHY_CRSGAIN_CTL, ~0x40);
137
138 b43_phy_maskset(dev, B43_LPPHY_CRS_ED_THRESH, 0xFF00, 0xB3);
139 b43_phy_maskset(dev, B43_LPPHY_CRS_ED_THRESH, 0x00FF, 0xAD00);
140 b43_phy_maskset(dev, B43_LPPHY_INPUT_PWRDB, 0xFF00, lpphy->rx_pwr_offset);
141 b43_phy_set(dev, B43_LPPHY_RESET_CTL, 0x44);
142 b43_phy_write(dev, B43_LPPHY_RESET_CTL, 0x80);
143 b43_phy_write(dev, B43_LPPHY_AFE_RSSI_CTL_0, 0xA954);
144 b43_phy_write(dev, B43_LPPHY_AFE_RSSI_CTL_1,
145 0x2000 | ((u16)lpphy->rssi_gs << 10) |
146 ((u16)lpphy->rssi_vc << 4) | lpphy->rssi_vf);
73} 147}
74 148
75static void lpphy_baseband_init(struct b43_wldev *dev) 149static void lpphy_baseband_init(struct b43_wldev *dev)