]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - ArmPkg/Include/Library/OemMiscLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / ArmPkg / Include / Library / OemMiscLib.h
... / ...
CommitLineData
1/** @file\r
2*\r
3* Copyright (c) 2022, Ampere Computing LLC. All rights reserved.\r
4* Copyright (c) 2021, NUVIA Inc. All rights reserved.\r
5* Copyright (c) 2015, Hisilicon Limited. All rights reserved.\r
6* Copyright (c) 2015, Linaro Limited. All rights reserved.\r
7*\r
8* SPDX-License-Identifier: BSD-2-Clause-Patent\r
9*\r
10**/\r
11\r
12#ifndef OEM_MISC_LIB_H_\r
13#define OEM_MISC_LIB_H_\r
14\r
15#include <Uefi.h>\r
16#include <IndustryStandard/SmBios.h>\r
17\r
18typedef enum {\r
19 CpuCacheL1 = 1,\r
20 CpuCacheL2,\r
21 CpuCacheL3,\r
22 CpuCacheL4,\r
23 CpuCacheL5,\r
24 CpuCacheL6,\r
25 CpuCacheL7,\r
26 CpuCacheLevelMax\r
27} OEM_MISC_CPU_CACHE_LEVEL;\r
28\r
29typedef struct {\r
30 UINT8 Voltage; ///< Processor voltage\r
31 UINT16 CurrentSpeed; ///< Current clock speed in MHz\r
32 UINT16 MaxSpeed; ///< Maximum clock speed in MHz\r
33 UINT16 ExternalClock; ///< External clock speed in MHz\r
34 UINT16 CoreCount; ///< Number of cores available\r
35 UINT16 CoresEnabled; ///< Number of cores enabled\r
36 UINT16 ThreadCount; ///< Number of threads per processor\r
37} OEM_MISC_PROCESSOR_DATA;\r
38\r
39typedef enum {\r
40 BiosVersionType00,\r
41 ProductNameType01,\r
42 SerialNumType01,\r
43 UuidType01,\r
44 SystemManufacturerType01,\r
45 VersionType01,\r
46 SkuNumberType01,\r
47 FamilyType01,\r
48 AssetTagType02,\r
49 SerialNumberType02,\r
50 BoardManufacturerType02,\r
51 ProductNameType02,\r
52 VersionType02,\r
53 SkuNumberType02,\r
54 ChassisLocationType02,\r
55 AssetTagType03,\r
56 SerialNumberType03,\r
57 VersionType03,\r
58 ChassisTypeType03,\r
59 ManufacturerType03,\r
60 SkuNumberType03,\r
61 ProcessorPartNumType04,\r
62 ProcessorSerialNumType04,\r
63 ProcessorVersionType04,\r
64 SmbiosHiiStringFieldMax\r
65} OEM_MISC_SMBIOS_HII_STRING_FIELD;\r
66\r
67/*\r
68 * The following are functions that the each platform needs to\r
69 * implement in its OemMiscLib library.\r
70 */\r
71\r
72/** Gets the CPU frequency of the specified processor.\r
73\r
74 @param ProcessorIndex Index of the processor to get the frequency for.\r
75\r
76 @return CPU frequency in Hz\r
77**/\r
78UINTN\r
79EFIAPI\r
80OemGetCpuFreq (\r
81 IN UINT8 ProcessorIndex\r
82 );\r
83\r
84/** Gets information about the specified processor and stores it in\r
85 the structures provided.\r
86\r
87 @param ProcessorIndex Index of the processor to get the information for.\r
88 @param ProcessorStatus Processor status.\r
89 @param ProcessorCharacteristics Processor characteritics.\r
90 @param MiscProcessorData Miscellaneous processor information.\r
91\r
92 @return TRUE on success, FALSE on failure.\r
93**/\r
94BOOLEAN\r
95EFIAPI\r
96OemGetProcessorInformation (\r
97 IN UINTN ProcessorIndex,\r
98 IN OUT PROCESSOR_STATUS_DATA *ProcessorStatus,\r
99 IN OUT PROCESSOR_CHARACTERISTIC_FLAGS *ProcessorCharacteristics,\r
100 IN OUT OEM_MISC_PROCESSOR_DATA *MiscProcessorData\r
101 );\r
102\r
103/** Gets information about the cache at the specified cache level.\r
104\r
105 @param ProcessorIndex The processor to get information for.\r
106 @param CacheLevel The cache level to get information for.\r
107 @param DataCache Whether the cache is a data cache.\r
108 @param UnifiedCache Whether the cache is a unified cache.\r
109 @param SmbiosCacheTable The SMBIOS Type7 cache information structure.\r
110\r
111 @return TRUE on success, FALSE on failure.\r
112**/\r
113BOOLEAN\r
114EFIAPI\r
115OemGetCacheInformation (\r
116 IN UINT8 ProcessorIndex,\r
117 IN UINT8 CacheLevel,\r
118 IN BOOLEAN DataCache,\r
119 IN BOOLEAN UnifiedCache,\r
120 IN OUT SMBIOS_TABLE_TYPE7 *SmbiosCacheTable\r
121 );\r
122\r
123/** Gets the maximum number of processors supported by the platform.\r
124\r
125 @return The maximum number of processors.\r
126**/\r
127UINT8\r
128EFIAPI\r
129OemGetMaxProcessors (\r
130 VOID\r
131 );\r
132\r
133/** Gets the type of chassis for the system.\r
134\r
135 @retval The type of the chassis.\r
136**/\r
137MISC_CHASSIS_TYPE\r
138EFIAPI\r
139OemGetChassisType (\r
140 VOID\r
141 );\r
142\r
143/** Returns whether the specified processor is present or not.\r
144\r
145 @param ProcessIndex The processor index to check.\r
146\r
147 @return TRUE is the processor is present, FALSE otherwise.\r
148**/\r
149BOOLEAN\r
150EFIAPI\r
151OemIsProcessorPresent (\r
152 IN UINTN ProcessorIndex\r
153 );\r
154\r
155/** Updates the HII string for the specified field.\r
156\r
157 @param HiiHandle The HII handle.\r
158 @param TokenToUpdate The string to update.\r
159 @param Field The field to get information about.\r
160**/\r
161VOID\r
162EFIAPI\r
163OemUpdateSmbiosInfo (\r
164 IN EFI_HII_HANDLE HiiHandle,\r
165 IN EFI_STRING_ID TokenToUpdate,\r
166 IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field\r
167 );\r
168\r
169/** Fetches the Type 32 boot information status.\r
170\r
171 @return Boot status.\r
172**/\r
173MISC_BOOT_INFORMATION_STATUS_DATA_TYPE\r
174EFIAPI\r
175OemGetBootStatus (\r
176 VOID\r
177 );\r
178\r
179/** Fetches the chassis status when it was last booted.\r
180\r
181 @return Chassis status.\r
182**/\r
183MISC_CHASSIS_STATE\r
184EFIAPI\r
185OemGetChassisBootupState (\r
186 VOID\r
187 );\r
188\r
189/** Fetches the chassis power supply/supplies status when last booted.\r
190\r
191 @return Chassis power supply/supplies status.\r
192**/\r
193MISC_CHASSIS_STATE\r
194EFIAPI\r
195OemGetChassisPowerSupplyState (\r
196 VOID\r
197 );\r
198\r
199/** Fetches the chassis thermal status when last booted.\r
200\r
201 @return Chassis thermal status.\r
202**/\r
203MISC_CHASSIS_STATE\r
204EFIAPI\r
205OemGetChassisThermalState (\r
206 VOID\r
207 );\r
208\r
209/** Fetches the chassis security status when last booted.\r
210\r
211 @return Chassis security status.\r
212**/\r
213MISC_CHASSIS_SECURITY_STATE\r
214EFIAPI\r
215OemGetChassisSecurityStatus (\r
216 VOID\r
217 );\r
218\r
219/** Fetches the chassis height in RMUs (Rack Mount Units).\r
220\r
221 @return The height of the chassis.\r
222**/\r
223UINT8\r
224EFIAPI\r
225OemGetChassisHeight (\r
226 VOID\r
227 );\r
228\r
229/** Fetches the number of power cords.\r
230\r
231 @return The number of power cords.\r
232**/\r
233UINT8\r
234EFIAPI\r
235OemGetChassisNumPowerCords (\r
236 VOID\r
237 );\r
238\r
239/**\r
240 Fetches the system UUID.\r
241\r
242 @param[out] SystemUuid The pointer to the buffer to store the System UUID.\r
243\r
244**/\r
245VOID\r
246EFIAPI\r
247OemGetSystemUuid (\r
248 OUT GUID *SystemUuid\r
249 );\r
250\r
251/** Fetches the BIOS release.\r
252\r
253 @return The BIOS release.\r
254**/\r
255UINT16\r
256EFIAPI\r
257OemGetBiosRelease (\r
258 VOID\r
259 );\r
260\r
261/** Fetches the embedded controller firmware release.\r
262\r
263 @return The embedded controller firmware release.\r
264**/\r
265UINT16\r
266EFIAPI\r
267OemGetEmbeddedControllerFirmwareRelease (\r
268 VOID\r
269 );\r
270\r
271#endif // OEM_MISC_LIB_H_\r