diff mbox

[V5,08/12] iommu/arm-smmu: Clean up early-probing workarounds

Message ID 1484838356-24962-9-git-send-email-sricharan@codeaurora.org (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Gross
Headers show

Commit Message

Sricharan Ramabadhran Jan. 19, 2017, 3:05 p.m. UTC
From: Robin Murphy <robin.murphy@arm.com>

Now that the appropriate ordering is enforced via profe-deferral of
masters in core code, rip it all out and bask in the simplicity.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
[Sricharan: Rebased on top of ACPI IORT SMMU series]
Signed-off-by: Sricharan R <sricharan@codeaurora.org>
---
 * No change

 drivers/iommu/arm-smmu-v3.c | 46 ++---------------------------------
 drivers/iommu/arm-smmu.c    | 58 +++++++--------------------------------------
 2 files changed, 10 insertions(+), 94 deletions(-)

Comments

Will Deacon Jan. 19, 2017, 4:18 p.m. UTC | #1
On Thu, Jan 19, 2017 at 08:35:52PM +0530, Sricharan R wrote:
> From: Robin Murphy <robin.murphy@arm.com>
> 
> Now that the appropriate ordering is enforced via profe-deferral of
> masters in core code, rip it all out and bask in the simplicity.
> 
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> [Sricharan: Rebased on top of ACPI IORT SMMU series]
> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
> ---
>  * No change
> 
>  drivers/iommu/arm-smmu-v3.c | 46 ++---------------------------------
>  drivers/iommu/arm-smmu.c    | 58 +++++++--------------------------------------
>  2 files changed, 10 insertions(+), 94 deletions(-)

Acked-by: Will Deacon <will.deacon@arm.com>

I can't wait to see this series merged. What's the plan for that?

Will
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lorenzo Pieralisi Jan. 19, 2017, 4:50 p.m. UTC | #2
On Thu, Jan 19, 2017 at 08:35:52PM +0530, Sricharan R wrote:
> From: Robin Murphy <robin.murphy@arm.com>
> 
> Now that the appropriate ordering is enforced via profe-deferral of
> masters in core code, rip it all out and bask in the simplicity.
> 
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
> [Sricharan: Rebased on top of ACPI IORT SMMU series]
> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
> ---
>  * No change

Well, a tad too early on the series for ACPI, aka if we bisect the
series here you would break ACPI.

Totally agree on the patch, but you should move it to the end of the
series.

Lorenzo

>  drivers/iommu/arm-smmu-v3.c | 46 ++---------------------------------
>  drivers/iommu/arm-smmu.c    | 58 +++++++--------------------------------------
>  2 files changed, 10 insertions(+), 94 deletions(-)
> 
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index 7d45d8b..7fc4e5f 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -2724,51 +2724,9 @@ static int arm_smmu_device_remove(struct platform_device *pdev)
>  	.probe	= arm_smmu_device_probe,
>  	.remove	= arm_smmu_device_remove,
>  };
> +module_platform_driver(arm_smmu_driver);
>  
> -static int __init arm_smmu_init(void)
> -{
> -	static bool registered;
> -	int ret = 0;
> -
> -	if (!registered) {
> -		ret = platform_driver_register(&arm_smmu_driver);
> -		registered = !ret;
> -	}
> -	return ret;
> -}
> -
> -static void __exit arm_smmu_exit(void)
> -{
> -	return platform_driver_unregister(&arm_smmu_driver);
> -}
> -
> -subsys_initcall(arm_smmu_init);
> -module_exit(arm_smmu_exit);
> -
> -static int __init arm_smmu_of_init(struct device_node *np)
> -{
> -	int ret = arm_smmu_init();
> -
> -	if (ret)
> -		return ret;
> -
> -	if (!of_platform_device_create(np, NULL, platform_bus_type.dev_root))
> -		return -ENODEV;
> -
> -	return 0;
> -}
> -IOMMU_OF_DECLARE(arm_smmuv3, "arm,smmu-v3", arm_smmu_of_init);
> -
> -#ifdef CONFIG_ACPI
> -static int __init acpi_smmu_v3_init(struct acpi_table_header *table)
> -{
> -	if (iort_node_match(ACPI_IORT_NODE_SMMU_V3))
> -		return arm_smmu_init();
> -
> -	return 0;
> -}
> -IORT_ACPI_DECLARE(arm_smmu_v3, ACPI_SIG_IORT, acpi_smmu_v3_init);
> -#endif
> +IOMMU_OF_DECLARE(arm_smmuv3, "arm,smmu-v3", NULL);
>  
>  MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations");
>  MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index 73a0a25..c86ae5f 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -2134,56 +2134,14 @@ static int arm_smmu_device_remove(struct platform_device *pdev)
>  	.probe	= arm_smmu_device_probe,
>  	.remove	= arm_smmu_device_remove,
>  };
> -
> -static int __init arm_smmu_init(void)
> -{
> -	static bool registered;
> -	int ret = 0;
> -
> -	if (!registered) {
> -		ret = platform_driver_register(&arm_smmu_driver);
> -		registered = !ret;
> -	}
> -	return ret;
> -}
> -
> -static void __exit arm_smmu_exit(void)
> -{
> -	return platform_driver_unregister(&arm_smmu_driver);
> -}
> -
> -subsys_initcall(arm_smmu_init);
> -module_exit(arm_smmu_exit);
> -
> -static int __init arm_smmu_of_init(struct device_node *np)
> -{
> -	int ret = arm_smmu_init();
> -
> -	if (ret)
> -		return ret;
> -
> -	if (!of_platform_device_create(np, NULL, platform_bus_type.dev_root))
> -		return -ENODEV;
> -
> -	return 0;
> -}
> -IOMMU_OF_DECLARE(arm_smmuv1, "arm,smmu-v1", arm_smmu_of_init);
> -IOMMU_OF_DECLARE(arm_smmuv2, "arm,smmu-v2", arm_smmu_of_init);
> -IOMMU_OF_DECLARE(arm_mmu400, "arm,mmu-400", arm_smmu_of_init);
> -IOMMU_OF_DECLARE(arm_mmu401, "arm,mmu-401", arm_smmu_of_init);
> -IOMMU_OF_DECLARE(arm_mmu500, "arm,mmu-500", arm_smmu_of_init);
> -IOMMU_OF_DECLARE(cavium_smmuv2, "cavium,smmu-v2", arm_smmu_of_init);
> -
> -#ifdef CONFIG_ACPI
> -static int __init arm_smmu_acpi_init(struct acpi_table_header *table)
> -{
> -	if (iort_node_match(ACPI_IORT_NODE_SMMU))
> -		return arm_smmu_init();
> -
> -	return 0;
> -}
> -IORT_ACPI_DECLARE(arm_smmu, ACPI_SIG_IORT, arm_smmu_acpi_init);
> -#endif
> +module_platform_driver(arm_smmu_driver);
> +
> +IOMMU_OF_DECLARE(arm_smmuv1, "arm,smmu-v1", NULL);
> +IOMMU_OF_DECLARE(arm_smmuv2, "arm,smmu-v2", NULL);
> +IOMMU_OF_DECLARE(arm_mmu400, "arm,mmu-400", NULL);
> +IOMMU_OF_DECLARE(arm_mmu401, "arm,mmu-401", NULL);
> +IOMMU_OF_DECLARE(arm_mmu500, "arm,mmu-500", NULL);
> +IOMMU_OF_DECLARE(cavium_smmuv2, "cavium,smmu-v2", NULL);
>  
>  MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
>  MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Robin Murphy Jan. 19, 2017, 5:58 p.m. UTC | #3
On 19/01/17 16:50, Lorenzo Pieralisi wrote:
> On Thu, Jan 19, 2017 at 08:35:52PM +0530, Sricharan R wrote:
>> From: Robin Murphy <robin.murphy@arm.com>
>>
>> Now that the appropriate ordering is enforced via profe-deferral of
>> masters in core code, rip it all out and bask in the simplicity.
>>
>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
>> [Sricharan: Rebased on top of ACPI IORT SMMU series]
>> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
>> ---
>>  * No change
> 
> Well, a tad too early on the series for ACPI, aka if we bisect the
> series here you would break ACPI.
> 
> Totally agree on the patch, but you should move it to the end of the
> series.

