From d8a483fc7fd05f7c72a1690e0db326bd4bcd5514 Mon Sep 17 00:00:00 2001 From: Atish Patra Date: Tue, 19 Nov 2024 11:34:35 -0800 Subject: lib: sbi_pmu: PMU raw event v2 support As per the updated ISA specification and SBI PMU v3.0, lower 56 bits are available for the platform to implement mhpmeventX encoding. Implement the PMU raw event V2 support defined in SBI v3.0 which allows more bits for platforms to encode the raw events. Signed-off-by: Atish Patra Reviewed-by: Anup Patel --- platform/generic/platform.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'platform') diff --git a/platform/generic/platform.c b/platform/generic/platform.c index fb074d4b..fefb08cf 100644 --- a/platform/generic/platform.c +++ b/platform/generic/platform.c @@ -392,7 +392,8 @@ static uint64_t generic_pmu_xlate_to_mhpmevent(uint32_t event_idx, uint64_t evt_val = 0; /* data is valid only for raw events and is equal to event selector */ - if (event_idx == SBI_PMU_EVENT_RAW_IDX) + if (event_idx == SBI_PMU_EVENT_RAW_IDX || + event_idx == SBI_PMU_EVENT_RAW_V2_IDX) evt_val = data; else { /** -- cgit v1.3.1