public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Andrei Warkentin" <awarkentin@vmware.com>
To: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Leif Lindholm <leif@nuviainc.com>, Pete Batard <pete@akeo.ie>,
	Ard Biesheuvel <ard.biesheuvel@arm.com>
Subject: Re: [edk2-platform][PATCH v1 2/7] Platforms/RaspberryPi: SMBIOS Type 2 and Type 3 fixes
Date: Mon, 20 Jul 2020 21:53:02 +0000	[thread overview]
Message-ID: <BN6PR05MB3411133E7FB5F32BC83A3446B97B0@BN6PR05MB3411.namprd05.prod.outlook.com> (raw)
In-Reply-To: <20200720181646.2891-3-Samer.El-Haj-Mahmoud@arm.com>

[-- Attachment #1: Type: text/plain, Size: 4481 bytes --]

Reviewed-by: Andrei Warkentin <awarkentin@vmware.com>
________________________________
From: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Sent: Monday, July 20, 2020 1:16 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Leif Lindholm <leif@nuviainc.com>; Pete Batard <pete@akeo.ie>; Andrei Warkentin <awarkentin@vmware.com>; Ard Biesheuvel <ard.biesheuvel@arm.com>
Subject: [edk2-platform][PATCH v1 2/7] Platforms/RaspberryPi: SMBIOS Type 2 and Type 3 fixes

Various fixes for SMBIOS Types 2 and 3:
 - Add LocationInChassis string to Type 2
 - Update Type 3 NumberofPowerCords to 1
 - Add ChassisHandle refernce to Type2. This requires moving the
   Type 3 population to happen before Type 2

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Pete Batard <pete@akeo.ie>
Cc: Andrei Warkentin <awarkentin@vmware.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
---
 Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 41 ++++++++++++--------
 1 file changed, 24 insertions(+), 17 deletions(-)

diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
index 6eef66f125f8..170f1843f90b 100644
--- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
+++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
@@ -176,7 +176,7 @@ SMBIOS_TABLE_TYPE2 mBoardInfoType2 = {
     0,    //  HotSwappable          :1;
     0,    //  Reserved              :3;
   },
-  0,                        // LocationInChassis String
+  6,                        // LocationInChassis String
   0,                        // ChassisHandle;
   BaseBoardTypeMotherBoard, // BoardType;
   0,                        // NumberOfContainedObjectHandles;
@@ -191,6 +191,7 @@ CHAR8 *mBoardInfoType2Strings[] = {
   mSysInfoVersionName,
   mSysInfoSerial,
   mChassisAssetTag,
+  "Internal",
   NULL
 };

@@ -210,7 +211,7 @@ SMBIOS_TABLE_TYPE3 mEnclosureInfoType3 = {
   ChassisSecurityStatusNone,// SecurityStatus;
   { 0, 0, 0, 0 },           // OemDefined[4];
   0,    // Height;
-  0,    // NumberofPowerCords;
+  1,    // NumberofPowerCords;
   0,    // ContainedElementCount;
   0,    // ContainedElementRecordLength;
   { { 0 } },    // ContainedElements[1];
@@ -782,9 +783,22 @@ BoardInfoUpdateSmbiosType2 (
   VOID
   )
 {
-  UINTN      Size;
-  CHAR16     AssetTagVar[ASSET_TAG_STR_STORAGE_SIZE] = L"";
-  EFI_STATUS Status;
+
+  LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mBoardInfoType2, mBoardInfoType2Strings, NULL);
+}
+
+/***********************************************************************
+        SMBIOS data update  TYPE3  Enclosure Information
+************************************************************************/
+VOID
+EnclosureInfoUpdateSmbiosType3 (
+  VOID
+  )
+{
+  UINTN             Size;
+  EFI_STATUS        Status;
+  EFI_SMBIOS_HANDLE SmbiosHandle;
+  CHAR16            AssetTagVar[ASSET_TAG_STR_STORAGE_SIZE] = L"";

   Size = sizeof(AssetTagVar);
   Status = gRT->GetVariable(L"AssetTag",
@@ -802,18 +816,10 @@ BoardInfoUpdateSmbiosType2 (
   }
   DEBUG ((DEBUG_INFO, "System Asset Tag : %a\n", mChassisAssetTag));

-  LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mBoardInfoType2, mBoardInfoType2Strings, NULL);
-}
+  LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mEnclosureInfoType3, mEnclosureInfoType3Strings, &SmbiosHandle);

