@@ -361,6 +361,8 @@ static int qcom_sdm845_smmu500_reset(struct arm_smmu_device *smmu)
361
361
{
362
362
int ret ;
363
363
364
+ arm_mmu500_reset (smmu );
365
+
364
366
/*
365
367
* To address performance degradation in non-real time clients,
366
368
* 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)
374
376
return ret ;
375
377
}
376
378
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
-
389
379
static const struct arm_smmu_impl qcom_smmu_impl = {
390
380
.init_context = qcom_smmu_init_context ,
391
381
.cfg_probe = qcom_smmu_cfg_probe ,
392
382
.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 ,
394
393
.write_s2cr = qcom_smmu_write_s2cr ,
395
394
.tlb_sync = qcom_smmu_tlb_sync ,
396
395
};
397
396
398
397
static const struct arm_smmu_impl qcom_adreno_smmu_impl = {
399
398
.init_context = qcom_adreno_smmu_init_context ,
400
399
.def_domain_type = qcom_smmu_def_domain_type ,
401
- .reset = qcom_smmu500_reset ,
400
+ .reset = arm_mmu500_reset ,
402
401
.alloc_context_bank = qcom_adreno_smmu_alloc_context_bank ,
403
402
.write_sctlr = qcom_adreno_smmu_write_sctlr ,
404
403
.tlb_sync = qcom_smmu_tlb_sync ,
@@ -450,6 +449,14 @@ static const struct qcom_smmu_match_data qcom_smmu_data = {
450
449
.adreno_impl = & qcom_adreno_smmu_impl ,
451
450
};
452
451
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
+
453
460
static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match [] = {
454
461
{ .compatible = "qcom,msm8996-smmu-v2" , .data = & msm8996_smmu_data },
455
462
{ .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[] = {
461
468
{ .compatible = "qcom,sc8280xp-smmu-500" , .data = & qcom_smmu_data },
462
469
{ .compatible = "qcom,sdm630-smmu-v2" , .data = & qcom_smmu_data },
463
470
{ .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 },
465
472
{ .compatible = "qcom,sm6115-smmu-500" , .data = & qcom_smmu_data },
466
473
{ .compatible = "qcom,sm6125-smmu-500" , .data = & qcom_smmu_data },
467
474
{ .compatible = "qcom,sm6350-smmu-500" , .data = & qcom_smmu_data },
0 commit comments