|
43 | 43 | #define DDRC_V2_EVENT_TYPE 0xe74
|
44 | 44 | #define DDRC_V2_PERF_CTRL 0xeA0
|
45 | 45 |
|
| 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 | + |
46 | 51 | /* DDRC has 8-counters */
|
47 | 52 | #define DDRC_NR_COUNTERS 0x8
|
48 | 53 | #define DDRC_V1_PERF_CTRL_EN 0x2
|
@@ -460,9 +465,28 @@ static const struct hisi_pmu_dev_info hisi_ddrc_v2 = {
|
460 | 465 | .private = &hisi_ddrc_v2_pmu_regs,
|
461 | 466 | };
|
462 | 467 |
|
| 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 | + |
463 | 486 | static const struct acpi_device_id hisi_ddrc_pmu_acpi_match[] = {
|
464 | 487 | { "HISI0233", (kernel_ulong_t)&hisi_ddrc_v1 },
|
465 | 488 | { "HISI0234", (kernel_ulong_t)&hisi_ddrc_v2 },
|
| 489 | + { "HISI0235", (kernel_ulong_t)&hisi_ddrc_v3 }, |
466 | 490 | {}
|
467 | 491 | };
|
468 | 492 | MODULE_DEVICE_TABLE(acpi, hisi_ddrc_pmu_acpi_match);
|
|
0 commit comments