diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-08-19 17:31:37 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-09-01 10:28:31 +0530 |
commit | 2c341f7844f439017c9aab42ae92e919c3b98253 (patch) | |
tree | e1140a8dca11b40b895cd70c58bc052d6e9722f2 /lib/sbi/sbi_init.c | |
parent | 74d1db706293f42f5a4e87c907978339b2d0993d (diff) |
lib: sbi: Detect and print MHPM counters at boot-time
A RISC-V platform can leave unimplemented MHPM counters hard-wired
to zero. We extend hart_detect_features() to detect MHPM counters
which are accessible and not hard-wired to zero. We also print
number of available MHPM counters as part of boot prints.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/sbi/sbi_init.c')
-rw-r--r-- | lib/sbi/sbi_init.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c index c438eaa..e1a1d96 100644 --- a/lib/sbi/sbi_init.c +++ b/lib/sbi/sbi_init.c @@ -70,6 +70,7 @@ static void sbi_boot_prints(struct sbi_scratch *scratch, u32 hartid) sbi_hart_get_features_str(scratch, str, sizeof(str)); sbi_printf("BOOT HART Features : %s\n", str); sbi_printf("BOOT HART PMP Count : %d\n", sbi_hart_pmp_count(scratch)); + sbi_printf("BOOT HART MHPM Count: %d\n", sbi_hart_mhpm_count(scratch)); /* Firmware details */ sbi_printf("Firmware Base : 0x%lx\n", scratch->fw_start); |