mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 15:31:22 +01:00
platform: generic: Introduce pmu_init() platform override
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>
This commit is contained in:

committed by
Anup Patel

parent
51ec60c9ea
commit
effd89aa05
@@ -27,6 +27,7 @@ struct platform_override {
|
||||
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,
|
||||
|
@@ -267,6 +267,12 @@ static int generic_pmu_init(void)
|
||||
{
|
||||
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;
|
||||
|
Reference in New Issue
Block a user