4 * Copyright (c) 2021, NUVIA Inc. All rights reserved.
5 * Copyright (c) 2018, Hisilicon Limited. All rights reserved.
6 * Copyright (c) 2018, Linaro Limited. All rights reserved.
8 * SPDX-License-Identifier: BSD-2-Clause-Patent
13 #include <Library/BaseMemoryLib.h>
14 #include <Library/DebugLib.h>
15 #include <Library/HiiLib.h>
16 #include <Library/OemMiscLib.h>
19 /** Gets the CPU frequency of the specified processor.
21 @param ProcessorIndex Index of the processor to get the frequency for.
23 @return CPU frequency in Hz
28 IN UINT8 ProcessorIndex
35 /** Gets information about the specified processor and stores it in
36 the structures provided.
38 @param ProcessorIndex Index of the processor to get the information for.
39 @param ProcessorStatus Processor status.
40 @param ProcessorCharacteristics Processor characteritics.
41 @param MiscProcessorData Miscellaneous processor information.
43 @return TRUE on success, FALSE on failure.
47 OemGetProcessorInformation (
48 IN UINTN ProcessorIndex
,
49 IN OUT PROCESSOR_STATUS_DATA
*ProcessorStatus
,
50 IN OUT PROCESSOR_CHARACTERISTIC_FLAGS
*ProcessorCharacteristics
,
51 IN OUT OEM_MISC_PROCESSOR_DATA
*MiscProcessorData
58 /** Gets information about the cache at the specified cache level.
60 @param ProcessorIndex The processor to get information for.
61 @param CacheLevel The cache level to get information for.
62 @param DataCache Whether the cache is a data cache.
63 @param UnifiedCache Whether the cache is a unified cache.
64 @param SmbiosCacheTable The SMBIOS Type7 cache information structure.
66 @return TRUE on success, FALSE on failure.
70 OemGetCacheInformation (
71 IN UINT8 ProcessorIndex
,
74 IN BOOLEAN UnifiedCache
,
75 IN OUT SMBIOS_TABLE_TYPE7
*SmbiosCacheTable
82 /** Gets the maximum number of processors supported by the platform.
84 @return The maximum number of processors.
96 /** Gets the type of chassis for the system.
98 @retval The type of the chassis.
107 return MiscChassisTypeUnknown
;
110 /** Returns whether the specified processor is present or not.
112 @param ProcessIndex The processor index to check.
114 @return TRUE is the processor is present, FALSE otherwise.
118 OemIsProcessorPresent (
119 IN UINTN ProcessorIndex
126 /** Updates the HII string for the specified field.
128 @param HiiHandle The HII handle.
129 @param TokenToUpdate The string to update.
130 @param Field The field to get information about.
134 OemUpdateSmbiosInfo (
135 IN EFI_HII_HANDLE HiiHandle
,
136 IN EFI_STRING_ID TokenToUpdate
,
137 IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
143 /** Fetches the Type 32 boot information status.
147 MISC_BOOT_INFORMATION_STATUS_DATA_TYPE
154 return BootInformationStatusNoError
;
157 /** Fetches the chassis status when it was last booted.
159 @return Chassis status.
163 OemGetChassisBootupState (
168 return ChassisStateSafe
;
171 /** Fetches the chassis power supply/supplies status when last booted.
173 @return Chassis power supply/supplies status.
177 OemGetChassisPowerSupplyState (
182 return ChassisStateSafe
;
185 /** Fetches the chassis thermal status when last booted.
187 @return Chassis thermal status.
191 OemGetChassisThermalState (
196 return ChassisStateSafe
;
199 /** Fetches the chassis security status when last booted.
201 @return Chassis security status.
203 MISC_CHASSIS_SECURITY_STATE
205 OemGetChassisSecurityStatus (
210 return ChassisSecurityStatusNone
;
213 /** Fetches the chassis height in RMUs (Rack Mount Units).
215 @return The height of the chassis.
219 OemGetChassisHeight (
227 /** Fetches the number of power cords.
229 @return The number of power cords.
233 OemGetChassisNumPowerCords (