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