summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library
diff options
context:
space:
mode:
authorRebecca Cran <rebecca@nuviainc.com>2021-02-07 17:52:37 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-02-08 19:35:23 +0000
commitb69566afae852a947f0df344f7751b92d5d0994b (patch)
tree4ff17fd9f106dfa297955c01eb1f3e4d07b2be03 /ArmPkg/Library
parent92bdb2a9c65f57621ad48f9a91326f36fcf2c6f7 (diff)
downloadedk2-b69566afae852a947f0df344f7751b92d5d0994b.tar.gz
edk2-b69566afae852a947f0df344f7751b92d5d0994b.tar.bz2
edk2-b69566afae852a947f0df344f7751b92d5d0994b.zip
ArmPkg: Add helper to read the Memory Model Features Register 2
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> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Diffstat (limited to 'ArmPkg/Library')
-rw-r--r--ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h11
-rw-r--r--ArmPkg/Library/ArmLib/AArch64/AArch64Support.S3
2 files changed, 14 insertions, 0 deletions
diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h
index 85bcecda73..cfc0c878a4 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 129205d2ac..d3cc1e8671 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