Skip to content

Commit 417b76a

Browse files
lumagwilldeacon
authored andcommitted
iommu/arm-smmu-qcom: provide separate implementation for SDM845-smmu-500
There is only one platform, which needs special care in the reset function, the SDM845. Add special handler for sdm845 and drop the qcom_smmu500_reset() function. Reviewed-by: Sai Prakash Ranjan <[email protected]> Tested-by: Sai Prakash Ranjan <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 30b912a commit 417b76a

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,8 @@ static int qcom_sdm845_smmu500_reset(struct arm_smmu_device *smmu)
361361
{
362362
int ret;
363363

364+
arm_mmu500_reset(smmu);
365+
364366
/*
365367
* To address performance degradation in non-real time clients,
366368
* such as USB and UFS, turn off wait-for-safe on sdm845 based boards,
@@ -374,31 +376,28 @@ static int qcom_sdm845_smmu500_reset(struct arm_smmu_device *smmu)
374376
return ret;
375377
}
376378

377-
static int qcom_smmu500_reset(struct arm_smmu_device *smmu)
378-
{
379-
const struct device_node *np = smmu->dev->of_node;
380-
381-
arm_mmu500_reset(smmu);
382-
383-
if (of_device_is_compatible(np, "qcom,sdm845-smmu-500"))
384-
return qcom_sdm845_smmu500_reset(smmu);
385-
386-
return 0;
387-
}
388-
389379
static const struct arm_smmu_impl qcom_smmu_impl = {
390380
.init_context = qcom_smmu_init_context,
391381
.cfg_probe = qcom_smmu_cfg_probe,
392382
.def_domain_type = qcom_smmu_def_domain_type,
393-
.reset = qcom_smmu500_reset,
383+
.reset = arm_mmu500_reset,
384+
.write_s2cr = qcom_smmu_write_s2cr,
385+
.tlb_sync = qcom_smmu_tlb_sync,
386+
};
387+
388+
static const struct arm_smmu_impl sdm845_smmu_500_impl = {
389+
.init_context = qcom_smmu_init_context,
390+
.cfg_probe = qcom_smmu_cfg_probe,
391+
.def_domain_type = qcom_smmu_def_domain_type,
392+
.reset = qcom_sdm845_smmu500_reset,
394393
.write_s2cr = qcom_smmu_write_s2cr,
395394
.tlb_sync = qcom_smmu_tlb_sync,
396395
};
397396

398397
static const struct arm_smmu_impl qcom_adreno_smmu_impl = {
399398
.init_context = qcom_adreno_smmu_init_context,
400399
.def_domain_type = qcom_smmu_def_domain_type,
401-
.reset = qcom_smmu500_reset,
400+
.reset = arm_mmu500_reset,
402401
.alloc_context_bank = qcom_adreno_smmu_alloc_context_bank,
403402
.write_sctlr = qcom_adreno_smmu_write_sctlr,
404403
.tlb_sync = qcom_smmu_tlb_sync,
@@ -450,6 +449,14 @@ static const struct qcom_smmu_match_data qcom_smmu_data = {
450449
.adreno_impl = &qcom_adreno_smmu_impl,
451450
};
452451

452+
static const struct qcom_smmu_match_data sdm845_smmu_500_data = {
453+
.impl = &sdm845_smmu_500_impl,
454+
/*
455+
* No need for adreno impl here. On sdm845 the Adreno SMMU is handled
456+
* by the separate sdm845-smmu-v2 device.
457+
*/
458+
};
459+
453460
static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = {
454461
{ .compatible = "qcom,msm8996-smmu-v2", .data = &msm8996_smmu_data },
455462
{ .compatible = "qcom,msm8998-smmu-v2", .data = &qcom_smmu_data },
@@ -461,7 +468,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = {
461468
{ .compatible = "qcom,sc8280xp-smmu-500", .data = &qcom_smmu_data },
462469
{ .compatible = "qcom,sdm630-smmu-v2", .data = &qcom_smmu_data },
463470
{ .compatible = "qcom,sdm845-smmu-v2", .data = &qcom_smmu_data },
464-
{ .compatible = "qcom,sdm845-smmu-500", .data = &qcom_smmu_data },
471+
{ .compatible = "qcom,sdm845-smmu-500", .data = &sdm845_smmu_500_data },
465472
{ .compatible = "qcom,sm6115-smmu-500", .data = &qcom_smmu_data },
466473
{ .compatible = "qcom,sm6125-smmu-500", .data = &qcom_smmu_data },
467474
{ .compatible = "qcom,sm6350-smmu-500", .data = &qcom_smmu_data },

0 commit comments

Comments
 (0)