diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-06-30 09:16:13 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-10 12:16:52 -0400 |
commit | 1ef1a57de7078edc2504d156be606249cc32c199 (patch) | |
tree | b48c953ec2da6c1931d7d1bacaff64abb7277a17 /drivers | |
parent | 780b9c4644616ff6f91a196ce95655effdd3a0ea (diff) |
brcmsmac: use chip and package id constants from bcma
This patch depends on addin the chip IDs to bcma done in this commit in
my pending patch series for bcma.
Author: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sun Jun 3 18:17:57 2012 +0200
bcma: add constants for chip ids
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/aiutils.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/main.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/pmu.c | 12 |
5 files changed, 27 insertions, 37 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h index 3a5358c5b055..89562c1fbf49 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h +++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h | |||
@@ -88,16 +88,6 @@ | |||
88 | #define CLKD_OTP 0x000f0000 | 88 | #define CLKD_OTP 0x000f0000 |
89 | #define CLKD_OTP_SHIFT 16 | 89 | #define CLKD_OTP_SHIFT 16 |
90 | 90 | ||
91 | /* Package IDs */ | ||
92 | #define BCM4717_PKG_ID 9 /* 4717 package id */ | ||
93 | #define BCM4718_PKG_ID 10 /* 4718 package id */ | ||
94 | #define BCM43224_FAB_SMIC 0xa /* the chip is manufactured by SMIC */ | ||
95 | |||
96 | /* these are router chips */ | ||
97 | #define BCM4716_CHIP_ID 0x4716 /* 4716 chipcommon chipid */ | ||
98 | #define BCM47162_CHIP_ID 47162 /* 47162 chipcommon chipid */ | ||
99 | #define BCM4748_CHIP_ID 0x4748 /* 4716 chipcommon chipid (OTP, RBBU) */ | ||
100 | |||
101 | /* dynamic clock control defines */ | 91 | /* dynamic clock control defines */ |
102 | #define LPOMINFREQ 25000 /* low power oscillator min */ | 92 | #define LPOMINFREQ 25000 /* low power oscillator min */ |
103 | #define LPOMAXFREQ 43000 /* low power oscillator max */ | 93 | #define LPOMAXFREQ 43000 /* low power oscillator max */ |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c index 8776fbc8dcf1..478b374b65e5 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c | |||
@@ -2126,8 +2126,8 @@ void brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode) | |||
2126 | { | 2126 | { |
2127 | struct bcma_device *core = wlc_hw->d11core; | 2127 | struct bcma_device *core = wlc_hw->d11core; |
2128 | 2128 | ||
2129 | if ((ai_get_chip_id(wlc_hw->sih) == BCM43224_CHIP_ID) || | 2129 | if ((ai_get_chip_id(wlc_hw->sih) == BCMA_CHIP_ID_BCM43224) || |
2130 | (ai_get_chip_id(wlc_hw->sih) == BCM43225_CHIP_ID)) { | 2130 | (ai_get_chip_id(wlc_hw->sih) == BCMA_CHIP_ID_BCM43225)) { |
2131 | if (spurmode == WL_SPURAVOID_ON2) { /* 126Mhz */ | 2131 | if (spurmode == WL_SPURAVOID_ON2) { /* 126Mhz */ |
2132 | bcma_write16(core, D11REGOFFS(tsf_clk_frac_l), 0x2082); | 2132 | bcma_write16(core, D11REGOFFS(tsf_clk_frac_l), 0x2082); |
2133 | bcma_write16(core, D11REGOFFS(tsf_clk_frac_h), 0x8); | 2133 | bcma_write16(core, D11REGOFFS(tsf_clk_frac_h), 0x8); |
@@ -2791,7 +2791,7 @@ void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on) | |||
2791 | tmp = 0; | 2791 | tmp = 0; |
2792 | 2792 | ||
2793 | if (on) { | 2793 | if (on) { |
2794 | if ((ai_get_chip_id(wlc_hw->sih) == BCM4313_CHIP_ID)) { | 2794 | if ((ai_get_chip_id(wlc_hw->sih) == BCMA_CHIP_ID_BCM4313)) { |
2795 | bcma_set32(core, D11REGOFFS(clk_ctl_st), | 2795 | bcma_set32(core, D11REGOFFS(clk_ctl_st), |
2796 | CCS_ERSRC_REQ_HT | | 2796 | CCS_ERSRC_REQ_HT | |
2797 | CCS_ERSRC_REQ_D11PLL | | 2797 | CCS_ERSRC_REQ_D11PLL | |
@@ -4528,7 +4528,7 @@ static int brcms_b_attach(struct brcms_c_info *wlc, struct bcma_device *core, | |||
4528 | else | 4528 | else |
4529 | wlc_hw->_nbands = 1; | 4529 | wlc_hw->_nbands = 1; |
4530 | 4530 | ||
4531 | if ((ai_get_chip_id(wlc_hw->sih) == BCM43225_CHIP_ID)) | 4531 | if ((ai_get_chip_id(wlc_hw->sih) == BCMA_CHIP_ID_BCM43225)) |
4532 | wlc_hw->_nbands = 1; | 4532 | wlc_hw->_nbands = 1; |
4533 | 4533 | ||
4534 | /* BMAC_NOTE: remove init of pub values when brcms_c_attach() | 4534 | /* BMAC_NOTE: remove init of pub values when brcms_c_attach() |
@@ -5036,7 +5036,7 @@ static void brcms_b_hw_up(struct brcms_hardware *wlc_hw) | |||
5036 | wlc_hw->wlc->pub->hw_up = true; | 5036 | wlc_hw->wlc->pub->hw_up = true; |
5037 | 5037 | ||
5038 | if ((wlc_hw->boardflags & BFL_FEM) | 5038 | if ((wlc_hw->boardflags & BFL_FEM) |
5039 | && (ai_get_chip_id(wlc_hw->sih) == BCM4313_CHIP_ID)) { | 5039 | && (ai_get_chip_id(wlc_hw->sih) == BCMA_CHIP_ID_BCM4313)) { |
5040 | if (! | 5040 | if (! |
5041 | (wlc_hw->boardrev >= 0x1250 | 5041 | (wlc_hw->boardrev >= 0x1250 |
5042 | && (wlc_hw->boardflags & BFL_FEM_BT))) | 5042 | && (wlc_hw->boardflags & BFL_FEM_BT))) |
@@ -5130,7 +5130,7 @@ int brcms_c_up(struct brcms_c_info *wlc) | |||
5130 | } | 5130 | } |
5131 | 5131 | ||
5132 | if ((wlc->pub->boardflags & BFL_FEM) | 5132 | if ((wlc->pub->boardflags & BFL_FEM) |
5133 | && (ai_get_chip_id(wlc->hw->sih) == BCM4313_CHIP_ID)) { | 5133 | && (ai_get_chip_id(wlc->hw->sih) == BCMA_CHIP_ID_BCM4313)) { |
5134 | if (wlc->pub->boardrev >= 0x1250 | 5134 | if (wlc->pub->boardrev >= 0x1250 |
5135 | && (wlc->pub->boardflags & BFL_FEM_BT)) | 5135 | && (wlc->pub->boardflags & BFL_FEM_BT)) |
5136 | brcms_b_mhf(wlc->hw, MHF5, MHF5_4313_GPIOCTRL, | 5136 | brcms_b_mhf(wlc->hw, MHF5, MHF5_4313_GPIOCTRL, |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c index 264f8c4c703d..d16cbecdfc6c 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c | |||
@@ -837,7 +837,7 @@ wlc_phy_table_addr(struct brcms_phy *pi, uint tbl_id, uint tbl_offset, | |||
837 | pi->tbl_data_hi = tblDataHi; | 837 | pi->tbl_data_hi = tblDataHi; |
838 | pi->tbl_data_lo = tblDataLo; | 838 | pi->tbl_data_lo = tblDataLo; |
839 | 839 | ||
840 | if (pi->sh->chip == BCM43224_CHIP_ID && | 840 | if (pi->sh->chip == BCMA_CHIP_ID_BCM43224 && |
841 | pi->sh->chiprev == 1) { | 841 | pi->sh->chiprev == 1) { |
842 | pi->tbl_addr = tblAddr; | 842 | pi->tbl_addr = tblAddr; |
843 | pi->tbl_save_id = tbl_id; | 843 | pi->tbl_save_id = tbl_id; |
@@ -847,7 +847,7 @@ wlc_phy_table_addr(struct brcms_phy *pi, uint tbl_id, uint tbl_offset, | |||
847 | 847 | ||
848 | void wlc_phy_table_data_write(struct brcms_phy *pi, uint width, u32 val) | 848 | void wlc_phy_table_data_write(struct brcms_phy *pi, uint width, u32 val) |
849 | { | 849 | { |
850 | if ((pi->sh->chip == BCM43224_CHIP_ID) && | 850 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224) && |
851 | (pi->sh->chiprev == 1) && | 851 | (pi->sh->chiprev == 1) && |
852 | (pi->tbl_save_id == NPHY_TBL_ID_ANTSWCTRLLUT)) { | 852 | (pi->tbl_save_id == NPHY_TBL_ID_ANTSWCTRLLUT)) { |
853 | read_phy_reg(pi, pi->tbl_data_lo); | 853 | read_phy_reg(pi, pi->tbl_data_lo); |
@@ -881,7 +881,7 @@ wlc_phy_write_table(struct brcms_phy *pi, const struct phytbl_info *ptbl_info, | |||
881 | 881 | ||
882 | for (idx = 0; idx < ptbl_info->tbl_len; idx++) { | 882 | for (idx = 0; idx < ptbl_info->tbl_len; idx++) { |
883 | 883 | ||
884 | if ((pi->sh->chip == BCM43224_CHIP_ID) && | 884 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224) && |
885 | (pi->sh->chiprev == 1) && | 885 | (pi->sh->chiprev == 1) && |
886 | (tbl_id == NPHY_TBL_ID_ANTSWCTRLLUT)) { | 886 | (tbl_id == NPHY_TBL_ID_ANTSWCTRLLUT)) { |
887 | read_phy_reg(pi, tblDataLo); | 887 | read_phy_reg(pi, tblDataLo); |
@@ -918,7 +918,7 @@ wlc_phy_read_table(struct brcms_phy *pi, const struct phytbl_info *ptbl_info, | |||
918 | 918 | ||
919 | for (idx = 0; idx < ptbl_info->tbl_len; idx++) { | 919 | for (idx = 0; idx < ptbl_info->tbl_len; idx++) { |
920 | 920 | ||
921 | if ((pi->sh->chip == BCM43224_CHIP_ID) && | 921 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224) && |
922 | (pi->sh->chiprev == 1)) { | 922 | (pi->sh->chiprev == 1)) { |
923 | (void)read_phy_reg(pi, tblDataLo); | 923 | (void)read_phy_reg(pi, tblDataLo); |
924 | 924 | ||
@@ -2894,7 +2894,7 @@ const u8 *wlc_phy_get_ofdm_rate_lookup(void) | |||
2894 | 2894 | ||
2895 | void wlc_lcnphy_epa_switch(struct brcms_phy *pi, bool mode) | 2895 | void wlc_lcnphy_epa_switch(struct brcms_phy *pi, bool mode) |
2896 | { | 2896 | { |
2897 | if ((pi->sh->chip == BCM4313_CHIP_ID) && | 2897 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM4313) && |
2898 | (pi->sh->boardflags & BFL_FEM)) { | 2898 | (pi->sh->boardflags & BFL_FEM)) { |
2899 | if (mode) { | 2899 | if (mode) { |
2900 | u16 txant = 0; | 2900 | u16 txant = 0; |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c index a4ae93ebe36e..14da744e666a 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c | |||
@@ -19309,8 +19309,8 @@ void wlc_phy_init_nphy(struct brcms_phy *pi) | |||
19309 | pi->measure_hold |= PHY_HOLD_FOR_NOT_ASSOC; | 19309 | pi->measure_hold |= PHY_HOLD_FOR_NOT_ASSOC; |
19310 | 19310 | ||
19311 | if ((ISNPHY(pi)) && (NREV_GE(pi->pubpi.phy_rev, 5)) && | 19311 | if ((ISNPHY(pi)) && (NREV_GE(pi->pubpi.phy_rev, 5)) && |
19312 | ((pi->sh->chippkg == BCM4717_PKG_ID) || | 19312 | ((pi->sh->chippkg == BCMA_PKG_ID_BCM4717) || |
19313 | (pi->sh->chippkg == BCM4718_PKG_ID))) { | 19313 | (pi->sh->chippkg == BCMA_PKG_ID_BCM4718))) { |
19314 | if ((pi->sh->boardflags & BFL_EXTLNA) && | 19314 | if ((pi->sh->boardflags & BFL_EXTLNA) && |
19315 | (CHSPEC_IS2G(pi->radio_chanspec))) | 19315 | (CHSPEC_IS2G(pi->radio_chanspec))) |
19316 | ai_cc_reg(pi->sh->sih, | 19316 | ai_cc_reg(pi->sh->sih, |
@@ -20751,11 +20751,11 @@ wlc_phy_chanspec_radio2056_setup(struct brcms_phy *pi, | |||
20751 | cascbias = 0x20; | 20751 | cascbias = 0x20; |
20752 | 20752 | ||
20753 | if ((pi->sh->chip == | 20753 | if ((pi->sh->chip == |
20754 | BCM43224_CHIP_ID) | 20754 | BCMA_CHIP_ID_BCM43224) |
20755 | || (pi->sh->chip == | 20755 | || (pi->sh->chip == |
20756 | BCM43225_CHIP_ID)) { | 20756 | BCMA_CHIP_ID_BCM43225)) { |
20757 | if (pi->sh->chippkg == | 20757 | if (pi->sh->chippkg == |
20758 | BCM43224_FAB_SMIC) { | 20758 | BCMA_PKG_ID_BCM43224_FAB_SMIC) { |
20759 | bias = 0x2a; | 20759 | bias = 0x2a; |
20760 | cascbias = 0x38; | 20760 | cascbias = 0x38; |
20761 | } | 20761 | } |
@@ -20863,9 +20863,9 @@ wlc_phy_chanspec_radio2056_setup(struct brcms_phy *pi, | |||
20863 | 20863 | ||
20864 | cascbias = 0x30; | 20864 | cascbias = 0x30; |
20865 | 20865 | ||
20866 | if ((pi->sh->chip == BCM43224_CHIP_ID) || | 20866 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224) || |
20867 | (pi->sh->chip == BCM43225_CHIP_ID)) { | 20867 | (pi->sh->chip == BCMA_CHIP_ID_BCM43225)) { |
20868 | if (pi->sh->chippkg == BCM43224_FAB_SMIC) | 20868 | if (pi->sh->chippkg == BCMA_PKG_ID_BCM43224_FAB_SMIC) |
20869 | cascbias = 0x35; | 20869 | cascbias = 0x35; |
20870 | } | 20870 | } |
20871 | 20871 | ||
@@ -21193,8 +21193,8 @@ wlc_phy_chanspec_nphy_setup(struct brcms_phy *pi, u16 chanspec, | |||
21193 | bcma_pmu_spuravoid_pllupdate(&sii->icbus->drv_cc, spuravoid); | 21193 | bcma_pmu_spuravoid_pllupdate(&sii->icbus->drv_cc, spuravoid); |
21194 | wlapi_bmac_core_phypll_ctl(pi->sh->physhim, true); | 21194 | wlapi_bmac_core_phypll_ctl(pi->sh->physhim, true); |
21195 | 21195 | ||
21196 | if ((pi->sh->chip == BCM43224_CHIP_ID) || | 21196 | if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224) || |
21197 | (pi->sh->chip == BCM43225_CHIP_ID)) { | 21197 | (pi->sh->chip == BCMA_CHIP_ID_BCM43225)) { |
21198 | if (spuravoid == 1) { | 21198 | if (spuravoid == 1) { |
21199 | bcma_write16(pi->d11core, | 21199 | bcma_write16(pi->d11core, |
21200 | D11REGOFFS(tsf_clk_frac_l), | 21200 | D11REGOFFS(tsf_clk_frac_l), |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/pmu.c b/drivers/net/wireless/brcm80211/brcmsmac/pmu.c index 6b4344f1d2e3..7e9df566c733 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/pmu.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/pmu.c | |||
@@ -103,9 +103,9 @@ u16 si_pmu_fast_pwrup_delay(struct si_pub *sih) | |||
103 | uint delay = PMU_MAX_TRANSITION_DLY; | 103 | uint delay = PMU_MAX_TRANSITION_DLY; |
104 | 104 | ||
105 | switch (ai_get_chip_id(sih)) { | 105 | switch (ai_get_chip_id(sih)) { |
106 | case BCM43224_CHIP_ID: | 106 | case BCMA_CHIP_ID_BCM43224: |
107 | case BCM43225_CHIP_ID: | 107 | case BCMA_CHIP_ID_BCM43225: |
108 | case BCM4313_CHIP_ID: | 108 | case BCMA_CHIP_ID_BCM4313: |
109 | delay = 3700; | 109 | delay = 3700; |
110 | break; | 110 | break; |
111 | default: | 111 | default: |
@@ -156,9 +156,9 @@ u32 si_pmu_alp_clock(struct si_pub *sih) | |||
156 | return clock; | 156 | return clock; |
157 | 157 | ||
158 | switch (ai_get_chip_id(sih)) { | 158 | switch (ai_get_chip_id(sih)) { |
159 | case BCM43224_CHIP_ID: | 159 | case BCMA_CHIP_ID_BCM43224: |
160 | case BCM43225_CHIP_ID: | 160 | case BCMA_CHIP_ID_BCM43225: |
161 | case BCM4313_CHIP_ID: | 161 | case BCMA_CHIP_ID_BCM4313: |
162 | /* always 20Mhz */ | 162 | /* always 20Mhz */ |
163 | clock = 20000 * 1000; | 163 | clock = 20000 * 1000; |
164 | break; | 164 | break; |