summaryrefslogtreecommitdiff
path: root/sys/arch/armv7
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2016-09-10 16:00:19 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2016-09-10 16:00:19 +0000
commit71bd54cad75eb787b12dcb38e4e5211f4c3a0f4b (patch)
treef432c92af2f4657fad7e2aa64b232cb2f245adec /sys/arch/armv7
parentfb1b521588396cb2b40be69dbd227b2477d72371 (diff)
Moving the host reset after setting the clock in the attach path makes
the host reset succeed on the allwinner,sun5i-r8. ok kettenis
Diffstat (limited to 'sys/arch/armv7')
-rw-r--r--sys/arch/armv7/sunxi/sximmc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/arch/armv7/sunxi/sximmc.c b/sys/arch/armv7/sunxi/sximmc.c
index 6d888f50a9b..b8172282562 100644
--- a/sys/arch/armv7/sunxi/sximmc.c
+++ b/sys/arch/armv7/sunxi/sximmc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sximmc.c,v 1.7 2016/08/28 15:26:10 mglocker Exp $ */
+/* $OpenBSD: sximmc.c,v 1.8 2016/09/10 16:00:18 mglocker Exp $ */
/* $NetBSD: awin_mmc.c,v 1.23 2015/11/14 10:32:40 bouyer Exp $ */
/*-
@@ -419,9 +419,9 @@ sximmc_attach(struct device *parent, struct device *self, void *aux)
return;
}
- sximmc_host_reset(sc);
sximmc_bus_width(sc, 1);
sximmc_set_clock(sc, 400);
+ sximmc_host_reset(sc);
memset(&saa, 0, sizeof(saa));
saa.saa_busname = "sdmmc";
@@ -600,10 +600,6 @@ sximmc_host_reset(sdmmc_chipset_handle_t sch)
struct sximmc_softc *sc = sch;
int retry = 1000;
-#ifdef SXIMMC_DEBUG
- printf("%s: host reset\n", sc->sc_dev.dv_xname);
-#endif
-
#if 0
if (awin_chip_id() == AWIN_CHIP_ID_A80) {
if (sc->sc_mmc_port == 2 || sc->sc_mmc_port == 3) {
@@ -622,6 +618,12 @@ sximmc_host_reset(sdmmc_chipset_handle_t sch)
break;
delay(100);
}
+#ifdef SXIMMC_DEBUG
+ if (retry == 0)
+ printf("%s: host reset failed\n", sc->sc_dev.dv_xname);
+ else
+ printf("%s: host reset succeeded\n", sc->sc_dev.dv_xname);
+#endif
MMC_WRITE(sc, SXIMMC_TIMEOUT, 0xffffffff);