Indeed - I think a more appropriate ordering of the current patch
numbers would be:

1, 2, 3, 4, 9, 5+10 (squashed), 6, 11, 7, 8, 12

Robin.

> 
> Lorenzo
> 
>>  drivers/iommu/arm-smmu-v3.c | 46 ++---------------------------------
>>  drivers/iommu/arm-smmu.c    | 58 +++++++--------------------------------------
>>  2 files changed, 10 insertions(+), 94 deletions(-)
>>
>> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
>> index 7d45d8b..7fc4e5f 100644
>> --- a/drivers/iommu/arm-smmu-v3.c
>> +++ b/drivers/iommu/arm-smmu-v3.c
>> @@ -2724,51 +2724,9 @@ static int arm_smmu_device_remove(struct platform_device *pdev)
>>  	.probe	= arm_smmu_device_probe,
>>  	.remove	= arm_smmu_device_remove,
>>  };
>> +module_platform_driver(arm_smmu_driver);
>>  
>> -static int __init arm_smmu_init(void)
>> -{
>> -	static bool registered;
>> -	int ret = 0;
>> -
>> -	if (!registered) {
>> -		ret = platform_driver_register(&arm_smmu_driver);
>> -		registered = !ret;
>> -	}
>> -	return ret;
>> -}
>> -
>> -static void __exit arm_smmu_exit(void)
>> -{
>> -	return platform_driver_unregister(&arm_smmu_driver);
>> -}
>> -
>> -subsys_initcall(arm_smmu_init);
>> -module_exit(arm_smmu_exit);
>> -
>> -static int __init arm_smmu_of_init(struct device_node *np)
>> -{
>> -	int ret = arm_smmu_init();
>> -
>> -	if (ret)
>> -		return ret;
>> -
>> -	if (!of_platform_device_create(np, NULL, platform_bus_type.dev_root))
>> -		return -ENODEV;
>> -
>> -	return 0;
>> -}
>> -IOMMU_OF_DECLARE(arm_smmuv3, "arm,smmu-v3", arm_smmu_of_init);
>> -
>> -#ifdef CONFIG_ACPI
>> -static int __init acpi_smmu_v3_init(struct acpi_table_header *table)
>> -{
>> -	if (iort_node_match(ACPI_IORT_NODE_SMMU_V3))
>> -		return arm_smmu_init();
>> -
>> -	return 0;
>> -}
>> -IORT_ACPI_DECLARE(arm_smmu_v3, ACPI_SIG_IORT, acpi_smmu_v3_init);
>> -#endif
>> +IOMMU_OF_DECLARE(arm_smmuv3, "arm,smmu-v3", NULL);
>>  
>>  MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations");
>>  MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
>> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
>> index 73a0a25..c86ae5f 100644
>> --- a/drivers/iommu/arm-smmu.c
>> +++ b/drivers/iommu/arm-smmu.c
>> @@ -2134,56 +2134,14 @@ static int arm_smmu_device_remove(struct platform_device *pdev)
>>  	.probe	= arm_smmu_device_probe,
>>  	.remove	= arm_smmu_device_remove,
>>  };
>> -
>> -static int __init arm_smmu_init(void)
>> -{
>> -	static bool registered;
>> -	int ret = 0;
>> -
>> -	if (!registered) {
>> -		ret = platform_driver_register(&arm_smmu_driver);
>> -		registered = !ret;
>> -	}
>> -	return ret;
>> -}
>> -
>> -static void __exit arm_smmu_exit(void)
>> -{
>> -	return platform_driver_unregister(&arm_smmu_driver);
>> -}
>> -
>> -subsys_initcall(arm_smmu_init);
>> -module_exit(arm_smmu_exit);
>> -
>> -static int __init arm_smmu_of_init(struct device_node *np)
>> -{
>> -	int ret = arm_smmu_init();
>> -
>> -	if (ret)
>> -		return ret;
>> -
>> -	if (!of_platform_device_create(np, NULL, platform_bus_type.dev_root))
>> -		return -ENODEV;
>> -
>> -	return 0;
>> -}
>> -IOMMU_OF_DECLARE(arm_smmuv1, "arm,smmu-v1", arm_smmu_of_init);
>> -IOMMU_OF_DECLARE(arm_smmuv2, "arm,smmu-v2", arm_smmu_of_init);
>> -IOMMU_OF_DECLARE(arm_mmu400, "arm,mmu-400", arm_smmu_of_init);
>> -IOMMU_OF_DECLARE(arm_mmu401, "arm,mmu-401", arm_smmu_of_init);
>> -IOMMU_OF_DECLARE(arm_mmu500, "arm,mmu-500", arm_smmu_of_init);
>> -IOMMU_OF_DECLARE(cavium_smmuv2, "cavium,smmu-v2", arm_smmu_of_init);
>> -
>> -#ifdef CONFIG_ACPI
>> -static int __init arm_smmu_acpi_init(struct acpi_table_header *table)
>> -{
>> -	if (iort_node_match(ACPI_IORT_NODE_SMMU))
>> -		return arm_smmu_init();
>> -
>> -	return 0;
>> -}
>> -IORT_ACPI_DECLARE(arm_smmu, ACPI_SIG_IORT, arm_smmu_acpi_init);
>> -#endif
>> +module_platform_driver(arm_smmu_driver);
>> +
>> +IOMMU_OF_DECLARE(arm_smmuv1, "arm,smmu-v1", NULL);
>> +IOMMU_OF_DECLARE(arm_smmuv2, "arm,smmu-v2", NULL);
>> +IOMMU_OF_DECLARE(arm_mmu400, "arm,mmu-400", NULL);
>> +IOMMU_OF_DECLARE(arm_mmu401, "arm,mmu-401", NULL);
>> +IOMMU_OF_DECLARE(arm_mmu500, "arm,mmu-500", NULL);
>> +IOMMU_OF_DECLARE(cavium_smmuv2, "cavium,smmu-v2", NULL);
>>  
>>  MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
>>  MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
>> -- 
>> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sricharan Ramabadhran Jan. 20, 2017, 6:32 a.m. UTC | #4
Hi Robin,

