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