Skip to content

Commit 6f3f9ff

Browse files
nicolincwilldeacon
authored andcommitted
iommu/arm-smmu-v3: Add acpi_smmu_iort_probe_model for impl
For model-specific implementation, repurpose the acpi_smmu_get_options() to a wider acpi_smmu_acpi_probe_model(). A new model can add to the list in this new function. Suggested-by: Will Deacon <will@kernel.org> Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> Link: https://lore.kernel.org/r/79716299829aeab2e55b8c7932f2634b209bb4d5.1724970714.git.nicolinc@nvidia.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent b935a5b commit 6f3f9ff

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4341,18 +4341,25 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
43414341
}
43424342

43434343
#ifdef CONFIG_ACPI
4344-
static void acpi_smmu_get_options(u32 model, struct arm_smmu_device *smmu)
4344+
static int acpi_smmu_iort_probe_model(struct acpi_iort_node *node,
4345+
struct arm_smmu_device *smmu)
43454346
{
4346-
switch (model) {
4347+
struct acpi_iort_smmu_v3 *iort_smmu =
4348+
(struct acpi_iort_smmu_v3 *)node->node_data;
4349+
4350+
switch (iort_smmu->model) {
43474351
case ACPI_IORT_SMMU_V3_CAVIUM_CN99XX:
43484352
smmu->options |= ARM_SMMU_OPT_PAGE0_REGS_ONLY;
43494353
break;
43504354
case ACPI_IORT_SMMU_V3_HISILICON_HI161X:
43514355
smmu->options |= ARM_SMMU_OPT_SKIP_PREFETCH;
43524356
break;
4357+
case ACPI_IORT_SMMU_V3_GENERIC:
4358+
break;
43534359
}
43544360

43554361
dev_notice(smmu->dev, "option mask 0x%x\n", smmu->options);
4362+
return 0;
43564363
}
43574364

43584365
static int arm_smmu_device_acpi_probe(struct platform_device *pdev,
@@ -4367,8 +4374,6 @@ static int arm_smmu_device_acpi_probe(struct platform_device *pdev,
43674374
/* Retrieve SMMUv3 specific data */
43684375
iort_smmu = (struct acpi_iort_smmu_v3 *)node->node_data;
43694376

4370-
acpi_smmu_get_options(iort_smmu->model, smmu);
4371-
43724377
if (iort_smmu->flags & ACPI_IORT_SMMU_V3_COHACC_OVERRIDE)
43734378
smmu->features |= ARM_SMMU_FEAT_COHERENCY;
43744379

@@ -4380,7 +4385,7 @@ static int arm_smmu_device_acpi_probe(struct platform_device *pdev,
43804385
smmu->features |= ARM_SMMU_FEAT_HA;
43814386
}
43824387

4383-
return 0;
4388+
return acpi_smmu_iort_probe_model(node, smmu);
43844389
}
43854390
#else
43864391
static inline int arm_smmu_device_acpi_probe(struct platform_device *pdev,

0 commit comments

Comments
 (0)