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 @param ChassisType The type of the chassis.
133 @retval EFI_SUCCESS The chassis type was fetched successfully.
138 OUT UINT8
*ChassisType
141 /** Returns whether the specified processor is present or not.
143 @param ProcessIndex The processor index to check.
145 @return TRUE is the processor is present, FALSE otherwise.
149 OemIsProcessorPresent (
150 IN UINTN ProcessorIndex
153 /** Updates the HII string for the specified field.
155 @param HiiHandle The HII handle.
156 @param TokenToUpdate The string to update.
157 @param Field The field to get information about.
161 OemUpdateSmbiosInfo (
162 IN EFI_HII_HANDLE HiiHandle
,
163 IN EFI_STRING_ID TokenToUpdate
,
164 IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
167 #endif // OEM_MISC_LIB_H_