*\r
**/\r
\r
-#include <Library/IoLib.h>\r
#include <Library/BaseLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
+#include <Library/DebugAgentLib.h>\r
#include <Library/PrintLib.h>\r
#include <Library/ArmLib.h>\r
#include <Library/SerialPortLib.h>\r
+\r
+#include <Ppi/ArmGlobalVariable.h>\r
#include <Chipset/ArmV7.h>\r
\r
#include "PrePeiCore.h"\r
\r
EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI mSecTemporaryRamSupportPpi = {SecTemporaryRamSupport};\r
+ARM_GLOBAL_VARIABLE_PPI mGlobalVariablePpi = { PrePeiCoreGetGlobalVariableMemory };\r
\r
-EFI_PEI_PPI_DESCRIPTOR gSecPpiTable[] = {\r
+EFI_PEI_PPI_DESCRIPTOR gCommonPpiTable[] = {\r
{\r
- EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,\r
+ EFI_PEI_PPI_DESCRIPTOR_PPI,\r
&gEfiTemporaryRamSupportPpiGuid,\r
&mSecTemporaryRamSupportPpi\r
+ },\r
+ {\r
+ EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,\r
+ &gArmGlobalVariablePpiGuid,\r
+ &mGlobalVariablePpi\r
}\r
};\r
\r
VOID\r
CEntryPoint (\r
- IN UINTN CoreId,\r
+ IN UINTN MpId,\r
IN EFI_PEI_CORE_ENTRY_POINT PeiCoreEntryPoint\r
)\r
{\r
//Note: The MMU will be enabled by MemoryPeim. Only the primary core will have the MMU on.\r
\r
//If not primary Jump to Secondary Main\r
- if(0 == CoreId) {\r
- //Goto primary Main.\r
+ if (IS_PRIMARY_CORE(MpId)) {\r
+ // Initialize the Debug Agent for Source Level Debugging\r
+ InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL);\r
+ SaveAndSetDebugTimerInterrupt (TRUE);\r
+\r
+ // Goto primary Main.\r
PrimaryMain (PeiCoreEntryPoint);\r
} else {\r
- SecondaryMain (CoreId);\r
+ SecondaryMain (MpId);\r
}\r
\r
// PEI Core should always load and never return\r
\r
SecSwitchStack((UINTN)(PermanentMemoryBase - TemporaryMemoryBase));\r
\r
+EFI_STATUS\r
+PrePeiCoreGetGlobalVariableMemory (\r
+ OUT EFI_PHYSICAL_ADDRESS *GlobalVariableBase\r
+ )\r
+{\r
+ ASSERT (GlobalVariableBase != NULL);\r
+\r
+ *GlobalVariableBase = (UINTN)PcdGet32 (PcdCPUCoresStackBase) +\r
+ (UINTN)PcdGet32 (PcdCPUCorePrimaryStackSize) -\r
+ (UINTN)PcdGet32 (PcdPeiGlobalVariableSize);\r
+\r
return EFI_SUCCESS;\r
}\r
\r