3 * Copyright (c) 2011-2013, ARM Limited. All rights reserved.
5 * This program and the accompanying materials
6 * are licensed and made available under the terms and conditions of the BSD License
7 * which accompanies this distribution. The full text of the license may be found at
8 * http://opensource.org/licenses/bsd-license.php
10 * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include <Library/IoLib.h>
16 #include <Library/ArmPlatformLib.h>
17 #include <Library/DebugLib.h>
18 #include <Library/PcdLib.h>
20 #include <Ppi/ArmMpCoreInfo.h>
22 #include <ArmPlatform.h>
24 ARM_CORE_INFO mVersatileExpressMpCoreInfoTable
[] = {
30 // The foundation model does not have the VE_SYS_REGS like all the other VE
31 // platforms. We pick a spot in RAM that *should* be safe in the simple case
32 // of no UEFI apps interfering (Only the Linux loader getting used). By the
33 // time we come to load Linux we should have all the cores in a safe place.
34 // The image expects to be loaded at 0xa0000000. We also place the mailboxes
35 // here as it does not matter if we corrupt the image at this time.
36 // NOTE also see: "ArmVExpressSecLibRTSM/AArch64/RTSMFoundationBoot.S"
38 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
39 (EFI_PHYSICAL_ADDRESS
)0xa0000000,
40 (EFI_PHYSICAL_ADDRESS
)0xa0000000,
41 (EFI_PHYSICAL_ADDRESS
)0xa0000000,
49 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
50 (EFI_PHYSICAL_ADDRESS
)0xa0000000,
51 (EFI_PHYSICAL_ADDRESS
)0xa0000000,
52 (EFI_PHYSICAL_ADDRESS
)0xa0000000,
60 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
61 (EFI_PHYSICAL_ADDRESS
)0xa0000000,
62 (EFI_PHYSICAL_ADDRESS
)0xa0000000,
63 (EFI_PHYSICAL_ADDRESS
)0xa0000000,
70 // MP Core MailBox Set/Get/Clear Addresses and Clear Value
71 (EFI_PHYSICAL_ADDRESS
)0xa0000000,
72 (EFI_PHYSICAL_ADDRESS
)0xa0000000,
73 (EFI_PHYSICAL_ADDRESS
)0xa0000000,
79 Return the current Boot Mode
81 This function returns the boot reason on the platform
83 @return Return the current Boot Mode of the platform
87 ArmPlatformGetBootMode (
91 return BOOT_WITH_FULL_CONFIGURATION
;
95 Initialize controllers that must setup in the normal world
97 This function is called by the ArmPlatformPkg/Pei or ArmPlatformPkg/Pei/PlatformPeim
102 ArmPlatformInitialize (
106 /* The Foundation model has no SP810 to initialise. */
108 return RETURN_SUCCESS
;
112 Initialize the system (or sometimes called permanent) memory
114 This memory is generally represented by the DRAM.
118 ArmPlatformInitializeSystemMemory (
122 // Nothing to do here
126 PrePeiCoreGetMpCoreInfo (
127 OUT UINTN
*CoreCount
,
128 OUT ARM_CORE_INFO
**ArmCoreTable
131 // Foundation model has no VE_SYS_REGS
132 // Only support one cluster
133 *CoreCount
= ArmGetCpuCountPerCluster ();
134 *ArmCoreTable
= mVersatileExpressMpCoreInfoTable
;
139 // Needs to be declared in the file. Otherwise gArmMpCoreInfoPpiGuid is undefined in the context of PrePeiCore
140 EFI_GUID mArmMpCoreInfoPpiGuid
= ARM_MP_CORE_INFO_PPI_GUID
;
141 ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi
= { PrePeiCoreGetMpCoreInfo
};
143 EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable
[] = {
145 EFI_PEI_PPI_DESCRIPTOR_PPI
,
146 &mArmMpCoreInfoPpiGuid
,
152 ArmPlatformGetPlatformPpiList (
153 OUT UINTN
*PpiListSize
,
154 OUT EFI_PEI_PPI_DESCRIPTOR
**PpiList
157 *PpiListSize
= sizeof(gPlatformPpiTable
);
158 *PpiList
= gPlatformPpiTable
;