Skip to content

Commit f04ae51

Browse files
committed
Merge tag 'arm-smmu-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into arm/smmu
Arm SMMU updates for 6.2 - Report a warning if we fail to disable the MMU-500 prefetcher - Usual mass of devicetree binding additions - Qualcomm SMMU refactoring and generic "qcom,smmu-500" addition
2 parents 30a0b95 + 4428673 commit f04ae51

File tree

5 files changed

+302
-148
lines changed

5 files changed

+302
-148
lines changed

Documentation/devicetree/bindings/iommu/arm,smmu.yaml

Lines changed: 169 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,79 @@ properties:
2828
- enum:
2929
- qcom,msm8996-smmu-v2
3030
- qcom,msm8998-smmu-v2
31+
- qcom,sdm630-smmu-v2
3132
- const: qcom,smmu-v2
3233

33-
- description: Qcom SoCs implementing "arm,mmu-500"
34+
- description: Qcom SoCs implementing "qcom,smmu-500" and "arm,mmu-500"
3435
items:
3536
- enum:
3637
- qcom,qcm2290-smmu-500
38+
- qcom,qdu1000-smmu-500
3739
- qcom,sc7180-smmu-500
3840
- qcom,sc7280-smmu-500
3941
- qcom,sc8180x-smmu-500
4042
- qcom,sc8280xp-smmu-500
43+
- qcom,sdm670-smmu-500
4144
- qcom,sdm845-smmu-500
45+
- qcom,sm6115-smmu-500
46+
- qcom,sm6350-smmu-500
47+
- qcom,sm6375-smmu-500
48+
- qcom,sm8150-smmu-500
49+
- qcom,sm8250-smmu-500
50+
- qcom,sm8350-smmu-500
51+
- qcom,sm8450-smmu-500
52+
- const: qcom,smmu-500
53+
- const: arm,mmu-500
54+
55+
- description: Qcom SoCs implementing "arm,mmu-500" (non-qcom implementation)
56+
deprecated: true
57+
items:
58+
- enum:
4259
- qcom,sdx55-smmu-500
4360
- qcom,sdx65-smmu-500
61+
- const: arm,mmu-500
62+
63+
- description: Qcom SoCs implementing "arm,mmu-500" (legacy binding)
64+
deprecated: true
65+
items:
66+
# Do not add additional SoC to this list. Instead use two previous lists.
67+
- enum:
68+
- qcom,qcm2290-smmu-500
69+
- qcom,sc7180-smmu-500
70+
- qcom,sc7280-smmu-500
71+
- qcom,sc8180x-smmu-500
72+
- qcom,sc8280xp-smmu-500
73+
- qcom,sdm845-smmu-500
74+
- qcom,sm6115-smmu-500
4475
- qcom,sm6350-smmu-500
4576
- qcom,sm6375-smmu-500
4677
- qcom,sm8150-smmu-500
4778
- qcom,sm8250-smmu-500
4879
- qcom,sm8350-smmu-500
4980
- qcom,sm8450-smmu-500
5081
- const: arm,mmu-500
82+
83+
- description: Qcom Adreno GPUs implementing "arm,smmu-500"
84+
items:
85+
- enum:
86+
- qcom,sc7280-smmu-500
87+
- qcom,sm8250-smmu-500
88+
- const: qcom,adreno-smmu
89+
- const: arm,mmu-500
5190
- description: Qcom Adreno GPUs implementing "arm,smmu-v2"
5291
items:
5392
- enum:
93+
- qcom,msm8996-smmu-v2
5494
- qcom,sc7180-smmu-v2
95+
- qcom,sdm630-smmu-v2
5596
- qcom,sdm845-smmu-v2
97+
- qcom,sm6350-smmu-v2
5698
- const: qcom,adreno-smmu
5799
- const: qcom,smmu-v2
100+
- description: Qcom Adreno GPUs on Google Cheza platform
101+
items:
102+
- const: qcom,sdm845-smmu-v2
103+
- const: qcom,smmu-v2
58104
- description: Marvell SoCs implementing "arm,mmu-500"
59105
items:
60106
- const: marvell,ap806-smmu-500
@@ -147,16 +193,12 @@ properties:
147193
present in such cases.
148194
149195
clock-names:
150-
items:
151-
- const: bus
152-
- const: iface
196+
minItems: 1
197+
maxItems: 7
153198

154199
clocks:
155-
items:
156-
- description: bus clock required for downstream bus access and for the
157-
smmu ptw
158-
- description: interface clock required to access smmu's registers
159-
through the TCU's programming interface.
200+
minItems: 1
201+
maxItems: 7
160202

161203
power-domains:
162204
maxItems: 1
@@ -206,6 +248,124 @@ allOf:
206248
reg:
207249
maxItems: 1
208250

