public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.
@ 2023-05-04  2:34 simowang
  2023-05-09  1:32 ` [edk2-devel] " Simon Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: simowang @ 2023-05-04  2:34 UTC (permalink / raw)
  To: devel; +Cc: Ray Ni, Zhichao Gao

The initial version of Smbios Specification 3.6.0
type 45 and type 46 support.

Signed-off-by: Simon Wang <simowang@nvidia.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
---
 .../SmbiosView/PrintInfo.c                    | 111 +++++++++++++++++-
 .../SmbiosView/PrintInfo.h                    |  25 ++++
 .../SmbiosView/QueryTable.c                   |  81 +++++++++++++
 .../SmbiosView/SmbiosViewStrings.uni          |   9 +-
 4 files changed, 222 insertions(+), 4 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index 1811cf0c44..e6a110beee 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -5,6 +5,7 @@
   Copyright (c) 1985 - 2022, American Megatrends International LLC.<BR>
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
   (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -305,9 +306,10 @@ SmbiosPrintStructure (
   IN  UINT8                     Option
   )
 {
-  UINT8  Index;
-  UINT8  Index2;
-  UINT8  *Buffer;
+  UINT8       Index;
+  UINT8       Index2;
+  UINT8       *Buffer;
+  EFI_STRING  String;
 
   if (Struct == NULL) {
     return EFI_INVALID_PARAMETER;
@@ -1302,6 +1304,109 @@ SmbiosPrintStructure (
       break;
 
     //
+    // Firmware Inventory (Type 45)
+    //
+    case 45:
+      PRINT_PENDING_STRING (Struct, Type45, FirmwareComponentName);
+      PRINT_PENDING_STRING (Struct, Type45, FirmwareVersion);
+      if (Struct->Type45->FirmwareVersionFormat == VersionFormatTypeFreeForm) {
+        String = L"Free-form string";
+      } else if (Struct->Type45->FirmwareVersionFormat == VersionFormatTypeMajorMinor) {
+        String = L"MAJOR.MINOR";
+      } else if (Struct->Type45->FirmwareVersionFormat == VersionFormatType32BitHex) {
+        String = L"32-bit hexadecimal string";
+      } else if (Struct->Type45->FirmwareVersionFormat == VersionFormatTypeMajorMinor) {
+        String = L"64-bit hexadecimal string";
+      } else if (Struct->Type45->FirmwareVersionFormat >= 0x80) {
+        String = L"BIOS Vendor/OEM-specific";
+      } else {
+        String = L"Reserved";
+      }
+
+      ShellPrintHiiEx (
+        -1,
+        -1,
+        NULL,
+        STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_VERSION_FORMAT),
+        gShellDebug1HiiHandle,
+        String
+        );
+      PRINT_PENDING_STRING (Struct, Type45, FirmwareId);
+      if (Struct->Type45->FirmwareIdFormat == FirmwareIdFormatTypeFreeForm) {
+        String = L"Free-form string";
+      } else if (Struct->Type45->FirmwareIdFormat == FirmwareIdFormatTypeUuid) {
+        String = L"RFC4122 UUID string";
+      } else if (Struct->Type45->FirmwareIdFormat >= 0x80) {
+        String = L"BIOS Vendor/OEM-specific";
+      } else {
+        String = L"Reserved";
+      }
+
+      ShellPrintHiiEx (
+        -1,
+        -1,
+        NULL,
+        STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_ID_FORMAT),
+        gShellDebug1HiiHandle,
+        String
+        );
+      PRINT_PENDING_STRING (Struct, Type45, ReleaseDate);
+      PRINT_PENDING_STRING (Struct, Type45, Manufacturer);
+      PRINT_PENDING_STRING (Struct, Type45, LowestSupportedVersion);
+      if (Struct->Type45->ImageSize != MAX_UINT64) {
+        PRINT_STRUCT_VALUE_H (Struct, Type45, ImageSize);
+      } else {
+        ShellPrintHiiEx (
+          -1,
+          -1,
+          NULL,
+          STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_IMAGE_SIZE_UNKNOWN),
+          gShellDebug1HiiHandle
+          );
+      }
+
+      DisplayFirmwareCharacteristics (ReadUnaligned16 ((UINT16 *)(UINTN)&(Struct->Type45->Characteristics)), Option);
+      DisplayFirmwareState (*(UINT8 *)(UINTN)&(Struct->Type45->State), Option);
+
+      PRINT_STRUCT_VALUE_H (Struct, Type45, AssociatedComponentCount);
+      if (Struct->Hdr->Length > sizeof (*Struct->Type45)) {
+        for (Index = 0; Index < Struct->Type45->AssociatedComponentCount; Index++) {
+          ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_INVENTORY_ASSOCIATED), gShellDebug1HiiHandle);
+          Print (L"    0x%04X ", Buffer[sizeof (*Struct->Type45) + (Index * sizeof (SMBIOS_HANDLE))]);
+          Print (L"\n");
+        }
+      }
+
+      break;
+
+    //
+    // String Property (Type 46)
+    //
+    case 46:
+      if (Struct->Type46->StringPropertyId == StringPropertyIdDevicePath) {
+        String = L"UEFI device path";
+      } else if ((Struct->Type46->StringPropertyId >= StringPropertyIdBiosVendor) &&
+                 (Struct->Type46->StringPropertyId < StringPropertyIdOem))
+      {
+        String = L"BIOS vendor defined";
+      } else if (Struct->Type46->StringPropertyId >= StringPropertyIdOem) {
+        String = L"OEM defined";
+      } else {
+        String = L"Reserved";
+      }
+
+      ShellPrintHiiEx (
+        -1,
+        -1,
+        NULL,
+        STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STRING_PROPERTY_ID),
+        gShellDebug1HiiHandle,
+        String
+        );
+      PRINT_PENDING_STRING (Struct, Type46, StringPropertyValue);
+      PRINT_STRUCT_VALUE_H (Struct, Type46, ParentHandle);
+      break;
+    //
     // Inactive (Type 126)
     //
     case 126:
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
index 8ecec693ad..4f52932a4d 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
@@ -3,6 +3,7 @@
 
   Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2017 - 2019 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -439,4 +440,28 @@ DisplayProcessorArchitectureType (
   IN UINT8  Option
   );
 
+/**
+  Display Firmware Characteristics (Type 45) details.
+
+  @param[in] Chara    The information bits.
+  @param[in] Option   The optional information.
+**/
+VOID
+DisplayFirmwareCharacteristics (
+  IN UINT16  Chara,
+  IN UINT8   Option
+  );
+
+/**
+  Display Firmware state (Type 45) details.
+
+  @param[in] Key            The key of the structure.
+  @param[in] Option         The optional information.
+**/
+VOID
+DisplayFirmwareState (
+  IN UINT8  Key,
+  IN UINT8  Option
+  );
+
 #endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
index edb46817e4..29b5a29001 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
@@ -4,6 +4,7 @@
 
   Copyright (c) 2005 - 2021, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2016-2019 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -3622,6 +3623,52 @@ TABLE_ITEM  ProcessorArchitectureTypesTable[] = {
   }
 };
 
+TABLE_ITEM  FirmwareInventoryCharTable[] = {
+  {
+    0,
+    L"Updatable"
+  },
+  {
+    1,
+    L"Write-Protect"
+  }
+};
+
+TABLE_ITEM  FirmwareInventoryStateTable[] = {
+  {
+    1,
+    L"  Other"
+  },
+  {
+    2,
+    L"  Unknown "
+  },
+  {
+    3,
+    L"  Disabled: This firmware component is disabled. "
+  },
+  {
+    4,
+    L"  Enabled: This firmware component is enabled. "
+  },
+  {
+    5,
+    L"  Absent: This firmware component is either not present or not detected "
+  },
+  {
+    6,
+    L"  StandbyOffline: This firmware is enabled but awaits an external action to activate it. "
+  },
+  {
+    7,
+    L"  StandbySpare: This firmware is part of a redundancy set and awaits a failover or other external action to activate it. "
+  },
+  {
+    8,
+    L"  UnavailableOffline: This firmware component is present but cannot be used. "
+  },
+};
+
 TABLE_ITEM  StructureTypeInfoTable[] = {
   {
     0,
@@ -5126,6 +5173,40 @@ DisplayProcessorArchitectureType (
   PRINT_TABLE_ITEM (ProcessorArchitectureTypesTable, Key);
 }
 
+/**
+  Display Firmware Characteristics (Type 45) details.
+
+  @param[in] Chara    The information bits.
+  @param[in] Option   The optional information.
+**/
+VOID
+DisplayFirmwareCharacteristics (
+  IN UINT16  Chara,
+  IN UINT8   Option
+  )
+{
+  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_FIRMWARE_INVENTORY_CHAR), gShellDebug1HiiHandle);
+  PRINT_INFO_OPTION (Chara, Option);
+  PRINT_BITS_INFO (FirmwareInventoryCharTable, Chara);
+}
+
+/**
+  Display Firmware state (Type 45) details.
+
+  @param[in] Key            The key of the structure.
+  @param[in] Option         The optional information.
+**/
+VOID
+DisplayFirmwareState (
+  IN UINT8  Key,
+  IN UINT8  Option
+  )
+{
+  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_FIRMWARE_INVENTORY_STATE), gShellDebug1HiiHandle);
+  PRINT_INFO_OPTION (Key, Option);
+  PRINT_TABLE_ITEM (FirmwareInventoryStateTable, Key);
+}
+
 /**
   Display the structure type information.
 
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
index 73f7b2ab19..971e0d09bd 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
@@ -4,6 +4,7 @@
 // Copyright (c) 1985 - 2022, American Megatrends International LLC.<BR>
 // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR>
 // (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP<BR>
+// Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 // SPDX-License-Identifier: BSD-2-Clause-Patent
 //
 // Module Name:
@@ -511,4 +512,10 @@
 #string STR_SMBIOSVIEW_PRINTINFO_IPMI_SPECIFICATION_REVISION    #language en-US "IPMISpecificationRevision: %d.%d\n"
 #string STR_SMBIOSVIEW_PRINTINFO_NV_STORAGE_DEVICE_NOT_PRESENT  #language en-US "NVStorageDevice: Not Present\n"
 #string STR_SMBIOSVIEW_PRINTINFO_BASE_ADDRESS                   #language en-US "BaseAddress: 0x%x\n"
-
+#string STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_VERSION_FORMAT        #language en-US "FirmwareVersionFormat: %s\r\n"
+#string STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_ID_FORMAT             #language en-US "FirmwareIdFormat: %s\r\n"
+#string STR_SMBIOSVIEW_QUERYTABLE_FIRMWARE_INVENTORY_CHAR       #language en-US "Characteristics:\r\n"
+#string STR_SMBIOSVIEW_QUERYTABLE_FIRMWARE_INVENTORY_STATE      #language en-US "State:\r\n"
+#string STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_INVENTORY_ASSOCIATED  #language en-US "  Associated handle:\r\n"
+#string STR_SMBIOSVIEW_PRINTINFO_IMAGE_SIZE_UNKNOWN             #language en-US "ImageSize: Unknown\r\n"
+#string STR_SMBIOSVIEW_PRINTINFO_STRING_PROPERTY_ID             #language en-US "String Property ID: %s\r\n"
-- 
2.40.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.
  2023-05-04  2:34 [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support simowang
@ 2023-05-09  1:32 ` Simon Wang
  2023-05-14 13:40 ` Simon Wang
  2023-05-19  2:09 ` Gao, Zhichao
  2 siblings, 0 replies; 9+ messages in thread
