diff mbox series

[v3,03/15] lib: sbi: Add Xandespmu in hart extensions

Message ID 20231122073617.379441-4-peterlin@andestech.com
State Changes Requested
Headers show
Series Add Andes PMU extension support | expand

Commit Message

Yu-Chien Peter Lin Nov. 22, 2023, 7:36 a.m. UTC
When SBI PMU updates inhibit bits on mcyclecfg and
minstretcfg, it will check if Smcntrpmf extension
is supported, we need to check Xandespmu similarly
in the pmu_fixed_ctr_update_inhibit_bits() so add
the custom extension to hart extension list.

Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
---
Changes v2 -> v3:
  - New patch
---
 include/sbi/sbi_hart.h | 2 ++
 lib/sbi/sbi_hart.c     | 3 +++
 2 files changed, 5 insertions(+)

Comments

Atish Patra Nov. 23, 2023, 12:02 a.m. UTC | #1
On Tue, Nov 21, 2023 at 11:40 PM Yu Chien Peter Lin
<peterlin@andestech.com> wrote:
>
> When SBI PMU updates inhibit bits on mcyclecfg and
> minstretcfg, it will check if Smcntrpmf extension
> is supported, we need to check Xandespmu similarly
> in the pmu_fixed_ctr_update_inhibit_bits() so add
> the custom extension to hart extension list.
>
> Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
> ---
> Changes v2 -> v3:
>   - New patch
> ---
>  include/sbi/sbi_hart.h | 2 ++
>  lib/sbi/sbi_hart.c     | 3 +++
>  2 files changed, 5 insertions(+)
>
> diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h
> index 6ee49ff..811e5f5 100644
> --- a/include/sbi/sbi_hart.h
> +++ b/include/sbi/sbi_hart.h
> @@ -45,6 +45,8 @@ enum sbi_hart_extensions {
>         SBI_HART_EXT_ZKR,
>         /** Hart has Smcntrpmf extension */
>         SBI_HART_EXT_SMCNTRPMF,
> +       /** Hart has Xandespmu extension */
> +       SBI_HART_EXT_XANDESPMU,
>
>         /** Maximum index of Hart extension */
>         SBI_HART_EXT_MAX,
> diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c
> index 77eef49..d372af1 100644
> --- a/lib/sbi/sbi_hart.c
> +++ b/lib/sbi/sbi_hart.c
> @@ -693,6 +693,9 @@ static inline char *sbi_hart_extension_id2string(int ext)
>         case SBI_HART_EXT_SMCNTRPMF:
>                 estr = "smcntrpmf";
>                 break;
> +       case SBI_HART_EXT_XANDESPMU:
> +               estr = "xandespmu";
> +               break;
>         default:
>                 break;
>         }
> --
> 2.34.1
>


Reviewed-by: Atish Patra <atishp@rivosinc.com>
Prabhakar Nov. 24, 2023, 2:45 p.m. UTC | #2
On Wed, Nov 22, 2023 at 7:41 AM Yu Chien Peter Lin
<peterlin@andestech.com> wrote:
>
> When SBI PMU updates inhibit bits on mcyclecfg and
> minstretcfg, it will check if Smcntrpmf extension
> is supported, we need to check Xandespmu similarly
> in the pmu_fixed_ctr_update_inhibit_bits() so add
> the custom extension to hart extension list.
>
> Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
> ---
> Changes v2 -> v3:
>   - New patch
> ---
>  include/sbi/sbi_hart.h | 2 ++
>  lib/sbi/sbi_hart.c     | 3 +++
>  2 files changed, 5 insertions(+)
>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Cheers,
Prabhakar

> diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h
> index 6ee49ff..811e5f5 100644
> --- a/include/sbi/sbi_hart.h
> +++ b/include/sbi/sbi_hart.h
> @@ -45,6 +45,8 @@ enum sbi_hart_extensions {
>         SBI_HART_EXT_ZKR,
>         /** Hart has Smcntrpmf extension */
>         SBI_HART_EXT_SMCNTRPMF,
> +       /** Hart has Xandespmu extension */
> +       SBI_HART_EXT_XANDESPMU,
>
>         /** Maximum index of Hart extension */
>         SBI_HART_EXT_MAX,
> diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c
> index 77eef49..d372af1 100644
> --- a/lib/sbi/sbi_hart.c
> +++ b/lib/sbi/sbi_hart.c
> @@ -693,6 +693,9 @@ static inline char *sbi_hart_extension_id2string(int ext)
>         case SBI_HART_EXT_SMCNTRPMF:
>                 estr = "smcntrpmf";
>                 break;
> +       case SBI_HART_EXT_XANDESPMU:
> +               estr = "xandespmu";
> +               break;
>         default:
>                 break;
>         }
> --
> 2.34.1
>
>
> --
> opensbi mailing list
> opensbi@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi
diff mbox series

Patch

diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h
index 6ee49ff..811e5f5 100644
--- a/include/sbi/sbi_hart.h
+++ b/include/sbi/sbi_hart.h
@@ -45,6 +45,8 @@  enum sbi_hart_extensions {
 	SBI_HART_EXT_ZKR,
 	/** Hart has Smcntrpmf extension */
 	SBI_HART_EXT_SMCNTRPMF,
+	/** Hart has Xandespmu extension */
+	SBI_HART_EXT_XANDESPMU,
 
 	/** Maximum index of Hart extension */
 	SBI_HART_EXT_MAX,
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c
index 77eef49..d372af1 100644
--- a/lib/sbi/sbi_hart.c
+++ b/lib/sbi/sbi_hart.c
@@ -693,6 +693,9 @@  static inline char *sbi_hart_extension_id2string(int ext)
 	case SBI_HART_EXT_SMCNTRPMF:
 		estr = "smcntrpmf";
 		break;
+	case SBI_HART_EXT_XANDESPMU:
+		estr = "xandespmu";
+		break;
 	default:
 		break;
 	}