Skip to content

Commit 3d0dc6c

Browse files
rmurphy-armgregkh
authored andcommitted
perf/arm-cmn: Fix CMN S3 DTM offset
commit b3fe1c8 upstream. CMN S3's DTM offset is different between r0px and r1p0, and it turns out this was not a error in the earlier documentation, but does actually exist in the design. Lovely. Cc: [email protected] Fixes: 0dc2f49 ("perf/arm-cmn: Support CMN S3") Signed-off-by: Robin Murphy <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a51bf59 commit 3d0dc6c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/perf/arm-cmn.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
/* PMU registers occupy the 3rd 4KB page of each node's region */
6666
#define CMN_PMU_OFFSET 0x2000
6767
/* ...except when they don't :( */
68-
#define CMN_S3_DTM_OFFSET 0xa000
68+
#define CMN_S3_R1_DTM_OFFSET 0xa000
6969
#define CMN_S3_PMU_OFFSET 0xd900
7070

7171
/* For most nodes, this is all there is */
@@ -233,6 +233,9 @@ enum cmn_revision {
233233
REV_CMN700_R1P0,
234234
REV_CMN700_R2P0,
235235
REV_CMN700_R3P0,
236+
REV_CMNS3_R0P0 = 0,
237+
REV_CMNS3_R0P1,
238+
REV_CMNS3_R1P0,
236239
REV_CI700_R0P0 = 0,
237240
REV_CI700_R1P0,
238241
REV_CI700_R2P0,
@@ -425,8 +428,8 @@ static enum cmn_model arm_cmn_model(const struct arm_cmn *cmn)
425428
static int arm_cmn_pmu_offset(const struct arm_cmn *cmn, const struct arm_cmn_node *dn)
426429
{
427430
if (cmn->part == PART_CMN_S3) {
428-
if (dn->type == CMN_TYPE_XP)
429-
return CMN_S3_DTM_OFFSET;
431+
if (cmn->rev >= REV_CMNS3_R1P0 && dn->type == CMN_TYPE_XP)
432+
return CMN_S3_R1_DTM_OFFSET;
430433
return CMN_S3_PMU_OFFSET;
431434
}
432435
return CMN_PMU_OFFSET;

0 commit comments

Comments
 (0)