]>
Commit | Line | Data |
---|---|---|
2c7c64fc RC |
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 | |
2c7c64fc RC |
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 | |
429309e0 | 17 | typedef enum {\r |
2c7c64fc RC |
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 | |
429309e0 MK |
28 | typedef 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 | |
2c7c64fc RC |
36 | } OEM_MISC_PROCESSOR_DATA;\r |
37 | \r | |
429309e0 MK |
38 | typedef enum {\r |
39 | ProductNameType01,\r | |
40 | SerialNumType01,\r | |
41 | UuidType01,\r | |
42 | SystemManufacturerType01,\r | |
45e38429 | 43 | VersionType01,\r |
429309e0 MK |
44 | SkuNumberType01,\r |
45 | FamilyType01,\r | |
46 | AssertTagType02,\r | |
47 | SerialNumberType02,\r | |
48 | BoardManufacturerType02,\r | |
45e38429 NP |
49 | ProductNameType02,\r |
50 | VersionType02,\r | |
429309e0 MK |
51 | SkuNumberType02,\r |
52 | ChassisLocationType02,\r | |
53 | AssetTagType03,\r | |
54 | SerialNumberType03,\r | |
55 | VersionType03,\r | |
56 | ChassisTypeType03,\r | |
57 | ManufacturerType03,\r | |
58 | SkuNumberType03,\r | |
b451c690 NP |
59 | ProcessorPartNumType04,\r |
60 | ProcessorSerialNumType04,\r | |
429309e0 | 61 | SmbiosHiiStringFieldMax\r |
2c7c64fc RC |
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 | |
2c7c64fc | 75 | UINTN\r |
533fff50 | 76 | EFIAPI\r |
2c7c64fc | 77 | OemGetCpuFreq (\r |
429309e0 | 78 | IN UINT8 ProcessorIndex\r |
2c7c64fc RC |
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 | |
2c7c64fc | 91 | BOOLEAN\r |
533fff50 | 92 | EFIAPI\r |
2c7c64fc | 93 | OemGetProcessorInformation (\r |
429309e0 MK |
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 | |
2c7c64fc RC |
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 | |
2c7c64fc | 110 | BOOLEAN\r |
533fff50 | 111 | EFIAPI\r |
2c7c64fc | 112 | OemGetCacheInformation (\r |
429309e0 MK |
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 | |
2c7c64fc RC |
118 | );\r |
119 | \r | |
869ccd4a | 120 | /** Gets the maximum number of processors supported by the platform.\r |
2c7c64fc | 121 | \r |
869ccd4a | 122 | @return The maximum number of processors.\r |
2c7c64fc | 123 | **/\r |
2c7c64fc | 124 | UINT8\r |
533fff50 | 125 | EFIAPI\r |
869ccd4a | 126 | OemGetMaxProcessors (\r |
2c7c64fc RC |
127 | VOID\r |
128 | );\r | |
129 | \r | |
130 | /** Gets the type of chassis for the system.\r | |
131 | \r | |
a2b5ea38 | 132 | @retval The type of the chassis.\r |
2c7c64fc | 133 | **/\r |
a2b5ea38 | 134 | MISC_CHASSIS_TYPE\r |
533fff50 | 135 | EFIAPI\r |
2c7c64fc | 136 | OemGetChassisType (\r |
a2b5ea38 | 137 | VOID\r |
2c7c64fc RC |
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 | |
2c7c64fc | 146 | BOOLEAN\r |
533fff50 | 147 | EFIAPI\r |
869ccd4a | 148 | OemIsProcessorPresent (\r |
429309e0 | 149 | IN UINTN ProcessorIndex\r |
2c7c64fc RC |
150 | );\r |
151 | \r | |
152 | /** Updates the HII string for the specified field.\r | |
153 | \r | |
869ccd4a | 154 | @param HiiHandle The HII handle.\r |
2c7c64fc | 155 | @param TokenToUpdate The string to update.\r |
869ccd4a | 156 | @param Field The field to get information about.\r |
2c7c64fc | 157 | **/\r |
2c7c64fc | 158 | VOID\r |
533fff50 | 159 | EFIAPI\r |
2c7c64fc | 160 | OemUpdateSmbiosInfo (\r |
429309e0 MK |
161 | IN EFI_HII_HANDLE HiiHandle,\r |
162 | IN EFI_STRING_ID TokenToUpdate,\r | |
163 | IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field\r | |
2c7c64fc RC |
164 | );\r |
165 | \r | |
bbeb1bea RC |
166 | /** Fetches the Type 32 boot information status.\r |
167 | \r | |
168 | @return Boot status.\r | |
169 | **/\r | |
170 | MISC_BOOT_INFORMATION_STATUS_DATA_TYPE\r | |
171 | EFIAPI\r | |
172 | OemGetBootStatus (\r | |
173 | VOID\r | |
174 | );\r | |
175 | \r | |
bf2b9999 RC |
176 | /** Fetches the chassis status when it was last booted.\r |
177 | \r | |
178 | @return Chassis status.\r | |
179 | **/\r | |
180 | MISC_CHASSIS_STATE\r | |
181 | EFIAPI\r | |
182 | OemGetChassisBootupState (\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 | |
190 | MISC_CHASSIS_STATE\r | |
191 | EFIAPI\r | |
192 | OemGetChassisPowerSupplyState (\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 | |
200 | MISC_CHASSIS_STATE\r | |
201 | EFIAPI\r | |
202 | OemGetChassisThermalState (\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 | |
210 | MISC_CHASSIS_SECURITY_STATE\r | |
211 | EFIAPI\r | |
212 | OemGetChassisSecurityStatus (\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 | |
220 | UINT8\r | |
221 | EFIAPI\r | |
222 | OemGetChassisHeight (\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 | |
230 | UINT8\r | |
231 | EFIAPI\r | |
232 | OemGetChassisNumPowerCords (\r | |
233 | VOID\r | |
234 | );\r | |
235 | \r | |
2c7c64fc | 236 | #endif // OEM_MISC_LIB_H_\r |