Merge tag 'clang-lto-v5.12-rc1-fix1' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-block.git] / drivers / iommu / mtk_iommu.h
index df32b3e3408b79d32f71ea90dec7e172607bb160..f81fa8862ed04b22f997bf45700e58dd90fc068b 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/dma-mapping.h>
 #include <soc/mediatek/smi.h>
+#include <dt-bindings/memory/mtk-memory-port.h>
 
 #define MTK_LARB_COM_MAX       8
 #define MTK_LARB_SUBCOM_MAX    4
 
+#define MTK_IOMMU_GROUP_MAX    8
+
 struct mtk_iommu_suspend_reg {
        union {
                u32                     standard_axi_mode;/* v1 */
@@ -42,12 +45,18 @@ enum mtk_iommu_plat {
        M4U_MT8167,
        M4U_MT8173,
        M4U_MT8183,
+       M4U_MT8192,
 };
 
+struct mtk_iommu_iova_region;
+
 struct mtk_iommu_plat_data {
        enum mtk_iommu_plat m4u_plat;
        u32                 flags;
        u32                 inv_sel_reg;
+
+       unsigned int                            iova_region_nr;
+       const struct mtk_iommu_iova_region      *iova_region;
        unsigned char       larbid_remap[MTK_LARB_COM_MAX][MTK_LARB_SUBCOM_MAX];
 };
 
@@ -61,12 +70,13 @@ struct mtk_iommu_data {
        phys_addr_t                     protect_base; /* protect memory base */
        struct mtk_iommu_suspend_reg    reg;
        struct mtk_iommu_domain         *m4u_dom;
-       struct iommu_group              *m4u_group;
+       struct iommu_group              *m4u_group[MTK_IOMMU_GROUP_MAX];
        bool                            enable_4GB;
        spinlock_t                      tlb_lock; /* lock for tlb range flush */
 
        struct iommu_device             iommu;
        const struct mtk_iommu_plat_data *plat_data;
+       struct device                   *smicomm_dev;
 
        struct dma_iommu_mapping        *mapping; /* For mtk_iommu_v1.c */