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 ProcessorPartNumType04
,
60 ProcessorSerialNumType04
,
61 SmbiosHiiStringFieldMax
62 } OEM_MISC_SMBIOS_HII_STRING_FIELD
;
65 * The following are functions that the each platform needs to
66 * implement in its OemMiscLib library.
69 /** Gets the CPU frequency of the specified processor.
71 @param ProcessorIndex Index of the processor to get the frequency for.
73 @return CPU frequency in Hz
78 IN UINT8 ProcessorIndex
81 /** Gets information about the specified processor and stores it in
82 the structures provided.
84 @param ProcessorIndex Index of the processor to get the information for.
85 @param ProcessorStatus Processor status.
86 @param ProcessorCharacteristics Processor characteritics.
87 @param MiscProcessorData Miscellaneous processor information.
89 @return TRUE on success, FALSE on failure.
93 OemGetProcessorInformation (
94 IN UINTN ProcessorIndex
,
95 IN OUT PROCESSOR_STATUS_DATA
*ProcessorStatus
,
96 IN OUT PROCESSOR_CHARACTERISTIC_FLAGS
*ProcessorCharacteristics
,
97 IN OUT OEM_MISC_PROCESSOR_DATA
*MiscProcessorData
100 /** Gets information about the cache at the specified cache level.
102 @param ProcessorIndex The processor to get information for.
103 @param CacheLevel The cache level to get information for.
104 @param DataCache Whether the cache is a data cache.
105 @param UnifiedCache Whether the cache is a unified cache.
106 @param SmbiosCacheTable The SMBIOS Type7 cache information structure.
108 @return TRUE on success, FALSE on failure.
112 OemGetCacheInformation (
113 IN UINT8 ProcessorIndex
,
115 IN BOOLEAN DataCache
,
116 IN BOOLEAN UnifiedCache
,
117 IN OUT SMBIOS_TABLE_TYPE7
*SmbiosCacheTable
120 /** Gets the maximum number of processors supported by the platform.
122 @return The maximum number of processors.
126 OemGetMaxProcessors (
130 /** Gets the type of chassis for the system.
132 @retval The type of the chassis.
140 /** Returns whether the specified processor is present or not.
142 @param ProcessIndex The processor index to check.
144 @return TRUE is the processor is present, FALSE otherwise.
148 OemIsProcessorPresent (
149 IN UINTN ProcessorIndex
152 /** Updates the HII string for the specified field.
154 @param HiiHandle The HII handle.
155 @param TokenToUpdate The string to update.
156 @param Field The field to get information about.
160 OemUpdateSmbiosInfo (
161 IN EFI_HII_HANDLE HiiHandle
,
162 IN EFI_STRING_ID TokenToUpdate
,
163 IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
166 /** Fetches the Type 32 boot information status.
170 MISC_BOOT_INFORMATION_STATUS_DATA_TYPE
176 /** Fetches the chassis status when it was last booted.
178 @return Chassis status.
182 OemGetChassisBootupState (
186 /** Fetches the chassis power supply/supplies status when last booted.
188 @return Chassis power supply/supplies status.
192 OemGetChassisPowerSupplyState (
196 /** Fetches the chassis thermal status when last booted.
198 @return Chassis thermal status.
202 OemGetChassisThermalState (
206 /** Fetches the chassis security status when last booted.
208 @return Chassis security status.
210 MISC_CHASSIS_SECURITY_STATE
212 OemGetChassisSecurityStatus (
216 /** Fetches the chassis height in RMUs (Rack Mount Units).
218 @return The height of the chassis.
222 OemGetChassisHeight (
226 /** Fetches the number of power cords.
228 @return The number of power cords.
232 OemGetChassisNumPowerCords (
236 #endif // OEM_MISC_LIB_H_