Skip to content

Commit b4c6ee5

Browse files
lumagwilldeacon
authored andcommitted
iommu/arm-smmu-qcom: Stop using mmu500 reset for v2 MMUs
The arm_mmu500_reset() writes into registers specific for MMU500. For the generic ARM SMMU v2 these registers (sACR) are defined as 'implementation defined'. Downstream Qualcomm driver for SMMUv2 doesn't touch them. 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] [will: Remove unused 'qcom_smmu_data' stucture] Signed-off-by: Will Deacon <[email protected]>
1 parent 4172dda commit b4c6ee5

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

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

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,15 @@ static int qcom_sdm845_smmu500_reset(struct arm_smmu_device *smmu)
376376
return ret;
377377
}
378378

379-
static const struct arm_smmu_impl qcom_smmu_impl = {
379+
static const struct arm_smmu_impl qcom_smmu_v2_impl = {
380+
.init_context = qcom_smmu_init_context,
381+
.cfg_probe = qcom_smmu_cfg_probe,
382+
.def_domain_type = qcom_smmu_def_domain_type,
383+
.write_s2cr = qcom_smmu_write_s2cr,
384+
.tlb_sync = qcom_smmu_tlb_sync,
385+
};
386+
387+
static const struct arm_smmu_impl qcom_smmu_500_impl = {
380388
.init_context = qcom_smmu_init_context,
381389
.cfg_probe = qcom_smmu_cfg_probe,
382390
.def_domain_type = qcom_smmu_def_domain_type,
@@ -394,7 +402,15 @@ static const struct arm_smmu_impl sdm845_smmu_500_impl = {
394402
.tlb_sync = qcom_smmu_tlb_sync,
395403
};
396404

397-
static const struct arm_smmu_impl qcom_adreno_smmu_impl = {
405+
static const struct arm_smmu_impl qcom_adreno_smmu_v2_impl = {
406+
.init_context = qcom_adreno_smmu_init_context,
407+
.def_domain_type = qcom_smmu_def_domain_type,
408+
.alloc_context_bank = qcom_adreno_smmu_alloc_context_bank,
409+
.write_sctlr = qcom_adreno_smmu_write_sctlr,
410+
.tlb_sync = qcom_smmu_tlb_sync,
411+
};
412+
413+
static const struct arm_smmu_impl qcom_adreno_smmu_500_impl = {
398414
.init_context = qcom_adreno_smmu_init_context,
399415
.def_domain_type = qcom_smmu_def_domain_type,
400416
.reset = arm_mmu500_reset,
@@ -452,12 +468,12 @@ static const struct qcom_smmu_config qcom_smmu_impl0_cfg = {
452468
*/
453469
static const struct qcom_smmu_match_data msm8996_smmu_data = {
454470
.impl = NULL,
455-
.adreno_impl = &qcom_adreno_smmu_impl,
471+
.adreno_impl = &qcom_adreno_smmu_v2_impl,
456472
};
457473

458-
static const struct qcom_smmu_match_data qcom_smmu_data = {
459-
.impl = &qcom_smmu_impl,
460-
.adreno_impl = &qcom_adreno_smmu_impl,
474+
static const struct qcom_smmu_match_data qcom_smmu_v2_data = {
475+
.impl = &qcom_smmu_v2_impl,
476+
.adreno_impl = &qcom_adreno_smmu_v2_impl,
461477
};
462478

463479
static const struct qcom_smmu_match_data sdm845_smmu_500_data = {
@@ -470,22 +486,22 @@ static const struct qcom_smmu_match_data sdm845_smmu_500_data = {
470486
};
471487

472488
static const struct qcom_smmu_match_data qcom_smmu_500_impl0_data = {
473-
.impl = &qcom_smmu_impl,
474-
.adreno_impl = &qcom_adreno_smmu_impl,
489+
.impl = &qcom_smmu_500_impl,
490+
.adreno_impl = &qcom_adreno_smmu_500_impl,
475491
.cfg = &qcom_smmu_impl0_cfg,
476492
};
477493

478494
static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = {
479495
{ .compatible = "qcom,msm8996-smmu-v2", .data = &msm8996_smmu_data },
480-
{ .compatible = "qcom,msm8998-smmu-v2", .data = &qcom_smmu_data },
496+
{ .compatible = "qcom,msm8998-smmu-v2", .data = &qcom_smmu_v2_data },
481497
{ .compatible = "qcom,qcm2290-smmu-500", .data = &qcom_smmu_500_impl0_data },
482498
{ .compatible = "qcom,qdu1000-smmu-500", .data = &qcom_smmu_500_impl0_data },
483499
{ .compatible = "qcom,sc7180-smmu-500", .data = &qcom_smmu_500_impl0_data },
484500
{ .compatible = "qcom,sc7280-smmu-500", .data = &qcom_smmu_500_impl0_data },
485501
{ .compatible = "qcom,sc8180x-smmu-500", .data = &qcom_smmu_500_impl0_data },
486502
{ .compatible = "qcom,sc8280xp-smmu-500", .data = &qcom_smmu_500_impl0_data },
487-
{ .compatible = "qcom,sdm630-smmu-v2", .data = &qcom_smmu_data },
488-
{ .compatible = "qcom,sdm845-smmu-v2", .data = &qcom_smmu_data },
503+
{ .compatible = "qcom,sdm630-smmu-v2", .data = &qcom_smmu_v2_data },
504+
{ .compatible = "qcom,sdm845-smmu-v2", .data = &qcom_smmu_v2_data },
489505
{ .compatible = "qcom,sdm845-smmu-500", .data = &sdm845_smmu_500_data },
490506
{ .compatible = "qcom,sm6115-smmu-500", .data = &qcom_smmu_500_impl0_data},
491507
{ .compatible = "qcom,sm6125-smmu-500", .data = &qcom_smmu_500_impl0_data },

0 commit comments

Comments
 (0)