Skip to content

Commit 3e35c3e

Browse files
Bibek Kumar Patrowilldeacon
authored andcommitted
iommu/arm-smmu: Add ACTLR data and support for qcom_smmu_500
Add ACTLR data table for qcom_smmu_500 including corresponding data entry and set prefetch value by way of a list of compatible strings. Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Bibek Kumar Patro <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 9fe18d8 commit 3e35c3e

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,40 @@
1616

1717
#define QCOM_DUMMY_VAL -1
1818

19+
/*
20+
* SMMU-500 TRM defines BIT(0) as CMTLB (Enable context caching in the
21+
* macro TLB) and BIT(1) as CPRE (Enable context caching in the prefetch
22+
* buffer). The remaining bits are implementation defined and vary across
23+
* SoCs.
24+
*/
25+
26+
#define CPRE (1 << 1)
27+
#define CMTLB (1 << 0)
28+
#define PREFETCH_SHIFT 8
29+
#define PREFETCH_DEFAULT 0
30+
#define PREFETCH_SHALLOW (1 << PREFETCH_SHIFT)
31+
#define PREFETCH_MODERATE (2 << PREFETCH_SHIFT)
32+
#define PREFETCH_DEEP (3 << PREFETCH_SHIFT)
1933
#define GFX_ACTLR_PRR (1 << 5)
2034

35+
static const struct of_device_id qcom_smmu_actlr_client_of_match[] = {
36+
{ .compatible = "qcom,adreno",
37+
.data = (const void *) (PREFETCH_DEEP | CPRE | CMTLB) },
38+
{ .compatible = "qcom,adreno-gmu",
39+
.data = (const void *) (PREFETCH_DEEP | CPRE | CMTLB) },
40+
{ .compatible = "qcom,adreno-smmu",
41+
.data = (const void *) (PREFETCH_DEEP | CPRE | CMTLB) },
42+
{ .compatible = "qcom,fastrpc",
43+
.data = (const void *) (PREFETCH_DEEP | CPRE | CMTLB) },
44+
{ .compatible = "qcom,sc7280-mdss",
45+
.data = (const void *) (PREFETCH_SHALLOW | CPRE | CMTLB) },
46+
{ .compatible = "qcom,sc7280-venus",
47+
.data = (const void *) (PREFETCH_SHALLOW | CPRE | CMTLB) },
48+
{ .compatible = "qcom,sm8550-mdss",
49+
.data = (const void *) (PREFETCH_DEFAULT | CMTLB) },
50+
{ }
51+
};
52+
2153
static struct qcom_smmu *to_qcom_smmu(struct arm_smmu_device *smmu)
2254
{
2355
return container_of(smmu, struct qcom_smmu, smmu);
@@ -635,6 +667,7 @@ static const struct qcom_smmu_match_data qcom_smmu_500_impl0_data = {
635667
.impl = &qcom_smmu_500_impl,
636668
.adreno_impl = &qcom_adreno_smmu_500_impl,
637669
.cfg = &qcom_smmu_impl0_cfg,
670+
.client_match = qcom_smmu_actlr_client_of_match,
638671
};
639672

640673
/*

0 commit comments

Comments
 (0)