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