mirror of https://github.com/acidanthera/audk.git
ArmPlatformPkg: Introduction of gArmPlatformTokenSpaceGuid.PcdCoreCount
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
This commit is contained in:
parent
0a6653bc2a
commit
695df8ba90
|
@ -55,6 +55,7 @@
|
||||||
gArmPlatformTokenSpaceGuid.PcdNorFlashCheckBlockLocked|FALSE|BOOLEAN|0x0000003C
|
gArmPlatformTokenSpaceGuid.PcdNorFlashCheckBlockLocked|FALSE|BOOLEAN|0x0000003C
|
||||||
|
|
||||||
[PcdsFixedAtBuild.common]
|
[PcdsFixedAtBuild.common]
|
||||||
|
gArmPlatformTokenSpaceGuid.PcdCoreCount|1|UINT32|0x00000039
|
||||||
gArmPlatformTokenSpaceGuid.PcdClusterCount|1|UINT32|0x00000038
|
gArmPlatformTokenSpaceGuid.PcdClusterCount|1|UINT32|0x00000038
|
||||||
|
|
||||||
# Stack for CPU Cores in Secure Mode
|
# Stack for CPU Cores in Secure Mode
|
||||||
|
|
|
@ -67,6 +67,8 @@
|
||||||
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM RealView Emulation Board"
|
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM RealView Emulation Board"
|
||||||
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmRealViewEb-A9x2"
|
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmRealViewEb-A9x2"
|
||||||
|
|
||||||
|
gArmPlatformTokenSpaceGuid.PcdCoreCount|2
|
||||||
|
|
||||||
#
|
#
|
||||||
# NV Storage PCDs. Use base of 0x43F00000 for NOR0
|
# NV Storage PCDs. Use base of 0x43F00000 for NOR0
|
||||||
#
|
#
|
||||||
|
|
|
@ -95,6 +95,8 @@
|
||||||
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"
|
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"
|
||||||
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress"
|
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress"
|
||||||
|
|
||||||
|
gArmPlatformTokenSpaceGuid.PcdCoreCount|4
|
||||||
|
|
||||||
#
|
#
|
||||||
# NV Storage PCDs. Use base of 0x43FC0000 for NOR0 or 0x47FC0000 for NOR1 on Versatile Express
|
# NV Storage PCDs. Use base of 0x43FC0000 for NOR0 or 0x47FC0000 for NOR1 on Versatile Express
|
||||||
#
|
#
|
||||||
|
|
|
@ -72,7 +72,6 @@
|
||||||
|
|
||||||
[PcdsFixedAtBuild.common]
|
[PcdsFixedAtBuild.common]
|
||||||
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"
|
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"
|
||||||
|
|
||||||
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"
|
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -72,9 +72,10 @@
|
||||||
|
|
||||||
[PcdsFixedAtBuild.common]
|
[PcdsFixedAtBuild.common]
|
||||||
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"
|
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"
|
||||||
|
|
||||||
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"
|
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"
|
||||||
|
|
||||||
|
gArmPlatformTokenSpaceGuid.PcdCoreCount|2
|
||||||
|
|
||||||
#
|
#
|
||||||
# NV Storage PCDs. Use base of 0x0C000000 for NOR1
|
# NV Storage PCDs. Use base of 0x0C000000 for NOR1
|
||||||
#
|
#
|
||||||
|
|
|
@ -76,6 +76,8 @@
|
||||||
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"
|
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"
|
||||||
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"
|
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"
|
||||||
|
|
||||||
|
gArmPlatformTokenSpaceGuid.PcdCoreCount|4
|
||||||
|
|
||||||
#
|
#
|
||||||
# NV Storage PCDs. Use base of 0x0C000000 for NOR1
|
# NV Storage PCDs. Use base of 0x0C000000 for NOR1
|
||||||
#
|
#
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
|
|
||||||
IMPORT CEntryPoint
|
IMPORT CEntryPoint
|
||||||
IMPORT ArmReadMpidr
|
IMPORT ArmReadMpidr
|
||||||
IMPORT ArmIsMpCore
|
IMPORT ArmPlatformStackSet
|
||||||
|
|
||||||
EXPORT _ModuleEntryPoint
|
EXPORT _ModuleEntryPoint
|
||||||
|
|
||||||
PRESERVE8
|
PRESERVE8
|
||||||
|
@ -107,11 +108,20 @@ _GetStackBaseMpCore
|
||||||
// r1 = The top of the Mpcore Stacks
|
// r1 = The top of the Mpcore Stacks
|
||||||
// Stack for the primary core = PrimaryCoreStack
|
// Stack for the primary core = PrimaryCoreStack
|
||||||
LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)
|
LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)
|
||||||
sub r7, r1, r2
|
sub r8, r1, r2
|
||||||
|
|
||||||
// Stack for the secondary core = Number of Clusters * (4 Cores per cluster) * SecondaryStackSize
|
// Stack for the secondary core = Number of Cores - 1
|
||||||
LoadConstantToReg (FixedPcdGet32(PcdClusterCount), r2)
|
LoadConstantToReg (FixedPcdGet32(PcdCoreCount), r0)
|
||||||
lsl r2, r2, #2
|
sub r0, r0, #1
|
||||||
|
LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r1)
|
||||||
|
mul r1, r1, r0
|
||||||
|
sub r8, r8, r1
|
||||||
|
|
||||||
|
// r8 = The base of the MpCore Stacks (primary stack & secondary stacks)
|
||||||
|
mov r0, r8
|
||||||
|
mov r1, r6
|
||||||
|
//ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackSize)
|
||||||
|
LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)
|
||||||
LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r3)
|
LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r3)
|
||||||
mul r2, r2, r3
|
mul r2, r2, r3
|
||||||
sub r7, r7, r2
|
sub r7, r7, r2
|
||||||
|
|
|
@ -91,6 +91,7 @@
|
||||||
gArmTokenSpaceGuid.PcdSystemMemorySize
|
gArmTokenSpaceGuid.PcdSystemMemorySize
|
||||||
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
|
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
|
||||||
|
|
||||||
|
gArmPlatformTokenSpaceGuid.PcdCoreCount
|
||||||
gArmPlatformTokenSpaceGuid.PcdClusterCount
|
gArmPlatformTokenSpaceGuid.PcdClusterCount
|
||||||
gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
|
gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
|
||||||
gArmTokenSpaceGuid.PcdArmPrimaryCore
|
gArmTokenSpaceGuid.PcdArmPrimaryCore
|
||||||
|
|
|
@ -85,6 +85,7 @@
|
||||||
gArmTokenSpaceGuid.PcdSystemMemorySize
|
gArmTokenSpaceGuid.PcdSystemMemorySize
|
||||||
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
|
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
|
||||||
|
|
||||||
|
gArmPlatformTokenSpaceGuid.PcdCoreCount
|
||||||
gArmPlatformTokenSpaceGuid.PcdClusterCount
|
gArmPlatformTokenSpaceGuid.PcdClusterCount
|
||||||
gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
|
gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
|
||||||
gArmTokenSpaceGuid.PcdArmPrimaryCore
|
gArmTokenSpaceGuid.PcdArmPrimaryCore
|
||||||
|
|
|
@ -212,6 +212,8 @@ CEntryPoint (
|
||||||
{
|
{
|
||||||
UINT64 StartTimeStamp;
|
UINT64 StartTimeStamp;
|
||||||
|
|
||||||
|
ASSERT(!ArmIsMpCore() || (PcdGet32 (PcdCoreCount) > 1));
|
||||||
|
|
||||||
// Initialize the platform specific controllers
|
// Initialize the platform specific controllers
|
||||||
ArmPlatformInitialize (MpId);
|
ArmPlatformInitialize (MpId);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue