iommu/rockchip: Ignore isp reset when isp mmu attach
authorSimon <xxm@rock-chips.com>
Thu, 1 Dec 2016 01:40:28 +0000 (09:40 +0800)
committerSimon <xxm@rock-chips.com>
Tue, 13 Dec 2016 02:52:39 +0000 (10:52 +0800)
Reset isp mmu would failed when attach,just ignore reset operation

Change-Id: Ib323db151e7313635524526d5304e16b9b504201
Signed-off-by: Simon <xxm@rock-chips.com>
arch/arm64/boot/dts/rockchip/rk3399.dtsi
drivers/iommu/rockchip-iommu.c

index 9ab8cad27debac386a892d5b14e1764b0ae4190d..0ac0c0a9a3d0e27438c3f9fbbff4b1dcb3eb9fa9 100644 (file)
                interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH 0>;
                interrupt-names = "isp0_mmu";
                #iommu-cells = <0>;
+               rk_iommu,disable_reset_quirk;
                status = "disabled";
        };
 
                interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH 0>;
                interrupt-names = "isp1_mmu";
                #iommu-cells = <0>;
+               rk_iommu,disable_reset_quirk;
                status = "disabled";
        };
 
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;
 }