diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-04-28 20:04:13 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-05-16 12:45:22 -0400 |
commit | e2da4bd3ec7842fbef2bc7bffde3e1ad0c15f516 (patch) | |
tree | 05eeb21b157fa2b39fc0d66fc4fd2c30a9395ce6 /drivers/ssb | |
parent | 432c4d1eef64fc4c57faf713f361a96e58e66c72 (diff) |
bcma/ssb: parse new attributes from sprom
These newly added attributes are used by brcmsmac. Now bcma should
parse all attributes used by brcmsmac out of the sprom.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb')
-rw-r--r-- | drivers/ssb/pci.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c index 2cb604d142f4..e9d94968f394 100644 --- a/drivers/ssb/pci.c +++ b/drivers/ssb/pci.c | |||
@@ -178,6 +178,18 @@ err_pci: | |||
178 | #define SPEX(_outvar, _offset, _mask, _shift) \ | 178 | #define SPEX(_outvar, _offset, _mask, _shift) \ |
179 | SPEX16(_outvar, _offset, _mask, _shift) | 179 | SPEX16(_outvar, _offset, _mask, _shift) |
180 | 180 | ||
181 | #define SPEX_ARRAY8(_field, _offset, _mask, _shift) \ | ||
182 | do { \ | ||
183 | SPEX(_field[0], _offset + 0, _mask, _shift); \ | ||
184 | SPEX(_field[1], _offset + 2, _mask, _shift); \ | ||
185 | SPEX(_field[2], _offset + 4, _mask, _shift); \ | ||
186 | SPEX(_field[3], _offset + 6, _mask, _shift); \ | ||
187 | SPEX(_field[4], _offset + 8, _mask, _shift); \ | ||
188 | SPEX(_field[5], _offset + 10, _mask, _shift); \ | ||
189 | SPEX(_field[6], _offset + 12, _mask, _shift); \ | ||
190 | SPEX(_field[7], _offset + 14, _mask, _shift); \ | ||
191 | } while (0) | ||
192 | |||
181 | 193 | ||
182 | static inline u8 ssb_crc8(u8 crc, u8 data) | 194 | static inline u8 ssb_crc8(u8 crc, u8 data) |
183 | { | 195 | { |
@@ -663,6 +675,63 @@ static void sprom_extract_r8(struct ssb_sprom *out, const u16 *in) | |||
663 | SPEX(fem.ghz5.antswlut, SSB_SPROM8_FEM5G, | 675 | SPEX(fem.ghz5.antswlut, SSB_SPROM8_FEM5G, |
664 | SSB_SROM8_FEM_ANTSWLUT, SSB_SROM8_FEM_ANTSWLUT_SHIFT); | 676 | SSB_SROM8_FEM_ANTSWLUT, SSB_SROM8_FEM_ANTSWLUT_SHIFT); |
665 | 677 | ||
678 | SPEX(leddc_on_time, SSB_SPROM8_LEDDC, SSB_SPROM8_LEDDC_ON, | ||
679 | SSB_SPROM8_LEDDC_ON_SHIFT); | ||
680 | SPEX(leddc_off_time, SSB_SPROM8_LEDDC, SSB_SPROM8_LEDDC_OFF, | ||
681 | SSB_SPROM8_LEDDC_OFF_SHIFT); | ||
682 | |||
683 | SPEX(txchain, SSB_SPROM8_TXRXC, SSB_SPROM8_TXRXC_TXCHAIN, | ||
684 | SSB_SPROM8_TXRXC_TXCHAIN_SHIFT); | ||
685 | SPEX(rxchain, SSB_SPROM8_TXRXC, SSB_SPROM8_TXRXC_RXCHAIN, | ||
686 | SSB_SPROM8_TXRXC_RXCHAIN_SHIFT); | ||
687 | SPEX(antswitch, SSB_SPROM8_TXRXC, SSB_SPROM8_TXRXC_SWITCH, | ||
688 | SSB_SPROM8_TXRXC_SWITCH_SHIFT); | ||
689 | |||
690 | SPEX(opo, SSB_SPROM8_OFDM2GPO, 0x00ff, 0); | ||
691 | |||
692 | SPEX_ARRAY8(mcs2gpo, SSB_SPROM8_2G_MCSPO, ~0, 0); | ||
693 | SPEX_ARRAY8(mcs5gpo, SSB_SPROM8_5G_MCSPO, ~0, 0); | ||
694 | SPEX_ARRAY8(mcs5glpo, SSB_SPROM8_5GL_MCSPO, ~0, 0); | ||
695 | SPEX_ARRAY8(mcs5ghpo, SSB_SPROM8_5GH_MCSPO, ~0, 0); | ||
696 | |||
697 | SPEX(rawtempsense, SSB_SPROM8_RAWTS, SSB_SPROM8_RAWTS_RAWTEMP, | ||
698 | SSB_SPROM8_RAWTS_RAWTEMP_SHIFT); | ||
699 | SPEX(measpower, SSB_SPROM8_RAWTS, SSB_SPROM8_RAWTS_MEASPOWER, | ||
700 | SSB_SPROM8_RAWTS_MEASPOWER_SHIFT); | ||
701 | SPEX(tempsense_slope, SSB_SPROM8_OPT_CORRX, | ||
702 | SSB_SPROM8_OPT_CORRX_TEMP_SLOPE, | ||
703 | SSB_SPROM8_OPT_CORRX_TEMP_SLOPE_SHIFT); | ||
704 | SPEX(tempcorrx, SSB_SPROM8_OPT_CORRX, SSB_SPROM8_OPT_CORRX_TEMPCORRX, | ||
705 | SSB_SPROM8_OPT_CORRX_TEMPCORRX_SHIFT); | ||
706 | SPEX(tempsense_option, SSB_SPROM8_OPT_CORRX, | ||
707 | SSB_SPROM8_OPT_CORRX_TEMP_OPTION, | ||
708 | SSB_SPROM8_OPT_CORRX_TEMP_OPTION_SHIFT); | ||
709 | SPEX(freqoffset_corr, SSB_SPROM8_HWIQ_IQSWP, | ||
710 | SSB_SPROM8_HWIQ_IQSWP_FREQ_CORR, | ||
711 | SSB_SPROM8_HWIQ_IQSWP_FREQ_CORR_SHIFT); | ||
712 | SPEX(iqcal_swp_dis, SSB_SPROM8_HWIQ_IQSWP, | ||
713 | SSB_SPROM8_HWIQ_IQSWP_IQCAL_SWP, | ||
714 | SSB_SPROM8_HWIQ_IQSWP_IQCAL_SWP_SHIFT); | ||
715 | SPEX(hw_iqcal_en, SSB_SPROM8_HWIQ_IQSWP, SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL, | ||
716 | SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL_SHIFT); | ||
717 | |||
718 | SPEX(bw40po, SSB_SPROM8_BW40PO, ~0, 0); | ||
719 | SPEX(cddpo, SSB_SPROM8_CDDPO, ~0, 0); | ||
720 | SPEX(stbcpo, SSB_SPROM8_STBCPO, ~0, 0); | ||
721 | SPEX(bwduppo, SSB_SPROM8_BWDUPPO, ~0, 0); | ||
722 | |||
723 | SPEX(tempthresh, SSB_SPROM8_THERMAL, SSB_SPROM8_THERMAL_TRESH, | ||
724 | SSB_SPROM8_THERMAL_TRESH_SHIFT); | ||
725 | SPEX(tempoffset, SSB_SPROM8_THERMAL, SSB_SPROM8_THERMAL_OFFSET, | ||
726 | SSB_SPROM8_THERMAL_OFFSET_SHIFT); | ||
727 | SPEX(phycal_tempdelta, SSB_SPROM8_TEMPDELTA, | ||
728 | SSB_SPROM8_TEMPDELTA_PHYCAL, | ||
729 | SSB_SPROM8_TEMPDELTA_PHYCAL_SHIFT); | ||
730 | SPEX(temps_period, SSB_SPROM8_TEMPDELTA, SSB_SPROM8_TEMPDELTA_PERIOD, | ||
731 | SSB_SPROM8_TEMPDELTA_PERIOD_SHIFT); | ||
732 | SPEX(temps_hysteresis, SSB_SPROM8_TEMPDELTA, | ||
733 | SSB_SPROM8_TEMPDELTA_HYSTERESIS, | ||
734 | SSB_SPROM8_TEMPDELTA_HYSTERESIS_SHIFT); | ||
666 | sprom_extract_r458(out, in); | 735 | sprom_extract_r458(out, in); |
667 | 736 | ||
668 | /* TODO - get remaining rev 8 stuff needed */ | 737 | /* TODO - get remaining rev 8 stuff needed */ |