251+
- if:
252+
properties:
253+
compatible:
254+
contains:
255+
enum:
256+
- qcom,msm8998-smmu-v2
257+
- qcom,sdm630-smmu-v2
258+
then:
259+
anyOf:
260+
- properties:
261+
clock-names:
262+
items:
263+
- const: bus
264+
clocks:
265+
items:
266+
- description: bus clock required for downstream bus access and for
267+
the smmu ptw
268+
- properties:
269+
clock-names:
270+
items:
271+
- const: iface
272+
- const: mem
273+
- const: mem_iface
274+
clocks:
275+
items:
276+
- description: interface clock required to access smmu's registers
277+
through the TCU's programming interface.
278+
- description: bus clock required for memory access
279+
- description: bus clock required for GPU memory access
280+
- properties:
281+
clock-names:
282+
items:
283+
- const: iface-mm
284+
- const: iface-smmu
285+
- const: bus-mm
286+
- const: bus-smmu
287+
clocks:
288+
items:
289+
- description: interface clock required to access mnoc's registers
290+
through the TCU's programming interface.
291+
- description: interface clock required to access smmu's registers
292+
through the TCU's programming interface.
293+
- description: bus clock required for downstream bus access
294+
- description: bus clock required for the smmu ptw
295+
296+
- if:
297+
properties:
298+
compatible:
299+
contains:
300+
enum:
301+
- qcom,msm8996-smmu-v2
302+
- qcom,sc7180-smmu-v2
303+
- qcom,sdm845-smmu-v2
304+
then:
305+
properties:
306+
clock-names:
307+
items:
308+
- const: bus
309+
- const: iface
310+
311+
clocks:
312+
items:
313+
- description: bus clock required for downstream bus access and for
314+
the smmu ptw
315+
- description: interface clock required to access smmu's registers
316+
through the TCU's programming interface.
317+
318+
- if:
319+
properties:
320+
compatible:
321+
contains:
322+
const: qcom,sc7280-smmu-500
323+
then:
324+
properties:
325+
clock-names:
326+
items:
327+
- const: gcc_gpu_memnoc_gfx_clk
328+
- const: gcc_gpu_snoc_dvm_gfx_clk
329+
- const: gpu_cc_ahb_clk
330+
- const: gpu_cc_hlos1_vote_gpu_smmu_clk
331+
- const: gpu_cc_cx_gmu_clk
332+
- const: gpu_cc_hub_cx_int_clk
333+
- const: gpu_cc_hub_aon_clk
334+
335+
clocks:
336+
items:
337+
- description: GPU memnoc_gfx clock
338+
- description: GPU snoc_dvm_gfx clock
339+
- description: GPU ahb clock
340+
- description: GPU hlos1_vote_GPU smmu clock
341+
- description: GPU cx_gmu clock
342+
- description: GPU hub_cx_int clock
343+
- description: GPU hub_aon clock
344+
345+
- if:
346+
properties:
347+
compatible:
348+
contains:
349+
enum:
350+
- qcom,sm6350-smmu-v2
351+
- qcom,sm8150-smmu-500
352+
- qcom,sm8250-smmu-500
353+
then:
354+
properties:
355+
clock-names:
356+
items:
357+
- const: ahb
358+
- const: bus
359+
- const: iface
360+
361+
clocks:
362+
items:
363+
- description: bus clock required for AHB bus access
364+
- description: bus clock required for downstream bus access and for
365+
the smmu ptw
366+
- description: interface clock required to access smmu's registers
367+
through the TCU's programming interface.
368+
209369
examples:
210370
- |+
211371
/* SMMU with stream matching or stream indexing */

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ int arm_mmu500_reset(struct arm_smmu_device *smmu)
136136
reg = arm_smmu_cb_read(smmu, i, ARM_SMMU_CB_ACTLR);
137137
reg &= ~ARM_MMU500_ACTLR_CPRE;
138138
arm_smmu_cb_write(smmu, i, ARM_SMMU_CB_ACTLR, reg);
139+
reg = arm_smmu_cb_read(smmu, i, ARM_SMMU_CB_ACTLR);
140+
if (reg & ARM_MMU500_ACTLR_CPRE)
141+
dev_warn_once(smmu->dev, "Failed to disable prefetcher [errata #841119 and #826419], check ACR.CACHE_LOCK\n");
139142
}
140143

141144
return 0;

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

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@
1010
#include "arm-smmu.h"
1111
#include "arm-smmu-qcom.h"
1212

