3 * Copyright (c) 2011-2013, ARM Limited. All rights reserved.
5 * SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _ARMPLATFORMLIB_H_
10 #define _ARMPLATFORMLIB_H_
13 // The package level header files this module uses
17 // The protocols, PPI and GUID definitions for this module
19 #include <Ppi/MasterBootMode.h>
20 #include <Ppi/BootInRecoveryMode.h>
22 #include <Library/ArmLib.h>
25 Return the core position from the value of its MpId register
27 This function returns the core position from the position 0 in the processor.
28 This function might be called from assembler before any stack is set.
30 @return Return the core position
34 ArmPlatformGetCorePosition (
39 Return a non-zero value if the callee is the primary core
41 This function returns a non-zero value if the callee is the primary core.
42 The primary core is the core responsible to initialize the hardware and run UEFI.
43 This function might be called from assembler before any stack is set.
45 @return Return a non-zero value if the callee is the primary core.
49 ArmPlatformIsPrimaryCore (
54 Return the MpId of the primary core
56 This function returns the MpId of the primary core.
57 This function might be called from assembler before any stack is set.
59 @return Return the MpId of the primary core
63 ArmPlatformGetPrimaryCoreMpId (
68 Return the current Boot Mode
70 This function returns the boot reason on the platform
72 @return Return the current Boot Mode of the platform
76 ArmPlatformGetBootMode (
81 First platform specific function to be called in the PEI phase
83 This function is actually the first function called by the PrePi
84 or PrePeiCore modules. It allows to retrieve arguments passed to
85 the UEFI firmware through the CPU registers.
87 This function might be written into assembler as no stack are set
88 when the function is invoked.
92 ArmPlatformPeiBootAction (
97 Initialize controllers that must setup in the normal world
99 This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei
104 ArmPlatformInitialize (
109 Return the Virtual Memory Map of your platform
111 This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU on your platform.
113 @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR describing a Physical-to-
114 Virtual Memory mapping. This array must be ended by a zero-filled
119 ArmPlatformGetVirtualMemoryMap (
120 OUT ARM_MEMORY_REGION_DESCRIPTOR
** VirtualMemoryMap
124 Return the Platform specific PPIs
126 This function exposes the Platform Specific PPIs. They can be used by any PrePi modules or passed
127 to the PeiCore by PrePeiCore.
129 @param[out] PpiListSize Size in Bytes of the Platform PPI List
130 @param[out] PpiList Platform PPI List
134 ArmPlatformGetPlatformPpiList (
135 OUT UINTN
*PpiListSize
,
136 OUT EFI_PEI_PPI_DESCRIPTOR
**PpiList