diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-06-30 09:16:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-10 12:16:54 -0400 |
commit | c9d6afc91d65029fb43b1d237d0efc71fc9de49f (patch) | |
tree | e72b92e87776f748c0654cee38a0381626901959 /drivers | |
parent | 0d3b9dd1a3608eadbd2db157f44bbdd11cf63745 (diff) |
brcmsmac: add some workarounds for other chips again
This adds some workarounds for the BCM4716, BCM47162, BCM5357 to the
phy code again. This patch reverts parts of the following patch.
commit c2c724977f95135f397fe0cb45f3c041d26b91e1
Author: Arend van Spriel <arend@broadcom.com>
Date: Wed Jun 29 16:46:35 2011 -0700
staging: brcm80211: remove unsupported chipset code from brcmsmac phy
The BCM4716 is working for me with an other firmware and I am working
on adding support for the other chips.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c | 131 |
1 files changed, 89 insertions, 42 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c index 14da744e666..65db9b7458d 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c | |||
@@ -17893,6 +17893,8 @@ static u32 *wlc_phy_get_ipa_gaintbl_nphy(struct brcms_phy *pi) | |||
17893 | nphy_tpc_txgain_ipa_2g_2057rev7; | 17893 | nphy_tpc_txgain_ipa_2g_2057rev7; |
17894 | } else if (NREV_IS(pi->pubpi.phy_rev, 6)) { | 17894 | } else if (NREV_IS(pi->pubpi.phy_rev, 6)) { |
17895 | tx_pwrctrl_tbl = nphy_tpc_txgain_ipa_rev6; | 17895 | tx_pwrctrl_tbl = nphy_tpc_txgain_ipa_rev6; |
17896 | if (pi->sh->chip == BCMA_CHIP_ID_BCM47162) | ||
17897 | tx_pwrctrl_tbl = nphy_tpc_txgain_ipa_rev5; | ||
17896 | } else if (NREV_IS(pi->pubpi.phy_rev, 5)) { | 17898 | } else if (NREV_IS(pi->pubpi.phy_rev, 5)) { |
17897 | tx_pwrctrl_tbl = nphy_tpc_txgain_ipa_rev5; | 17899 | tx_pwrctrl_tbl = nphy_tpc_txgain_ipa_rev5; |
17898 | } else { | 17900 | } else { |
@@ -19254,8 +19256,14 @@ static void wlc_phy_spurwar_nphy(struct brcms_phy *pi) | |||
19254 | case 38: | 19256 | case 38: |
19255 | case 102: | 19257 | case 102: |
19256 | case 118: | 19258 | case 118: |
19257 | nphy_adj_tone_id_buf[0] = 0; | 19259 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM4716) && |
19258 | nphy_adj_noise_var_buf[0] = 0x0; | 19260 | (pi->sh->chippkg == BCMA_PKG_ID_BCM4717)) { |
19261 | nphy_adj_tone_id_buf[0] = 32; | ||
19262 | nphy_adj_noise_var_buf[0] = 0x21f; | ||
19263 | } else { | ||
19264 | nphy_adj_tone_id_buf[0] = 0; | ||
19265 | nphy_adj_noise_var_buf[0] = 0x0; | ||
19266 | } | ||
19259 | break; | 19267 | break; |
19260 | case 134: | 19268 | case 134: |
19261 | nphy_adj_tone_id_buf[0] = 32; | 19269 | nphy_adj_tone_id_buf[0] = 32; |
@@ -19318,6 +19326,10 @@ void wlc_phy_init_nphy(struct brcms_phy *pi) | |||
19318 | 0x40, 0x40); | 19326 | 0x40, 0x40); |
19319 | } | 19327 | } |
19320 | 19328 | ||
19329 | if ((!PHY_IPA(pi)) && (pi->sh->chip == BCMA_CHIP_ID_BCM5357)) | ||
19330 | si_pmu_chipcontrol(pi->sh->sih, 1, CCTRL5357_EXTPA, | ||
19331 | CCTRL5357_EXTPA); | ||
19332 | |||
19321 | if ((pi->nphy_gband_spurwar2_en) && CHSPEC_IS2G(pi->radio_chanspec) && | 19333 | if ((pi->nphy_gband_spurwar2_en) && CHSPEC_IS2G(pi->radio_chanspec) && |
19322 | CHSPEC_IS40(pi->radio_chanspec)) { | 19334 | CHSPEC_IS40(pi->radio_chanspec)) { |
19323 | 19335 | ||
@@ -20695,12 +20707,22 @@ wlc_phy_chanspec_radio2056_setup(struct brcms_phy *pi, | |||
20695 | write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER2 | | 20707 | write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER2 | |
20696 | RADIO_2056_SYN, 0x1f); | 20708 | RADIO_2056_SYN, 0x1f); |
20697 | 20709 | ||
20698 | write_radio_reg(pi, | 20710 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM4716) || |
20699 | RADIO_2056_SYN_PLL_LOOPFILTER4 | | 20711 | (pi->sh->chip == BCMA_CHIP_ID_BCM47162)) { |
20700 | RADIO_2056_SYN, 0xb); | 20712 | write_radio_reg(pi, |
20701 | write_radio_reg(pi, | 20713 | RADIO_2056_SYN_PLL_LOOPFILTER4 | |
20702 | RADIO_2056_SYN_PLL_CP2 | | 20714 | RADIO_2056_SYN, 0x14); |
20703 | RADIO_2056_SYN, 0x14); | 20715 | write_radio_reg(pi, |
20716 | RADIO_2056_SYN_PLL_CP2 | | ||
20717 | RADIO_2056_SYN, 0x00); | ||
20718 | } else { | ||
20719 | write_radio_reg(pi, | ||
20720 | RADIO_2056_SYN_PLL_LOOPFILTER4 | | ||
20721 | RADIO_2056_SYN, 0xb); | ||
20722 | write_radio_reg(pi, | ||
20723 | RADIO_2056_SYN_PLL_CP2 | | ||
20724 | RADIO_2056_SYN, 0x14); | ||
20725 | } | ||
20704 | } | 20726 | } |
20705 | } | 20727 | } |
20706 | 20728 | ||
@@ -20747,24 +20769,30 @@ wlc_phy_chanspec_radio2056_setup(struct brcms_phy *pi, | |||
20747 | WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, | 20769 | WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, |
20748 | PADG_IDAC, 0xcc); | 20770 | PADG_IDAC, 0xcc); |
20749 | 20771 | ||
20750 | bias = 0x25; | 20772 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM4716) || |
20751 | cascbias = 0x20; | 20773 | (pi->sh->chip == BCMA_CHIP_ID_BCM47162)) { |
20774 | bias = 0x40; | ||
20775 | cascbias = 0x45; | ||
20776 | pag_boost_tune = 0x5; | ||
20777 | pgag_boost_tune = 0x33; | ||
20778 | padg_boost_tune = 0x77; | ||
20779 | mixg_boost_tune = 0x55; | ||
20780 | } else { | ||
20781 | bias = 0x25; | ||
20782 | cascbias = 0x20; | ||
20752 | 20783 | ||
20753 | if ((pi->sh->chip == | 20784 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224 || |
20754 | BCMA_CHIP_ID_BCM43224) | 20785 | pi->sh->chip == BCMA_CHIP_ID_BCM43225) && |
20755 | || (pi->sh->chip == | 20786 | pi->sh->chippkg == BCMA_PKG_ID_BCM43224_FAB_SMIC) { |
20756 | BCMA_CHIP_ID_BCM43225)) { | ||
20757 | if (pi->sh->chippkg == | ||
20758 | BCMA_PKG_ID_BCM43224_FAB_SMIC) { | ||
20759 | bias = 0x2a; | 20787 | bias = 0x2a; |
20760 | cascbias = 0x38; | 20788 | cascbias = 0x38; |
20761 | } | 20789 | } |
20762 | } | ||
20763 | 20790 | ||
20764 | pag_boost_tune = 0x4; | 20791 | pag_boost_tune = 0x4; |
20765 | pgag_boost_tune = 0x03; | 20792 | pgag_boost_tune = 0x03; |
20766 | padg_boost_tune = 0x77; | 20793 | padg_boost_tune = 0x77; |
20767 | mixg_boost_tune = 0x65; | 20794 | mixg_boost_tune = 0x65; |
20795 | } | ||
20768 | 20796 | ||
20769 | WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, | 20797 | WRITE_RADIO_REG2(pi, RADIO_2056, TX, core, |
20770 | INTPAG_IMAIN_STAT, bias); | 20798 | INTPAG_IMAIN_STAT, bias); |
@@ -20863,11 +20891,10 @@ wlc_phy_chanspec_radio2056_setup(struct brcms_phy *pi, | |||
20863 | 20891 | ||
20864 | cascbias = 0x30; | 20892 | cascbias = 0x30; |
20865 | 20893 | ||
20866 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224) || | 20894 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224 || |
20867 | (pi->sh->chip == BCMA_CHIP_ID_BCM43225)) { | 20895 | pi->sh->chip == BCMA_CHIP_ID_BCM43225) && |
20868 | if (pi->sh->chippkg == BCMA_PKG_ID_BCM43224_FAB_SMIC) | 20896 | pi->sh->chippkg == BCMA_PKG_ID_BCM43224_FAB_SMIC) |
20869 | cascbias = 0x35; | 20897 | cascbias = 0x35; |
20870 | } | ||
20871 | 20898 | ||
20872 | pabias = (pi->phy_pabias == 0) ? 0x30 : pi->phy_pabias; | 20899 | pabias = (pi->phy_pabias == 0) ? 0x30 : pi->phy_pabias; |
20873 | 20900 | ||
@@ -21179,19 +21206,29 @@ wlc_phy_chanspec_nphy_setup(struct brcms_phy *pi, u16 chanspec, | |||
21179 | } else if (NREV_GE(pi->pubpi.phy_rev, 7)) { | 21206 | } else if (NREV_GE(pi->pubpi.phy_rev, 7)) { |
21180 | if (val == 54) | 21207 | if (val == 54) |
21181 | spuravoid = 1; | 21208 | spuravoid = 1; |
21182 | } else { | 21209 | } else if (pi->nphy_aband_spurwar_en && |
21183 | if (pi->nphy_aband_spurwar_en && | 21210 | ((val == 38) || (val == 102) || (val == 118))) { |
21184 | ((val == 38) || (val == 102) | 21211 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM4716) |
21185 | || (val == 118))) | 21212 | && (pi->sh->chippkg == BCMA_PKG_ID_BCM4717)) { |
21213 | spuravoid = 0; | ||
21214 | } else { | ||
21186 | spuravoid = 1; | 21215 | spuravoid = 1; |
21216 | } | ||
21187 | } | 21217 | } |
21188 | 21218 | ||
21189 | if (pi->phy_spuravoid == SPURAVOID_FORCEON) | 21219 | if (pi->phy_spuravoid == SPURAVOID_FORCEON) |
21190 | spuravoid = 1; | 21220 | spuravoid = 1; |
21191 | 21221 | ||
21192 | wlapi_bmac_core_phypll_ctl(pi->sh->physhim, false); | 21222 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM4716) || |
21193 | bcma_pmu_spuravoid_pllupdate(&sii->icbus->drv_cc, spuravoid); | 21223 | (pi->sh->chip == BCMA_CHIP_ID_BCM43225)) { |
21194 | wlapi_bmac_core_phypll_ctl(pi->sh->physhim, true); | 21224 | bcma_pmu_spuravoid_pllupdate(&sii->icbus->drv_cc, |
21225 | spuravoid); | ||
21226 | } else { | ||
21227 | wlapi_bmac_core_phypll_ctl(pi->sh->physhim, false); | ||
21228 | bcma_pmu_spuravoid_pllupdate(&sii->icbus->drv_cc, | ||
21229 | spuravoid); | ||
21230 | wlapi_bmac_core_phypll_ctl(pi->sh->physhim, true); | ||
21231 | } | ||
21195 | 21232 | ||
21196 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224) || | 21233 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224) || |
21197 | (pi->sh->chip == BCMA_CHIP_ID_BCM43225)) { | 21234 | (pi->sh->chip == BCMA_CHIP_ID_BCM43225)) { |
@@ -21210,7 +21247,9 @@ wlc_phy_chanspec_nphy_setup(struct brcms_phy *pi, u16 chanspec, | |||
21210 | } | 21247 | } |
21211 | } | 21248 | } |
21212 | 21249 | ||
21213 | wlapi_bmac_core_phypll_reset(pi->sh->physhim); | 21250 | if (!((pi->sh->chip == BCMA_CHIP_ID_BCM4716) || |
21251 | (pi->sh->chip == BCMA_CHIP_ID_BCM47162))) | ||
21252 | wlapi_bmac_core_phypll_reset(pi->sh->physhim); | ||
21214 | 21253 | ||
21215 | mod_phy_reg(pi, 0x01, (0x1 << 15), | 21254 | mod_phy_reg(pi, 0x01, (0x1 << 15), |
21216 | ((spuravoid > 0) ? (0x1 << 15) : 0)); | 21255 | ((spuravoid > 0) ? (0x1 << 15) : 0)); |
@@ -22172,9 +22211,15 @@ s16 wlc_phy_tempsense_nphy(struct brcms_phy *pi) | |||
22172 | wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x03, 16, | 22211 | wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x03, 16, |
22173 | &auxADC_rssi_ctrlH_save); | 22212 | &auxADC_rssi_ctrlH_save); |
22174 | 22213 | ||
22175 | radio_temp[0] = (179 * (radio_temp[1] + radio_temp2[1]) | 22214 | if (pi->sh->chip == BCMA_CHIP_ID_BCM5357) { |
22176 | + 82 * (auxADC_Vl) - 28861 + | 22215 | radio_temp[0] = (193 * (radio_temp[1] + radio_temp2[1]) |
22177 | 128) / 256; | 22216 | + 88 * (auxADC_Vl) - 27111 + |
22217 | 128) / 256; | ||
22218 | } else { | ||
22219 | radio_temp[0] = (179 * (radio_temp[1] + radio_temp2[1]) | ||
22220 | + 82 * (auxADC_Vl) - 28861 + | ||
22221 | 128) / 256; | ||
22222 | } | ||
22178 | 22223 | ||
22179 | offset = (s16) pi->phy_tempsense_offset; | 22224 | offset = (s16) pi->phy_tempsense_offset; |
22180 | 22225 | ||
@@ -24924,14 +24969,16 @@ wlc_phy_a2_nphy(struct brcms_phy *pi, struct nphy_ipa_txcalgains *txgains, | |||
24924 | if (txgains->useindex) { | 24969 | if (txgains->useindex) { |
24925 | phy_a4 = 15 - ((txgains->index) >> 3); | 24970 | phy_a4 = 15 - ((txgains->index) >> 3); |
24926 | if (CHSPEC_IS2G(pi->radio_chanspec)) { | 24971 | if (CHSPEC_IS2G(pi->radio_chanspec)) { |
24927 | if (NREV_GE(pi->pubpi.phy_rev, 6)) | 24972 | if (NREV_GE(pi->pubpi.phy_rev, 6) && |
24973 | pi->sh->chip == BCMA_CHIP_ID_BCM47162) { | ||
24974 | phy_a5 = 0x10f7 | (phy_a4 << 8); | ||
24975 | } else if (NREV_GE(pi->pubpi.phy_rev, 6)) { | ||
24928 | phy_a5 = 0x00f7 | (phy_a4 << 8); | 24976 | phy_a5 = 0x00f7 | (phy_a4 << 8); |
24929 | 24977 | } else if (NREV_IS(pi->pubpi.phy_rev, 5)) { | |
24930 | else | ||
24931 | if (NREV_IS(pi->pubpi.phy_rev, 5)) | ||
24932 | phy_a5 = 0x10f7 | (phy_a4 << 8); | 24978 | phy_a5 = 0x10f7 | (phy_a4 << 8); |
24933 | else | 24979 | } else { |
24934 | phy_a5 = 0x50f7 | (phy_a4 << 8); | 24980 | phy_a5 = 0x50f7 | (phy_a4 << 8); |
24981 | } | ||
24935 | } else { | 24982 | } else { |
24936 | phy_a5 = 0x70f7 | (phy_a4 << 8); | 24983 | phy_a5 = 0x70f7 | (phy_a4 << 8); |
24937 | } | 24984 | } |