aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ssb
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ssb')
-rw-r--r--include/linux/ssb/ssb.h108
-rw-r--r--include/linux/ssb/ssb_driver_gige.h1
-rw-r--r--include/linux/ssb/ssb_regs.h34
3 files changed, 128 insertions, 15 deletions
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index dcf35b0f303a..d27683180025 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -16,6 +16,12 @@ struct pcmcia_device;
16struct ssb_bus; 16struct ssb_bus;
17struct ssb_driver; 17struct ssb_driver;
18 18
19struct ssb_sprom_core_pwr_info {
20 u8 itssi_2g, itssi_5g;
21 u8 maxpwr_2g, maxpwr_5gl, maxpwr_5g, maxpwr_5gh;
22 u16 pa_2g[4], pa_5gl[4], pa_5g[4], pa_5gh[4];
23};
24
19struct ssb_sprom { 25struct ssb_sprom {
20 u8 revision; 26 u8 revision;
21 u8 il0mac[6]; /* MAC address for 802.11b/g */ 27 u8 il0mac[6]; /* MAC address for 802.11b/g */
@@ -26,9 +32,12 @@ struct ssb_sprom {
26 u8 et0mdcport; /* MDIO for enet0 */ 32 u8 et0mdcport; /* MDIO for enet0 */
27 u8 et1mdcport; /* MDIO for enet1 */ 33 u8 et1mdcport; /* MDIO for enet1 */
28 u16 board_rev; /* Board revision number from SPROM. */ 34 u16 board_rev; /* Board revision number from SPROM. */
35 u16 board_num; /* Board number from SPROM. */
36 u16 board_type; /* Board type from SPROM. */
29 u8 country_code; /* Country Code */ 37 u8 country_code; /* Country Code */
30 u16 leddc_on_time; /* LED Powersave Duty Cycle On Count */ 38 char alpha2[2]; /* Country Code as two chars like EU or US */
31 u16 leddc_off_time; /* LED Powersave Duty Cycle Off Count */ 39 u8 leddc_on_time; /* LED Powersave Duty Cycle On Count */
40 u8 leddc_off_time; /* LED Powersave Duty Cycle Off Count */
32 u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */ 41 u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */
33 u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */ 42 u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */
34 u16 pa0b0; 43 u16 pa0b0;
@@ -47,10 +56,10 @@ struct ssb_sprom {
47 u8 gpio1; /* GPIO pin 1 */ 56 u8 gpio1; /* GPIO pin 1 */
48 u8 gpio2; /* GPIO pin 2 */ 57 u8 gpio2; /* GPIO pin 2 */
49 u8 gpio3; /* GPIO pin 3 */ 58 u8 gpio3; /* GPIO pin 3 */
50 u16 maxpwr_bg; /* 2.4GHz Amplifier Max Power (in dBm Q5.2) */ 59 u8 maxpwr_bg; /* 2.4GHz Amplifier Max Power (in dBm Q5.2) */
51 u16 maxpwr_al; /* 5.2GHz Amplifier Max Power (in dBm Q5.2) */ 60 u8 maxpwr_al; /* 5.2GHz Amplifier Max Power (in dBm Q5.2) */
52 u16 maxpwr_a; /* 5.3GHz Amplifier Max Power (in dBm Q5.2) */ 61 u8 maxpwr_a; /* 5.3GHz Amplifier Max Power (in dBm Q5.2) */
53 u16 maxpwr_ah; /* 5.8GHz Amplifier Max Power (in dBm Q5.2) */ 62 u8 maxpwr_ah; /* 5.8GHz Amplifier Max Power (in dBm Q5.2) */
54 u8 itssi_a; /* Idle TSSI Target for A-PHY */ 63 u8 itssi_a; /* Idle TSSI Target for A-PHY */
55 u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */ 64 u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */
56 u8 tri2g; /* 2.4GHz TX isolation */ 65 u8 tri2g; /* 2.4GHz TX isolation */
@@ -61,8 +70,8 @@ struct ssb_sprom {
61 u8 txpid5gl[4]; /* 4.9 - 5.1GHz TX power index */ 70 u8 txpid5gl[4]; /* 4.9 - 5.1GHz TX power index */
62 u8 txpid5g[4]; /* 5.1 - 5.5GHz TX power index */ 71 u8 txpid5g[4]; /* 5.1 - 5.5GHz TX power index */
63 u8 txpid5gh[4]; /* 5.5 - ...GHz TX power index */ 72 u8 txpid5gh[4]; /* 5.5 - ...GHz TX power index */
64 u8 rxpo2g; /* 2GHz RX power offset */ 73 s8 rxpo2g; /* 2GHz RX power offset */
65 u8 rxpo5g; /* 5GHz RX power offset */ 74 s8 rxpo5g; /* 5GHz RX power offset */
66 u8 rssisav2g; /* 2GHz RSSI params */ 75 u8 rssisav2g; /* 2GHz RSSI params */
67 u8 rssismc2g; 76 u8 rssismc2g;
68 u8 rssismf2g; 77 u8 rssismf2g;
@@ -82,16 +91,13 @@ struct ssb_sprom {
82 u16 boardflags2_hi; /* Board flags (bits 48-63) */ 91 u16 boardflags2_hi; /* Board flags (bits 48-63) */
83 /* TODO store board flags in a single u64 */ 92 /* TODO store board flags in a single u64 */
84 93
94 struct ssb_sprom_core_pwr_info core_pwr_info[4];
95
85 /* Antenna gain values for up to 4 antennas 96 /* Antenna gain values for up to 4 antennas
86 * on each band. Values in dBm/4 (Q5.2). Negative gain means the 97 * on each band. Values in dBm/4 (Q5.2). Negative gain means the
87 * loss in the connectors is bigger than the gain. */ 98 * loss in the connectors is bigger than the gain. */
88 struct { 99 struct {
89 struct { 100 s8 a0, a1, a2, a3;
90 s8 a0, a1, a2, a3;
91 } ghz24; /* 2.4GHz band */
92 struct {
93 s8 a0, a1, a2, a3;
94 } ghz5; /* 5GHz band */
95 } antenna_gain; 101 } antenna_gain;
96 102
97 struct { 103 struct {
@@ -103,7 +109,79 @@ struct ssb_sprom {
103 } ghz5; 109 } ghz5;
104 } fem; 110 } fem;
105 111
106 /* TODO - add any parameters needed from rev 2, 3, 4, 5 or 8 SPROMs */ 112 u16 mcs2gpo[8];
113 u16 mcs5gpo[8];
114 u16 mcs5glpo[8];
115 u16 mcs5ghpo[8];
116 u8 opo;
117
118 u8 rxgainerr2ga[3];
119 u8 rxgainerr5gla[3];
120 u8 rxgainerr5gma[3];
121 u8 rxgainerr5gha[3];
122 u8 rxgainerr5gua[3];
123
124 u8 noiselvl2ga[3];
125 u8 noiselvl5gla[3];
126 u8 noiselvl5gma[3];
127 u8 noiselvl5gha[3];
128 u8 noiselvl5gua[3];
129
130 u8 regrev;
131 u8 txchain;
132 u8 rxchain;
133 u8 antswitch;
134 u16 cddpo;
135 u16 stbcpo;
136 u16 bw40po;
137 u16 bwduppo;
138
139 u8 tempthresh;
140 u8 tempoffset;
141 u16 rawtempsense;
142 u8 measpower;
143 u8 tempsense_slope;
144 u8 tempcorrx;
145 u8 tempsense_option;
146 u8 freqoffset_corr;
147 u8 iqcal_swp_dis;
148 u8 hw_iqcal_en;
149 u8 elna2g;
150 u8 elna5g;
151 u8 phycal_tempdelta;
152 u8 temps_period;
153 u8 temps_hysteresis;
154 u8 measpower1;
155 u8 measpower2;
156 u8 pcieingress_war;
157
158 /* power per rate from sromrev 9 */
159 u16 cckbw202gpo;
160 u16 cckbw20ul2gpo;
161 u32 legofdmbw202gpo;
162 u32 legofdmbw20ul2gpo;
163 u32 legofdmbw205glpo;
164 u32 legofdmbw20ul5glpo;
165 u32 legofdmbw205gmpo;
166 u32 legofdmbw20ul5gmpo;
167 u32 legofdmbw205ghpo;
168 u32 legofdmbw20ul5ghpo;
169 u32 mcsbw202gpo;
170 u32 mcsbw20ul2gpo;
171 u32 mcsbw402gpo;
172 u32 mcsbw205glpo;
173 u32 mcsbw20ul5glpo;
174 u32 mcsbw405glpo;
175 u32 mcsbw205gmpo;
176 u32 mcsbw20ul5gmpo;
177 u32 mcsbw405gmpo;
178 u32 mcsbw205ghpo;
179 u32 mcsbw20ul5ghpo;
180 u32 mcsbw405ghpo;
181 u16 mcs32po;
182 u16 legofdm40duppo;
183 u8 sar2g;
184 u8 sar5g;
107}; 185};
108 186
109/* Information about the PCB the circuitry is soldered on. */ 187/* Information about the PCB the circuitry is soldered on. */
diff --git a/include/linux/ssb/ssb_driver_gige.h b/include/linux/ssb/ssb_driver_gige.h
index eba52a100533..6b05dcd927ff 100644
--- a/include/linux/ssb/ssb_driver_gige.h
+++ b/include/linux/ssb/ssb_driver_gige.h
@@ -2,6 +2,7 @@
2#define LINUX_SSB_DRIVER_GIGE_H_ 2#define LINUX_SSB_DRIVER_GIGE_H_
3 3
4#include <linux/ssb/ssb.h> 4#include <linux/ssb/ssb.h>
5#include <linux/bug.h>
5#include <linux/pci.h> 6#include <linux/pci.h>
6#include <linux/spinlock.h> 7#include <linux/spinlock.h>
7 8
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index c814ae6eeb22..40b1ef8595ee 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -449,6 +449,39 @@
449#define SSB_SPROM8_TS_SLP_OPT_CORRX 0x00B6 449#define SSB_SPROM8_TS_SLP_OPT_CORRX 0x00B6
450#define SSB_SPROM8_FOC_HWIQ_IQSWP 0x00B8 450#define SSB_SPROM8_FOC_HWIQ_IQSWP 0x00B8
451#define SSB_SPROM8_PHYCAL_TEMPDELTA 0x00BA 451#define SSB_SPROM8_PHYCAL_TEMPDELTA 0x00BA
452
453/* There are 4 blocks with power info sharing the same layout */
454#define SSB_SROM8_PWR_INFO_CORE0 0x00C0
455#define SSB_SROM8_PWR_INFO_CORE1 0x00E0
456#define SSB_SROM8_PWR_INFO_CORE2 0x0100
457#define SSB_SROM8_PWR_INFO_CORE3 0x0120
458
459#define SSB_SROM8_2G_MAXP_ITSSI 0x00
460#define SSB_SPROM8_2G_MAXP 0x00FF
461#define SSB_SPROM8_2G_ITSSI 0xFF00
462#define SSB_SPROM8_2G_ITSSI_SHIFT 8
463#define SSB_SROM8_2G_PA_0 0x02 /* 2GHz power amp settings */
464#define SSB_SROM8_2G_PA_1 0x04
465#define SSB_SROM8_2G_PA_2 0x06
466#define SSB_SROM8_5G_MAXP_ITSSI 0x08 /* 5GHz ITSSI and 5.3GHz Max Power */
467#define SSB_SPROM8_5G_MAXP 0x00FF
468#define SSB_SPROM8_5G_ITSSI 0xFF00
469#define SSB_SPROM8_5G_ITSSI_SHIFT 8
470#define SSB_SPROM8_5GHL_MAXP 0x0A /* 5.2GHz and 5.8GHz Max Power */
471#define SSB_SPROM8_5GH_MAXP 0x00FF
472#define SSB_SPROM8_5GL_MAXP 0xFF00
473#define SSB_SPROM8_5GL_MAXP_SHIFT 8
474#define SSB_SROM8_5G_PA_0 0x0C /* 5.3GHz power amp settings */
475#define SSB_SROM8_5G_PA_1 0x0E
476#define SSB_SROM8_5G_PA_2 0x10
477#define SSB_SROM8_5GL_PA_0 0x12 /* 5.2GHz power amp settings */
478#define SSB_SROM8_5GL_PA_1 0x14
479#define SSB_SROM8_5GL_PA_2 0x16
480#define SSB_SROM8_5GH_PA_0 0x18 /* 5.8GHz power amp settings */
481#define SSB_SROM8_5GH_PA_1 0x1A
482#define SSB_SROM8_5GH_PA_2 0x1C
483
484/* TODO: Make it deprecated */
452#define SSB_SPROM8_MAXP_BG 0x00C0 /* Max Power 2GHz in path 1 */ 485#define SSB_SPROM8_MAXP_BG 0x00C0 /* Max Power 2GHz in path 1 */
453#define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power 2GHz */ 486#define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power 2GHz */
454#define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ 487#define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */
@@ -473,6 +506,7 @@
473#define SSB_SPROM8_PA1HIB0 0x00D8 /* 5.8GHz power amp settings */ 506#define SSB_SPROM8_PA1HIB0 0x00D8 /* 5.8GHz power amp settings */
474#define SSB_SPROM8_PA1HIB1 0x00DA 507#define SSB_SPROM8_PA1HIB1 0x00DA
475#define SSB_SPROM8_PA1HIB2 0x00DC 508#define SSB_SPROM8_PA1HIB2 0x00DC
509
476#define SSB_SPROM8_CCK2GPO 0x0140 /* CCK power offset */ 510#define SSB_SPROM8_CCK2GPO 0x0140 /* CCK power offset */
477#define SSB_SPROM8_OFDM2GPO 0x0142 /* 2.4GHz OFDM power offset */ 511#define SSB_SPROM8_OFDM2GPO 0x0142 /* 2.4GHz OFDM power offset */
478#define SSB_SPROM8_OFDM5GPO 0x0146 /* 5.3GHz OFDM power offset */ 512#define SSB_SPROM8_OFDM5GPO 0x0146 /* 5.3GHz OFDM power offset */