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>
18 /** Gets the CPU frequency of the specified processor.
20 @param ProcessorIndex Index of the processor to get the frequency for.
22 @return CPU frequency in Hz
27 IN UINT8 ProcessorIndex
34 /** Gets information about the specified processor and stores it in
35 the structures provided.
37 @param ProcessorIndex Index of the processor to get the information for.
38 @param ProcessorStatus Processor status.
39 @param ProcessorCharacteristics Processor characteritics.
40 @param MiscProcessorData Miscellaneous processor information.
42 @return TRUE on success, FALSE on failure.
46 OemGetProcessorInformation (
47 IN UINTN ProcessorIndex
,
48 IN OUT PROCESSOR_STATUS_DATA
*ProcessorStatus
,
49 IN OUT PROCESSOR_CHARACTERISTIC_FLAGS
*ProcessorCharacteristics
,
50 IN OUT OEM_MISC_PROCESSOR_DATA
*MiscProcessorData
57 /** Gets information about the cache at the specified cache level.
59 @param ProcessorIndex The processor to get information for.
60 @param CacheLevel The cache level to get information for.
61 @param DataCache Whether the cache is a data cache.
62 @param UnifiedCache Whether the cache is a unified cache.
63 @param SmbiosCacheTable The SMBIOS Type7 cache information structure.
65 @return TRUE on success, FALSE on failure.
69 OemGetCacheInformation (
70 IN UINT8 ProcessorIndex
,
73 IN BOOLEAN UnifiedCache
,
74 IN OUT SMBIOS_TABLE_TYPE7
*SmbiosCacheTable
81 /** Gets the maximum number of processors supported by the platform.
83 @return The maximum number of processors.
95 /** Gets the type of chassis for the system.
97 @retval The type of the chassis.
106 return MiscChassisTypeUnknown
;
109 /** Returns whether the specified processor is present or not.
111 @param ProcessIndex The processor index to check.
113 @return TRUE is the processor is present, FALSE otherwise.
117 OemIsProcessorPresent (
118 IN UINTN ProcessorIndex
125 /** Updates the HII string for the specified field.
127 @param HiiHandle The HII handle.
128 @param TokenToUpdate The string to update.
129 @param Field The field to get information about.
133 OemUpdateSmbiosInfo (
134 IN EFI_HII_HANDLE HiiHandle
,
135 IN EFI_STRING_ID TokenToUpdate
,
136 IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
142 /** Fetches the Type 32 boot information status.
146 MISC_BOOT_INFORMATION_STATUS_DATA_TYPE
153 return BootInformationStatusNoError
;
156 /** Fetches the chassis status when it was last booted.
158 @return Chassis status.
162 OemGetChassisBootupState (
167 return ChassisStateSafe
;
170 /** Fetches the chassis power supply/supplies status when last booted.
172 @return Chassis power supply/supplies status.
176 OemGetChassisPowerSupplyState (
181 return ChassisStateSafe
;
184 /** Fetches the chassis thermal status when last booted.
186 @return Chassis thermal status.
190 OemGetChassisThermalState (
195 return ChassisStateSafe
;
198 /** Fetches the chassis security status when last booted.
200 @return Chassis security status.
202 MISC_CHASSIS_SECURITY_STATE
204 OemGetChassisSecurityStatus (
209 return ChassisSecurityStatusNone
;
212 /** Fetches the chassis height in RMUs (Rack Mount Units).
214 @return The height of the chassis.
218 OemGetChassisHeight (
226 /** Fetches the number of power cords.
228 @return The number of power cords.
232 OemGetChassisNumPowerCords (