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 This structure is used to describe a region of the EFI memory map
33 Every EFI regions of the system memory described by their physical start address and their size
34 can have different attributes. Some regions can be tested and other untested.
38 EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute
;
39 EFI_PHYSICAL_ADDRESS PhysicalStart
;
41 } ARM_SYSTEM_MEMORY_REGION_DESCRIPTOR
;
44 Return the core position from the value of its MpId register
46 This function returns the core position from the position 0 in the processor.
47 This function might be called from assembler before any stack is set.
49 @return Return the core position
53 ArmPlatformGetCorePosition (
58 Return a non-zero value if the callee is the primary core
60 This function returns a non-zero value if the callee is the primary core.
61 The primary core is the core responsible to initialize the hardware and run UEFI.
62 This function might be called from assembler before any stack is set.
64 @return Return a non-zero value if the callee is the primary core.
68 ArmPlatformIsPrimaryCore (
73 Return the MpId of the primary core
75 This function returns the MpId of the primary core.
76 This function might be called from assembler before any stack is set.
78 @return Return the MpId of the primary core
82 ArmPlatformGetPrimaryCoreMpId (
87 Return the current Boot Mode
89 This function returns the boot reason on the platform
91 @return Return the current Boot Mode of the platform
95 ArmPlatformGetBootMode (
100 First platform specific function to be called in the PEI phase
102 This function is actually the first function called by the PrePi
103 or PrePeiCore modules. It allows to retrieve arguments passed to
104 the UEFI firmware through the CPU registers.
106 This function might be written into assembler as no stack are set
107 when the function is invoked.
111 ArmPlatformPeiBootAction (
116 Initialize controllers that must setup in the normal world
118 This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei
123 ArmPlatformInitialize (
128 Initialize the system (or sometimes called permanent) memory
130 This memory is generally represented by the DRAM.
134 ArmPlatformInitializeSystemMemory (
139 Return the Virtual Memory Map of your platform
141 This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU on your platform.
143 @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR describing a Physical-to-
144 Virtual Memory mapping. This array must be ended by a zero-filled
149 ArmPlatformGetVirtualMemoryMap (
150 OUT ARM_MEMORY_REGION_DESCRIPTOR
** VirtualMemoryMap
154 Return the Platform specific PPIs
156 This function exposes the Platform Specific PPIs. They can be used by any PrePi modules or passed
157 to the PeiCore by PrePeiCore.
159 @param[out] PpiListSize Size in Bytes of the Platform PPI List
160 @param[out] PpiList Platform PPI List
164 ArmPlatformGetPlatformPpiList (
165 OUT UINTN
*PpiListSize
,
166 OUT EFI_PEI_PPI_DESCRIPTOR
**PpiList