提交 d43c1c52 编写于 作者: H Hauke Mehrtens 提交者: John W. Linville

brcmsmac: remove support for cc rev < 20

The lowest chip common version used on bcma based devices is 31 on the
bcm4718 and 32 on the bcm4313, bcm43224, and bcm43225, so the support
for the old versions could be removed.
Signed-off-by: NHauke Mehrtens <hauke@hauke-m.de>
Tested-by: NArend van Spriel <arend@broadcom.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 1928ad71
...@@ -491,8 +491,7 @@ ai_buscore_setup(struct si_info *sii, struct bcma_device *cc) ...@@ -491,8 +491,7 @@ ai_buscore_setup(struct si_info *sii, struct bcma_device *cc)
sii->pub.ccrev = cc->id.rev; sii->pub.ccrev = cc->id.rev;
/* get chipcommon chipstatus */ /* get chipcommon chipstatus */
if (ai_get_ccrev(&sii->pub) >= 11) sii->chipst = bcma_read32(cc, CHIPCREGOFFS(chipstatus));
sii->chipst = bcma_read32(cc, CHIPCREGOFFS(chipstatus));
/* get chipcommon capabilites */ /* get chipcommon capabilites */
sii->pub.cccaps = bcma_read32(cc, CHIPCREGOFFS(capabilities)); sii->pub.cccaps = bcma_read32(cc, CHIPCREGOFFS(capabilities));
...@@ -721,21 +720,7 @@ uint ai_cc_reg(struct si_pub *sih, uint regoff, u32 mask, u32 val) ...@@ -721,21 +720,7 @@ uint ai_cc_reg(struct si_pub *sih, uint regoff, u32 mask, u32 val)
/* return the slow clock source - LPO, XTAL, or PCI */ /* return the slow clock source - LPO, XTAL, or PCI */
static uint ai_slowclk_src(struct si_pub *sih, struct bcma_device *cc) static uint ai_slowclk_src(struct si_pub *sih, struct bcma_device *cc)
{ {
struct si_info *sii; return SCC_SS_XTAL;
u32 val;
sii = (struct si_info *)sih;
if (ai_get_ccrev(&sii->pub) < 6) {
pci_read_config_dword(sii->pcibus, PCI_GPIO_OUT,
&val);
if (val & PCI_CFG_GPIO_SCS)
return SCC_SS_PCI;
return SCC_SS_XTAL;
} else if (ai_get_ccrev(&sii->pub) < 10) {
return bcma_read32(cc, CHIPCREGOFFS(slow_clk_ctl)) &
SCC_SS_MASK;
} else /* Insta-clock */
return SCC_SS_XTAL;
} }
/* /*
...@@ -745,36 +730,12 @@ static uint ai_slowclk_src(struct si_pub *sih, struct bcma_device *cc) ...@@ -745,36 +730,12 @@ static uint ai_slowclk_src(struct si_pub *sih, struct bcma_device *cc)
static uint ai_slowclk_freq(struct si_pub *sih, bool max_freq, static uint ai_slowclk_freq(struct si_pub *sih, bool max_freq,
struct bcma_device *cc) struct bcma_device *cc)
{ {
u32 slowclk;
uint div; uint div;
slowclk = ai_slowclk_src(sih, cc); /* Chipc rev 10 is InstaClock */
if (ai_get_ccrev(sih) < 6) { div = bcma_read32(cc, CHIPCREGOFFS(system_clk_ctl));
if (slowclk == SCC_SS_PCI) div = 4 * ((div >> SYCC_CD_SHIFT) + 1);
return max_freq ? (PCIMAXFREQ / 64) return max_freq ? XTALMAXFREQ : (XTALMINFREQ / div);
: (PCIMINFREQ / 64);
else
return max_freq ? (XTALMAXFREQ / 32)
: (XTALMINFREQ / 32);
} else if (ai_get_ccrev(sih) < 10) {
div = 4 *
(((bcma_read32(cc, CHIPCREGOFFS(slow_clk_ctl)) &
SCC_CD_MASK) >> SCC_CD_SHIFT) + 1);
if (slowclk == SCC_SS_LPO)
return max_freq ? LPOMAXFREQ : LPOMINFREQ;
else if (slowclk == SCC_SS_XTAL)
return max_freq ? (XTALMAXFREQ / div)
: (XTALMINFREQ / div);
else if (slowclk == SCC_SS_PCI)
return max_freq ? (PCIMAXFREQ / div)
: (PCIMINFREQ / div);
} else {
/* Chipc rev 10 is InstaClock */
div = bcma_read32(cc, CHIPCREGOFFS(system_clk_ctl));
div = 4 * ((div >> SYCC_CD_SHIFT) + 1);
return max_freq ? XTALMAXFREQ : (XTALMINFREQ / div);
}
return 0;
} }
static void static void
...@@ -797,8 +758,7 @@ ai_clkctl_setdelay(struct si_pub *sih, struct bcma_device *cc) ...@@ -797,8 +758,7 @@ ai_clkctl_setdelay(struct si_pub *sih, struct bcma_device *cc)
/* Starting with 4318 it is ILP that is used for the delays */ /* Starting with 4318 it is ILP that is used for the delays */
slowmaxfreq = slowmaxfreq =
ai_slowclk_freq(sih, ai_slowclk_freq(sih, false, cc);
(ai_get_ccrev(sih) >= 10) ? false : true, cc);
pll_on_delay = ((slowmaxfreq * pll_delay) + 999999) / 1000000; pll_on_delay = ((slowmaxfreq * pll_delay) + 999999) / 1000000;
fref_sel_delay = ((slowmaxfreq * FREF_DELAY) + 999999) / 1000000; fref_sel_delay = ((slowmaxfreq * FREF_DELAY) + 999999) / 1000000;
...@@ -820,9 +780,8 @@ void ai_clkctl_init(struct si_pub *sih) ...@@ -820,9 +780,8 @@ void ai_clkctl_init(struct si_pub *sih)
return; return;
/* set all Instaclk chip ILP to 1 MHz */ /* set all Instaclk chip ILP to 1 MHz */
if (ai_get_ccrev(sih) >= 10) bcma_maskset32(cc, CHIPCREGOFFS(system_clk_ctl), SYCC_CD_MASK,
bcma_maskset32(cc, CHIPCREGOFFS(system_clk_ctl), SYCC_CD_MASK, (ILP_DIV_1MHZ << SYCC_CD_SHIFT));
(ILP_DIV_1MHZ << SYCC_CD_SHIFT));
ai_clkctl_setdelay(sih, cc); ai_clkctl_setdelay(sih, cc);
} }
...@@ -926,31 +885,11 @@ static bool _ai_clkctl_cc(struct si_info *sii, uint mode) ...@@ -926,31 +885,11 @@ static bool _ai_clkctl_cc(struct si_info *sii, uint mode)
struct bcma_device *cc; struct bcma_device *cc;
u32 scc; u32 scc;
/* chipcommon cores prior to rev6 don't support dynamic clock control */
if (ai_get_ccrev(&sii->pub) < 6)
return false;
cc = ai_findcore(&sii->pub, BCMA_CORE_CHIPCOMMON, 0); cc = ai_findcore(&sii->pub, BCMA_CORE_CHIPCOMMON, 0);
if (!(ai_get_cccaps(&sii->pub) & CC_CAP_PWR_CTL) &&
(ai_get_ccrev(&sii->pub) < 20))
return mode == CLK_FAST;
switch (mode) { switch (mode) {
case CLK_FAST: /* FORCEHT, fast (pll) clock */ case CLK_FAST: /* FORCEHT, fast (pll) clock */
if (ai_get_ccrev(&sii->pub) < 10) { bcma_set32(cc, CHIPCREGOFFS(clk_ctl_st), CCS_FORCEHT);
/*
* don't forget to force xtal back
* on before we clear SCC_DYN_XTAL..
*/
ai_clkctl_xtal(&sii->pub, XTAL, ON);
bcma_maskset32(cc, CHIPCREGOFFS(slow_clk_ctl),
(SCC_XC | SCC_FS | SCC_IP), SCC_IP);
} else if (ai_get_ccrev(&sii->pub) < 20) {
bcma_set32(cc, CHIPCREGOFFS(system_clk_ctl), SYCC_HR);
} else {
bcma_set32(cc, CHIPCREGOFFS(clk_ctl_st), CCS_FORCEHT);
}
/* wait for the PLL */ /* wait for the PLL */
if (ai_get_cccaps(&sii->pub) & CC_CAP_PMU) { if (ai_get_cccaps(&sii->pub) & CC_CAP_PMU) {
...@@ -963,25 +902,7 @@ static bool _ai_clkctl_cc(struct si_info *sii, uint mode) ...@@ -963,25 +902,7 @@ static bool _ai_clkctl_cc(struct si_info *sii, uint mode)
break; break;
case CLK_DYNAMIC: /* enable dynamic clock control */ case CLK_DYNAMIC: /* enable dynamic clock control */
if (ai_get_ccrev(&sii->pub) < 10) { bcma_mask32(cc, CHIPCREGOFFS(clk_ctl_st), ~CCS_FORCEHT);
scc = bcma_read32(cc, CHIPCREGOFFS(slow_clk_ctl));
scc &= ~(SCC_FS | SCC_IP | SCC_XC);
if ((scc & SCC_SS_MASK) != SCC_SS_XTAL)
scc |= SCC_XC;
bcma_write32(cc, CHIPCREGOFFS(slow_clk_ctl), scc);
/*
* for dynamic control, we have to
* release our xtal_pu "force on"
*/
if (scc & SCC_XC)
ai_clkctl_xtal(&sii->pub, XTAL, OFF);
} else if (ai_get_ccrev(&sii->pub) < 20) {
/* Instaclock */
bcma_mask32(cc, CHIPCREGOFFS(system_clk_ctl), ~SYCC_HR);
} else {
bcma_mask32(cc, CHIPCREGOFFS(clk_ctl_st), ~CCS_FORCEHT);
}
break; break;
default: default:
...@@ -1005,10 +926,6 @@ bool ai_clkctl_cc(struct si_pub *sih, uint mode) ...@@ -1005,10 +926,6 @@ bool ai_clkctl_cc(struct si_pub *sih, uint mode)
sii = (struct si_info *)sih; sii = (struct si_info *)sih;
/* chipcommon cores prior to rev6 don't support dynamic clock control */
if (ai_get_ccrev(sih) < 6)
return false;
if (PCI_FORCEHT(sih)) if (PCI_FORCEHT(sih))
return mode == CLK_FAST; return mode == CLK_FAST;
......
...@@ -217,11 +217,6 @@ extern void ai_epa_4313war(struct si_pub *sih); ...@@ -217,11 +217,6 @@ extern void ai_epa_4313war(struct si_pub *sih);
extern uint ai_get_buscoretype(struct si_pub *sih); extern uint ai_get_buscoretype(struct si_pub *sih);
extern uint ai_get_buscorerev(struct si_pub *sih); extern uint ai_get_buscorerev(struct si_pub *sih);
static inline int ai_get_ccrev(struct si_pub *sih)
{
return sih->ccrev;
}
static inline u32 ai_get_cccaps(struct si_pub *sih) static inline u32 ai_get_cccaps(struct si_pub *sih)
{ {
return sih->cccaps; return sih->cccaps;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册