| 803 | } |
| 804 | |
| 805 | static int |
| 806 | aw_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 | |
| 826 | static int |
| 827 | aw_mmc_init(struct aw_mmc_softc *sc) |
no test coverage detected