ANDROID: iommu/io-pgtable-arm: Add IOMMU_CACHE_ICACHE_OCACHE_NWA

Allow io-coherent devices to use a inner writeback read/write allocate,
outer writeback read allocate, no-write allocate cache policy. The outer
cache policy affects the behavior of a system cache, at least on qcom
boards which have one.

The rational follows that of IOMMU_SYS_CACHE_ONLY_NWA. Certain gpu
usecases perform better when using a no-write allocate policy.

Rename the IOMMU_SYS_CACHE_* flags to better reflect that they are not
exclusive with IOMMU_CACHE.

Bug: 191811876
Change-Id: Ic91616a148f39fead008a5b87a54ffd781fee734
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
This commit is contained in:
Patrick Daly
2021-06-22 12:05:36 -07:00
committed by Will Deacon
parent 2e289f3641
commit 3b6916b4d4
3 changed files with 33 additions and 26 deletions

View File

@@ -32,18 +32,17 @@
*/
#define IOMMU_PRIV (1 << 5)
/*
* Non-coherent masters can use this page protection flag to set cacheable
* memory attributes for only a transparent outer level of cache, also known as
* the last-level or system cache.
* Allow caching in a transparent outer level of cache, also known as
* the last-level or system cache, with a read/write allocation policy.
* Does not depend on IOMMU_CACHE. Incompatible with IOMMU_SYS_CACHE_NWA.
*/
#define IOMMU_SYS_CACHE_ONLY (1 << 6)
#define IOMMU_SYS_CACHE (1 << 6)
/*
* Non-coherent masters can use this page protection flag to set cacheable
* memory attributes with a no write allocation cache policy for only a
* transparent outer level of cache, also known as the last-level or system
* cache.
* Allow caching in a transparent outer level of cache, also known as
* the last-level or system cache, with a read allocation policy.
* Does not depend on IOMMU_CACHE. Incompatible with IOMMU_SYS_CACHE.
*/
#define IOMMU_SYS_CACHE_ONLY_NWA (1 << 7)
#define IOMMU_SYS_CACHE_NWA (1 << 7)
struct iommu_ops;
struct iommu_group;