]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | *\r | |
3 | * Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r | |
4 | * \r | |
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 | |
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 | |
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 | |
37 | typedef 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 | |
43 | /**\r | |
44 | Return the core position from the value of its MpId register\r | |
45 | \r | |
46 | This function returns the core position from the position 0 in the processor.\r | |
47 | This function might be called from assembler before any stack is set.\r | |
48 | \r | |
49 | @return Return the core position\r | |
50 | \r | |
51 | **/\r | |
52 | UINTN\r | |
53 | ArmPlatformGetCorePosition (\r | |
54 | IN UINTN MpId\r | |
55 | );\r | |
56 | \r | |
57 | /**\r | |
58 | Return a non-zero value if the callee is the primary core\r | |
59 | \r | |
60 | This function returns a non-zero value if the callee is the primary core.\r | |
61 | The primary core is the core responsible to initialize the hardware and run UEFI.\r | |
62 | This function might be called from assembler before any stack is set.\r | |
63 | \r | |
64 | @return Return a non-zero value if the callee is the primary core.\r | |
65 | \r | |
66 | **/\r | |
67 | UINTN\r | |
68 | ArmPlatformIsPrimaryCore (\r | |
69 | IN UINTN MpId\r | |
70 | );\r | |
71 | \r | |
72 | /**\r | |
73 | Return the MpId of the primary core\r | |
74 | \r | |
75 | This function returns the MpId of the primary core.\r | |
76 | This function might be called from assembler before any stack is set.\r | |
77 | \r | |
78 | @return Return the MpId of the primary core\r | |
79 | \r | |
80 | **/\r | |
81 | UINTN\r | |
82 | ArmPlatformGetPrimaryCoreMpId (\r | |
83 | VOID\r | |
84 | );\r | |
85 | \r | |
86 | /**\r | |
87 | Return the current Boot Mode\r | |
88 | \r | |
89 | This function returns the boot reason on the platform\r | |
90 | \r | |
91 | @return Return the current Boot Mode of the platform\r | |
92 | \r | |
93 | **/\r | |
94 | EFI_BOOT_MODE\r | |
95 | ArmPlatformGetBootMode (\r | |
96 | VOID\r | |
97 | );\r | |
98 | \r | |
99 | /**\r | |
100 | Initialize controllers that must setup in the normal world\r | |
101 | \r | |
102 | This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei\r | |
103 | in the PEI phase.\r | |
104 | \r | |
105 | **/\r | |
106 | RETURN_STATUS\r | |
107 | ArmPlatformInitialize (\r | |
108 | IN UINTN MpId\r | |
109 | );\r | |
110 | \r | |
111 | /**\r | |
112 | Initialize the system (or sometimes called permanent) memory\r | |
113 | \r | |
114 | This memory is generally represented by the DRAM.\r | |
115 | \r | |
116 | **/\r | |
117 | VOID\r | |
118 | ArmPlatformInitializeSystemMemory (\r | |
119 | VOID\r | |
120 | );\r | |
121 | \r | |
122 | /**\r | |
123 | Return the Virtual Memory Map of your platform\r | |
124 | \r | |
125 | This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU on your platform.\r | |
126 | \r | |
127 | @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR describing a Physical-to-\r | |
128 | Virtual Memory mapping. This array must be ended by a zero-filled\r | |
129 | entry\r | |
130 | \r | |
131 | **/\r | |
132 | VOID\r | |
133 | ArmPlatformGetVirtualMemoryMap (\r | |
134 | OUT ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap\r | |
135 | );\r | |
136 | \r | |
137 | /**\r | |
138 | Return the Platform specific PPIs\r | |
139 | \r | |
140 | This function exposes the Platform Specific PPIs. They can be used by any PrePi modules or passed\r | |
141 | to the PeiCore by PrePeiCore.\r | |
142 | \r | |
143 | @param[out] PpiListSize Size in Bytes of the Platform PPI List\r | |
144 | @param[out] PpiList Platform PPI List\r | |
145 | \r | |
146 | **/\r | |
147 | VOID\r | |
148 | ArmPlatformGetPlatformPpiList (\r | |
149 | OUT UINTN *PpiListSize,\r | |
150 | OUT EFI_PEI_PPI_DESCRIPTOR **PpiList\r | |
151 | );\r | |
152 | \r | |
153 | #endif\r |