]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Helper.S
ARM Packages: Removed trailing spaces
[mirror_edk2.git] / ArmPlatformPkg / ArmVExpressPkg / Library / ArmVExpressLibCTA15-A7 / CTA15-A7Helper.S
index 09cfc827a175323e26f118fddbe086c12888a382..e208a84ca27eb74cb34c28c2d04184970add765a 100644 (file)
 \r
 #include <ArmPlatform.h>\r
 \r
-.text \r
-.align 3\r
+.text\r
+.align 2\r
 \r
+GCC_ASM_EXPORT(ArmPlatformPeiBootAction)\r
 GCC_ASM_EXPORT(ArmPlatformGetCorePosition)\r
 GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore)\r
+GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId)\r
+\r
+ASM_PFX(ArmPlatformPeiBootAction):\r
+  bx    lr\r
 \r
 //UINTN\r
 //ArmPlatformGetCorePosition (\r
@@ -62,3 +67,23 @@ ASM_PFX(ArmPlatformIsPrimaryCore):
   movne r0, #0\r
   bx    lr\r
 \r
+//UINTN\r
+//ArmPlatformGetPrimaryCoreMpId (\r
+//  VOID\r
+//  );\r
+ASM_PFX(ArmPlatformGetPrimaryCoreMpId):\r
+  // Extract cpu_id and cluster_id from ARM_SCC_CFGREG48\r
+  // with cpu_id[0:3] and cluster_id[4:7]\r
+  LoadConstantToReg (ARM_CTA15A7_SCC_CFGREG48, r0)\r
+  ldr   r0, [r0]\r
+  lsr   r0, #24\r
+\r
+  // Shift the SCC value to get the cluster ID at the offset #8\r
+  lsl   r1, r0, #4\r
+  and   r1, r1, #0xF00\r
+\r
+  // Keep only the cpu ID from the original SCC\r
+  and   r0, r0, #0x0F\r
+  // Add the Cluster ID to the Cpu ID\r
+  orr   r0, r0, r1\r
+  bx    lr\r