iommu/rockchip: Ignore isp reset when isp mmu attach
[firefly-linux-kernel-4.4.55.git] / drivers / iommu / rockchip-iommu.c
index ce1ed0deb384e429343dd97702c33bc526c93b39..a681df695f5bd1a00f146150545218e770e78c01 100644 (file)
@@ -90,6 +90,7 @@ struct rk_iommu {
        void __iomem **bases;
        int num_mmu;
        int irq;
+       bool reset_disabled; /* isp iommu reset operation would failed */
        struct list_head node; /* entry in rk_iommu_domain.iommus */
        struct iommu_domain *domain; /* domain to which iommu is attached */
 };
@@ -414,6 +415,10 @@ static int rk_iommu_force_reset(struct rk_iommu *iommu)
        int ret, i;
        u32 dte_addr;
 
+       /* Workaround for isp mmus */
+       if (iommu->reset_disabled)
+               return 0;
+
        /*
         * Check if register DTE_ADDR is working by writing DTE_ADDR_DUMMY
         * and verifying that upper 5 nybbles are read back.
@@ -1157,6 +1162,9 @@ static int rk_iommu_probe(struct platform_device *pdev)
                return -ENXIO;
        }
 
+       iommu->reset_disabled = device_property_read_bool(dev,
+                               "rk_iommu,disable_reset_quirk");
+
        return 0;
 }