]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg: Introduction of gArmPlatformTokenSpaceGuid.PcdCoreCount
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 28 Sep 2012 10:43:28 +0000 (10:43 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 28 Sep 2012 10:43:28 +0000 (10:43 +0000)
On ARM PLatforms, there is no standard way to know how many cores are
available on the platform.
This PCD is expected to contain this number.

Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13769 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/ArmPlatformPkg.dec
ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-A9x2.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.dsc
ArmPlatformPkg/PrePi/ModuleEntryPoint.asm
ArmPlatformPkg/PrePi/PeiMPCore.inf
ArmPlatformPkg/PrePi/PeiUniCore.inf
ArmPlatformPkg/PrePi/PrePi.c

index e23cc08fcada3d6ba6f7e412e482b3f94b6ad4df..3e2900ba319a3a5312b7f43bdb804cd3031ace8f 100644 (file)
@@ -55,6 +55,7 @@
   gArmPlatformTokenSpaceGuid.PcdNorFlashCheckBlockLocked|FALSE|BOOLEAN|0x0000003C\r
   \r
 [PcdsFixedAtBuild.common]\r
+  gArmPlatformTokenSpaceGuid.PcdCoreCount|1|UINT32|0x00000039\r
   gArmPlatformTokenSpaceGuid.PcdClusterCount|1|UINT32|0x00000038\r
     \r
   # Stack for CPU Cores in Secure Mode\r
index 67721de7b11e7cfb14155c382b87b67442397e64..ff62ee596a977c23b00ac5aec93fd5807c61fd9e 100644 (file)
@@ -66,6 +66,8 @@
 [PcdsFixedAtBuild.common]\r
   gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM RealView Emulation Board"\r
   gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmRealViewEb-A9x2"\r
+\r
+  gArmPlatformTokenSpaceGuid.PcdCoreCount|2\r
   \r
   #\r
   # NV Storage PCDs. Use base of 0x43F00000 for NOR0\r
index a949e936c729658915001dcaa57ad5346d0f3323..3f9654f42902eafbf913fa5a34a84a7598f193b1 100644 (file)
@@ -95,6 +95,8 @@
   gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"  \r
   gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress"\r
 \r
+  gArmPlatformTokenSpaceGuid.PcdCoreCount|4\r
+\r
   #\r
   # NV Storage PCDs. Use base of 0x43FC0000 for NOR0 or 0x47FC0000 for NOR1 on Versatile Express\r
   #\r
index 404fef7b53634ae6f9c0c2aa4faa1593641af685..09dfe7f542fd288090f7e3a48a9cba169aa7fb75 100644 (file)
@@ -72,7 +72,6 @@
   \r
 [PcdsFixedAtBuild.common]\r
   gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
-  \r
   gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"\r
 \r
   #\r
index d4d21500ef65cf2a5006da78324953a53e8aebbc..7934d1e545082e8f405db072b9251c49fe6307a7 100644 (file)
   \r
 [PcdsFixedAtBuild.common]\r
   gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
-  \r
   gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"\r
 \r
+  gArmPlatformTokenSpaceGuid.PcdCoreCount|2\r
+\r
   #\r
   # NV Storage PCDs. Use base of 0x0C000000 for NOR1\r
   #\r
index 762edbbe360be23bfdf05bca8cd4a78b013df160..99272a99007fa9e051576152a664d11be2b02739 100644 (file)
@@ -76,6 +76,8 @@
   gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
   gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"\r
 \r
+  gArmPlatformTokenSpaceGuid.PcdCoreCount|4\r
+\r
   #\r
   # NV Storage PCDs. Use base of 0x0C000000 for NOR1\r
   #\r
index 0c7299a995fb1b7c8f25bf182ccc1f31722f0b25..3437818b52a4d4cb4aa03a87cc58f0cdbe9c4a97 100644 (file)
@@ -20,7 +20,8 @@
   \r
   IMPORT  CEntryPoint\r
   IMPORT  ArmReadMpidr\r
-  IMPORT  ArmIsMpCore\r
+  IMPORT  ArmPlatformStackSet\r
+  \r
   EXPORT  _ModuleEntryPoint\r
 \r
   PRESERVE8\r
@@ -107,11 +108,20 @@ _GetStackBaseMpCore
   // r1 = The top of the Mpcore Stacks\r
   // Stack for the primary core = PrimaryCoreStack\r
   LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)\r
-  sub   r7, r1, r2\r
-\r
-  // Stack for the secondary core = Number of Clusters * (4 Cores per cluster) * SecondaryStackSize\r
-  LoadConstantToReg (FixedPcdGet32(PcdClusterCount), r2)\r
-  lsl   r2, r2, #2\r
+  sub   r8, r1, r2\r
+\r
+  // Stack for the secondary core = Number of Cores - 1\r
+  LoadConstantToReg (FixedPcdGet32(PcdCoreCount), r0)\r
+  sub  r0, r0, #1\r
+  LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r1)\r
+  mul   r1, r1, r0\r
+  sub   r8, r8, r1\r
+\r
+  // r8 = The base of the MpCore Stacks (primary stack & secondary stacks)\r
+  mov  r0, r8\r
+  mov  r1, r6\r
+  //ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackSize)\r
+  LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)\r
   LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r3)\r
   mul   r2, r2, r3\r
   sub   r7, r7, r2\r
index cd61b7a2fcd5e6b7e430d9098add86d232f57106..1d27f9c94d24254ff8d592a3c31fa9cea40d9940 100755 (executable)
@@ -91,6 +91,7 @@
   gArmTokenSpaceGuid.PcdSystemMemorySize\r
   gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize\r
   \r
+  gArmPlatformTokenSpaceGuid.PcdCoreCount\r
   gArmPlatformTokenSpaceGuid.PcdClusterCount\r
   gArmTokenSpaceGuid.PcdArmPrimaryCoreMask\r
   gArmTokenSpaceGuid.PcdArmPrimaryCore\r
index f28768ecf8b0b602f061f4fb3de04514dc8154b5..304461c3e9183660b274c3ec544be04b9d7a1057 100755 (executable)
@@ -85,6 +85,7 @@
   gArmTokenSpaceGuid.PcdSystemMemorySize\r
   gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize\r
   \r
+  gArmPlatformTokenSpaceGuid.PcdCoreCount\r
   gArmPlatformTokenSpaceGuid.PcdClusterCount\r
   gArmTokenSpaceGuid.PcdArmPrimaryCoreMask\r
   gArmTokenSpaceGuid.PcdArmPrimaryCore\r
index c3fca90ca9826bb81679e14e1adf26f89b0224bf..bdeb60d84c75420dd62261bb36fa760f2e017bb6 100755 (executable)
@@ -212,6 +212,8 @@ CEntryPoint (
 {\r
   UINT64   StartTimeStamp;\r
  \r
+  ASSERT(!ArmIsMpCore() || (PcdGet32 (PcdCoreCount) > 1));\r
+\r
   // Initialize the platform specific controllers\r
   ArmPlatformInitialize (MpId);\r
 \r