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
,
47 BoardManufacturerType02
,
49 ChassisLocationType02
,
56 SmbiosHiiStringFieldMax
57 } OEM_MISC_SMBIOS_HII_STRING_FIELD
;
60 * The following are functions that the each platform needs to
61 * implement in its OemMiscLib library.
64 /** Gets the CPU frequency of the specified processor.
66 @param ProcessorIndex Index of the processor to get the frequency for.
68 @return CPU frequency in Hz
73 IN UINT8 ProcessorIndex
76 /** Gets information about the specified processor and stores it in
77 the structures provided.
79 @param ProcessorIndex Index of the processor to get the information for.
80 @param ProcessorStatus Processor status.
81 @param ProcessorCharacteristics Processor characteritics.
82 @param MiscProcessorData Miscellaneous processor information.
84 @return TRUE on success, FALSE on failure.
88 OemGetProcessorInformation (
89 IN UINTN ProcessorIndex
,
90 IN OUT PROCESSOR_STATUS_DATA
*ProcessorStatus
,
91 IN OUT PROCESSOR_CHARACTERISTIC_FLAGS
*ProcessorCharacteristics
,
92 IN OUT OEM_MISC_PROCESSOR_DATA
*MiscProcessorData
95 /** Gets information about the cache at the specified cache level.
97 @param ProcessorIndex The processor to get information for.
98 @param CacheLevel The cache level to get information for.
99 @param DataCache Whether the cache is a data cache.
100 @param UnifiedCache Whether the cache is a unified cache.
101 @param SmbiosCacheTable The SMBIOS Type7 cache information structure.
103 @return TRUE on success, FALSE on failure.
107 OemGetCacheInformation (
108 IN UINT8 ProcessorIndex
,
110 IN BOOLEAN DataCache
,
111 IN BOOLEAN UnifiedCache
,
112 IN OUT SMBIOS_TABLE_TYPE7
*SmbiosCacheTable
115 /** Gets the maximum number of processors supported by the platform.
117 @return The maximum number of processors.
121 OemGetMaxProcessors (
125 /** Gets the type of chassis for the system.
127 @retval The type of the chassis.
135 /** Returns whether the specified processor is present or not.
137 @param ProcessIndex The processor index to check.
139 @return TRUE is the processor is present, FALSE otherwise.
143 OemIsProcessorPresent (
144 IN UINTN ProcessorIndex
147 /** Updates the HII string for the specified field.
149 @param HiiHandle The HII handle.
150 @param TokenToUpdate The string to update.
151 @param Field The field to get information about.
155 OemUpdateSmbiosInfo (
156 IN EFI_HII_HANDLE HiiHandle
,
157 IN EFI_STRING_ID TokenToUpdate
,
158 IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
161 /** Fetches the Type 32 boot information status.
165 MISC_BOOT_INFORMATION_STATUS_DATA_TYPE
171 /** Fetches the chassis status when it was last booted.
173 @return Chassis status.
177 OemGetChassisBootupState (
181 /** Fetches the chassis power supply/supplies status when last booted.
183 @return Chassis power supply/supplies status.
187 OemGetChassisPowerSupplyState (
191 /** Fetches the chassis thermal status when last booted.
193 @return Chassis thermal status.
197 OemGetChassisThermalState (
201 /** Fetches the chassis security status when last booted.
203 @return Chassis security status.
205 MISC_CHASSIS_SECURITY_STATE
207 OemGetChassisSecurityStatus (
211 /** Fetches the chassis height in RMUs (Rack Mount Units).
213 @return The height of the chassis.
217 OemGetChassisHeight (
221 /** Fetches the number of power cords.
223 @return The number of power cords.
227 OemGetChassisNumPowerCords (
231 #endif // OEM_MISC_LIB_H_