13-
enum qcom_smmu_impl_reg_offset {
14-
QCOM_SMMU_TBU_PWR_STATUS,
15-
QCOM_SMMU_STATS_SYNC_INV_TBU_ACK,
16-
QCOM_SMMU_MMU2QSS_AND_SAFE_WAIT_CNTR,
17-
};
18-
19-
struct qcom_smmu_config {
20-
const u32 *reg_offset;
21-
};
22-
2313
void qcom_smmu_tlb_sync_debug(struct arm_smmu_device *smmu)
2414
{
2515
int ret;
@@ -59,84 +49,3 @@ void qcom_smmu_tlb_sync_debug(struct arm_smmu_device *smmu)
5949
tbu_pwr_status, sync_inv_ack, sync_inv_progress);
6050
}
6151
}
62-
63-
/* Implementation Defined Register Space 0 register offsets */
64-
static const u32 qcom_smmu_impl0_reg_offset[] = {
65-
[QCOM_SMMU_TBU_PWR_STATUS] = 0x2204,
66-
[QCOM_SMMU_STATS_SYNC_INV_TBU_ACK] = 0x25dc,
67-
[QCOM_SMMU_MMU2QSS_AND_SAFE_WAIT_CNTR] = 0x2670,
68-
};
69-
70-
static const struct qcom_smmu_config qcm2290_smmu_cfg = {
71-
.reg_offset = qcom_smmu_impl0_reg_offset,
72-
};
73-
74-
static const struct qcom_smmu_config sc7180_smmu_cfg = {
75-
.reg_offset = qcom_smmu_impl0_reg_offset,
76-
};
77-
78-
static const struct qcom_smmu_config sc7280_smmu_cfg = {
79-
.reg_offset = qcom_smmu_impl0_reg_offset,
80-
};
81-
82-
static const struct qcom_smmu_config sc8180x_smmu_cfg = {
83-
.reg_offset = qcom_smmu_impl0_reg_offset,
84-
};
85-
86-
static const struct qcom_smmu_config sc8280xp_smmu_cfg = {
87-
.reg_offset = qcom_smmu_impl0_reg_offset,
88-
};
89-
90-
static const struct qcom_smmu_config sm6125_smmu_cfg = {
91-
.reg_offset = qcom_smmu_impl0_reg_offset,
92-
};
93-
94-
static const struct qcom_smmu_config sm6350_smmu_cfg = {
95-
.reg_offset = qcom_smmu_impl0_reg_offset,
96-
};
97-
98-
static const struct qcom_smmu_config sm8150_smmu_cfg = {
99-
.reg_offset = qcom_smmu_impl0_reg_offset,
100-
};
101-
102-
static const struct qcom_smmu_config sm8250_smmu_cfg = {
103-
.reg_offset = qcom_smmu_impl0_reg_offset,
104-
};
105-
106-
static const struct qcom_smmu_config sm8350_smmu_cfg = {
107-
.reg_offset = qcom_smmu_impl0_reg_offset,
108-
};
109-
110-
static const struct qcom_smmu_config sm8450_smmu_cfg = {
111-
.reg_offset = qcom_smmu_impl0_reg_offset,
112-
};
113-
114-
static const struct of_device_id __maybe_unused qcom_smmu_impl_debug_match[] = {
115-
{ .compatible = "qcom,msm8998-smmu-v2" },
116-
{ .compatible = "qcom,qcm2290-smmu-500", .data = &qcm2290_smmu_cfg },
117-
{ .compatible = "qcom,sc7180-smmu-500", .data = &sc7180_smmu_cfg },
118-
{ .compatible = "qcom,sc7280-smmu-500", .data = &sc7280_smmu_cfg},
119-
{ .compatible = "qcom,sc8180x-smmu-500", .data = &sc8180x_smmu_cfg },
120-
{ .compatible = "qcom,sc8280xp-smmu-500", .data = &sc8280xp_smmu_cfg },
121-
{ .compatible = "qcom,sdm630-smmu-v2" },
122-
{ .compatible = "qcom,sdm845-smmu-500" },
123-
{ .compatible = "qcom,sm6125-smmu-500", .data = &sm6125_smmu_cfg},
124-
{ .compatible = "qcom,sm6350-smmu-500", .data = &sm6350_smmu_cfg},
125-
{ .compatible = "qcom,sm8150-smmu-500", .data = &sm8150_smmu_cfg },
126-
{ .compatible = "qcom,sm8250-smmu-500", .data = &sm8250_smmu_cfg },
127-
{ .compatible = "qcom,sm8350-smmu-500", .data = &sm8350_smmu_cfg },
128-
{ .compatible = "qcom,sm8450-smmu-500", .data = &sm8450_smmu_cfg },
129-
{ }
130-
};
131-
132-
const void *qcom_smmu_impl_data(struct arm_smmu_device *smmu)
133-
{
134-
const struct of_device_id *match;
135-
const struct device_node *np = smmu->dev->of_node;
136-
137-
match = of_match_node(qcom_smmu_impl_debug_match, np);
138-
if (!match)
139-
return NULL;
140-
141-
return match->data;
142-
}

0 commit comments

Comments
 (0)