>-----Original Message-----
>From: linux-arm-msm-owner@vger.kernel.org [mailto:linux-arm-msm-owner@vger.kernel.org] On Behalf Of Robin Murphy
>Sent: Thursday, January 19, 2017 11:28 PM
>To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>; Sricharan R <sricharan@codeaurora.org>
>Cc: will.deacon@arm.com; joro@8bytes.org; iommu@lists.linux-foundation.org; linux-arm-kernel@lists.infradead.org; linux-arm-
>msm@vger.kernel.org; m.szyprowski@samsung.com 
>Subject: Re: [PATCH V5 08/12] iommu/arm-smmu: Clean up early-probing workarounds
>
>On 19/01/17 16:50, Lorenzo Pieralisi wrote:
>> On Thu, Jan 19, 2017 at 08:35:52PM +0530, Sricharan R wrote:
>>> From: Robin Murphy <robin.murphy@arm.com>
>>>
>>> Now that the appropriate ordering is enforced via profe-deferral of
>>> masters in core code, rip it all out and bask in the simplicity.
>>>
>>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
>>> [Sricharan: Rebased on top of ACPI IORT SMMU series]
>>> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
>>> ---
>>>  * No change
>>
>> Well, a tad too early on the series for ACPI, aka if we bisect the
>> series here you would break ACPI.
>>
>> Totally agree on the patch, but you should move it to the end of the
>> series.
>
>Indeed - I think a more appropriate ordering of the current patch
>numbers would be:
>
>1, 2, 3, 4, 9, 5+10 (squashed), 6, 11, 7, 8, 12
>

