From bf2b99990e1b0a0eed09d6e5b22b293b9dfa978f Mon Sep 17 00:00:00 2001 From: Rebecca Cran Date: Tue, 30 Mar 2021 20:16:16 -0600 Subject: ArmPkg: Allow platforms to supply more data for SMBIOS Type3 record 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 Reviewed-by: Leif Lindholm --- .../Universal/Smbios/OemMiscLibNull/OemMiscLib.c | 84 ++++++++++++++++++++++ .../Type03/MiscChassisManufacturerFunction.c | 8 +++ 2 files changed, 92 insertions(+) (limited to 'ArmPkg/Universal') diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c index 21f106f1e0..33b0081d65 100644 --- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c +++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c @@ -139,3 +139,87 @@ OemUpdateSmbiosInfo ( { ASSERT (FALSE); } + +/** Fetches the chassis status when it was last booted. + + @return Chassis status. +**/ +MISC_CHASSIS_STATE +EFIAPI +OemGetChassisBootupState ( + VOID + ) +{ + ASSERT (FALSE); + return ChassisStateSafe; +} + +/** Fetches the chassis power supply/supplies status when last booted. + + @return Chassis power supply/supplies status. +**/ +MISC_CHASSIS_STATE +EFIAPI +OemGetChassisPowerSupplyState ( + VOID + ) +{ + ASSERT (FALSE); + return ChassisStateSafe; +} + +/** Fetches the chassis thermal status when last booted. + + @return Chassis thermal status. +**/ +MISC_CHASSIS_STATE +EFIAPI +OemGetChassisThermalState ( + VOID + ) +{ + ASSERT (FALSE); + return ChassisStateSafe; +} + +/** Fetches the chassis security status when last booted. + + @return Chassis security status. +**/ +MISC_CHASSIS_SECURITY_STATE +EFIAPI +OemGetChassisSecurityStatus ( + VOID + ) +{ + ASSERT (FALSE); + return ChassisSecurityStatusNone; +} + +/** Fetches the chassis height in RMUs (Rack Mount Units). + + @return The height of the chassis. +**/ +UINT8 +EFIAPI +OemGetChassisHeight ( + VOID + ) +{ + ASSERT (FALSE); + return 1U; +} + +/** Fetches the number of power cords. + + @return The number of power cords. +**/ +UINT8 +EFIAPI +OemGetChassisNumPowerCords ( + VOID + ) +{ + ASSERT (FALSE); + return 1; +} diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c index fc4dba319a..344343ed60 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c @@ -162,6 +162,14 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscChassisManufacturer) UnicodeStrToAsciiStrS (AssertTag, StrStart, AssertTagStrLen + 1); StrStart += AssertTagStrLen + 1; UnicodeStrToAsciiStrS (ChassisSkuNumber, StrStart, ChaNumStrLen + 1); + + SmbiosRecord->BootupState = OemGetChassisBootupState (); + SmbiosRecord->PowerSupplyState = OemGetChassisPowerSupplyState (); + SmbiosRecord->ThermalState = OemGetChassisThermalState (); + SmbiosRecord->SecurityStatus = OemGetChassisSecurityStatus (); + SmbiosRecord->Height = OemGetChassisHeight (); + SmbiosRecord->NumberofPowerCords = OemGetChassisNumPowerCords (); + // // Now we have got the full smbios record, call smbios protocol to add this record. // -- cgit v1.2.3