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