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
;
43 SystemManufacturerType01
,
49 BoardManufacturerType02
,
53 ChassisLocationType02
,
60 ProcessorPartNumType04
,
61 ProcessorSerialNumType04
,
62 ProcessorVersionType04
,
63 SmbiosHiiStringFieldMax
64 } OEM_MISC_SMBIOS_HII_STRING_FIELD
;
67 * The following are functions that the each platform needs to
68 * implement in its OemMiscLib library.
71 /** Gets the CPU frequency of the specified processor.
73 @param ProcessorIndex Index of the processor to get the frequency for.
75 @return CPU frequency in Hz
80 IN UINT8 ProcessorIndex
83 /** Gets information about the specified processor and stores it in
84 the structures provided.
86 @param ProcessorIndex Index of the processor to get the information for.
87 @param ProcessorStatus Processor status.
88 @param ProcessorCharacteristics Processor characteritics.
89 @param MiscProcessorData Miscellaneous processor information.
91 @return TRUE on success, FALSE on failure.
95 OemGetProcessorInformation (
96 IN UINTN ProcessorIndex
,
97 IN OUT PROCESSOR_STATUS_DATA
*ProcessorStatus
,
98 IN OUT PROCESSOR_CHARACTERISTIC_FLAGS
*ProcessorCharacteristics
,
99 IN OUT OEM_MISC_PROCESSOR_DATA
*MiscProcessorData
102 /** Gets information about the cache at the specified cache level.
104 @param ProcessorIndex The processor to get information for.
105 @param CacheLevel The cache level to get information for.
106 @param DataCache Whether the cache is a data cache.
107 @param UnifiedCache Whether the cache is a unified cache.
108 @param SmbiosCacheTable The SMBIOS Type7 cache information structure.
110 @return TRUE on success, FALSE on failure.
114 OemGetCacheInformation (
115 IN UINT8 ProcessorIndex
,
117 IN BOOLEAN DataCache
,
118 IN BOOLEAN UnifiedCache
,
119 IN OUT SMBIOS_TABLE_TYPE7
*SmbiosCacheTable
122 /** Gets the maximum number of processors supported by the platform.
124 @return The maximum number of processors.
128 OemGetMaxProcessors (
132 /** Gets the type of chassis for the system.
134 @retval The type of the chassis.
142 /** Returns whether the specified processor is present or not.
144 @param ProcessIndex The processor index to check.
146 @return TRUE is the processor is present, FALSE otherwise.
150 OemIsProcessorPresent (
151 IN UINTN ProcessorIndex
154 /** Updates the HII string for the specified field.
156 @param HiiHandle The HII handle.
157 @param TokenToUpdate The string to update.
158 @param Field The field to get information about.
162 OemUpdateSmbiosInfo (
163 IN EFI_HII_HANDLE HiiHandle
,
164 IN EFI_STRING_ID TokenToUpdate
,
165 IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
168 /** Fetches the Type 32 boot information status.
172 MISC_BOOT_INFORMATION_STATUS_DATA_TYPE
178 /** Fetches the chassis status when it was last booted.
180 @return Chassis status.
184 OemGetChassisBootupState (
188 /** Fetches the chassis power supply/supplies status when last booted.
190 @return Chassis power supply/supplies status.
194 OemGetChassisPowerSupplyState (
198 /** Fetches the chassis thermal status when last booted.
200 @return Chassis thermal status.
204 OemGetChassisThermalState (
208 /** Fetches the chassis security status when last booted.
210 @return Chassis security status.
212 MISC_CHASSIS_SECURITY_STATE
214 OemGetChassisSecurityStatus (
218 /** Fetches the chassis height in RMUs (Rack Mount Units).
220 @return The height of the chassis.
224 OemGetChassisHeight (
228 /** Fetches the number of power cords.
230 @return The number of power cords.
234 OemGetChassisNumPowerCords (
239 Fetches the system UUID.
241 @param[out] SystemUuid The pointer to the buffer to store the System UUID.
250 #endif // OEM_MISC_LIB_H_