|
28 | 28 | #define SLLC_VERSION 0x1cf0
|
29 | 29 | #define SLLC_EVENT_CNT0_L 0x1d00
|
30 | 30 |
|
| 31 | +/* SLLC registers definition in v3 */ |
| 32 | +#define SLLC_V3_INT_MASK 0x6834 |
| 33 | +#define SLLC_V3_INT_STATUS 0x6838 |
| 34 | +#define SLLC_V3_INT_CLEAR 0x683c |
| 35 | +#define SLLC_V3_VERSION 0x6c00 |
| 36 | +#define SLLC_V3_PERF_CTRL 0x6d00 |
| 37 | +#define SLLC_V3_SRCID_CTRL 0x6d04 |
| 38 | +#define SLLC_V3_TGTID_CTRL 0x6d08 |
| 39 | +#define SLLC_V3_EVENT_CTRL 0x6d14 |
| 40 | +#define SLLC_V3_EVENT_TYPE0 0x6d18 |
| 41 | +#define SLLC_V3_EVENT_CNT0_L 0x6e00 |
| 42 | + |
31 | 43 | #define SLLC_EVTYPE_MASK 0xff
|
32 | 44 | #define SLLC_PERF_CTRL_EN BIT(0)
|
33 | 45 | #define SLLC_FILT_EN BIT(1)
|
|
40 | 52 | #define SLLC_TGTID_MAX_SHIFT 12
|
41 | 53 | #define SLLC_SRCID_CMD_SHIFT 1
|
42 | 54 | #define SLLC_SRCID_MSK_SHIFT 12
|
| 55 | + |
| 56 | +#define SLLC_V3_TGTID_MIN_SHIFT 1 |
| 57 | +#define SLLC_V3_TGTID_MAX_SHIFT 10 |
| 58 | +#define SLLC_V3_SRCID_CMD_SHIFT 1 |
| 59 | +#define SLLC_V3_SRCID_MSK_SHIFT 10 |
| 60 | + |
43 | 61 | #define SLLC_NR_EVENTS 0x80
|
44 | 62 | #define SLLC_EVENT_CNTn(cnt0, n) ((cnt0) + (n) * 8)
|
45 | 63 |
|
@@ -404,6 +422,27 @@ static const struct hisi_pmu_dev_info hisi_sllc_v2 = {
|
404 | 422 | .private = &hisi_sllc_v2_pmu_regs,
|
405 | 423 | };
|
406 | 424 |
|
| 425 | +static struct hisi_sllc_pmu_regs hisi_sllc_v3_pmu_regs = { |
| 426 | + .int_mask = SLLC_V3_INT_MASK, |
| 427 | + .int_clear = SLLC_V3_INT_CLEAR, |
| 428 | + .int_status = SLLC_V3_INT_STATUS, |
| 429 | + .perf_ctrl = SLLC_V3_PERF_CTRL, |
| 430 | + .srcid_ctrl = SLLC_V3_SRCID_CTRL, |
| 431 | + .srcid_cmd_shift = SLLC_V3_SRCID_CMD_SHIFT, |
| 432 | + .srcid_mask_shift = SLLC_V3_SRCID_MSK_SHIFT, |
| 433 | + .tgtid_ctrl = SLLC_V3_TGTID_CTRL, |
| 434 | + .tgtid_min_shift = SLLC_V3_TGTID_MIN_SHIFT, |
| 435 | + .tgtid_max_shift = SLLC_V3_TGTID_MAX_SHIFT, |
| 436 | + .event_ctrl = SLLC_V3_EVENT_CTRL, |
| 437 | + .event_type0 = SLLC_V3_EVENT_TYPE0, |
| 438 | + .version = SLLC_V3_VERSION, |
| 439 | + .event_cnt0 = SLLC_V3_EVENT_CNT0_L, |
| 440 | +}; |
| 441 | + |
| 442 | +static const struct hisi_pmu_dev_info hisi_sllc_v3 = { |
| 443 | + .private = &hisi_sllc_v3_pmu_regs, |
| 444 | +}; |
| 445 | + |
407 | 446 | static const struct hisi_uncore_ops hisi_uncore_sllc_ops = {
|
408 | 447 | .write_evtype = hisi_sllc_pmu_write_evtype,
|
409 | 448 | .get_event_idx = hisi_uncore_pmu_get_event_idx,
|
@@ -497,6 +536,7 @@ static void hisi_sllc_pmu_remove(struct platform_device *pdev)
|
497 | 536 |
|
498 | 537 | static const struct acpi_device_id hisi_sllc_pmu_acpi_match[] = {
|
499 | 538 | { "HISI0263", (kernel_ulong_t)&hisi_sllc_v2 },
|
| 539 | + { "HISI0264", (kernel_ulong_t)&hisi_sllc_v3 }, |
500 | 540 | {}
|
501 | 541 | };
|
502 | 542 | MODULE_DEVICE_TABLE(acpi, hisi_sllc_pmu_acpi_match);
|
|
0 commit comments