Ok, will repost with this order.

Regards,
 Sricharan

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sricharan Ramabadhran Jan. 20, 2017, 7:20 p.m. UTC | #5
Hi Will,

>-----Original Message-----
>From: linux-arm-msm-owner@vger.kernel.org [mailto:linux-arm-msm-owner@vger.kernel.org] On Behalf Of Will Deacon
>Sent: Thursday, January 19, 2017 9:48 PM
>To: Sricharan R <sricharan@codeaurora.org>
>Cc: robin.murphy@arm.com; joro@8bytes.org; lorenzo.pieralisi@arm.com; iommu@lists.linux-foundation.org; linux-arm-
>kernel@lists.infradead.org; linux-arm-msm@vger.kernel.org; m.szyprowski@samsung.com
>Subject: Re: [PATCH V5 08/12] iommu/arm-smmu: Clean up early-probing workarounds
>
>On Thu, Jan 19, 2017 at 08:35:52PM +0530, Sricharan R wrote:
>> From: Robin Murphy <robin.murphy@arm.com>
>>
>> Now that the appropriate ordering is enforced via profe-deferral of
>> masters in core code, rip it all out and bask in the simplicity.
>>
>> Signed-off-by: Robin Murphy <robin.murphy@arm.com>
>> [Sricharan: Rebased on top of ACPI IORT SMMU series]
>> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
>> ---
>>  * No change
>>
>>  drivers/iommu/arm-smmu-v3.c | 46 ++---------------------------------
>>  drivers/iommu/arm-smmu.c    | 58 +++++++--------------------------------------
>>  2 files changed, 10 insertions(+), 94 deletions(-)
>
>Acked-by: Will Deacon <will.deacon@arm.com>
>
>I can't wait to see this series merged. What's the plan for that?

Thanks. Posted V6 with your tags and comments for V5 addressed.

