]>
Commit | Line | Data |
---|---|---|
1e57a462 | 1 | /** @file\r |
2 | *\r | |
3 | * Copyright (c) 2011-2012, 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 | #include <Library/ArmLib.h>\r | |
16 | #include <Library/ArmPlatformLib.h>\r | |
17 | \r | |
18 | #include <Ppi/ArmMpCoreInfo.h>\r | |
19 | \r | |
20 | \r | |
21 | ARM_CORE_INFO mArmPlatformNullMpCoreInfoTable[] = {\r | |
22 | {\r | |
23 | // Cluster 0, Core 0\r | |
24 | 0x0, 0x0,\r | |
25 | \r | |
26 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value\r | |
27 | (EFI_PHYSICAL_ADDRESS)0,\r | |
28 | (EFI_PHYSICAL_ADDRESS)0,\r | |
29 | (EFI_PHYSICAL_ADDRESS)0,\r | |
30 | (UINT64)0xFFFFFFFF\r | |
31 | },\r | |
32 | {\r | |
33 | // Cluster 0, Core 1\r | |
34 | 0x0, 0x1,\r | |
35 | \r | |
36 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value\r | |
37 | (EFI_PHYSICAL_ADDRESS)0,\r | |
38 | (EFI_PHYSICAL_ADDRESS)0,\r | |
39 | (EFI_PHYSICAL_ADDRESS)0,\r | |
40 | (UINT64)0xFFFFFFFF\r | |
41 | },\r | |
42 | {\r | |
43 | // Cluster 0, Core 2\r | |
44 | 0x0, 0x2,\r | |
45 | \r | |
46 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value\r | |
47 | (EFI_PHYSICAL_ADDRESS)0,\r | |
48 | (EFI_PHYSICAL_ADDRESS)0,\r | |
49 | (EFI_PHYSICAL_ADDRESS)0,\r | |
50 | (UINT64)0xFFFFFFFF\r | |
51 | },\r | |
52 | {\r | |
53 | // Cluster 0, Core 3\r | |
54 | 0x0, 0x3,\r | |
55 | \r | |
56 | // MP Core MailBox Set/Get/Clear Addresses and Clear Value\r | |
57 | (EFI_PHYSICAL_ADDRESS)0,\r | |
58 | (EFI_PHYSICAL_ADDRESS)0,\r | |
59 | (EFI_PHYSICAL_ADDRESS)0,\r | |
60 | (UINT64)0xFFFFFFFF\r | |
61 | }\r | |
62 | };\r | |
63 | \r | |
64 | // This function should be better located into TimerLib implementation\r | |
65 | RETURN_STATUS\r | |
66 | EFIAPI\r | |
67 | TimerConstructor (\r | |
68 | VOID\r | |
69 | )\r | |
70 | {\r | |
71 | return EFI_SUCCESS;\r | |
72 | }\r | |
73 | \r | |
74 | /**\r | |
75 | Return the current Boot Mode\r | |
76 | \r | |
77 | This function returns the boot reason on the platform\r | |
78 | \r | |
79 | **/\r | |
80 | EFI_BOOT_MODE\r | |
81 | ArmPlatformGetBootMode (\r | |
82 | VOID\r | |
83 | )\r | |
84 | {\r | |
85 | return BOOT_WITH_FULL_CONFIGURATION;\r | |
86 | }\r | |
87 | \r | |
88 | /**\r | |
89 | Initialize controllers that must setup in the normal world\r | |
90 | \r | |
91 | This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei\r | |
92 | in the PEI phase.\r | |
93 | \r | |
94 | **/\r | |
95 | RETURN_STATUS\r | |
96 | ArmPlatformInitialize (\r | |
97 | IN UINTN MpId\r | |
98 | )\r | |
99 | {\r | |
bebda7ce | 100 | if (!ArmPlatformIsPrimaryCore (MpId)) {\r |
1e57a462 | 101 | return RETURN_SUCCESS;\r |
102 | }\r | |
103 | \r | |
104 | //TODO: Implement me\r | |
105 | \r | |
106 | return RETURN_SUCCESS;\r | |
107 | }\r | |
108 | \r | |
109 | /**\r | |
110 | Initialize the system (or sometimes called permanent) memory\r | |
111 | \r | |
112 | This memory is generally represented by the DRAM.\r | |
113 | \r | |
114 | **/\r | |
115 | VOID\r | |
116 | ArmPlatformInitializeSystemMemory (\r | |
117 | VOID\r | |
118 | )\r | |
119 | {\r | |
120 | //TODO: Implement me\r | |
121 | }\r | |
122 | \r | |
123 | EFI_STATUS\r | |
124 | PrePeiCoreGetMpCoreInfo (\r | |
125 | OUT UINTN *CoreCount,\r | |
126 | OUT ARM_CORE_INFO **ArmCoreTable\r | |
127 | )\r | |
128 | {\r | |
129 | if (ArmIsMpCore()) {\r | |
130 | *CoreCount = sizeof(mArmPlatformNullMpCoreInfoTable) / sizeof(ARM_CORE_INFO);\r | |
131 | *ArmCoreTable = mArmPlatformNullMpCoreInfoTable;\r | |
132 | return EFI_SUCCESS;\r | |
133 | } else {\r | |
134 | return EFI_UNSUPPORTED;\r | |
135 | }\r | |
136 | }\r | |
137 | \r | |
138 | // Needs to be declared in the file. Otherwise gArmMpCoreInfoPpiGuid is undefined in the contect of PrePeiCore\r | |
139 | EFI_GUID mArmMpCoreInfoPpiGuid = ARM_MP_CORE_INFO_PPI_GUID;\r | |
140 | ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi = { PrePeiCoreGetMpCoreInfo };\r | |
141 | \r | |
142 | EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = {\r | |
143 | {\r | |
144 | EFI_PEI_PPI_DESCRIPTOR_PPI,\r | |
145 | &mArmMpCoreInfoPpiGuid,\r | |
146 | &mMpCoreInfoPpi\r | |
147 | }\r | |
148 | };\r | |
149 | \r | |
150 | VOID\r | |
151 | ArmPlatformGetPlatformPpiList (\r | |
152 | OUT UINTN *PpiListSize,\r | |
153 | OUT EFI_PEI_PPI_DESCRIPTOR **PpiList\r | |
154 | )\r | |
155 | {\r | |
156 | if (ArmIsMpCore()) {\r | |
157 | *PpiListSize = sizeof(gPlatformPpiTable);\r | |
158 | *PpiList = gPlatformPpiTable;\r | |
159 | } else {\r | |
160 | *PpiListSize = 0;\r | |
161 | *PpiList = NULL;\r | |
162 | }\r | |
163 | }\r | |
164 | \r |