lib: sbi_pmu: Add custom PMU device operations
authorAnup Patel <apatel@ventanamicro.com>
Wed, 24 Aug 2022 09:41:41 +0000 (15:11 +0530)
committerAnup Patel <anup@brainfault.org>
Thu, 1 Sep 2022 11:23:22 +0000 (16:53 +0530)
commitd10c1f4acde1753ec5818728e9f864b9838f09d1
treeb0b3abcac196e241ff970ac57a7385fa391a20af
parentc9b388d578647c3283aea03f74bf1251503a58f0
lib: sbi_pmu: Add custom PMU device operations

We extend SBI PMU implementation to allow custom PMU device operations
which a platform can use for platform specific quirks.

The custom PMU device operations added by this patch include:
1) Operations to allow a platform implement custom firmware events.
   These custom firmware events can be SBI vendor extension related
   events or platform specific per-HART events are not possible to
   count through HPM CSRs.
2) Operations to allow a platform implement custom way for enabling
   (or disabling) an overflow interrupt (e.g. T-Head C9xx).

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
include/sbi/sbi_pmu.h
lib/sbi/sbi_pmu.c