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 #ifndef _ARMPLATFORMLIB_H_
16 #define _ARMPLATFORMLIB_H_
19 // The package level header files this module uses
23 // The protocols, PPI and GUID defintions for this module
25 #include <Ppi/MasterBootMode.h>
26 #include <Ppi/BootInRecoveryMode.h>
28 #include <Library/ArmLib.h>
31 Return the core position from the value of its MpId register
33 This function returns the core position from the position 0 in the processor.
34 This function might be called from assembler before any stack is set.
36 @return Return the core position
40 ArmPlatformGetCorePosition (
45 Return a non-zero value if the callee is the primary core
47 This function returns a non-zero value if the callee is the primary core.
48 The primary core is the core responsible to initialize the hardware and run UEFI.
49 This function might be called from assembler before any stack is set.
51 @return Return a non-zero value if the callee is the primary core.
55 ArmPlatformIsPrimaryCore (
60 Return the MpId of the primary core
62 This function returns the MpId of the primary core.
63 This function might be called from assembler before any stack is set.
65 @return Return the MpId of the primary core
69 ArmPlatformGetPrimaryCoreMpId (
74 Return the current Boot Mode
76 This function returns the boot reason on the platform
78 @return Return the current Boot Mode of the platform
82 ArmPlatformGetBootMode (
87 First platform specific function to be called in the PEI phase
89 This function is actually the first function called by the PrePi
90 or PrePeiCore modules. It allows to retrieve arguments passed to
91 the UEFI firmware through the CPU registers.
93 This function might be written into assembler as no stack are set
94 when the function is invoked.
98 ArmPlatformPeiBootAction (
103 Initialize controllers that must setup in the normal world
105 This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei
110 ArmPlatformInitialize (
115 Return the Virtual Memory Map of your platform
117 This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU on your platform.
119 @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR describing a Physical-to-
120 Virtual Memory mapping. This array must be ended by a zero-filled
125 ArmPlatformGetVirtualMemoryMap (
126 OUT ARM_MEMORY_REGION_DESCRIPTOR
** VirtualMemoryMap
130 Return the Platform specific PPIs
132 This function exposes the Platform Specific PPIs. They can be used by any PrePi modules or passed
133 to the PeiCore by PrePeiCore.
135 @param[out] PpiListSize Size in Bytes of the Platform PPI List
136 @param[out] PpiList Platform PPI List
140 ArmPlatformGetPlatformPpiList (
141 OUT UINTN
*PpiListSize
,
142 OUT EFI_PEI_PPI_DESCRIPTOR
**PpiList