3 * Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
4 * Copyright (c) 2021, NUVIA Inc. All rights reserved.
5 * Copyright (c) 2015, Hisilicon Limited. All rights reserved.
6 * Copyright (c) 2015, Linaro Limited. All rights reserved.
8 * SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef OEM_MISC_LIB_H_
13 #define OEM_MISC_LIB_H_
16 #include <IndustryStandard/SmBios.h>
27 } OEM_MISC_CPU_CACHE_LEVEL
;
30 UINT8 Voltage
; ///< Processor voltage
31 UINT16 CurrentSpeed
; ///< Current clock speed in MHz
32 UINT16 MaxSpeed
; ///< Maximum clock speed in MHz
33 UINT16 ExternalClock
; ///< External clock speed in MHz
34 UINT16 CoreCount
; ///< Number of cores available
35 UINT16 CoresEnabled
; ///< Number of cores enabled
36 UINT16 ThreadCount
; ///< Number of threads per processor
37 } OEM_MISC_PROCESSOR_DATA
;
44 SystemManufacturerType01
,
50 BoardManufacturerType02
,
54 ChassisLocationType02
,
61 ProcessorPartNumType04
,
62 ProcessorSerialNumType04
,
63 ProcessorVersionType04
,
64 SmbiosHiiStringFieldMax
65 } OEM_MISC_SMBIOS_HII_STRING_FIELD
;
68 * The following are functions that the each platform needs to
69 * implement in its OemMiscLib library.
72 /** Gets the CPU frequency of the specified processor.
74 @param ProcessorIndex Index of the processor to get the frequency for.
76 @return CPU frequency in Hz
81 IN UINT8 ProcessorIndex
84 /** Gets information about the specified processor and stores it in
85 the structures provided.
87 @param ProcessorIndex Index of the processor to get the information for.
88 @param ProcessorStatus Processor status.
89 @param ProcessorCharacteristics Processor characteritics.
90 @param MiscProcessorData Miscellaneous processor information.
92 @return TRUE on success, FALSE on failure.
96 OemGetProcessorInformation (
97 IN UINTN ProcessorIndex
,
98 IN OUT PROCESSOR_STATUS_DATA
*ProcessorStatus
,
99 IN OUT PROCESSOR_CHARACTERISTIC_FLAGS
*ProcessorCharacteristics
,
100 IN OUT OEM_MISC_PROCESSOR_DATA
*MiscProcessorData
103 /** Gets information about the cache at the specified cache level.
105 @param ProcessorIndex The processor to get information for.
106 @param CacheLevel The cache level to get information for.
107 @param DataCache Whether the cache is a data cache.
108 @param UnifiedCache Whether the cache is a unified cache.
109 @param SmbiosCacheTable The SMBIOS Type7 cache information structure.
111 @return TRUE on success, FALSE on failure.
115 OemGetCacheInformation (
116 IN UINT8 ProcessorIndex
,
118 IN BOOLEAN DataCache
,
119 IN BOOLEAN UnifiedCache
,
120 IN OUT SMBIOS_TABLE_TYPE7
*SmbiosCacheTable
123 /** Gets the maximum number of processors supported by the platform.
125 @return The maximum number of processors.
129 OemGetMaxProcessors (
133 /** Gets the type of chassis for the system.
135 @retval The type of the chassis.
143 /** Returns whether the specified processor is present or not.
145 @param ProcessIndex The processor index to check.
147 @return TRUE is the processor is present, FALSE otherwise.
151 OemIsProcessorPresent (
152 IN UINTN ProcessorIndex
155 /** Updates the HII string for the specified field.
157 @param HiiHandle The HII handle.
158 @param TokenToUpdate The string to update.
159 @param Field The field to get information about.
163 OemUpdateSmbiosInfo (
164 IN EFI_HII_HANDLE HiiHandle
,
165 IN EFI_STRING_ID TokenToUpdate
,
166 IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
169 /** Fetches the Type 32 boot information status.
173 MISC_BOOT_INFORMATION_STATUS_DATA_TYPE
179 /** Fetches the chassis status when it was last booted.
181 @return Chassis status.
185 OemGetChassisBootupState (
189 /** Fetches the chassis power supply/supplies status when last booted.
191 @return Chassis power supply/supplies status.
195 OemGetChassisPowerSupplyState (
199 /** Fetches the chassis thermal status when last booted.
201 @return Chassis thermal status.
205 OemGetChassisThermalState (
209 /** Fetches the chassis security status when last booted.
211 @return Chassis security status.
213 MISC_CHASSIS_SECURITY_STATE
215 OemGetChassisSecurityStatus (
219 /** Fetches the chassis height in RMUs (Rack Mount Units).
221 @return The height of the chassis.
225 OemGetChassisHeight (
229 /** Fetches the number of power cords.
231 @return The number of power cords.
235 OemGetChassisNumPowerCords (
240 Fetches the system UUID.
242 @param[out] SystemUuid The pointer to the buffer to store the System UUID.
251 /** Fetches the BIOS release.
253 @return The BIOS release.
261 /** Fetches the embedded controller firmware release.
263 @return The embedded controller firmware release.
267 OemGetEmbeddedControllerFirmwareRelease (
271 #endif // OEM_MISC_LIB_H_