summaryrefslogtreecommitdiff
path: root/sys/dev/sdmmc/sdhc.c
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2018-05-30 13:32:41 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2018-05-30 13:32:41 +0000
commit4d118bd7cc51f8f6e25bc6fb04a45e743eb414bb (patch)
treed884a96526e8d1630e69b56f920e77b96177aab6 /sys/dev/sdmmc/sdhc.c
parente008385c9dbbc2aded048fdbe8edbcafdf0d13d2 (diff)
Clear the DMA select bits in case we use PIO instead of DMA. Some
SDHC controllers get confused if the ADMA bit is set even though we don't set the DMA enable flag. This can happen with the SDIO stack which uses PIO for 4 byte read/writes but DMA for larger transfers and thus switches from one mode to the other. ok kettenis@
Diffstat (limited to 'sys/dev/sdmmc/sdhc.c')
-rw-r--r--sys/dev/sdmmc/sdhc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/sdmmc/sdhc.c b/sys/dev/sdmmc/sdhc.c
index b73368cb0c5..c2d149c8a90 100644
--- a/sys/dev/sdmmc/sdhc.c
+++ b/sys/dev/sdmmc/sdhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdhc.c,v 1.59 2018/05/25 00:04:12 patrick Exp $ */
+/* $OpenBSD: sdhc.c,v 1.60 2018/05/30 13:32:40 patrick Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -918,7 +918,8 @@ sdhc_start_command(struct sdhc_host *hp, struct sdmmc_command *cmd)
HWRITE4(hp, SDHC_ADMA_SYSTEM_ADDR,
hp->adma_map->dm_segs[0].ds_addr);
- }
+ } else
+ HCLR1(hp, SDHC_HOST_CTL, SDHC_DMA_SELECT);
DPRINTF(1,("%s: cmd=%#x mode=%#x blksize=%d blkcount=%d\n",
DEVNAME(hp->sc), command, mode, blksize, blkcount));