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