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