Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 276170b9 authored by Mark Salyzyn's avatar Mark Salyzyn Committed by Saravana Kannan
Browse files

ANDROID: GKI: iommu/arm-smmu: Modularize ARM SMMU driver



Allow ARM SMMU driver to be compiled as a module to allow vendors to use
their own implementations.

Bug: 155522481
Signed-off-by: default avatarMark Salyzyn <salyzyn@google.com>
Change-Id: I80d54a1ead843aab860410a32221fbf02aa703c8
Signed-off-by: default avatarSaravana Kannan <saravanak@google.com>
parent e24979f0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -344,7 +344,7 @@ config SPAPR_TCE_IOMMU

# ARM IOMMU support
config ARM_SMMU
	bool "ARM Ltd. System MMU (SMMU) Support"
	tristate "ARM Ltd. System MMU (SMMU) Support"
	depends on (ARM64 || ARM) && MMU
	select IOMMU_API
	select IOMMU_IO_PGTABLE_LPAE
+22 −1
Original line number Diff line number Diff line
@@ -2188,7 +2188,9 @@ static int arm_smmu_legacy_bus_init(void)
		arm_smmu_bus_init();
	return 0;
}
#ifndef MODULE
device_initcall_sync(arm_smmu_legacy_bus_init);
#endif

static int arm_smmu_device_remove(struct platform_device *pdev)
{
@@ -2230,7 +2232,26 @@ static struct platform_driver arm_smmu_driver = {
	.remove	= arm_smmu_device_remove,
	.shutdown = arm_smmu_device_shutdown,
};
module_platform_driver(arm_smmu_driver);

static int __init arm_smmu_driver_init(void)
{
	int ret;

	ret = platform_driver_register(&arm_smmu_driver);
#ifdef MODULE
	if (!ret)
		arm_smmu_legacy_bus_init();
#endif
	return ret;
}

static void __exit arm_smmu_driver_exit(void)
{
	platform_driver_unregister(&arm_smmu_driver);
}

subsys_initcall(arm_smmu_driver_init);
module_exit(arm_smmu_driver_exit);

MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");