]>
Commit | Line | Data |
---|---|---|
1e57a462 | 1 | /** @file\r |
2 | *\r | |
bc7b889a | 3 | * Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r |
1e57a462 | 4 | *\r |
f4dfad05 | 5 | * SPDX-License-Identifier: BSD-2-Clause-Patent\r |
1e57a462 | 6 | *\r |
7 | **/\r | |
8 | \r | |
9 | #ifndef _ARMPLATFORMLIB_H_\r | |
10 | #define _ARMPLATFORMLIB_H_\r | |
11 | \r | |
12 | //\r | |
13 | // The package level header files this module uses\r | |
14 | //\r | |
15 | #include <PiPei.h>\r | |
16 | //\r | |
16f3544d | 17 | // The protocols, PPI and GUID definitions for this module\r |
1e57a462 | 18 | //\r |
19 | #include <Ppi/MasterBootMode.h>\r | |
20 | #include <Ppi/BootInRecoveryMode.h>\r | |
1e57a462 | 21 | \r |
22 | #include <Library/ArmLib.h>\r | |
23 | \r | |
bebda7ce | 24 | /**\r |
25 | Return the core position from the value of its MpId register\r | |
26 | \r | |
27 | This function returns the core position from the position 0 in the processor.\r | |
28 | This function might be called from assembler before any stack is set.\r | |
29 | \r | |
30 | @return Return the core position\r | |
31 | \r | |
32 | **/\r | |
1e57a462 | 33 | UINTN\r |
34 | ArmPlatformGetCorePosition (\r | |
35 | IN UINTN MpId\r | |
36 | );\r | |
37 | \r | |
bebda7ce | 38 | /**\r |
39 | Return a non-zero value if the callee is the primary core\r | |
40 | \r | |
41 | This function returns a non-zero value if the callee is the primary core.\r | |
42 | The primary core is the core responsible to initialize the hardware and run UEFI.\r | |
43 | This function might be called from assembler before any stack is set.\r | |
44 | \r | |
45 | @return Return a non-zero value if the callee is the primary core.\r | |
46 | \r | |
47 | **/\r | |
48 | UINTN\r | |
49 | ArmPlatformIsPrimaryCore (\r | |
50 | IN UINTN MpId\r | |
51 | );\r | |
52 | \r | |
d05ca26c | 53 | /**\r |
54 | Return the MpId of the primary core\r | |
55 | \r | |
56 | This function returns the MpId of the primary core.\r | |
57 | This function might be called from assembler before any stack is set.\r | |
58 | \r | |
59 | @return Return the MpId of the primary core\r | |
60 | \r | |
61 | **/\r | |
62 | UINTN\r | |
63 | ArmPlatformGetPrimaryCoreMpId (\r | |
64 | VOID\r | |
65 | );\r | |
66 | \r | |
1e57a462 | 67 | /**\r |
68 | Return the current Boot Mode\r | |
69 | \r | |
70 | This function returns the boot reason on the platform\r | |
71 | \r | |
72 | @return Return the current Boot Mode of the platform\r | |
73 | \r | |
74 | **/\r | |
75 | EFI_BOOT_MODE\r | |
76 | ArmPlatformGetBootMode (\r | |
77 | VOID\r | |
78 | );\r | |
79 | \r | |
6913a683 OM |
80 | /**\r |
81 | First platform specific function to be called in the PEI phase\r | |
82 | \r | |
83 | This function is actually the first function called by the PrePi\r | |
84 | or PrePeiCore modules. It allows to retrieve arguments passed to\r | |
85 | the UEFI firmware through the CPU registers.\r | |
86 | \r | |
87 | This function might be written into assembler as no stack are set\r | |
88 | when the function is invoked.\r | |
89 | \r | |
90 | **/\r | |
91 | VOID\r | |
92 | ArmPlatformPeiBootAction (\r | |
93 | VOID\r | |
94 | );\r | |
95 | \r | |
1e57a462 | 96 | /**\r |
97 | Initialize controllers that must setup in the normal world\r | |
98 | \r | |
99 | This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei\r | |
100 | in the PEI phase.\r | |
101 | \r | |
102 | **/\r | |
103 | RETURN_STATUS\r | |
104 | ArmPlatformInitialize (\r | |
105 | IN UINTN MpId\r | |
106 | );\r | |
107 | \r | |
1e57a462 | 108 | /**\r |
109 | Return the Virtual Memory Map of your platform\r | |
110 | \r | |
111 | This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU on your platform.\r | |
112 | \r | |
113 | @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR describing a Physical-to-\r | |
114 | Virtual Memory mapping. This array must be ended by a zero-filled\r | |
115 | entry\r | |
116 | \r | |
117 | **/\r | |
118 | VOID\r | |
119 | ArmPlatformGetVirtualMemoryMap (\r | |
120 | OUT ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap\r | |
121 | );\r | |
122 | \r | |
1e57a462 | 123 | /**\r |
124 | Return the Platform specific PPIs\r | |
125 | \r | |
126 | This function exposes the Platform Specific PPIs. They can be used by any PrePi modules or passed\r | |
127 | to the PeiCore by PrePeiCore.\r | |
128 | \r | |
129 | @param[out] PpiListSize Size in Bytes of the Platform PPI List\r | |
130 | @param[out] PpiList Platform PPI List\r | |
131 | \r | |
132 | **/\r | |
133 | VOID\r | |
134 | ArmPlatformGetPlatformPpiList (\r | |
135 | OUT UINTN *PpiListSize,\r | |
136 | OUT EFI_PEI_PPI_DESCRIPTOR **PpiList\r | |
137 | );\r | |
138 | \r | |
139 | #endif\r |