mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "guojinhui.liam" <guojinhui.liam@bytedance.com>
To: will@kernel.org, mark.rutland@arm.com
Cc: lizefan.x@bytedance.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	"guojinhui.liam" <guojinhui.liam@bytedance.com>
Subject: [PATCH] perf/arm-cmn: Fix CMN_DTM_UNIT_INFO offset in CMN700
Date: Tue, 12 Sep 2023 12:03:09 +0800	[thread overview]
Message-ID: <20230912040309.1789-1-guojinhui.liam@bytedance.com> (raw)

The por_dtm_unit_info's offest is 0x0960 in CMN700 according to
the CMN700 spec.

CMN700 spec link:
https://developer.arm.com/documentation/102308/0302/?lang=en
por_dtm_unit_info can be found in section [4.3.13.10 por_dtm_unit_info].

Signed-off-by: guojinhui.liam <guojinhui.liam@bytedance.com>
---
 drivers/perf/arm-cmn.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index 913dc04b3a40..6f3fafee0ac9 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -113,6 +113,7 @@
 #define CMN_DTM_PMEVCNTSR		0x240
 
 #define CMN_DTM_UNIT_INFO		0x0910
+#define CMN700_DTM_UNIT_INFO		0x0960
 
 #define CMN_DTM_NUM_COUNTERS		4
 /* Want more local counters? Why not replicate the whole DTM! Ugh... */
@@ -2247,6 +2248,8 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
 
 		if (cmn->part == PART_CMN600)
 			xp->dtc = 0xf;
+		else if (cmn->part == PART_CMN700)
+			xp->dtc = 1 << readl_relaxed(xp_region + CMN700_DTM_UNIT_INFO);
 		else
 			xp->dtc = 1 << readl_relaxed(xp_region + CMN_DTM_UNIT_INFO);
 
-- 
2.20.1


             reply	other threads:[~2023-09-12  4:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12  4:03 guojinhui.liam [this message]
2023-09-12  8:08 ` Robin Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230912040309.1789-1-guojinhui.liam@bytedance.com \
    --to=guojinhui.liam@bytedance.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®