diff options
author | 2018-12-29 11:37:54 +0000 | |
---|---|---|
committer | 2018-12-29 11:37:54 +0000 | |
commit | 39823558b3b2ccf2d621854ae8b03fac6a73f7e2 (patch) | |
tree | 8e1fbc8a439c34c2e1c12bc548dfc694bc7bded4 | |
parent | Allow passing the maximum size of a segment that a SD/MMC host (diff) | |
download | wireguard-openbsd-39823558b3b2ccf2d621854ae8b03fac6a73f7e2.tar.xz wireguard-openbsd-39823558b3b2ccf2d621854ae8b03fac6a73f7e2.zip |
The i.MX SD/MMC host controller does not support zero-length DMA
descriptors, which are used to encode 64k transfers since it's a
16-bit value in the descriptor, which means that we only support
a maximum segment size of 64k minus one. This fixes I/O errors
on i.MX machines.
ok kettenis@
-rw-r--r-- | sys/dev/fdt/imxesdhc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/fdt/imxesdhc.c b/sys/dev/fdt/imxesdhc.c index a7654abf253..54654802af9 100644 --- a/sys/dev/fdt/imxesdhc.c +++ b/sys/dev/fdt/imxesdhc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imxesdhc.c,v 1.10 2018/08/09 13:53:30 patrick Exp $ */ +/* $OpenBSD: imxesdhc.c,v 1.11 2018/12/29 11:37:54 patrick Exp $ */ /* * Copyright (c) 2009 Dale Rahn <drahn@openbsd.org> * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -435,9 +435,11 @@ imxesdhc_attach(struct device *parent, struct device *self, void *aux) saa.sct = &imxesdhc_functions; saa.sch = sc; saa.dmat = sc->sc_dmat; - if (ISSET(sc->flags, SHF_USE_DMA)) + if (ISSET(sc->flags, SHF_USE_DMA)) { saa.caps |= SMC_CAPS_DMA; - + saa.max_seg = 65535; + } + if (caps & SDHC_HOST_CTRL_CAP_HSS) saa.caps |= SMC_CAPS_MMC_HIGHSPEED | SMC_CAPS_SD_HIGHSPEED; |