From: Simon Wang @ 2023-05-09  1:32 UTC (permalink / raw)
  To: Simon Wang, devel

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

Hi @Ray Ni ( ray.ni@... ) , @Zhichao Gao ( zhichao.gao@... ) ,

Could you please help to review this change?

Thanks,

Simon

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.
  2023-05-04  2:34 [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support simowang
  2023-05-09  1:32 ` [edk2-devel] " Simon Wang
@ 2023-05-14 13:40 ` Simon Wang
  2023-05-19  2:09 ` Gao, Zhichao
  2 siblings, 0 replies; 9+ messages in thread
From: Simon Wang @ 2023-05-14 13:40 UTC (permalink / raw)
  To: Simon Wang, devel

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

Hi Ray, Zhichao

Could you please help to review this change?

Thanks,

Simon

Could you please help to review this change?

Thanks,

Simon

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.
  2023-05-04  2:34 [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support simowang
  2023-05-09  1:32 ` [edk2-devel] " Simon Wang
  2023-05-14 13:40 ` Simon Wang
@ 2023-05-19  2:09 ` Gao, Zhichao
  2023-06-01 13:01   ` [edk2-devel] " Simon Wang
  2 siblings, 1 reply; 9+ messages in thread
From: Gao, Zhichao @ 2023-05-19  2:09 UTC (permalink / raw)
  To: Simon Wang, devel@edk2.groups.io; +Cc: Ni, Ray

Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>

Thanks,
Zhichao

-----Original Message-----
From: Simon Wang <simowang@nvidia.com> 
Sent: Thursday, May 4, 2023 10:34 AM
To: devel@edk2.groups.io
Cc: Ni, Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
Subject: [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.

The initial version of Smbios Specification 3.6.0 type 45 and type 46 support.

Signed-off-by: Simon Wang <simowang@nvidia.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
---
 .../SmbiosView/PrintInfo.c                    | 111 +++++++++++++++++-
 .../SmbiosView/PrintInfo.h                    |  25 ++++
 .../SmbiosView/QueryTable.c                   |  81 +++++++++++++
 .../SmbiosView/SmbiosViewStrings.uni          |   9 +-
 4 files changed, 222 insertions(+), 4 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index 1811cf0c44..e6a110beee 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -5,6 +5,7 @@
   Copyright (c) 1985 - 2022, American Megatrends International LLC.<BR>
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
   (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -305,9 +306,10 @@ SmbiosPrintStructure (
   IN  UINT8                     Option
   )
 {
-  UINT8  Index;
-  UINT8  Index2;
-  UINT8  *Buffer;
+  UINT8       Index;
+  UINT8       Index2;
+  UINT8       *Buffer;
+  EFI_STRING  String;
 
   if (Struct == NULL) {
     return EFI_INVALID_PARAMETER;
@@ -1302,6 +1304,109 @@ SmbiosPrintStructure (
       break;
 
     //
+    // Firmware Inventory (Type 45)
+    //
+    case 45:
+      PRINT_PENDING_STRING (Struct, Type45, FirmwareComponentName);
+      PRINT_PENDING_STRING (Struct, Type45, FirmwareVersion);
+      if (Struct->Type45->FirmwareVersionFormat == VersionFormatTypeFreeForm) {
+        String = L"Free-form string";
+      } else if (Struct->Type45->FirmwareVersionFormat == VersionFormatTypeMajorMinor) {
+        String = L"MAJOR.MINOR";
+      } else if (Struct->Type45->FirmwareVersionFormat == VersionFormatType32BitHex) {
+        String = L"32-bit hexadecimal string";
+      } else if (Struct->Type45->FirmwareVersionFormat == VersionFormatTypeMajorMinor) {
+        String = L"64-bit hexadecimal string";
+      } else if (Struct->Type45->FirmwareVersionFormat >= 0x80) {
+        String = L"BIOS Vendor/OEM-specific";
+      } else {
+        String = L"Reserved";
+      }
+
+      ShellPrintHiiEx (
+        -1,
+        -1,
+        NULL,
+        STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_VERSION_FORMAT),
+        gShellDebug1HiiHandle,
+        String
+        );
+      PRINT_PENDING_STRING (Struct, Type45, FirmwareId);
+      if (Struct->Type45->FirmwareIdFormat == FirmwareIdFormatTypeFreeForm) {
+        String = L"Free-form string";
+      } else if (Struct->Type45->FirmwareIdFormat == FirmwareIdFormatTypeUuid) {
+        String = L"RFC4122 UUID string";
+      } else if (Struct->Type45->FirmwareIdFormat >= 0x80) {
+        String = L"BIOS Vendor/OEM-specific";
+      } else {
+        String = L"Reserved";
+      }
+
+      ShellPrintHiiEx (
+        -1,
+        -1,
+        NULL,
+        STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_ID_FORMAT),
+        gShellDebug1HiiHandle,
+        String
+        );
+      PRINT_PENDING_STRING (Struct, Type45, ReleaseDate);
+      PRINT_PENDING_STRING (Struct, Type45, Manufacturer);
+      PRINT_PENDING_STRING (Struct, Type45, LowestSupportedVersion);
+      if (Struct->Type45->ImageSize != MAX_UINT64) {
+        PRINT_STRUCT_VALUE_H (Struct, Type45, ImageSize);
+      } else {
+        ShellPrintHiiEx (
+          -1,
+          -1,
+          NULL,
+          STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_IMAGE_SIZE_UNKNOWN),
+          gShellDebug1HiiHandle
+          );
+      }
+
+      DisplayFirmwareCharacteristics (ReadUnaligned16 ((UINT16 *)(UINTN)&(Struct->Type45->Characteristics)), Option);
+      DisplayFirmwareState (*(UINT8 *)(UINTN)&(Struct->Type45->State), 
+ Option);
+
+      PRINT_STRUCT_VALUE_H (Struct, Type45, AssociatedComponentCount);
+      if (Struct->Hdr->Length > sizeof (*Struct->Type45)) {
+        for (Index = 0; Index < Struct->Type45->AssociatedComponentCount; Index++) {
+          ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_INVENTORY_ASSOCIATED), gShellDebug1HiiHandle);
+          Print (L"    0x%04X ", Buffer[sizeof (*Struct->Type45) + (Index * sizeof (SMBIOS_HANDLE))]);
+          Print (L"\n");
+        }
+      }
+
+      break;
+
+    //
+    // String Property (Type 46)
+    //
+    case 46:
+      if (Struct->Type46->StringPropertyId == StringPropertyIdDevicePath) {
+        String = L"UEFI device path";
+      } else if ((Struct->Type46->StringPropertyId >= StringPropertyIdBiosVendor) &&
+                 (Struct->Type46->StringPropertyId < StringPropertyIdOem))
+      {
+        String = L"BIOS vendor defined";
+      } else if (Struct->Type46->StringPropertyId >= StringPropertyIdOem) {
+        String = L"OEM defined";
+      } else {
+        String = L"Reserved";
+      }
+
+      ShellPrintHiiEx (
+        -1,
+        -1,
+        NULL,
+        STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STRING_PROPERTY_ID),
+        gShellDebug1HiiHandle,
+        String
+        );
+      PRINT_PENDING_STRING (Struct, Type46, StringPropertyValue);
+      PRINT_STRUCT_VALUE_H (Struct, Type46, ParentHandle);
+      break;
+    //
     // Inactive (Type 126)
     //
     case 126:
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
index 8ecec693ad..4f52932a4d 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
@@ -3,6 +3,7 @@
 
   Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2017 - 2019 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -439,4 +440,28 @@ DisplayProcessorArchitectureType (
   IN UINT8  Option
   );
 
+/**
+  Display Firmware Characteristics (Type 45) details.
+
+  @param[in] Chara    The information bits.
+  @param[in] Option   The optional information.
+**/
+VOID
+DisplayFirmwareCharacteristics (
+  IN UINT16  Chara,
+  IN UINT8   Option
+  );
+
+/**
+  Display Firmware state (Type 45) details.
+
+  @param[in] Key            The key of the structure.
+  @param[in] Option         The optional information.
+**/
+VOID
+DisplayFirmwareState (
+  IN UINT8  Key,
+  IN UINT8  Option
+  );
+
 #endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
index edb46817e4..29b5a29001 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.
+++ c
@@ -4,6 +4,7 @@
 
   Copyright (c) 2005 - 2021, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2016-2019 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -3622,6 +3623,52 @@ TABLE_ITEM  ProcessorArchitectureTypesTable[] = {
   }
 };
 
+TABLE_ITEM  FirmwareInventoryCharTable[] = {
+  {
+    0,
+    L"Updatable"
+  },
+  {
+    1,
+    L"Write-Protect"
+  }
+};
+
+TABLE_ITEM  FirmwareInventoryStateTable[] = {
+  {
+    1,
+    L"  Other"
+  },
+  {
+    2,
+    L"  Unknown "
+  },
+  {
+    3,
+    L"  Disabled: This firmware component is disabled. "
+  },
+  {
+    4,
+    L"  Enabled: This firmware component is enabled. "
+  },
+  {
+    5,
+    L"  Absent: This firmware component is either not present or not detected "
+  },
+  {
+    6,
+    L"  StandbyOffline: This firmware is enabled but awaits an external action to activate it. "
+  },
+  {
+    7,
+    L"  StandbySpare: This firmware is part of a redundancy set and awaits a failover or other external action to activate it. "
+  },
+  {
+    8,
+    L"  UnavailableOffline: This firmware component is present but cannot be used. "
+  },
+};
+
 TABLE_ITEM  StructureTypeInfoTable[] = {
   {
     0,
@@ -5126,6 +5173,40 @@ DisplayProcessorArchitectureType (
   PRINT_TABLE_ITEM (ProcessorArchitectureTypesTable, Key);  }
 
+/**
+  Display Firmware Characteristics (Type 45) details.
+
+  @param[in] Chara    The information bits.
+  @param[in] Option   The optional information.
+**/
+VOID
+DisplayFirmwareCharacteristics (
+  IN UINT16  Chara,
+  IN UINT8   Option
+  )
+{
+  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN 
+(STR_SMBIOSVIEW_QUERYTABLE_FIRMWARE_INVENTORY_CHAR), 
+gShellDebug1HiiHandle);
+  PRINT_INFO_OPTION (Chara, Option);
+  PRINT_BITS_INFO (FirmwareInventoryCharTable, Chara); }
+
+/**
+  Display Firmware state (Type 45) details.
+
+  @param[in] Key            The key of the structure.
+  @param[in] Option         The optional information.
+**/
+VOID
+DisplayFirmwareState (
+  IN UINT8  Key,
+  IN UINT8  Option
+  )
+{
+  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN 
+(STR_SMBIOSVIEW_QUERYTABLE_FIRMWARE_INVENTORY_STATE), 
+gShellDebug1HiiHandle);
+  PRINT_INFO_OPTION (Key, Option);
+  PRINT_TABLE_ITEM (FirmwareInventoryStateTable, Key); }
+
 /**
   Display the structure type information.
 
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
index 73f7b2ab19..971e0d09bd 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewS
+++ trings.uni
@@ -4,6 +4,7 @@
 // Copyright (c) 1985 - 2022, American Megatrends International LLC.<BR>  // (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.<BR>  // (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP<BR>
+// Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 // SPDX-License-Identifier: BSD-2-Clause-Patent  //  // Module Name:
@@ -511,4 +512,10 @@
 #string STR_SMBIOSVIEW_PRINTINFO_IPMI_SPECIFICATION_REVISION    #language en-US "IPMISpecificationRevision: %d.%d\n"
 #string STR_SMBIOSVIEW_PRINTINFO_NV_STORAGE_DEVICE_NOT_PRESENT  #language en-US "NVStorageDevice: Not Present\n"
 #string STR_SMBIOSVIEW_PRINTINFO_BASE_ADDRESS                   #language en-US "BaseAddress: 0x%x\n"
-
+#string STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_VERSION_FORMAT        #language en-US "FirmwareVersionFormat: %s\r\n"
+#string STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_ID_FORMAT             #language en-US "FirmwareIdFormat: %s\r\n"
+#string STR_SMBIOSVIEW_QUERYTABLE_FIRMWARE_INVENTORY_CHAR       #language en-US "Characteristics:\r\n"
+#string STR_SMBIOSVIEW_QUERYTABLE_FIRMWARE_INVENTORY_STATE      #language en-US "State:\r\n"
+#string STR_SMBIOSVIEW_PRINTINFO_FIRMWARE_INVENTORY_ASSOCIATED  #language en-US "  Associated handle:\r\n"
+#string STR_SMBIOSVIEW_PRINTINFO_IMAGE_SIZE_UNKNOWN             #language en-US "ImageSize: Unknown\r\n"
+#string STR_SMBIOSVIEW_PRINTINFO_STRING_PROPERTY_ID             #language en-US "String Property ID: %s\r\n"
--
2.40.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.
  2023-05-19  2:09 ` Gao, Zhichao
@ 2023-06-01 13:01   ` Simon Wang
  2023-06-02  1:22     ` 回复: " gaoliming
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Wang @ 2023-06-01 13:01 UTC (permalink / raw)
  To: Gao, Zhichao, devel

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

Hi,

May I know the plan of code merging?

Thanks,
Simon

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* 回复: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.
  2023-06-01 13:01   ` [edk2-devel] " Simon Wang
@ 2023-06-02  1:22     ` gaoliming
  2023-06-08  1:22       ` Gao, Zhichao
  0 siblings, 1 reply; 9+ messages in thread
From: gaoliming @ 2023-06-02  1:22 UTC (permalink / raw)
  To: devel, simowang, <Gao>, 'Zhichao'

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

Simon:

 Can you create Pull Request for this patch to verify in on EDKII CI?

 

Thanks

Liming

发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Simon Wang via groups.io
发送时间: 2023年6月1日 21:02
收件人: Gao; Zhichao <zhichao.gao@intel.com>; devel@edk2.groups.io
主题: Re: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.

 

Hi,

May I know the plan of code merging?

Thanks,
Simon 




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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.
  2023-06-02  1:22     ` 回复: " gaoliming
@ 2023-06-08  1:22       ` Gao, Zhichao
  2023-06-08  6:12         ` Simon Wang
  0 siblings, 1 reply; 9+ messages in thread
From: Gao, Zhichao @ 2023-06-08  1:22 UTC (permalink / raw)
  To: Gao, Liming, devel@edk2.groups.io, simowang@nvidia.com,
	Gao <Gao>

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

I create the PR: ShellPkg/SmbiosView: type 45 and type 46 support. by ZhichaoGao · Pull Request #4528 · tianocore/edk2 (github.com)<https://github.com/tianocore/edk2/pull/4528>
But it fail because some CI canceled.

Thanks,
Zhichao

From: gaoliming <gaoliming@byosoft.com.cn>
Sent: Friday, June 2, 2023 9:22 AM
To: devel@edk2.groups.io; simowang@nvidia.com; Gao; Gao, Zhichao <zhichao.gao@intel.com>
Subject: 回复: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.

Simon:
 Can you create Pull Request for this patch to verify in on EDKII CI?

Thanks
Liming
发件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> 代表 Simon Wang via groups.io
发送时间: 2023年6月1日 21:02
收件人: Gao; Zhichao <zhichao.gao@intel.com<mailto:zhichao.gao@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>
主题: Re: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.

Hi,

May I know the plan of code merging?

Thanks,
Simon


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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.
  2023-06-08  1:22       ` Gao, Zhichao
@ 2023-06-08  6:12         ` Simon Wang
  2023-06-08  6:41           ` Gao, Zhichao
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Wang @ 2023-06-08  6:12 UTC (permalink / raw)
  To: Gao, Zhichao, devel

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

Zhichao,

PR, ShellPkg/SmbiosView: type 45 and type 46 support. by wangsim · Pull Request #4482 · tianocore/edk2 (github.com) ( https://github.com/tianocore/edk2/pull/4482 )
Just finished CI/CD check.

Thanks,
Simon

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.
  2023-06-08  6:12         ` Simon Wang
@ 2023-06-08  6:41           ` Gao, Zhichao
  0 siblings, 0 replies; 9+ messages in thread
From: Gao, Zhichao @ 2023-06-08  6:41 UTC (permalink / raw)
  To: Simon Wang, devel@edk2.groups.io

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

It should be same with my PR. But you miss my Reviewed-by.
I just rebase my PR: ShellPkg/SmbiosView: type 45 and type 46 support. by ZhichaoGao · Pull Request #4528 · tianocore/edk2 (github.com)<https://github.com/tianocore/edk2/pull/4528>
If you want the maintainer to push your patch directly with your PR. You need add the Reviewed-by in you commit message. And the maintainer can easily add the push label for CI to auto merge.

Thanks,
Zhichao

From: simowang via groups.io <simowang=nvidia.com@groups.io>
Sent: Thursday, June 8, 2023 2:13 PM
To: Gao; Gao, Zhichao <zhichao.gao@intel.com>; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support.

Zhichao,

PR, ShellPkg/SmbiosView: type 45 and type 46 support. by wangsim · Pull Request #4482 · tianocore/edk2 (github.com)<https://github.com/tianocore/edk2/pull/4482>
Just finished CI/CD check.

Thanks,
Simon

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-06-08  6:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-04  2:34 [PATCH] ShellPkg/SmbiosView: type 45 and type 46 support simowang
2023-05-09  1:32 ` [edk2-devel] " Simon Wang
2023-05-14 13:40 ` Simon Wang
2023-05-19  2:09 ` Gao, Zhichao
2023-06-01 13:01   ` [edk2-devel] " Simon Wang
2023-06-02  1:22     ` 回复: " gaoliming
2023-06-08  1:22       ` Gao, Zhichao
2023-06-08  6:12         ` Simon Wang
2023-06-08  6:41           ` Gao, Zhichao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox