@@ -136,7 +136,7 @@ union sbi_pmu_ctr_info {
136
136
};
137
137
};
138
138
139
- #define RISCV_PMU_RAW_EVENT_MASK GENMASK_ULL(55 , 0)
139
+ #define RISCV_PMU_RAW_EVENT_MASK GENMASK_ULL(47 , 0)
140
140
#define RISCV_PMU_RAW_EVENT_IDX 0x20000
141
141
142
142
/** General pmu event codes specified in SBI PMU extension */
@@ -203,12 +203,26 @@ enum sbi_pmu_ctr_type {
203
203
SBI_PMU_CTR_TYPE_FW ,
204
204
};
205
205
206
+ /* Helper macros to decode event idx */
207
+ #define SBI_PMU_EVENT_IDX_OFFSET 20
208
+ #define SBI_PMU_EVENT_IDX_MASK 0xFFFFF
209
+ #define SBI_PMU_EVENT_IDX_CODE_MASK 0xFFFF
210
+ #define SBI_PMU_EVENT_IDX_TYPE_MASK 0xF0000
211
+ #define SBI_PMU_EVENT_RAW_IDX 0x20000
212
+ #define SBI_PMU_FIXED_CTR_MASK 0x07
213
+
214
+ #define SBI_PMU_EVENT_CACHE_ID_CODE_MASK 0xFFF8
215
+ #define SBI_PMU_EVENT_CACHE_OP_ID_CODE_MASK 0x06
216
+ #define SBI_PMU_EVENT_CACHE_RESULT_ID_CODE_MASK 0x01
217
+
218
+ #define SBI_PMU_EVENT_IDX_INVALID 0xFFFFFFFF
219
+
206
220
/* Flags defined for config matching function */
207
221
#define SBI_PMU_CFG_FLAG_SKIP_MATCH (1 << 0)
208
222
#define SBI_PMU_CFG_FLAG_CLEAR_VALUE (1 << 1)
209
223
#define SBI_PMU_CFG_FLAG_AUTO_START (1 << 2)
210
224
#define SBI_PMU_CFG_FLAG_SET_VUINH (1 << 3)
211
- #define SBI_PMU_CFG_FLAG_SET_VSNH (1 << 4)
225
+ #define SBI_PMU_CFG_FLAG_SET_VSINH (1 << 4)
212
226
#define SBI_PMU_CFG_FLAG_SET_UINH (1 << 5)
213
227
#define SBI_PMU_CFG_FLAG_SET_SINH (1 << 6)
214
228
#define SBI_PMU_CFG_FLAG_SET_MINH (1 << 7)
0 commit comments