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
12 #ifndef OEM_MISC_LIB_H_
13 #define OEM_MISC_LIB_H_
16 #include <IndustryStandard/SmBios.h>
28 } OEM_MISC_CPU_CACHE_LEVEL
;
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
;
46 SystemManufacturerType01
,
51 BoardManufacturerType02
,
53 ChassisLocationType02
,
60 SmbiosHiiStringFieldMax
61 } OEM_MISC_SMBIOS_HII_STRING_FIELD
;
64 * The following are functions that the each platform needs to
65 * implement in its OemMiscLib library.
68 /** Gets the CPU frequency of the specified processor.
70 @param ProcessorIndex Index of the processor to get the frequency for.
72 @return CPU frequency in Hz
77 IN UINT8 ProcessorIndex
80 /** Gets information about the specified processor and stores it in
81 the structures provided.
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.
88 @return TRUE on success, FALSE on failure.
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
99 /** Gets information about the cache at the specified cache level.
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.
107 @return TRUE on success, FALSE on failure.
111 OemGetCacheInformation (
112 IN UINT8 ProcessorIndex
,
114 IN BOOLEAN DataCache
,
115 IN BOOLEAN UnifiedCache
,
116 IN OUT SMBIOS_TABLE_TYPE7
*SmbiosCacheTable
119 /** Gets the maximum number of processors supported by the platform.
121 @return The maximum number of processors.
125 OemGetMaxProcessors (
129 /** Gets the type of chassis for the system.
131 @retval The type of the chassis.
139 /** Returns whether the specified processor is present or not.
141 @param ProcessIndex The processor index to check.
143 @return TRUE is the processor is present, FALSE otherwise.
147 OemIsProcessorPresent (
148 IN UINTN ProcessorIndex
151 /** Updates the HII string for the specified field.
153 @param HiiHandle The HII handle.
154 @param TokenToUpdate The string to update.
155 @param Field The field to get information about.
159 OemUpdateSmbiosInfo (
160 IN EFI_HII_HANDLE HiiHandle
,
161 IN EFI_STRING_ID TokenToUpdate
,
162 IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
165 /** Fetches the chassis status when it was last booted.
167 @return Chassis status.
171 OemGetChassisBootupState (
175 /** Fetches the chassis power supply/supplies status when last booted.
177 @return Chassis power supply/supplies status.
181 OemGetChassisPowerSupplyState (
185 /** Fetches the chassis thermal status when last booted.
187 @return Chassis thermal status.
191 OemGetChassisThermalState (
195 /** Fetches the chassis security status when last booted.
197 @return Chassis security status.
199 MISC_CHASSIS_SECURITY_STATE
201 OemGetChassisSecurityStatus (
205 /** Fetches the chassis height in RMUs (Rack Mount Units).
207 @return The height of the chassis.
211 OemGetChassisHeight (
215 /** Fetches the number of power cords.
217 @return The number of power cords.
221 OemGetChassisNumPowerCords (
225 #endif // OEM_MISC_LIB_H_