]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/Sec/SecEntryPoint.S
ArmPlatformPkg: Introduce Primary core macros
[mirror_edk2.git] / ArmPlatformPkg / Sec / SecEntryPoint.S
index 8e5ea31f66da875a730b65c5312a7ff23b5c3b1b..909f7fafbc3d3a5dd55c514751c105df06b3bc0e 100644 (file)
@@ -35,6 +35,7 @@ GCC_ASM_IMPORT(ArmPlatformInitializeBootMemory)
 GCC_ASM_IMPORT(ArmDisableInterrupts)\r
 GCC_ASM_IMPORT(ArmDisableCachesAndMmu)\r
 GCC_ASM_IMPORT(ArmWriteVBar)\r
 GCC_ASM_IMPORT(ArmDisableInterrupts)\r
 GCC_ASM_IMPORT(ArmDisableCachesAndMmu)\r
 GCC_ASM_IMPORT(ArmWriteVBar)\r
+GCC_ASM_IMPORT(ArmReadMpidr)\r
 GCC_ASM_IMPORT(SecVectorTable)\r
 \r
 #if (FixedPcdGet32(PcdMPCoreSupport))\r
 GCC_ASM_IMPORT(SecVectorTable)\r
 \r
 #if (FixedPcdGet32(PcdMPCoreSupport))\r
@@ -58,10 +59,13 @@ ASM_PFX(_ModuleEntryPoint):
 _IdentifyCpu: \r
   # Identify CPU ID\r
   bl    ASM_PFX(ArmReadMpidr)\r
 _IdentifyCpu: \r
   # Identify CPU ID\r
   bl    ASM_PFX(ArmReadMpidr)\r
-  and   r5, r0, #0xf\r
+  // Get ID of this CPU in Multicore system\r
+  LoadConstantToReg (FixedPcdGet32(PcdArmPrimaryCoreMask), r1)\r
+  and   r5, r0, r1\r
   \r
   #get ID of this CPU in Multicore system\r
   \r
   #get ID of this CPU in Multicore system\r
-  cmp   r5, #0\r
+  LoadConstantToReg (FixedPcdGet32(PcdArmPrimaryCore), r1)\r
+  cmp   r5, r1\r
   # Only the primary core initialize the memory (SMC)\r
   beq   _InitMem\r
   \r
   # Only the primary core initialize the memory (SMC)\r
   beq   _InitMem\r
   \r