summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2017-12-24 12:55:53 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2017-12-24 12:55:53 +0000
commit5e12d26c40a9a0042f3a698e3dcac29f1dbdc1e9 (patch)
treed737164321fbe806fcfb319f9e0a934352fd74f4 /sys/dev
parent75a517b8ab31b919370b5794bf1be903b6b5c692 (diff)
Allow SD/MMC controller drivers to allocate their own DMA mapping structure
to account for any relevant hardware constraints. ok stsp@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sdmmc/sdmmc.c5
-rw-r--r--sys/dev/sdmmc/sdmmcchip.h3
2 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/sdmmc/sdmmc.c b/sys/dev/sdmmc/sdmmc.c
index 81c5a101454..863f4ee69f4 100644
--- a/sys/dev/sdmmc/sdmmc.c
+++ b/sys/dev/sdmmc/sdmmc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdmmc.c,v 1.47 2017/04/06 07:07:28 jsg Exp $ */
+/* $OpenBSD: sdmmc.c,v 1.48 2017/12/24 12:55:52 kettenis Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -115,11 +115,12 @@ sdmmc_attach(struct device *parent, struct device *self, void *aux)
sc->sct = saa->sct;
sc->sch = saa->sch;
sc->sc_dmat = saa->dmat;
+ sc->sc_dmap = saa->dmap;
sc->sc_flags = saa->flags;
sc->sc_caps = saa->caps;
sc->sc_max_xfer = saa->max_xfer;
- if (ISSET(sc->sc_caps, SMC_CAPS_DMA)) {
+ if (ISSET(sc->sc_caps, SMC_CAPS_DMA) && sc->sc_dmap == NULL) {
error = bus_dmamap_create(sc->sc_dmat, MAXPHYS, SDMMC_MAXNSEGS,
MAXPHYS, 0, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW, &sc->sc_dmap);
if (error) {
diff --git a/sys/dev/sdmmc/sdmmcchip.h b/sys/dev/sdmmc/sdmmcchip.h
index f2acb6a6925..464521602f7 100644
--- a/sys/dev/sdmmc/sdmmcchip.h
+++ b/sys/dev/sdmmc/sdmmcchip.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdmmcchip.h,v 1.9 2016/05/05 20:40:48 kettenis Exp $ */
+/* $OpenBSD: sdmmcchip.h,v 1.10 2017/12/24 12:55:52 kettenis Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -97,6 +97,7 @@ struct sdmmcbus_attach_args {
sdmmc_chipset_tag_t sct;
sdmmc_chipset_handle_t sch;
bus_dma_tag_t dmat;
+ bus_dmamap_t dmap;
int flags;
int caps;
long max_xfer;