-/***********************************************************************
-        SMBIOS data update  TYPE3  Enclosure Information
-************************************************************************/
-VOID
-EnclosureInfoUpdateSmbiosType3 (
-  VOID
-  )
-{
-  LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mEnclosureInfoType3, mEnclosureInfoType3Strings, NULL);
+  // Set Type2 ChassisHandle to point to the newly added Type3 handle
+  mBoardInfoType2.ChassisHandle = (UINT16) SmbiosHandle;
 }

 /***********************************************************************
@@ -982,9 +988,10 @@ PlatformSmbiosDriverEntryPoint (

   SysInfoUpdateSmbiosType1 ();

+  EnclosureInfoUpdateSmbiosType3 (); // Add Type 3 first to get chassis handle for use in Type 2
+
   BoardInfoUpdateSmbiosType2 ();

-  EnclosureInfoUpdateSmbiosType3 ();

   ProcessorInfoUpdateSmbiosType4 (4);   //One example for creating and updating

--
2.17.1


[-- Attachment #2: Type: text/html, Size: 7440 bytes --]

  reply	other threads:[~2020-07-20 21:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 18:16 [edk2-platform][PATCH v1 0/7] Platform/RaspberryPi : SMBIOS fixes and cleanup Samer El-Haj-Mahmoud
2020-07-20 18:16 ` [edk2-platform][PATCH v1 1/7] Platforms/RaspberryPi: Fix NULL AssetTag in SMBIOS Samer El-Haj-Mahmoud
2020-07-20 21:52   ` Andrei Warkentin
2020-07-20 18:16 ` [edk2-platform][PATCH v1 2/7] Platforms/RaspberryPi: SMBIOS Type 2 and Type 3 fixes Samer El-Haj-Mahmoud
2020-07-20 21:53   ` Andrei Warkentin [this message]
2020-07-20 18:16 ` [edk2-platform][PATCH v1 3/7] Platforms/RaspberryPi: SMBIOS Type 0 fixes Samer El-Haj-Mahmoud
2020-07-20 21:53   ` Andrei Warkentin
2020-07-20 18:16 ` [edk2-platform][PATCH v1 4/7] Platforms/RaspberryPi: SMBIOS Type 4 fixes Samer El-Haj-Mahmoud
2020-07-20 21:55   ` Andrei Warkentin
2020-07-20 18:16 ` [edk2-platform][PATCH v1 5/7] Platforms/RaspberryPi: SMBIOS Type 7 fixes Samer El-Haj-Mahmoud
2020-07-20 21:54   ` Andrei Warkentin
2020-07-20 18:16 ` [edk2-platform][PATCH v1 6/7] Platforms/RaspberryPi: SMBIOS Memory Types fixes Samer El-Haj-Mahmoud
2020-07-20 21:55   ` Andrei Warkentin
2020-07-20 18:16 ` [edk2-platform][PATCH v1 7/7] Platforms/RaspberryPi: SMBIOS minor cleanup Samer El-Haj-Mahmoud
2020-08-12 16:27   ` Pete Batard
2020-08-13 13:47 ` [edk2-platform][PATCH v1 0/7] Platform/RaspberryPi : SMBIOS fixes and cleanup Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN6PR05MB3411133E7FB5F32BC83A3446B97B0@BN6PR05MB3411.namprd05.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox