diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2016-09-11 10:22:17 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2016-09-11 10:22:17 +0000 |
commit | 766b210c6fd231399b8a5732d250190b377dd325 (patch) | |
tree | d79a8ceda94a840a3e84f7a347007de88ba84f9d /sys/dev | |
parent | 25aceb51b4781fedf4bee9a41c1df3f306d3bb7d (diff) |
Get SDIO reset working.
Tested and ok kettenis
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/sdmmc/sdmmc_io.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/sdmmc/sdmmc_io.c b/sys/dev/sdmmc/sdmmc_io.c index ec3a987f149..ac0f19897ec 100644 --- a/sys/dev/sdmmc/sdmmc_io.c +++ b/sys/dev/sdmmc/sdmmc_io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdmmc_io.c,v 1.26 2016/05/12 15:26:42 kettenis Exp $ */ +/* $OpenBSD: sdmmc_io.c,v 1.27 2016/09/11 10:22:16 mglocker Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -113,9 +113,6 @@ sdmmc_io_enable(struct sdmmc_softc *sc) return 1; } - /* Reset I/O functions (again). */ - sdmmc_io_reset(sc); - /* Send the new OCR value until all cards are ready. */ if (sdmmc_io_send_op_cond(sc, host_ocr, NULL) != 0) { printf("%s: can't send I/O OCR\n", DEVNAME(sc)); @@ -550,10 +547,13 @@ sdmmc_io_xchg(struct sdmmc_softc *sc, struct sdmmc_function *sf, void sdmmc_io_reset(struct sdmmc_softc *sc) { -#if 0 /* XXX command fails */ - (void)sdmmc_io_write(sc, NULL, SD_IO_REG_CCCR_CTL, CCCR_CTL_RES); - sdmmc_delay(100000); -#endif + u_int8_t data = CCCR_CTL_RES; + + rw_assert_wrlock(&sc->sc_lock); + + if (sdmmc_io_rw_direct(sc, NULL, SD_IO_CCCR_CTL, (u_char *)&data, + SD_ARG_CMD52_WRITE) == 0) + sdmmc_delay(100000); } /* |