From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Date: Wed, 16 Mar 2022 20:21:18 +0000 (+0100)
Subject: cmd: sbi: add Performance Monitoring Unit Extension
X-Git-Tag: v2025.01-rc5-pxa1908~1473^2~4
X-Git-Url: http://git.dujemihanovic.xyz/img/static/html/%7B%7B%20%24.Site.BaseURL%20%7D%7Dposts/%7B%7B%20%28.OutputFormats.Get?a=commitdiff_plain;h=70ae54bd2579568372e79f69417e5cb568b24b6f;p=u-boot.git

cmd: sbi: add Performance Monitoring Unit Extension

Version 1.0-rc3 of the RISC-V Supervisor Binary Interface Specification
has added the Performance Monitoring Unit Extension.

The sbi command should be able to detect it.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---

diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h
index bfcd204953..76453121ea 100644
--- a/arch/riscv/include/asm/sbi.h
+++ b/arch/riscv/include/asm/sbi.h
@@ -27,6 +27,7 @@ enum sbi_ext_id {
 	SBI_EXT_RFENCE = 0x52464E43,
 	SBI_EXT_HSM = 0x48534D,
 	SBI_EXT_SRST = 0x53525354,
+	SBI_EXT_PMU = 0x504D55,
 };
 
 enum sbi_ext_base_fid {
diff --git a/cmd/riscv/sbi.c b/cmd/riscv/sbi.c
index c4a9c840f3..8349123925 100644
--- a/cmd/riscv/sbi.c
+++ b/cmd/riscv/sbi.c
@@ -44,6 +44,7 @@ static struct sbi_ext extensions[] = {
 	{ SBI_EXT_RFENCE,		      "RFENCE Extension" },
 	{ SBI_EXT_HSM,			      "Hart State Management Extension" },
 	{ SBI_EXT_SRST,			      "System Reset Extension" },
+	{ SBI_EXT_PMU,			      "Performance Monitoring Unit Extension" },
 };
 
 static int do_sbi(struct cmd_tbl *cmdtp, int flag, int argc,