summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2016-05-15 22:10:25 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2016-05-15 22:10:25 +0000
commitbe215b460d1f2314222e4caee341ae86cccff417 (patch)
tree09d9bfa961b0c0b315388deb3f91373e15dd56f4 /sys
parentb0e71a8884959fcf318b90c631776227670cb515 (diff)
Map the ADMA2 descriptor table use BUS_DMA_COHERENT and add a missing
bus_dmamap_sync(9). Doesn't really fix anything, but adding the missing sync makes the code more correct. Using BUS_DMA_COHERENT avoids some cache flushes.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/armv7/imx/imxesdhc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/arch/armv7/imx/imxesdhc.c b/sys/arch/armv7/imx/imxesdhc.c
index 6c7cbefc2d2..4a7164f82e5 100644
--- a/sys/arch/armv7/imx/imxesdhc.c
+++ b/sys/arch/armv7/imx/imxesdhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imxesdhc.c,v 1.18 2016/05/08 20:22:03 kettenis Exp $ */
+/* $OpenBSD: imxesdhc.c,v 1.19 2016/05/15 22:10:24 kettenis Exp $ */
/*
* Copyright (c) 2009 Dale Rahn <drahn@openbsd.org>
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -362,7 +362,7 @@ imxesdhc_attach(struct device *parent, struct device *self, void *args)
if (error)
goto adma_done;
error = bus_dmamem_map(sc->sc_dmat, sc->adma_segs, rseg,
- PAGE_SIZE, &sc->adma2, BUS_DMA_WAITOK);
+ PAGE_SIZE, &sc->adma2, BUS_DMA_WAITOK | BUS_DMA_COHERENT);
if (error) {
bus_dmamem_free(sc->sc_dmat, sc->adma_segs, rseg);
goto adma_done;
@@ -976,6 +976,8 @@ imxesdhc_transfer_data(struct imxesdhc_softc *sc, struct sdmmc_command *cmd)
}
}
+ bus_dmamap_sync(sc->sc_dmat, sc->adma_map, 0, PAGE_SIZE,
+ BUS_DMASYNC_POSTWRITE);
goto done;
}