]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/PrePeiCore/MainUniCore.c
ArmPlatformPkg: Add ArmPlatformGetPlatformPpiList()
[mirror_edk2.git] / ArmPlatformPkg / PrePeiCore / MainUniCore.c
CommitLineData
1d5d0ae9 1/** @file\r
2*\r
3* Copyright (c) 2011, ARM Limited. All rights reserved.\r
4*\r
5* This program and the accompanying materials\r
6* are licensed and made available under the terms and conditions of the BSD License\r
7* which accompanies this distribution. The full text of the license may be found at\r
8* http://opensource.org/licenses/bsd-license.php\r
9*\r
10* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12*\r
13**/\r
14\r
1d5d0ae9 15#include <Chipset/ArmV7.h>\r
16\r
f598bf12 17#include "PrePeiCore.h"\r
18\r
1d5d0ae9 19VOID\r
20EFIAPI\r
f598bf12 21SecondaryMain (\r
0787bc61 22 IN UINTN MpId\r
f598bf12 23 )\r
1d5d0ae9 24{\r
f598bf12 25 ASSERT(FALSE);\r
1d5d0ae9 26}\r
27\r
f598bf12 28VOID\r
29EFIAPI\r
30PrimaryMain (\r
1d5d0ae9 31 IN EFI_PEI_CORE_ENTRY_POINT PeiCoreEntryPoint\r
32 )\r
33{\r
f598bf12 34 EFI_SEC_PEI_HAND_OFF SecCoreData;\r
77de7e53 35 UINTN PpiListSize;\r
36 EFI_PEI_PPI_DESCRIPTOR *PpiList;\r
37 UINTN TemporaryRamBase;\r
38 UINTN TemporaryRamSize;\r
f598bf12 39\r
77de7e53 40 CreatePpiList (&PpiListSize, &PpiList);\r
41\r
42 // Adjust the Temporary Ram as the new Ppi List (Common + Platform Ppi Lists) is created at\r
43 // the base of the primary core stack\r
44 PpiListSize = ALIGN_VALUE(PpiListSize, 0x4);\r
45 TemporaryRamBase = (UINTN)PcdGet32 (PcdCPUCoresStackBase) + PpiListSize;\r
46 TemporaryRamSize = (UINTN)PcdGet32 (PcdCPUCorePrimaryStackSize) - PpiListSize;\r
f598bf12 47\r
48 //\r
49 // Bind this information into the SEC hand-off state\r
50 // Note: this must be in sync with the stuff in the asm file\r
51 // Note also: HOBs (pei temp ram) MUST be above stack\r
52 //\r
53 SecCoreData.DataSize = sizeof(EFI_SEC_PEI_HAND_OFF);\r
f92b93c9 54 SecCoreData.BootFirmwareVolumeBase = (VOID *)(UINTN)PcdGet32 (PcdFvBaseAddress);\r
55 SecCoreData.BootFirmwareVolumeSize = PcdGet32 (PcdFvSize);\r
77de7e53 56 SecCoreData.TemporaryRamBase = (VOID *)TemporaryRamBase; // We run on the primary core (and so we use the first stack)\r
57 SecCoreData.TemporaryRamSize = TemporaryRamSize;\r
58 SecCoreData.PeiTemporaryRamBase = SecCoreData.TemporaryRamBase;\r
f598bf12 59 SecCoreData.PeiTemporaryRamSize = SecCoreData.TemporaryRamSize / 2;\r
93d451c6 60 SecCoreData.StackBase = (VOID *)((UINTN)(SecCoreData.TemporaryRamBase) + (SecCoreData.TemporaryRamSize/2));\r
61 SecCoreData.StackSize = SecCoreData.TemporaryRamSize / 2;\r
f598bf12 62\r
77de7e53 63 // Jump to PEI core entry point\r
64 (PeiCoreEntryPoint)(&SecCoreData, PpiList);\r
1d5d0ae9 65}\r