Regards,
 Sricharan

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 7d45d8b..7fc4e5f 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -2724,51 +2724,9 @@  static int arm_smmu_device_remove(struct platform_device *pdev)
 	.probe	= arm_smmu_device_probe,
 	.remove	= arm_smmu_device_remove,
 };
+module_platform_driver(arm_smmu_driver);
 
-static int __init arm_smmu_init(void)
-{
-	static bool registered;
-	int ret = 0;
-
-	if (!registered) {
-		ret = platform_driver_register(&arm_smmu_driver);
-		registered = !ret;
-	}
-	return ret;
-}
-
-static void __exit arm_smmu_exit(void)
-{
-	return platform_driver_unregister(&arm_smmu_driver);
-}
-
-subsys_initcall(arm_smmu_init);
-module_exit(arm_smmu_exit);
-
-static int __init arm_smmu_of_init(struct device_node *np)
-{
-	int ret = arm_smmu_init();
-
-	if (ret)
-		return ret;
-
-	if (!of_platform_device_create(np, NULL, platform_bus_type.dev_root))
-		return -ENODEV;
-
-	return 0;
-}
-IOMMU_OF_DECLARE(arm_smmuv3, "arm,smmu-v3", arm_smmu_of_init);
-
-#ifdef CONFIG_ACPI
-static int __init acpi_smmu_v3_init(struct acpi_table_header *table)
-{
-	if (iort_node_match(ACPI_IORT_NODE_SMMU_V3))
-		return arm_smmu_init();
-
-	return 0;
-}
-IORT_ACPI_DECLARE(arm_smmu_v3, ACPI_SIG_IORT, acpi_smmu_v3_init);
-#endif
+IOMMU_OF_DECLARE(arm_smmuv3, "arm,smmu-v3", NULL);
 
 MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations");
 MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 73a0a25..c86ae5f 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -2134,56 +2134,14 @@  static int arm_smmu_device_remove(struct platform_device *pdev)
 	.probe	= arm_smmu_device_probe,
 	.remove	= arm_smmu_device_remove,
 };
-
-static int __init arm_smmu_init(void)
-{
-	static bool registered;
-	int ret = 0;
-
-	if (!registered) {
-		ret = platform_driver_register(&arm_smmu_driver);
-		registered = !ret;
-	}
-	return ret;
-}
-
-static void __exit arm_smmu_exit(void)
-{
-	return platform_driver_unregister(&arm_smmu_driver);
-}
-
-subsys_initcall(arm_smmu_init);
-module_exit(arm_smmu_exit);
-
-static int __init arm_smmu_of_init(struct device_node *np)
-{
-	int ret = arm_smmu_init();
-
-	if (ret)
-		return ret;
-
-	if (!of_platform_device_create(np, NULL, platform_bus_type.dev_root))
-		return -ENODEV;
-
-	return 0;
-}
-IOMMU_OF_DECLARE(arm_smmuv1, "arm,smmu-v1", arm_smmu_of_init);
-IOMMU_OF_DECLARE(arm_smmuv2, "arm,smmu-v2", arm_smmu_of_init);
-IOMMU_OF_DECLARE(arm_mmu400, "arm,mmu-400", arm_smmu_of_init);
-IOMMU_OF_DECLARE(arm_mmu401, "arm,mmu-401", arm_smmu_of_init);
-IOMMU_OF_DECLARE(arm_mmu500, "arm,mmu-500", arm_smmu_of_init);
-IOMMU_OF_DECLARE(cavium_smmuv2, "cavium,smmu-v2", arm_smmu_of_init);
-
-#ifdef CONFIG_ACPI
-static int __init arm_smmu_acpi_init(struct acpi_table_header *table)
-{
-	if (iort_node_match(ACPI_IORT_NODE_SMMU))
-		return arm_smmu_init();
-
-	return 0;
-}
-IORT_ACPI_DECLARE(arm_smmu, ACPI_SIG_IORT, arm_smmu_acpi_init);
-#endif
+module_platform_driver(arm_smmu_driver);
+
+IOMMU_OF_DECLARE(arm_smmuv1, "arm,smmu-v1", NULL);
+IOMMU_OF_DECLARE(arm_smmuv2, "arm,smmu-v2", NULL);
+IOMMU_OF_DECLARE(arm_mmu400, "arm,mmu-400", NULL);
+IOMMU_OF_DECLARE(arm_mmu401, "arm,mmu-401", NULL);
+IOMMU_OF_DECLARE(arm_mmu500, "arm,mmu-500", NULL);
+IOMMU_OF_DECLARE(cavium_smmuv2, "cavium,smmu-v2", NULL);
 
 MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
 MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");