]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: Add helper to read the CCSIDR2 register
authorRebecca Cran <rebecca@nuviainc.com>
Mon, 8 Feb 2021 00:52:43 +0000 (17:52 -0700)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 8 Feb 2021 19:35:23 +0000 (19:35 +0000)
Add helper function to read the CCSIDR2 register.
This is used when CCIDX is supported in AARCH32 mode.

Signed-off-by: Rebecca Cran <rebecca@nuviainc.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S
ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm
ArmPkg/Library/ArmLib/ArmLibPrivate.h

index af61dbee52615be54562c61996670cff3672967d..d843f91dfca880439d6e4805c5f6e0c089272276 100644 (file)
@@ -74,6 +74,16 @@ ASM_FUNC(ReadCCSIDR)
   mrc p15,1,r0,c0,c0,0   @ Read current CP15 Cache Size ID Register (CCSIDR)\r
   bx  lr\r
 \r
+// UINT32\r
+// ReadCCSIDR2 (\r
+//   IN UINT32 CSSELR\r
+//   )\r
+ASM_FUNC(ReadCCSIDR2)\r
+  mcr p15,2,r0,c0,c0,0   @ Write Cache Size Selection Register (CSSELR)\r
+  isb\r
+  mrc p15,1,r0,c0,c0,2   @ Read current CP15 Cache Size ID Register (CCSIDR2)\r
+  bx  lr\r
+\r
 // UINT32\r
 // ReadCLIDR (\r
 //   IN UINT32 CSSELR\r
index 81f3cb79994c94982f8d390268db48ecbef9c0e0..e14f1566258cc4520a1e16649ba26819b4a97214 100644 (file)
   mrc p15,1,r0,c0,c0,0 ; Read current CP15 Cache Size ID Register (CCSIDR)\r
   bx  lr\r
 \r
+// UINT32\r
+// ReadCCSIDR2 (\r
+//   IN UINT32 CSSELR\r
+//   )\r
+ RVCT_ASM_EXPORT ReadCCSIDR2\r
+  mcr p15,2,r0,c0,c0,0 ; Write Cache Size Selection Register (CSSELR)\r
+  isb\r
+  mrc p15,1,r0,c0,c0,2 ; Read current CP15 Cache Size ID Register (CCSIDR2)\r
+  bx  lr\r
+\r
 // UINT32\r
 // ReadCLIDR (\r
 //   IN UINT32 CSSELR\r
index 25560a01e9cfe9bc2830b369632565684fcacd19..1818a1994dc328f0bcc14321a89db726e11a3f12 100644 (file)
@@ -170,6 +170,17 @@ ReadCCSIDR (
   IN UINT32 CSSELR\r
   );\r
 \r
+/** Reads the CCSIDR2 for the specified cache.\r
+\r
+  @param CSSELR The CSSELR cache selection register value\r
+\r
+  @return The contents of the CCSIDR2 register for the specified cache.\r
+**/\r
+UINT32\r
+ReadCCSIDR2 (\r
+  IN UINT32 CSSELR\r
+  );\r
+\r
 UINT32\r
 ReadCLIDR (\r
   VOID\r