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.
7 * SPDX-License-Identifier: BSD-2-Clause-Patent
11 #ifndef OEM_MISC_LIB_H_
12 #define OEM_MISC_LIB_H_
15 #include <IndustryStandard/SmBios.h>
26 } OEM_MISC_CPU_CACHE_LEVEL
;
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
;
42 SystemManufacturerType01
,
48 BoardManufacturerType02
,
52 ChassisLocationType02
,
59 SmbiosHiiStringFieldMax
60 } OEM_MISC_SMBIOS_HII_STRING_FIELD
;
63 * The following are functions that the each platform needs to
64 * implement in its OemMiscLib library.
67 /** Gets the CPU frequency of the specified processor.
69 @param ProcessorIndex Index of the processor to get the frequency for.
71 @return CPU frequency in Hz
76 IN UINT8 ProcessorIndex
79 /** Gets information about the specified processor and stores it in
80 the structures provided.
82 @param ProcessorIndex Index of the processor to get the information for.
83 @param ProcessorStatus Processor status.
84 @param ProcessorCharacteristics Processor characteritics.
85 @param MiscProcessorData Miscellaneous processor information.
87 @return TRUE on success, FALSE on failure.
91 OemGetProcessorInformation (
92 IN UINTN ProcessorIndex
,
93 IN OUT PROCESSOR_STATUS_DATA
*ProcessorStatus
,
94 IN OUT PROCESSOR_CHARACTERISTIC_FLAGS
*ProcessorCharacteristics
,
95 IN OUT OEM_MISC_PROCESSOR_DATA
*MiscProcessorData
98 /** Gets information about the cache at the specified cache level.
100 @param ProcessorIndex The processor to get information for.
101 @param CacheLevel The cache level to get information for.
102 @param DataCache Whether the cache is a data cache.
103 @param UnifiedCache Whether the cache is a unified cache.
104 @param SmbiosCacheTable The SMBIOS Type7 cache information structure.
106 @return TRUE on success, FALSE on failure.
110 OemGetCacheInformation (
111 IN UINT8 ProcessorIndex
,
113 IN BOOLEAN DataCache
,
114 IN BOOLEAN UnifiedCache
,
115 IN OUT SMBIOS_TABLE_TYPE7
*SmbiosCacheTable
118 /** Gets the maximum number of processors supported by the platform.
120 @return The maximum number of processors.
124 OemGetMaxProcessors (
128 /** Gets the type of chassis for the system.
130 @retval The type of the chassis.
138 /** Returns whether the specified processor is present or not.
140 @param ProcessIndex The processor index to check.
142 @return TRUE is the processor is present, FALSE otherwise.
146 OemIsProcessorPresent (
147 IN UINTN ProcessorIndex
150 /** Updates the HII string for the specified field.
152 @param HiiHandle The HII handle.
153 @param TokenToUpdate The string to update.
154 @param Field The field to get information about.
158 OemUpdateSmbiosInfo (
159 IN EFI_HII_HANDLE HiiHandle
,
160 IN EFI_STRING_ID TokenToUpdate
,
161 IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
164 /** Fetches the Type 32 boot information status.
168 MISC_BOOT_INFORMATION_STATUS_DATA_TYPE
174 /** Fetches the chassis status when it was last booted.
176 @return Chassis status.
180 OemGetChassisBootupState (
184 /** Fetches the chassis power supply/supplies status when last booted.
186 @return Chassis power supply/supplies status.
190 OemGetChassisPowerSupplyState (
194 /** Fetches the chassis thermal status when last booted.
196 @return Chassis thermal status.
200 OemGetChassisThermalState (
204 /** Fetches the chassis security status when last booted.
206 @return Chassis security status.
208 MISC_CHASSIS_SECURITY_STATE
210 OemGetChassisSecurityStatus (
214 /** Fetches the chassis height in RMUs (Rack Mount Units).
216 @return The height of the chassis.
220 OemGetChassisHeight (
224 /** Fetches the number of power cords.
226 @return The number of power cords.
230 OemGetChassisNumPowerCords (
234 #endif // OEM_MISC_LIB_H_