From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) by mx.groups.io with SMTP id smtpd.web09.1270.1617156989378957572 for ; Tue, 30 Mar 2021 19:16:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=vX9ZLG0i; spf=pass (domain: nuviainc.com, ip: 209.85.167.171, mailfrom: rebecca@nuviainc.com) Received: by mail-oi1-f171.google.com with SMTP id k25so18566656oic.4 for ; Tue, 30 Mar 2021 19:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=McGn4YFGuZbOsE53NfA+FNkEhRYNMnuuhXtM/p2CFWQ=; b=vX9ZLG0i3Y5fkmgwjCfvm6IQskw/aEudwO2UKrG3Zle/3cuKnPKQP7GdsW801p17fq yQDfmDMUo5VJooKIteXMfyMnhDbcwJ0QbqxI1JXkTRWJEvCiGpDNrrgOK9bZ2CK0zfze To2IYskqecml7N1Q9as775+WewYhXQopDuqlGOkY0xBianAiAgfFFM9CXraVhAXF7/O/ TrOvklRhsqX8DIGHNOojDb9z1b2hFYc4Kr8t8ggWzgk9hqxRQMG8/VdUNY9CJ7Tx6uHa 74ASQc0YvgMJ8aSA/KVxCEXut2gmT9oCtIRy7fZGpghQdZM0ylrTnn4+raXPNCO7lP8T t+yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=McGn4YFGuZbOsE53NfA+FNkEhRYNMnuuhXtM/p2CFWQ=; b=JEvdAFgbQJIPd19PiYfWH1ri+Ctj9lER3G2+UPLT/u7essc4ovLOr4QzpYiuAfNNA7 mQAtua+JUnSXQvrpBvk5AmDEISpQakT0P/2gwkK0Y0NR6SW4LCZwKWjD3PNc4/8UWeiI /Tkepg2dZTchoipFKc5hrZFVDBItFvyy7uNGurXpof2Gw/H9VoIovm3MgBI1DsAWAE9e MJlVFZfz1e1QglDRVKnhnRXCKBxWRcGav67g2xta4h303lodt8aUBDZkzYz4/nRkocMJ yBpYsW0FulmHxJSHQLWJspnBc20hfcLjZU7LN53a9o1yqtCSxk1Nzh8+uiyI8X68JTBH zN4Q== X-Gm-Message-State: AOAM533cvkTKrvynVjsMAmBtIjc4wxV2VXC8s+cVXHgIftY7AFilt9KK K5gQf8rU3oTllunNcs1vIvnPdIwgypSMQ733xyxixNSZceKwbFXZ857pfMdIhgb/tfIXxP7fHy/ pUs+BJSJ+HwB5DjinWMhe/U3M2/M2p215J2jBUdTlykWzY2/qgOgY6ckDCJIez/smDlFZ3A== X-Google-Smtp-Source: ABdhPJxLTut11ak7cWRY6XEft6YJoFcKqUjf327pqgKoDfP0P5aIWgH0hyLsJJl19zye7Ovi4xYq3w== X-Received: by 2002:aca:d485:: with SMTP id l127mr658065oig.21.1617156988474; Tue, 30 Mar 2021 19:16:28 -0700 (PDT) Return-Path: Received: from cube.nuviainc.com (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id u11sm199996oif.10.2021.03.30.19.16.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 19:16:28 -0700 (PDT) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , Leif Lindholm , Ard Biesheuvel Subject: [PATCH 2/5] ArmPkg: Allow platforms to supply more data for SMBIOS Type3 record Date: Tue, 30 Mar 2021 20:16:16 -0600 Message-Id: <20210331021619.19761-3-rebecca@nuviainc.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210331021619.19761-1-rebecca@nuviainc.com> References: <20210331021619.19761-1-rebecca@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- ArmPkg/Include/Library/OemMiscLib.h | 60 ++++++++++++++ ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c | 85 ++++++++++++++++++++ ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c | 8 ++ 3 files changed, 153 insertions(+) diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h index 6dcc76a214df..25ae508ddb03 100644 --- a/ArmPkg/Include/Library/OemMiscLib.h +++ b/ArmPkg/Include/Library/OemMiscLib.h @@ -162,4 +162,64 @@ OemUpdateSmbiosInfo ( IN OEM_MISC_SMBIOS_HII_STRING_FIELD Field ); +/** Fetches the chassis status when it was last booted. + + @return Chassis status. +**/ +MISC_CHASSIS_STATE +EFIAPI +OemGetChassisBootupState ( + VOID + ); + +/** Fetches the chassis power supply/supplies status when last booted. + + @return Chassis power supply/supplies status. +**/ +MISC_CHASSIS_STATE +EFIAPI +OemGetChassisPowerSupplyState ( + VOID + ); + +/** Fetches the chassis thermal status when last booted. + + @return Chassis thermal status. +**/ +MISC_CHASSIS_STATE +EFIAPI +OemGetChassisThermalState ( + VOID + ); + +/** Fetches the chassis security status when last booted. + + @return Chassis security status. +**/ +MISC_CHASSIS_SECURITY_STATE +EFIAPI +OemGetChassisSecurityStatus ( + VOID + ); + +/** Fetches the chassis height in RMUs (Rack Mount Units). + + @return The height of the chassis. +**/ +UINT8 +EFIAPI +OemGetChassisHeight ( + VOID + ); + +/** Fetches the number of power cords. + + @return The number of power cords. +**/ +UINT8 +EFIAPI +OemGetChassisNumPowerCords ( + VOID + ); + #endif // OEM_MISC_LIB_H_ diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c index 21f106f1e060..e6a4793fe1c2 100644 --- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c +++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c @@ -139,3 +139,88 @@ 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 fc4dba319aad..344343ed60a5 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. // -- 2.26.2