Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc36e64a authored by Laura Abbott's avatar Laura Abbott Committed by Patrick Daly
Browse files

common: DMA-mapping: Add strongly ordered memory attribute



Strongly ordered memory is occasionally needed for some DMA
allocations for specialized use cases. Add the corresponding
DMA attribute.

Change-Id: Idd9e756c242ef57d6fa6700e51cc38d0863b760d
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent 0727443a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -126,3 +126,12 @@ means that we won't try quite as hard to get them.

NOTE: At the moment DMA_ATTR_ALLOC_SINGLE_PAGES is only implemented on ARM,
though ARM64 patches will likely be posted soon.

DMA_ATTR_STRONGLY_ORDERED
-------------------------

DMA_ATTR_STRONGLY_ORDERED allocates memory with a very restrictive type
of mapping (no unaligned accesses, no re-ordering, no write merging, no
buffering, no pre-fetching). This has severe performance penalties and
should not be used for general purpose DMA allocations. It should only
be used if one of the restrictions on strongly ordered memory is required.
+6 −0
Original line number Diff line number Diff line
@@ -56,6 +56,12 @@
 * that gives better TLB efficiency.
 */
#define DMA_ATTR_ALLOC_SINGLE_PAGES	(1UL << 7)
/*
 * DMA_ATTR_STRONGLY_ORDERED: Specifies that accesses to the mapping must
 * not be buffered, reordered, merged with other accesses, or unaligned.
 * No speculative access may occur in this mapping.
 */
#define DMA_ATTR_STRONGLY_ORDERED	(1UL << 8)

/*
 * A dma_addr_t can hold any valid DMA or bus address for the platform.