diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2012-01-02 02:41:25 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-24 14:06:04 -0500 |
commit | 507f9a71846a3d25d0e5322754da6b65adceda80 (patch) | |
tree | e8e816ec1cb7d3e7dcd9929404a780d8876cdb91 /drivers/bcma/sprom.c | |
parent | b35a9aca631ee0cf67cd23098ea9076ca33c3f7b (diff) |
bcma: SPROM: extract power info for cores
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma/sprom.c')
-rw-r--r-- | drivers/bcma/sprom.c | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/drivers/bcma/sprom.c b/drivers/bcma/sprom.c index 27f62cc2c8af..cb835f026d94 100644 --- a/drivers/bcma/sprom.c +++ b/drivers/bcma/sprom.c | |||
@@ -129,8 +129,14 @@ static int bcma_sprom_valid(const u16 *sprom) | |||
129 | 129 | ||
130 | static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom) | 130 | static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom) |
131 | { | 131 | { |
132 | u16 v; | 132 | u16 v, o; |
133 | int i; | 133 | int i; |
134 | u16 pwr_info_offset[] = { | ||
135 | SSB_SROM8_PWR_INFO_CORE0, SSB_SROM8_PWR_INFO_CORE1, | ||
136 | SSB_SROM8_PWR_INFO_CORE2, SSB_SROM8_PWR_INFO_CORE3 | ||
137 | }; | ||
138 | BUILD_BUG_ON(ARRAY_SIZE(pwr_info_offset) != | ||
139 | ARRAY_SIZE(bus->sprom.core_pwr_info)); | ||
134 | 140 | ||
135 | bus->sprom.revision = sprom[SSB_SPROMSIZE_WORDS_R4 - 1] & | 141 | bus->sprom.revision = sprom[SSB_SPROMSIZE_WORDS_R4 - 1] & |
136 | SSB_SPROM_REVISION_REV; | 142 | SSB_SPROM_REVISION_REV; |
@@ -185,6 +191,38 @@ static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom) | |||
185 | 191 | ||
186 | SPEX(country_code, SSB_SPROM8_CCODE, ~0, 0); | 192 | SPEX(country_code, SSB_SPROM8_CCODE, ~0, 0); |
187 | 193 | ||
194 | /* Extract cores power info info */ | ||
195 | for (i = 0; i < ARRAY_SIZE(pwr_info_offset); i++) { | ||
196 | o = pwr_info_offset[i]; | ||
197 | SPEX(core_pwr_info[i].itssi_2g, o + SSB_SROM8_2G_MAXP_ITSSI, | ||
198 | SSB_SPROM8_2G_ITSSI, SSB_SPROM8_2G_ITSSI_SHIFT); | ||
199 | SPEX(core_pwr_info[i].maxpwr_2g, o + SSB_SROM8_2G_MAXP_ITSSI, | ||
200 | SSB_SPROM8_2G_MAXP, 0); | ||
201 | |||
202 | SPEX(core_pwr_info[i].pa_2g[0], o + SSB_SROM8_2G_PA_0, ~0, 0); | ||
203 | SPEX(core_pwr_info[i].pa_2g[1], o + SSB_SROM8_2G_PA_1, ~0, 0); | ||
204 | SPEX(core_pwr_info[i].pa_2g[2], o + SSB_SROM8_2G_PA_2, ~0, 0); | ||
205 | |||
206 | SPEX(core_pwr_info[i].itssi_5g, o + SSB_SROM8_5G_MAXP_ITSSI, | ||
207 | SSB_SPROM8_5G_ITSSI, SSB_SPROM8_5G_ITSSI_SHIFT); | ||
208 | SPEX(core_pwr_info[i].maxpwr_5g, o + SSB_SROM8_5G_MAXP_ITSSI, | ||
209 | SSB_SPROM8_5G_MAXP, 0); | ||
210 | SPEX(core_pwr_info[i].maxpwr_5gh, o + SSB_SPROM8_5GHL_MAXP, | ||
211 | SSB_SPROM8_5GH_MAXP, 0); | ||
212 | SPEX(core_pwr_info[i].maxpwr_5gl, o + SSB_SPROM8_5GHL_MAXP, | ||
213 | SSB_SPROM8_5GL_MAXP, SSB_SPROM8_5GL_MAXP_SHIFT); | ||
214 | |||
215 | SPEX(core_pwr_info[i].pa_5gl[0], o + SSB_SROM8_5GL_PA_0, ~0, 0); | ||
216 | SPEX(core_pwr_info[i].pa_5gl[1], o + SSB_SROM8_5GL_PA_1, ~0, 0); | ||
217 | SPEX(core_pwr_info[i].pa_5gl[2], o + SSB_SROM8_5GL_PA_2, ~0, 0); | ||
218 | SPEX(core_pwr_info[i].pa_5g[0], o + SSB_SROM8_5G_PA_0, ~0, 0); | ||
219 | SPEX(core_pwr_info[i].pa_5g[1], o + SSB_SROM8_5G_PA_1, ~0, 0); | ||
220 | SPEX(core_pwr_info[i].pa_5g[2], o + SSB_SROM8_5G_PA_2, ~0, 0); | ||
221 | SPEX(core_pwr_info[i].pa_5gh[0], o + SSB_SROM8_5GH_PA_0, ~0, 0); | ||
222 | SPEX(core_pwr_info[i].pa_5gh[1], o + SSB_SROM8_5GH_PA_1, ~0, 0); | ||
223 | SPEX(core_pwr_info[i].pa_5gh[2], o + SSB_SROM8_5GH_PA_2, ~0, 0); | ||
224 | } | ||
225 | |||
188 | SPEX(fem.ghz2.tssipos, SSB_SPROM8_FEM2G, SSB_SROM8_FEM_TSSIPOS, | 226 | SPEX(fem.ghz2.tssipos, SSB_SPROM8_FEM2G, SSB_SROM8_FEM_TSSIPOS, |
189 | SSB_SROM8_FEM_TSSIPOS_SHIFT); | 227 | SSB_SROM8_FEM_TSSIPOS_SHIFT); |
190 | SPEX(fem.ghz2.extpa_gain, SSB_SPROM8_FEM2G, SSB_SROM8_FEM_EXTPA_GAIN, | 228 | SPEX(fem.ghz2.extpa_gain, SSB_SPROM8_FEM2G, SSB_SROM8_FEM_EXTPA_GAIN, |