Commit b3fe1c83 authored by Robin Murphy's avatar Robin Murphy Committed by Will Deacon
Browse files

perf/arm-cmn: Fix CMN S3 DTM offset



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: stable@vger.kernel.org
Fixes: 0dc2f496 ("perf/arm-cmn: Support CMN S3")
Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent a29fea30
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@
/* PMU registers occupy the 3rd 4KB page of each node's region */
#define CMN_PMU_OFFSET			0x2000
/* ...except when they don't :( */
#define CMN_S3_DTM_OFFSET		0xa000
#define CMN_S3_R1_DTM_OFFSET		0xa000
#define CMN_S3_PMU_OFFSET		0xd900

/* For most nodes, this is all there is */
@@ -233,6 +233,9 @@ enum cmn_revision {
	REV_CMN700_R1P0,
	REV_CMN700_R2P0,
	REV_CMN700_R3P0,
	REV_CMNS3_R0P0 = 0,
	REV_CMNS3_R0P1,
	REV_CMNS3_R1P0,
	REV_CI700_R0P0 = 0,
	REV_CI700_R1P0,
	REV_CI700_R2P0,
@@ -425,8 +428,8 @@ static enum cmn_model arm_cmn_model(const struct arm_cmn *cmn)
static int arm_cmn_pmu_offset(const struct arm_cmn *cmn, const struct arm_cmn_node *dn)
{
	if (cmn->part == PART_CMN_S3) {
		if (dn->type == CMN_TYPE_XP)
			return CMN_S3_DTM_OFFSET;
		if (cmn->rev >= REV_CMNS3_R1P0 && dn->type == CMN_TYPE_XP)
			return CMN_S3_R1_DTM_OFFSET;
		return CMN_S3_PMU_OFFSET;
	}
	return CMN_PMU_OFFSET;