|
@@ -23,6 +23,10 @@
|
|
|
#ifdef CONFIG_NOUVEAU_PLATFORM_DRIVER
|
|
|
#include "priv.h"
|
|
|
|
|
|
+#if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)
|
|
|
+#include <asm/dma-iommu.h>
|
|
|
+#endif
|
|
|
+
|
|
|
static int
|
|
|
nvkm_device_tegra_power_up(struct nvkm_device_tegra *tdev)
|
|
|
{
|
|
@@ -105,6 +109,15 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev)
|
|
|
unsigned long pgsize_bitmap;
|
|
|
int ret;
|
|
|
|
|
|
+#if IS_ENABLED(CONFIG_ARM_DMA_USE_IOMMU)
|
|
|
+ if (dev->archdata.mapping) {
|
|
|
+ struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev);
|
|
|
+
|
|
|
+ arm_iommu_detach_device(dev);
|
|
|
+ arm_iommu_release_mapping(mapping);
|
|
|
+ }
|
|
|
+#endif
|
|
|
+
|
|
|
if (!tdev->func->iommu_bit)
|
|
|
return;
|
|
|
|