Message ID | 1541476188-75475-7-git-send-email-chi-hsien.lin@cypress.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Kalle Valo |
Headers | show |
Series | chip related changes | expand |
On 11/6/2018 4:50 AM, Chi-Hsien Lin wrote: > From: Praveen Babu C <praveen.chandran@cypress.com> > > Add saverestore register settings for 43012. I would collapse this commit with PATCH 04/11. Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com> > Signed-off-by: Praveen Babu C <praveen.chandran@cypress.com> > Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com> > --- > .../wireless/broadcom/brcm80211/brcmfmac/chip.c | 5 +++++ > .../wireless/broadcom/brcm80211/brcmfmac/sdio.c | 22 +++++++++++++++++----- > 2 files changed, 22 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > index 299f59f58d8c..a32eb5f868b5 100644 > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c > @@ -3354,16 +3354,29 @@ static void brcmf_sdio_sr_init(struct brcmf_sdio *bus) > { > int err = 0; > u8 val; > + u8 wakeupctrl; > + u8 cardcap; > + u8 chipclkcsr; > > brcmf_dbg(TRACE, "Enter\n"); > > + if (bus->ci->chip == CY_CC_43012_CHIP_ID) { Use brcmf_chip_is_ulp() here as well (see PATCH 04/11). hmmm..wait. This is actually disabling the command decode for 43012, which is claimed to be done in PATCH 09/11. So maybe another helper would be more appropriate here, eg. brcmf_sdio_aos_no_decode(bus). > + wakeupctrl = SBSDIO_FUNC1_WCTRL_ALPWAIT_SHIFT; > + cardcap = SDIO_CCCR_BRCM_CARDCAP_CMD_NODEC; > + chipclkcsr = SBSDIO_HT_AVAIL_REQ; > + } else { > + wakeupctrl = SBSDIO_FUNC1_WCTRL_HTWAIT_SHIFT; > + cardcap = (SDIO_CCCR_BRCM_CARDCAP_CMD14_SUPPORT | > + SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT); > + chipclkcsr = SBSDIO_FORCE_HT; > + } > +
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c index 7d5005d75e01..a8d3b96b727f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c @@ -1365,6 +1365,11 @@ bool brcmf_chip_sr_capable(struct brcmf_chip *pub) addr = CORE_CC_REG(base, sr_control1); reg = chip->ops->read32(chip->ctx, addr); return reg != 0; + case CY_CC_43012_CHIP_ID: + addr = CORE_CC_REG(pmu->base, retention_ctl); + reg = chip->ops->read32(chip->ctx, addr); + return (reg & (PMU_RCTL_MACPHY_DISABLE_MASK | + PMU_RCTL_LOGIC_DISABLE_MASK)) == 0; default: addr = CORE_CC_REG(pmu->base, pmucapabilities_ext); reg = chip->ops->read32(chip->ctx, addr); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 299f59f58d8c..a32eb5f868b5 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -3354,16 +3354,29 @@ static void brcmf_sdio_sr_init(struct brcmf_sdio *bus) { int err = 0; u8 val; + u8 wakeupctrl; + u8 cardcap; + u8 chipclkcsr; brcmf_dbg(TRACE, "Enter\n"); + if (bus->ci->chip == CY_CC_43012_CHIP_ID) { + wakeupctrl = SBSDIO_FUNC1_WCTRL_ALPWAIT_SHIFT; + cardcap = SDIO_CCCR_BRCM_CARDCAP_CMD_NODEC; + chipclkcsr = SBSDIO_HT_AVAIL_REQ; + } else { + wakeupctrl = SBSDIO_FUNC1_WCTRL_HTWAIT_SHIFT; + cardcap = (SDIO_CCCR_BRCM_CARDCAP_CMD14_SUPPORT | + SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT); + chipclkcsr = SBSDIO_FORCE_HT; + } + val = brcmf_sdiod_readb(bus->sdiodev, SBSDIO_FUNC1_WAKEUPCTRL, &err); if (err) { brcmf_err("error reading SBSDIO_FUNC1_WAKEUPCTRL\n"); return; } - - val |= 1 << SBSDIO_FUNC1_WCTRL_HTWAIT_SHIFT; + val |= 1 << wakeupctrl; brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_WAKEUPCTRL, val, &err); if (err) { brcmf_err("error writing SBSDIO_FUNC1_WAKEUPCTRL\n"); @@ -3372,8 +3385,7 @@ static void brcmf_sdio_sr_init(struct brcmf_sdio *bus) /* Add CMD14 Support */ brcmf_sdiod_func0_wb(bus->sdiodev, SDIO_CCCR_BRCM_CARDCAP, - (SDIO_CCCR_BRCM_CARDCAP_CMD14_SUPPORT | - SDIO_CCCR_BRCM_CARDCAP_CMD14_EXT), + cardcap, &err); if (err) { brcmf_err("error writing SDIO_CCCR_BRCM_CARDCAP\n"); @@ -3381,7 +3393,7 @@ static void brcmf_sdio_sr_init(struct brcmf_sdio *bus) } brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, - SBSDIO_FORCE_HT, &err); + chipclkcsr, &err); if (err) { brcmf_err("error writing SBSDIO_FUNC1_CHIPCLKCSR\n"); return;