OemMiscLib.c 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. /** @file
  2. * OemMiscLib.c
  3. *
  4. * Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
  5. * Copyright (c) 2021, NUVIA Inc. All rights reserved.
  6. * Copyright (c) 2018, Hisilicon Limited. All rights reserved.
  7. * Copyright (c) 2018, Linaro Limited. All rights reserved.
  8. *
  9. * SPDX-License-Identifier: BSD-2-Clause-Patent
  10. *
  11. **/
  12. #include <Uefi.h>
  13. #include <Guid/ZeroGuid.h>
  14. #include <Library/BaseMemoryLib.h>
  15. #include <Library/DebugLib.h>
  16. #include <Library/HiiLib.h>
  17. #include <Library/OemMiscLib.h>
  18. #include <Library/PcdLib.h>
  19. /** Gets the CPU frequency of the specified processor.
  20. @param ProcessorIndex Index of the processor to get the frequency for.
  21. @return CPU frequency in Hz
  22. **/
  23. UINTN
  24. EFIAPI
  25. OemGetCpuFreq (
  26. IN UINT8 ProcessorIndex
  27. )
  28. {
  29. ASSERT (FALSE);
  30. return 0;
  31. }
  32. /** Gets information about the specified processor and stores it in
  33. the structures provided.
  34. @param ProcessorIndex Index of the processor to get the information for.
  35. @param ProcessorStatus Processor status.
  36. @param ProcessorCharacteristics Processor characteritics.
  37. @param MiscProcessorData Miscellaneous processor information.
  38. @return TRUE on success, FALSE on failure.
  39. **/
  40. BOOLEAN
  41. EFIAPI
  42. OemGetProcessorInformation (
  43. IN UINTN ProcessorIndex,
  44. IN OUT PROCESSOR_STATUS_DATA *ProcessorStatus,
  45. IN OUT PROCESSOR_CHARACTERISTIC_FLAGS *ProcessorCharacteristics,
  46. IN OUT OEM_MISC_PROCESSOR_DATA *MiscProcessorData
  47. )
  48. {
  49. ASSERT (FALSE);
  50. return TRUE;
  51. }
  52. /** Gets information about the cache at the specified cache level.
  53. @param ProcessorIndex The processor to get information for.
  54. @param CacheLevel The cache level to get information for.
  55. @param DataCache Whether the cache is a data cache.
  56. @param UnifiedCache Whether the cache is a unified cache.
  57. @param SmbiosCacheTable The SMBIOS Type7 cache information structure.
  58. @return TRUE on success, FALSE on failure.
  59. **/
  60. BOOLEAN
  61. EFIAPI
  62. OemGetCacheInformation (
  63. IN UINT8 ProcessorIndex,
  64. IN UINT8 CacheLevel,
  65. IN BOOLEAN DataCache,
  66. IN BOOLEAN UnifiedCache,
  67. IN OUT SMBIOS_TABLE_TYPE7 *SmbiosCacheTable
  68. )
  69. {
  70. ASSERT (FALSE);
  71. return TRUE;
  72. }
  73. /** Gets the maximum number of processors supported by the platform.
  74. @return The maximum number of processors.
  75. **/
  76. UINT8
  77. EFIAPI
  78. OemGetMaxProcessors (
  79. VOID
  80. )
  81. {
  82. ASSERT (FALSE);
  83. return 1;
  84. }
  85. /** Gets the type of chassis for the system.
  86. @retval The type of the chassis.
  87. **/
  88. MISC_CHASSIS_TYPE
  89. EFIAPI
  90. OemGetChassisType (
  91. VOID
  92. )
  93. {
  94. ASSERT (FALSE);
  95. return MiscChassisTypeUnknown;
  96. }
  97. /** Returns whether the specified processor is present or not.
  98. @param ProcessIndex The processor index to check.
  99. @return TRUE is the processor is present, FALSE otherwise.
  100. **/
  101. BOOLEAN
  102. EFIAPI
  103. OemIsProcessorPresent (
  104. IN UINTN ProcessorIndex
  105. )
  106. {
  107. ASSERT (FALSE);
  108. return FALSE;
  109. }
  110. /** Updates the HII string for the specified field.
  111. @param HiiHandle The HII handle.
  112. @param TokenToUpdate The string to update.
  113. @param Field The field to get information about.
  114. **/
  115. VOID
  116. EFIAPI
  117. OemUpdateSmbiosInfo (
  118. IN EFI_HII_HANDLE HiiHandle,
  119. IN EFI_STRING_ID TokenToUpdate,
  120. IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field
  121. )
  122. {
  123. ASSERT (FALSE);
  124. }
  125. /** Fetches the Type 32 boot information status.
  126. @return Boot status.
  127. **/
  128. MISC_BOOT_INFORMATION_STATUS_DATA_TYPE
  129. EFIAPI
  130. OemGetBootStatus (
  131. VOID
  132. )
  133. {
  134. ASSERT (FALSE);
  135. return BootInformationStatusNoError;
  136. }
  137. /** Fetches the chassis status when it was last booted.
  138. @return Chassis status.
  139. **/
  140. MISC_CHASSIS_STATE
  141. EFIAPI
  142. OemGetChassisBootupState (
  143. VOID
  144. )
  145. {
  146. ASSERT (FALSE);
  147. return ChassisStateSafe;
  148. }
  149. /** Fetches the chassis power supply/supplies status when last booted.
  150. @return Chassis power supply/supplies status.
  151. **/
  152. MISC_CHASSIS_STATE
  153. EFIAPI
  154. OemGetChassisPowerSupplyState (
  155. VOID
  156. )
  157. {
  158. ASSERT (FALSE);
  159. return ChassisStateSafe;
  160. }
  161. /** Fetches the chassis thermal status when last booted.
  162. @return Chassis thermal status.
  163. **/
  164. MISC_CHASSIS_STATE
  165. EFIAPI
  166. OemGetChassisThermalState (
  167. VOID
  168. )
  169. {
  170. ASSERT (FALSE);
  171. return ChassisStateSafe;
  172. }
  173. /** Fetches the chassis security status when last booted.
  174. @return Chassis security status.
  175. **/
  176. MISC_CHASSIS_SECURITY_STATE
  177. EFIAPI
  178. OemGetChassisSecurityStatus (
  179. VOID
  180. )
  181. {
  182. ASSERT (FALSE);
  183. return ChassisSecurityStatusNone;
  184. }
  185. /** Fetches the chassis height in RMUs (Rack Mount Units).
  186. @return The height of the chassis.
  187. **/
  188. UINT8
  189. EFIAPI
  190. OemGetChassisHeight (
  191. VOID
  192. )
  193. {
  194. ASSERT (FALSE);
  195. return 1U;
  196. }
  197. /** Fetches the number of power cords.
  198. @return The number of power cords.
  199. **/
  200. UINT8
  201. EFIAPI
  202. OemGetChassisNumPowerCords (
  203. VOID
  204. )
  205. {
  206. ASSERT (FALSE);
  207. return 1;
  208. }
  209. /**
  210. Fetches the system UUID.
  211. @param[out] SystemUuid The pointer to the buffer to store the System UUID.
  212. **/
  213. VOID
  214. EFIAPI
  215. OemGetSystemUuid (
  216. OUT GUID *SystemUuid
  217. )
  218. {
  219. ASSERT (FALSE);
  220. CopyGuid (SystemUuid, &gZeroGuid);
  221. }
  222. /** Fetches the BIOS release.
  223. @return The BIOS release.
  224. **/
  225. UINT16
  226. EFIAPI
  227. OemGetBiosRelease (
  228. VOID
  229. )
  230. {
  231. ASSERT (FALSE);
  232. return PcdGet16 (PcdSystemBiosRelease);
  233. }
  234. /** Fetches the embedded controller firmware release.
  235. @return The embedded controller firmware release.
  236. **/
  237. UINT16
  238. EFIAPI
  239. OemGetEmbeddedControllerFirmwareRelease (
  240. VOID
  241. )
  242. {
  243. ASSERT (FALSE);
  244. return PcdGet16 (PcdEmbeddedControllerFirmwareRelease);
  245. }