MCPcopy Create free account
hub / github.com/F-Stack/f-stack / aw_mmc_reset

Function aw_mmc_reset

freebsd/arm/allwinner/aw_mmc.c:805–824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

803}
804
805static int
806aw_mmc_reset(struct aw_mmc_softc *sc)
807{
808 uint32_t reg;
809 int timeout;
810
811 reg = AW_MMC_READ_4(sc, AW_MMC_GCTL);
812 reg |= AW_MMC_GCTL_RESET;
813 AW_MMC_WRITE_4(sc, AW_MMC_GCTL, reg);
814 timeout = AW_MMC_RESET_RETRY;
815 while (--timeout > 0) {
816 if ((AW_MMC_READ_4(sc, AW_MMC_GCTL) & AW_MMC_GCTL_RESET) == 0)
817 break;
818 DELAY(100);
819 }
820 if (timeout == 0)
821 return (ETIMEDOUT);
822
823 return (0);
824}
825
826static int
827aw_mmc_init(struct aw_mmc_softc *sc)

Callers 3

aw_mmc_attachFunction · 0.85
aw_mmc_initFunction · 0.85
aw_mmc_update_iosFunction · 0.85

Calls 1

DELAYFunction · 0.50

Tested by

no test coverage detected