Skip to content

Commit 64510ed

Browse files
Sai Prakash Ranjanwilldeacon
authored andcommitted
iommu: arm-smmu-impl: Convert to a generic reset implementation
Currently the QCOM specific smmu reset implementation is very specific to SDM845 SoC and has a wait-for-safe logic which may not be required for other SoCs. So move the SDM845 specific logic to its specific reset function. Also add SC7180 SMMU compatible for calling into QCOM specific implementation. Signed-off-by: Sai Prakash Ranjan <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/d24a0278021bc0b2732636c5728efe55e7318a8b.1587407458.git.saiprakash.ranjan@codeaurora.org Signed-off-by: Will Deacon <[email protected]>
1 parent 02782f3 commit 64510ed

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

drivers/iommu/arm-smmu-impl.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ static const struct arm_smmu_impl arm_mmu500_impl = {
150150

151151
struct arm_smmu_device *arm_smmu_impl_init(struct arm_smmu_device *smmu)
152152
{
153+
const struct device_node *np = smmu->dev->of_node;
154+
153155
/*
154156
* We will inevitably have to combine model-specific implementation
155157
* quirks with platform-specific integration quirks, but everything
@@ -166,11 +168,11 @@ struct arm_smmu_device *arm_smmu_impl_init(struct arm_smmu_device *smmu)
166168
break;
167169
}
168170

169-
if (of_property_read_bool(smmu->dev->of_node,
170-
"calxeda,smmu-secure-config-access"))
171+
if (of_property_read_bool(np, "calxeda,smmu-secure-config-access"))
171172
smmu->impl = &calxeda_impl;
172173

173-
if (of_device_is_compatible(smmu->dev->of_node, "qcom,sdm845-smmu-500"))
174+
if (of_device_is_compatible(np, "qcom,sdm845-smmu-500") ||
175+
of_device_is_compatible(np, "qcom,sc7180-smmu-500"))
174176
return qcom_smmu_impl_init(smmu);
175177

176178
return smmu;

drivers/iommu/arm-smmu-qcom.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ static int qcom_sdm845_smmu500_reset(struct arm_smmu_device *smmu)
1515
{
1616
int ret;
1717

18-
arm_mmu500_reset(smmu);
19-
2018
/*
2119
* To address performance degradation in non-real time clients,
2220
* such as USB and UFS, turn off wait-for-safe on sdm845 based boards,
@@ -30,8 +28,20 @@ static int qcom_sdm845_smmu500_reset(struct arm_smmu_device *smmu)
3028
return ret;
3129
}
3230

31+
static int qcom_smmu500_reset(struct arm_smmu_device *smmu)
32+
{
33+
const struct device_node *np = smmu->dev->of_node;
34+
35+
arm_mmu500_reset(smmu);
36+
37+
if (of_device_is_compatible(np, "qcom,sdm845-smmu-500"))
38+
return qcom_sdm845_smmu500_reset(smmu);
39+
40+
return 0;
41+
}
42+
3343
static const struct arm_smmu_impl qcom_smmu_impl = {
34-
.reset = qcom_sdm845_smmu500_reset,
44+
.reset = qcom_smmu500_reset,
3545
};
3646

3747
struct arm_smmu_device *qcom_smmu_impl_init(struct arm_smmu_device *smmu)

0 commit comments

Comments
 (0)