[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200925141218.13550-2-m.szyprowski@samsung.com>
Date: Fri, 25 Sep 2020 16:12:11 +0200
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: Linux IOMMU <iommu@...ts.linux-foundation.org>,
linux-media@...r.kernel.org, linux-samsung-soc@...r.kernel.org
Cc: Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>,
Joerg Roedel <joro@...tes.org>, Christoph Hellwig <hch@....de>,
Sylwester Nawrocki <snawrocki@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Tomasz Figa <tfiga@...omium.org>, linux-kernel@...r.kernel.org
Subject: [PATCH 1/8] dma-mapping: add DMA_ATTR_LOW_ADDRESS attribute
Some devices require to allocate a special buffer (usually for the
firmware) just at the beginning of the address space to ensure that all
further allocations can be expressed as a positive offset from that
special buffer. When IOMMU is used for managing the DMA address space,
such requirement can be easily fulfilled, simply by enforcing the
'first-fit' IOVA allocation algorithm.
This patch adds a DMA attribute for such case.
Signed-off-by: Marek Szyprowski <m.szyprowski@...sung.com>
---
include/linux/dma-mapping.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index bb138ac6f5e6..c8c568ba375b 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -66,6 +66,12 @@
* at least read-only at lesser-privileged levels).
*/
#define DMA_ATTR_PRIVILEGED (1UL << 9)
+/*
+ * DMA_ATTR_LOW_ADDRESS: used to indicate that the buffer should be allocated
+ * at the lowest possible DMA address, usually just at the beginning of the
+ * DMA/IOVA address space ('first-fit' allocation algorithm).
+ */
+#define DMA_ATTR_LOW_ADDRESS (1UL << 10)
/*
* A dma_addr_t can hold any valid DMA or bus address for the platform.
--
2.17.1
Powered by blists - more mailing lists