Skip to content

Commit 17aa34e

Browse files
Junhao Hewilldeacon
authored andcommitted
drivers/perf: hisi: Add support for HiSilicon DDRC v3 PMU driver
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 <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Signed-off-by: Yicong Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent dc86791 commit 17aa34e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
#define DDRC_V2_EVENT_TYPE 0xe74
4444
#define DDRC_V2_PERF_CTRL 0xeA0
4545

46+
/* DDRC interrupt registers definition in v3 */
47+
#define DDRC_V3_INT_MASK 0x534
48+
#define DDRC_V3_INT_STATUS 0x538
49+
#define DDRC_V3_INT_CLEAR 0x53C
50+
4651
/* DDRC has 8-counters */
4752
#define DDRC_NR_COUNTERS 0x8
4853
#define DDRC_V1_PERF_CTRL_EN 0x2
@@ -460,9 +465,28 @@ static const struct hisi_pmu_dev_info hisi_ddrc_v2 = {
460465
.private = &hisi_ddrc_v2_pmu_regs,
461466
};
462467

468+
static struct hisi_ddrc_pmu_regs hisi_ddrc_v3_pmu_regs = {
469+
.event_cnt = DDRC_V2_EVENT_CNT,
470+
.event_ctrl = DDRC_V2_EVENT_CTRL,
471+
.event_type = DDRC_V2_EVENT_TYPE,
472+
.perf_ctrl = DDRC_V2_PERF_CTRL,
473+
.perf_ctrl_en = DDRC_V2_PERF_CTRL_EN,
474+
.int_mask = DDRC_V3_INT_MASK,
475+
.int_clear = DDRC_V3_INT_CLEAR,
476+
.int_status = DDRC_V3_INT_STATUS,
477+
};
478+
479+
static const struct hisi_pmu_dev_info hisi_ddrc_v3 = {
480+
.counter_bits = 48,
481+
.check_event = DDRC_V2_NR_EVENTS,
482+
.attr_groups = hisi_ddrc_pmu_v2_attr_groups,
483+
.private = &hisi_ddrc_v3_pmu_regs,
484+
};
485+
463486
static const struct acpi_device_id hisi_ddrc_pmu_acpi_match[] = {
464487
{ "HISI0233", (kernel_ulong_t)&hisi_ddrc_v1 },
465488
{ "HISI0234", (kernel_ulong_t)&hisi_ddrc_v2 },
489+
{ "HISI0235", (kernel_ulong_t)&hisi_ddrc_v3 },
466490
{}
467491
};
468492
MODULE_DEVICE_TABLE(acpi, hisi_ddrc_pmu_acpi_match);

0 commit comments

Comments
 (0)