Add pmu_init() platform override, which will be used to register
PMU device and populate event mappings.
Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
int (*fdt_fixup)(void *fdt, const struct fdt_match *match);
int (*extensions_init)(const struct fdt_match *match,
struct sbi_hart_features *hfeatures);
+ int (*pmu_init)(const struct fdt_match *match);
void (*fw_init)(void *fdt, const struct fdt_match *match);
int (*vendor_ext_provider)(long funcid,
const struct sbi_trap_regs *regs,
{
int rc;
+ if (generic_plat && generic_plat->pmu_init) {
+ rc = generic_plat->pmu_init(generic_plat_match);
+ if (rc)
+ return rc;
+ }
+
rc = fdt_pmu_setup(fdt_get_address());
if (rc && rc != SBI_ENOENT)
return rc;