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