Commit 928055a0 authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Joerg Roedel

iommu/exynos: Remove custom platform device registration code

Commit 09515ef5 ("of/acpi: Configure dma operations at probe time for
platform/amba/pci bus devices") postponed the moment of attaching IOMMU
controller to its device, so there is no need to register IOMMU controllers
very early, before all other devices in the system. This change gives us an
opportunity to use standard platform device registration method also for
Exynos SYSMMU controllers.
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent db3a7fd7
...@@ -655,6 +655,13 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev) ...@@ -655,6 +655,13 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev)
} }
} }
/*
* use the first registered sysmmu device for performing
* dma mapping operations on iommu page tables (cpu cache flush)
*/
if (!dma_dev)
dma_dev = &pdev->dev;
pm_runtime_enable(dev); pm_runtime_enable(dev);
return 0; return 0;
...@@ -1335,8 +1342,6 @@ static struct iommu_ops exynos_iommu_ops = { ...@@ -1335,8 +1342,6 @@ static struct iommu_ops exynos_iommu_ops = {
.of_xlate = exynos_iommu_of_xlate, .of_xlate = exynos_iommu_of_xlate,
}; };
static bool init_done;
static int __init exynos_iommu_init(void) static int __init exynos_iommu_init(void)
{ {
int ret; int ret;
...@@ -1369,8 +1374,6 @@ static int __init exynos_iommu_init(void) ...@@ -1369,8 +1374,6 @@ static int __init exynos_iommu_init(void)
goto err_set_iommu; goto err_set_iommu;
} }
init_done = true;
return 0; return 0;
err_set_iommu: err_set_iommu:
kmem_cache_free(lv2table_kmem_cache, zero_lv2_table); kmem_cache_free(lv2table_kmem_cache, zero_lv2_table);
...@@ -1380,27 +1383,6 @@ static int __init exynos_iommu_init(void) ...@@ -1380,27 +1383,6 @@ static int __init exynos_iommu_init(void)
kmem_cache_destroy(lv2table_kmem_cache); kmem_cache_destroy(lv2table_kmem_cache);
return ret; return ret;
} }
core_initcall(exynos_iommu_init);
static int __init exynos_iommu_of_setup(struct device_node *np) IOMMU_OF_DECLARE(exynos_iommu_of, "samsung,exynos-sysmmu", NULL);
{
struct platform_device *pdev;
if (!init_done)
exynos_iommu_init();
pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
if (!pdev)
return -ENODEV;
/*
* use the first registered sysmmu device for performing
* dma mapping operations on iommu page tables (cpu cache flush)
*/
if (!dma_dev)
dma_dev = &pdev->dev;
return 0;
}
IOMMU_OF_DECLARE(exynos_iommu_of, "samsung,exynos-sysmmu",
exynos_iommu_of_setup);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment