]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/linux/iommu.h
Merge branches 'x86/vt-d', 'x86/amd', 'arm/smmu', 'arm/omap', 'generic-dma-ops' and...
[linux.git] / include / linux / iommu.h
index 76c8cda61dfd4b5dd46b31f97da9bb4771faaca2..fdc355ccc5701e59d5894bdd648ccb1c19d26d95 100644 (file)
@@ -1,19 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
 /*
  * Copyright (C) 2007-2008 Advanced Micro Devices, Inc.
  * Author: Joerg Roedel <joerg.roedel@amd.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
 #ifndef __LINUX_IOMMU_H
  * if the IOMMU page table format is equivalent.
  */
 #define IOMMU_PRIV     (1 << 5)
+/*
+ * Non-coherent masters on few Qualcomm SoCs can use this page protection flag
+ * to set correct cacheability attributes to use an outer level of cache -
+ * last level cache, aka system cache.
+ */
+#define IOMMU_QCOM_SYS_CACHE   (1 << 6)
 
 struct iommu_ops;
 struct iommu_group;
@@ -138,6 +132,12 @@ enum iommu_attr {
 enum iommu_resv_type {
        /* Memory regions which must be mapped 1:1 at all times */
        IOMMU_RESV_DIRECT,
+       /*
+        * Memory regions which are advertised to be 1:1 but are
+        * commonly considered relaxable in some conditions,
+        * for instance in device assignment use case (USB, Graphics)
+        */
+       IOMMU_RESV_DIRECT_RELAXABLE,
        /* Arbitrary "never map this or give it to a device" address ranges */
        IOMMU_RESV_RESERVED,
        /* Hardware MSI region (untranslated) */
@@ -412,6 +412,7 @@ extern void iommu_set_fault_handler(struct iommu_domain *domain,
 extern void iommu_get_resv_regions(struct device *dev, struct list_head *list);
 extern void iommu_put_resv_regions(struct device *dev, struct list_head *list);
 extern int iommu_request_dm_for_dev(struct device *dev);
+extern int iommu_request_dma_domain_for_dev(struct device *dev);
 extern struct iommu_resv_region *
 iommu_alloc_resv_region(phys_addr_t start, size_t length, int prot,
                        enum iommu_resv_type type);
@@ -688,6 +689,11 @@ static inline int iommu_request_dm_for_dev(struct device *dev)
        return -ENODEV;
 }
 
+static inline int iommu_request_dma_domain_for_dev(struct device *dev)
+{
+       return -ENODEV;
+}
+
 static inline int iommu_attach_group(struct iommu_domain *domain,
                                     struct iommu_group *group)
 {