]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: Allow platforms to supply more data for SMBIOS Type3 record
authorRebecca Cran <rebecca@nuviainc.com>
Wed, 31 Mar 2021 02:16:16 +0000 (20:16 -0600)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 27 Apr 2021 12:46:26 +0000 (12:46 +0000)
Add OemMiscLib calls to allow platforms to provide the following
information about the chassis:

o Bootup state
o Power supply/supplies state
o Thermal state
o Security state
o Chassis height (in RMU)
o Number of power cords

Signed-off-by: Rebecca Cran <rebecca@nuviainc.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
ArmPkg/Include/Library/OemMiscLib.h
ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c

index 6dcc76a214df71aa08059da1ed4cc924b37e2bf3..25ae508ddb0314227bceb826bc407b8842fd0e91 100644 (file)
@@ -162,4 +162,64 @@ OemUpdateSmbiosInfo (
   IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field\r
   );\r
 \r
+/** Fetches the chassis status when it was last booted.\r
+\r
+ @return Chassis status.\r
+**/\r
+MISC_CHASSIS_STATE\r
+EFIAPI\r
+OemGetChassisBootupState (\r
+  VOID\r
+  );\r
+\r
+/** Fetches the chassis power supply/supplies status when last booted.\r
+\r
+ @return Chassis power supply/supplies status.\r
+**/\r
+MISC_CHASSIS_STATE\r
+EFIAPI\r
+OemGetChassisPowerSupplyState (\r
+  VOID\r
+  );\r
+\r
+/** Fetches the chassis thermal status when last booted.\r
+\r
+ @return Chassis thermal status.\r
+**/\r
+MISC_CHASSIS_STATE\r
+EFIAPI\r
+OemGetChassisThermalState (\r
+  VOID\r
+  );\r
+\r
+/** Fetches the chassis security status when last booted.\r
+\r
+ @return Chassis security status.\r
+**/\r
+MISC_CHASSIS_SECURITY_STATE\r
+EFIAPI\r
+OemGetChassisSecurityStatus (\r
+  VOID\r
+  );\r
+\r
+/** Fetches the chassis height in RMUs (Rack Mount Units).\r
+\r
+  @return The height of the chassis.\r
+**/\r
+UINT8\r
+EFIAPI\r
+OemGetChassisHeight (\r
+  VOID\r
+  );\r
+\r
+/** Fetches the number of power cords.\r
+\r
+  @return The number of power cords.\r
+**/\r
+UINT8\r
+EFIAPI\r
+OemGetChassisNumPowerCords (\r
+  VOID\r
+  );\r
+\r
 #endif // OEM_MISC_LIB_H_\r
index 21f106f1e0607d23d40dd1d3aaf1e252ca8ccae6..33b0081d65b04d9748970acc18f1c290ce1f66f2 100644 (file)
@@ -139,3 +139,87 @@ OemUpdateSmbiosInfo (
 {\r
   ASSERT (FALSE);\r
 }\r
+\r
+/** Fetches the chassis status when it was last booted.\r
+\r
+ @return Chassis status.\r
+**/\r
+MISC_CHASSIS_STATE\r
+EFIAPI\r
+OemGetChassisBootupState (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return ChassisStateSafe;\r
+}\r
+\r
+/** Fetches the chassis power supply/supplies status when last booted.\r
+\r
+ @return Chassis power supply/supplies status.\r
+**/\r
+MISC_CHASSIS_STATE\r
+EFIAPI\r
+OemGetChassisPowerSupplyState (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return ChassisStateSafe;\r
+}\r
+\r
+/** Fetches the chassis thermal status when last booted.\r
+\r
+ @return Chassis thermal status.\r
+**/\r
+MISC_CHASSIS_STATE\r
+EFIAPI\r
+OemGetChassisThermalState (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return ChassisStateSafe;\r
+}\r
+\r
+/** Fetches the chassis security status when last booted.\r
+\r
+ @return Chassis security status.\r
+**/\r
+MISC_CHASSIS_SECURITY_STATE\r
+EFIAPI\r
+OemGetChassisSecurityStatus (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return ChassisSecurityStatusNone;\r
+}\r
+\r
+/** Fetches the chassis height in RMUs (Rack Mount Units).\r
+\r
+  @return The height of the chassis.\r
+**/\r
+UINT8\r
+EFIAPI\r
+OemGetChassisHeight (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return 1U;\r
+}\r
+\r
+/** Fetches the number of power cords.\r
+\r
+  @return The number of power cords.\r
+**/\r
+UINT8\r
+EFIAPI\r
+OemGetChassisNumPowerCords (\r
+  VOID\r
+  )\r
+{\r
+  ASSERT (FALSE);\r
+  return 1;\r
+}\r
index fc4dba319aad4071aa8cde3e552e11210d2a2bb7..344343ed60a5e20d81df9909d50f08a4dc3e665f 100644 (file)
@@ -162,6 +162,14 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer)
   UnicodeStrToAsciiStrS (AssertTag, StrStart, AssertTagStrLen + 1);\r
   StrStart += AssertTagStrLen + 1;\r
   UnicodeStrToAsciiStrS (ChassisSkuNumber, StrStart, ChaNumStrLen + 1);\r
+\r
+  SmbiosRecord->BootupState = OemGetChassisBootupState ();\r
+  SmbiosRecord->PowerSupplyState = OemGetChassisPowerSupplyState ();\r
+  SmbiosRecord->ThermalState = OemGetChassisThermalState ();\r
+  SmbiosRecord->SecurityStatus = OemGetChassisSecurityStatus ();\r
+  SmbiosRecord->Height = OemGetChassisHeight ();\r
+  SmbiosRecord->NumberofPowerCords = OemGetChassisNumPowerCords ();\r
+\r
   //\r
   // Now we have got the full smbios record, call smbios protocol to add this record.\r
   //\r