From: Yicong Yang <yangyicong@huawei.com>
To: <will@kernel.org>, <mark.rutland@arm.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Cc: <hejunhao3@huawei.com>, <jonathan.cameron@huawei.com>,
<prime.zeng@hisilicon.com>, <linuxarm@huawei.com>,
<yangyicong@hisilicon.com>, <wangyushan12@huawei.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: [PATCH v2 2/8] drivers/perf: hisi: Add support for HiSilicon DDRC v3 PMU driver
Date: Fri, 21 Mar 2025 15:38:40 +0800 [thread overview]
Message-ID: <20250321073846.23507-3-yangyicong@huawei.com> (raw)
In-Reply-To: <20250321073846.23507-1-yangyicong@huawei.com>
From: Junhao He <hejunhao3@huawei.com>
HiSilicon DDRC v3 PMU has the different interrupt register offset
compared to the v2. Add device information of v3 PMU with ACPI
HID HISI0235.
Signed-off-by: Junhao He <hejunhao3@huawei.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
---
drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
index 7e3c2436e96b..26eaa6d20c00 100644
--- a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
@@ -43,6 +43,11 @@
#define DDRC_V2_EVENT_TYPE 0xe74
#define DDRC_V2_PERF_CTRL 0xeA0
+/* DDRC interrupt registers definition in v3 */
+#define DDRC_V3_INT_MASK 0x534
+#define DDRC_V3_INT_STATUS 0x538
+#define DDRC_V3_INT_CLEAR 0x53C
+
/* DDRC has 8-counters */
#define DDRC_NR_COUNTERS 0x8
#define DDRC_V1_PERF_CTRL_EN 0x2
@@ -460,9 +465,28 @@ static const struct hisi_pmu_dev_info hisi_ddrc_v2 = {
.private = &hisi_ddrc_v2_pmu_regs,
};
+static struct hisi_ddrc_pmu_regs hisi_ddrc_v3_pmu_regs = {
+ .event_cnt = DDRC_V2_EVENT_CNT,
+ .event_ctrl = DDRC_V2_EVENT_CTRL,
+ .event_type = DDRC_V2_EVENT_TYPE,
+ .perf_ctrl = DDRC_V2_PERF_CTRL,
+ .perf_ctrl_en = DDRC_V2_PERF_CTRL_EN,
+ .int_mask = DDRC_V3_INT_MASK,
+ .int_clear = DDRC_V3_INT_CLEAR,
+ .int_status = DDRC_V3_INT_STATUS,
+};
+
+static const struct hisi_pmu_dev_info hisi_ddrc_v3 = {
+ .counter_bits = 48,
+ .check_event = DDRC_V2_NR_EVENTS,
+ .attr_groups = hisi_ddrc_pmu_v2_attr_groups,
+ .private = &hisi_ddrc_v3_pmu_regs,
+};
+
static const struct acpi_device_id hisi_ddrc_pmu_acpi_match[] = {
{ "HISI0233", (kernel_ulong_t)&hisi_ddrc_v1 },
{ "HISI0234", (kernel_ulong_t)&hisi_ddrc_v2 },
+ { "HISI0235", (kernel_ulong_t)&hisi_ddrc_v3 },
{}
};
MODULE_DEVICE_TABLE(acpi, hisi_ddrc_pmu_acpi_match);
--
2.24.0
next prev parent reply other threads:[~2025-03-21 7:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 7:38 [PATCH v2 0/8] General updates and two new drivers for HiSilicon Uncore PMU Yicong Yang
2025-03-21 7:38 ` [PATCH v2 1/8] drivers/perf: hisi: Simplify the probe process for each DDRC version Yicong Yang
2025-03-21 7:38 ` Yicong Yang [this message]
2025-03-21 7:38 ` [PATCH v2 3/8] drivers/perf: hisi: Use ACPI driver_data to retrieve SLLC PMU information Yicong Yang
2025-03-21 11:13 ` Jonathan Cameron
2025-03-21 7:38 ` [PATCH v2 4/8] drivers/perf: hisi: Add support for HiSilicon SLLC v3 PMU driver Yicong Yang
2025-03-21 7:38 ` [PATCH v2 5/8] drivers/perf: hisi: Relax the event number check of v2 PMUs Yicong Yang
2025-03-21 11:14 ` Jonathan Cameron
2025-03-21 7:38 ` [PATCH v2 6/8] drivers/perf: hisi: Support PMUs with no interrupt Yicong Yang
2025-03-21 7:38 ` [PATCH v2 7/8] drivers/perf: hisi: Add support for HiSilicon NoC PMU Yicong Yang
2025-03-21 7:38 ` [PATCH v2 8/8] drivers/perf: hisi: Add support for HiSilicon MN PMU driver Yicong Yang
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=20250321073846.23507-3-yangyicong@huawei.com \
--to=yangyicong@huawei.com \
--cc=hejunhao3@huawei.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mark.rutland@arm.com \
--cc=prime.zeng@hisilicon.com \
--cc=wangyushan12@huawei.com \
--cc=will@kernel.org \
--cc=yangyicong@hisilicon.com \
/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®