diff options
author | andrew <andrew@FreeBSD.org> | 2016-09-21 09:50:50 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2016-09-21 09:50:50 +0000 |
commit | 02efc1a994a14b68875fa43e1d39deb33232b4c1 (patch) | |
tree | e88aee74636208aa2930d760c9ea1d36daeeda1f /sys/arm64 | |
parent | 36f7b8535d10884b8dd31f0e959b765ada1feb3c (diff) | |
download | FreeBSD-src-02efc1a994a14b68875fa43e1d39deb33232b4c1.zip FreeBSD-src-02efc1a994a14b68875fa43e1d39deb33232b4c1.tar.gz |
MFC 304799:
Map coherent memory in a non-coherent dma tag as uncached. This is similar
to what the 32-bit arm code does, with the exception that it always assumes
the tag is non-coherent.
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/arm64')
-rw-r--r-- | sys/arm64/arm64/busdma_bounce.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/arm64/arm64/busdma_bounce.c b/sys/arm64/arm64/busdma_bounce.c index 7039153..aff1e23 100644 --- a/sys/arm64/arm64/busdma_bounce.c +++ b/sys/arm64/arm64/busdma_bounce.c @@ -438,6 +438,13 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, mflags |= M_ZERO; if (flags & BUS_DMA_NOCACHE) attr = VM_MEMATTR_UNCACHEABLE; + else if ((flags & BUS_DMA_COHERENT) != 0 && + (dmat->bounce_flags & BF_COHERENT) == 0) + /* + * If we have a non-coherent tag, and are trying to allocate + * a coherent block of memory it needs to be uncached. + */ + attr = VM_MEMATTR_UNCACHEABLE; else attr = VM_MEMATTR_DEFAULT; |