[edk2-devel] [PATCH v5 04/23] ArmPkg: Add helper to read the Memory Model Features Register 2

Rebecca Cran posted 23 patches 5 months, 2 weeks ago

[edk2-devel] [PATCH v5 04/23] ArmPkg: Add helper to read the Memory Model Features Register 2

Posted by Rebecca Cran 5 months, 2 weeks ago
Add helper function to read the MMFR2 register. We will need this to
determine CCIDX support.

Signed-off-by: Rebecca Cran <rebecca@nuviainc.com>
---
 ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h     | 11 +++++++++++
 ArmPkg/Library/ArmLib/AArch64/AArch64Support.S |  3 +++
 2 files changed, 14 insertions(+)

diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h
index 85bcecda730f..cfc0c878a415 100644
--- a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h
+++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h
@@ -41,5 +41,16 @@ EFIAPI
 ArmReadIdAA64Pfr0 (
   VOID
   );
+
+/** Reads the ID_AA64MMFR2_EL1 register.
+
+   @return The contents of the ID_AA64MMFR2_EL1 register.
+**/
+UINTN
+EFIAPI
+ArmReadIdAA64Mmfr2 (
+  VOID
+  );
+
 #endif // __AARCH64_LIB_H__
 
diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
index 129205d2ac27..d3cc1e86716b 100644
--- a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
+++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
@@ -425,6 +425,9 @@ ASM_FUNC(ArmCallWFI)
   wfi
   ret
 
+ASM_FUNC(ArmReadIdAA64Mmfr2)
+  mrs   x0, ID_AA64MMFR2_EL1           // read EL1 MMFR2
+  ret
 
 ASM_FUNC(ArmReadMpidr)
   mrs   x0, mpidr_el1           // read EL1 MPIDR
-- 
2.26.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69642): https://edk2.groups.io/g/devel/message/69642
Mute This Topic: https://groups.io/mt/79438406/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v5 04/23] ArmPkg: Add helper to read the Memory Model Features Register 2

Posted by Leif Lindholm 5 months, 1 week ago
On Mon, Jan 04, 2021 at 15:58:11 -0700, Rebecca Cran wrote:
> Add helper function to read the MMFR2 register. We will need this to
> determine CCIDX support.
> 
> Signed-off-by: Rebecca Cran <rebecca@nuviainc.com>

Reviewed-by: Leif Lindholm <leif@nuviainc.com>

> ---
>  ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h     | 11 +++++++++++
>  ArmPkg/Library/ArmLib/AArch64/AArch64Support.S |  3 +++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h
> index 85bcecda730f..cfc0c878a415 100644
> --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h
> +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h
> @@ -41,5 +41,16 @@ EFIAPI
>  ArmReadIdAA64Pfr0 (
>    VOID
>    );
> +
> +/** Reads the ID_AA64MMFR2_EL1 register.
> +
> +   @return The contents of the ID_AA64MMFR2_EL1 register.
> +**/
> +UINTN
> +EFIAPI
> +ArmReadIdAA64Mmfr2 (
> +  VOID
> +  );
> +
>  #endif // __AARCH64_LIB_H__
>  
> diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
> index 129205d2ac27..d3cc1e86716b 100644
> --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
> +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
> @@ -425,6 +425,9 @@ ASM_FUNC(ArmCallWFI)
>    wfi
>    ret
>  
> +ASM_FUNC(ArmReadIdAA64Mmfr2)
> +  mrs   x0, ID_AA64MMFR2_EL1           // read EL1 MMFR2
> +  ret
>  
>  ASM_FUNC(ArmReadMpidr)
>    mrs   x0, mpidr_el1           // read EL1 MPIDR
> -- 
> 2.26.2
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#70078): https://edk2.groups.io/g/devel/message/70078
Mute This Topic: https://groups.io/mt/79438406/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v5 04/23] ArmPkg: Add helper to read the Memory Model Features Register 2

Posted by Sami Mujawar 5 months, 1 week ago
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69797): https://edk2.groups.io/g/devel/message/69797
Mute This Topic: https://groups.io/mt/79438406/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-