From: kettenis Date: Tue, 24 Jul 2018 15:45:52 +0000 (+0000) Subject: Add support fotr the BCM4335/4339 SDIO chip to bwfm(4). This one is a bit X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=529fc9df1014f9c3190a70853f7c949f7148d978;p=openbsd Add support fotr the BCM4335/4339 SDIO chip to bwfm(4). This one is a bit slow booting up, so give it a bit longer to enable the clock. ok patrick@ --- diff --git a/sys/dev/sdmmc/if_bwfm_sdio.c b/sys/dev/sdmmc/if_bwfm_sdio.c index b55957e4317..d1fcf88e455 100644 --- a/sys/dev/sdmmc/if_bwfm_sdio.c +++ b/sys/dev/sdmmc/if_bwfm_sdio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bwfm_sdio.c,v 1.23 2018/07/17 19:44:38 patrick Exp $ */ +/* $OpenBSD: if_bwfm_sdio.c,v 1.24 2018/07/24 15:45:52 kettenis Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt @@ -363,6 +363,19 @@ bwfm_sdio_preinit(struct bwfm_softc *bwfm) name = "brcmfmac43340-sdio.bin"; nvname = "brcmfmac43340-sdio.nvram"; break; + case BRCM_CC_4335_CHIP_ID: + if (bwfm->sc_chip.ch_chiprev < 2) { + name = "brcmfmac4335-sdio.bin"; + nvname = "brcmfmac4335-sdio.nvram"; + } else { + name = "brcmfmac4339-sdio.bin"; + nvname = "brcmfmac4339-sdio.nvram"; + } + break; + case BRCM_CC_4339_CHIP_ID: + name = "brcmfmac4339-sdio.bin"; + nvname = "brcmfmac4339-sdio.nvram"; + break; case BRCM_CC_43430_CHIP_ID: if (bwfm->sc_chip.ch_chiprev == 0) { name = "brcmfmac43430a0-sdio.bin"; @@ -586,7 +599,7 @@ bwfm_sdio_htclk(struct bwfm_sdio_softc *sc, int on, int pendok) bwfm_sdio_write_1(sc, BWFM_SDIO_DEVICE_CTL, devctl); } - for (i = 0; i < 1000; i++) { + for (i = 0; i < 5000; i++) { if (BWFM_SDIO_FUNC1_CHIPCLKCSR_CLKAV(clkctl, sc->sc_alp_only)) break; @@ -934,12 +947,7 @@ uint32_t bwfm_sdio_buscore_read(struct bwfm_softc *bwfm, uint32_t reg) { struct bwfm_sdio_softc *sc = (void *)bwfm; - uint32_t val; - - val = bwfm_sdio_read_4(sc, reg); - /* TODO: Workaround for 4335/4339 */ - - return val; + return bwfm_sdio_read_4(sc, reg); } void