]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/Include/Library/ArmPlatformLib.h
ArmPlatformPkg/ArmVExpressDxe: Identify the current platform
[mirror_edk2.git] / ArmPlatformPkg / Include / Library / ArmPlatformLib.h
CommitLineData
1e57a462 1/** @file\r
2*\r
bc7b889a 3* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
1e57a462 4*\r
3402aac7
RC
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
1e57a462 12*\r
13**/\r
14\r
15#ifndef _ARMPLATFORMLIB_H_\r
16#define _ARMPLATFORMLIB_H_\r
17\r
18//\r
19// The package level header files this module uses\r
20//\r
21#include <PiPei.h>\r
22//\r
23// The protocols, PPI and GUID defintions for this module\r
24//\r
25#include <Ppi/MasterBootMode.h>\r
26#include <Ppi/BootInRecoveryMode.h>\r
1e57a462 27\r
28#include <Library/ArmLib.h>\r
29\r
30/**\r
31 This structure is used to describe a region of the EFI memory map\r
32\r
33 Every EFI regions of the system memory described by their physical start address and their size\r
34 can have different attributes. Some regions can be tested and other untested.\r
35\r
36**/\r
37typedef struct {\r
38 EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute;\r
39 EFI_PHYSICAL_ADDRESS PhysicalStart;\r
40 UINT64 NumberOfBytes;\r
41} ARM_SYSTEM_MEMORY_REGION_DESCRIPTOR;\r
42\r
dff72027
OM
43/**\r
44 Return the core per cluster. The method may differ per core type\r
45\r
46 This function might be called from assembler before any stack is set.\r
47\r
48 @return Return the core count per cluster\r
49\r
50**/\r
51UINTN\r
52ArmGetCpuCountPerCluster (\r
53 VOID\r
54 );\r
55\r
bebda7ce 56/**\r
57 Return the core position from the value of its MpId register\r
58\r
59 This function returns the core position from the position 0 in the processor.\r
60 This function might be called from assembler before any stack is set.\r
61\r
62 @return Return the core position\r
63\r
64**/\r
1e57a462 65UINTN\r
66ArmPlatformGetCorePosition (\r
67 IN UINTN MpId\r
68 );\r
69\r
bebda7ce 70/**\r
71 Return a non-zero value if the callee is the primary core\r
72\r
73 This function returns a non-zero value if the callee is the primary core.\r
74 The primary core is the core responsible to initialize the hardware and run UEFI.\r
75 This function might be called from assembler before any stack is set.\r
76\r
77 @return Return a non-zero value if the callee is the primary core.\r
78\r
79**/\r
80UINTN\r
81ArmPlatformIsPrimaryCore (\r
82 IN UINTN MpId\r
83 );\r
84\r
d05ca26c 85/**\r
86 Return the MpId of the primary core\r
87\r
88 This function returns the MpId of the primary core.\r
89 This function might be called from assembler before any stack is set.\r
90\r
91 @return Return the MpId of the primary core\r
92\r
93**/\r
94UINTN\r
95ArmPlatformGetPrimaryCoreMpId (\r
96 VOID\r
97 );\r
98\r
1e57a462 99/**\r
100 Return the current Boot Mode\r
101\r
102 This function returns the boot reason on the platform\r
103\r
104 @return Return the current Boot Mode of the platform\r
105\r
106**/\r
107EFI_BOOT_MODE\r
108ArmPlatformGetBootMode (\r
109 VOID\r
110 );\r
111\r
6913a683
OM
112/**\r
113 First platform specific function to be called in the PEI phase\r
114\r
115 This function is actually the first function called by the PrePi\r
116 or PrePeiCore modules. It allows to retrieve arguments passed to\r
117 the UEFI firmware through the CPU registers.\r
118\r
119 This function might be written into assembler as no stack are set\r
120 when the function is invoked.\r
121\r
122**/\r
123VOID\r
124ArmPlatformPeiBootAction (\r
125 VOID\r
126 );\r
127\r
1e57a462 128/**\r
129 Initialize controllers that must setup in the normal world\r
130\r
131 This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei\r
132 in the PEI phase.\r
133\r
134**/\r
135RETURN_STATUS\r
136ArmPlatformInitialize (\r
137 IN UINTN MpId\r
138 );\r
139\r
140/**\r
141 Initialize the system (or sometimes called permanent) memory\r
142\r
143 This memory is generally represented by the DRAM.\r
144\r
145**/\r
146VOID\r
147ArmPlatformInitializeSystemMemory (\r
148 VOID\r
149 );\r
150\r
151/**\r
152 Return the Virtual Memory Map of your platform\r
153\r
154 This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU on your platform.\r
155\r
156 @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR describing a Physical-to-\r
157 Virtual Memory mapping. This array must be ended by a zero-filled\r
158 entry\r
159\r
160**/\r
161VOID\r
162ArmPlatformGetVirtualMemoryMap (\r
163 OUT ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap\r
164 );\r
165\r
1e57a462 166/**\r
167 Return the Platform specific PPIs\r
168\r
169 This function exposes the Platform Specific PPIs. They can be used by any PrePi modules or passed\r
170 to the PeiCore by PrePeiCore.\r
171\r
172 @param[out] PpiListSize Size in Bytes of the Platform PPI List\r
173 @param[out] PpiList Platform PPI List\r
174\r
175**/\r
176VOID\r
177ArmPlatformGetPlatformPpiList (\r
178 OUT UINTN *PpiListSize,\r
179 OUT EFI_PEI_PPI_DESCRIPTOR **PpiList\r
180 );\r
181\r
182#endif\r