From nobody Wed May 15 18:16:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+88572+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+88572+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1649396382; cv=none; d=zohomail.com; s=zohoarc; b=dANWTAuJ01zAISoieFLY+GBKhi875dGAv3ugO4TpIfaDH0SmCyFuz9QtsYlnpwGDOIxSmUgMIYsg0NdJksykdli+vSy5/FyaPUMJ6q6XSc/Kh7iVyl7UH1zQdGhKo4lXuRBa9KFVnuoltrWeIWpGTCwINECLZnsh/qhinLDUPrs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649396382; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=WyRVR0WkxOry3DAbUqW/upO8p/dIDIZDSGnEgzh640Y=; b=GZHTWsjxywhVh6+DHbAIy/lrZvMhdloO/47vL4SV7sNa7fDinRaYjfk96NqfNFfdfD0drmZcGjySs/GJffyY69+qyZzmUZhe+JTUuQMM+by+afGQD0ovxQ4AqQoDSOhg6USek2L/UB9hXZHkZIK5cKAZcm6VskywG9W1bk2xMAU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+88572+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1649396382384311.3557412897279; Thu, 7 Apr 2022 22:39:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id qr2MYY1788612x35qOF2DJ1U; Thu, 07 Apr 2022 22:39:41 -0700 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.2509.1649396380542866601 for ; Thu, 07 Apr 2022 22:39:41 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="261691069" X-IronPort-AV: E=Sophos;i="5.90,244,1643702400"; d="scan'208";a="261691069" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 22:39:39 -0700 X-IronPort-AV: E=Sophos;i="5.90,244,1643702400"; d="scan'208";a="506439464" X-Received: from bkex-mobl.gar.corp.intel.com ([10.215.255.156]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2022 22:39:37 -0700 From: "Bo Chang Ke" To: devel@edk2.groups.io Cc: Dandan Bi , Star Zeng Subject: [edk2-devel] [PATCH] ShellPkg: Update smbiosview type 9 with SMBIOS 3.5 fields Date: Fri, 8 Apr 2022 13:38:18 +0800 Message-Id: <63e25acf8baa305892939414d7bd841958ac0813.1649386188.git.bo-changx.ke@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,bo-changx.ke@intel.com X-Gm-Message-State: OtafDOQ3zUepWGVTHcCXvRDlx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1649396381; bh=9xzCgZ9A24Ohxl+VQ2zYzNhW+4mEANp45rDeJ1Xah0g=; h=Cc:Date:From:Reply-To:Subject:To; b=rPH/SqWfLo0SBwGWXsqxiF/OuVbRwNx1P+uUeCy5kCnQJ8UlS2X/sGEY06t59o7tSOp EFM/t68PBNmImxsu8YJd34a4MY5CN90J24DwQ8iVXj/8CJnywq0ULOrteY7Zd2JHGc39t gjjpY8Orx7t9FtXf1T71QDs1I9uhh2DAg+0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1649396384566100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bo Chang Ke Cc: Dandan Bi Cc: Star Zeng --- MdePkg/Include/IndustryStandard/SmBios.h | 50 +++- .../SmbiosView/PrintInfo.c | 11 +- .../SmbiosView/QueryTable.c | 238 ++++++++++++++++++ .../SmbiosView/QueryTable.h | 36 +++ .../SmbiosView/SmbiosViewStrings.uni | 5 +- 5 files changed, 334 insertions(+), 6 deletions(-) diff --git a/MdePkg/Include/IndustryStandard/SmBios.h b/MdePkg/Include/Indu= stryStandard/SmBios.h index 2b1567b052..cb39470c92 100644 --- a/MdePkg/Include/IndustryStandard/SmBios.h +++ b/MdePkg/Include/IndustryStandard/SmBios.h @@ -1306,6 +1306,11 @@ typedef enum { SlotTypePciExpressMini52pinWithBSKO =3D 0x21, ///< PCI Express Min= i 52-pin (CEM spec. 2.0) with bottom-side keep-outs. SlotTypePciExpressMini52pinWithoutBSKO =3D 0x22, ///< PCI Express Min= i 52-pin (CEM spec. 2.0) without bottom-side keep-outs. SlotTypePciExpressMini76pin =3D 0x23, ///< PCI Express Min= i 76-pin (CEM spec. 2.0) Corresponds to Display-Mini card. + SlotTypePCIExpressGen4SFF_8639 =3D 0x24, ///< U.2 + SlotTypePCIExpressGen5SFF_8639 =3D 0x25, ///< U.2 + SlotTypeOCPNIC30SmallFormFactor =3D 0x26, ///< SFF + SlotTypeOCPNIC30LargeFormFactor =3D 0x27, ///< LFF + SlotTypeOCPNICPriorto30 =3D 0x28, SlotTypeCXLFlexbus10 =3D 0x30, SlotTypePC98C20 =3D 0xA0, SlotTypePC98C24 =3D 0xA1, @@ -1335,7 +1340,17 @@ typedef enum { SlotTypePciExpressGen4X2 =3D 0xBA, SlotTypePciExpressGen4X4 =3D 0xBB, SlotTypePciExpressGen4X8 =3D 0xBC, - SlotTypePciExpressGen4X16 =3D 0xBD + SlotTypePciExpressGen4X16 =3D 0xBD, + SlotTypePCIExpressGen5 =3D 0xBE, + SlotTypePCIExpressGen5X1 =3D 0xBF, + SlotTypePCIExpressGen5X2 =3D 0xC0, + SlotTypePCIExpressGen5X4 =3D 0xC1, + SlotTypePCIExpressGen5X8 =3D 0xC2, + SlotTypePCIExpressGen5X16 =3D 0xC3, + SlotTypePCIExpressGen6andBeyond =3D 0xC4, + SlotTypeEnterpriseandDatacenter1UE1FormFactorSlot =3D 0xC5, + SlotTypeEnterpriseandDatacenter3E3FormFactorSlot =3D 0xC6 + } MISC_SLOT_TYPE; =20 /// @@ -1358,6 +1373,39 @@ typedef enum { SlotDataBusWidth32X =3D 0x0E ///< Or X32 } MISC_SLOT_DATA_BUS_WIDTH; =20 +/// +/// System Slots - Slot Physical Width. +/// +typedef enum { + SlotPhysicalWidthOther =3D 0x01, + SlotPhysicalWidthUnknown =3D 0x02, + SlotPhysicalWidth8Bit =3D 0x03, + SlotPhysicalWidth16Bit =3D 0x04, + SlotPhysicalWidth32Bit =3D 0x05, + SlotPhysicalWidth64Bit =3D 0x06, + SlotPhysicalWidth128Bit =3D 0x07, + SlotPhysicalWidth1X =3D 0x08, ///< Or X1 + SlotPhysicalWidth2X =3D 0x09, ///< Or X2 + SlotPhysicalWidth4X =3D 0x0A, ///< Or X4 + SlotPhysicalWidth8X =3D 0x0B, ///< Or X8 + SlotPhysicalWidth12X =3D 0x0C, ///< Or X12 + SlotPhysicalWidth16X =3D 0x0D, ///< Or X16 + SlotPhysicalWidth32X =3D 0x0E ///< Or X32 +} MISC_SLOT_PHYSICAL_WIDTH; + +/// +/// System Slots - Slot Information. +/// +typedef enum{ + others =3D 0x00, + Gen1 =3D 0x01, + Gen2 =3D 0x01, + Gen3 =3D 0x03, + Gen4 =3D 0x04, + Gen5 =3D 0x05, + Gen6 =3D 0x06 +}MISC_SLOT_INFORMATION; + /// /// System Slots - Current Usage. /// diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintIn= fo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c index b144600a25..0fa40dbe0c 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c @@ -637,6 +637,13 @@ SmbiosPrintStructure ( } } } + if (AE_SMBIOS_VERSION (0x3, 0x2)) { + if (Struct->Hdr->Length > 0x12) { + DisplaySystemSlotHeight(Struct->Type9->SlotHeight, Option); + DisplaySystemSlotPhysicalWidth(Struct->Type9->SlotPhysicalWidth,= Option); + DisplaySystemSlotInformation(Struct->Type9->SlotInformation, Opt= ion); + } + } =20 break; } @@ -2898,10 +2905,6 @@ DisplaySystemSlotId ( IN UINT8 Option ) { - // - // Display slot type first - // - DisplaySystemSlotType (SlotType, Option); =20 ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SL= OT_ID), gShellDebug1HiiHandle); // diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTa= ble.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c index c4a6acb167..96e0e4036a 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c @@ -1447,6 +1447,27 @@ TABLE_ITEM SystemSlotTypeTable[] =3D { 0x23, L"PCI Express Mini 76-pin (CEM spec. 2.0) Corresponds to Display-Mini = card" }, + { + 0x24, + L"PCI Express Gen 4 SFF-8639 (U.2)" + }, + { + 0x25, + L"PCI Express Gen 5 SFF-8639 (U.2)" + }, + { + 0x26, + L"OCP NIC 3.0 Small Form Factor (SFF)" + }, + { + 0x27, + L"OCP NIC 3.0 Large Form Factor (LFF)" + }, + { + 0x28, + L"OCP NIC Prior to 3.0" + }, + { SlotTypeCXLFlexbus10, L"CXL Flexbus 1.0" @@ -1566,6 +1587,42 @@ TABLE_ITEM SystemSlotTypeTable[] =3D { { SlotTypePciExpressGen4X16, L"PCI Express Gen 4 X16" + }, + { + SlotTypePCIExpressGen5, + L"PCI Express Gen 5" + }, + { + SlotTypePCIExpressGen5X1, + L"PCI Express Gen 5 x1" + }, + { + SlotTypePCIExpressGen5X2, + L"PCI Express Gen 5 x2" + }, + { + SlotTypePCIExpressGen5X4, + L"PCI Express Gen 5 x4" + }, + { + SlotTypePCIExpressGen5X8, + L"PCI Express Gen 5 x8" + }, + { + SlotTypePCIExpressGen5X16, + L"PCI Express Gen 5 x16" + }, + { + SlotTypePCIExpressGen6andBeyond, + L"PCI Express Gen 6 and Beyond" + }, + { + SlotTypeEnterpriseandDatacenter1UE1FormFactorSlot, + L"Enterprise and Datacenter 1U E1 Form Factor Slot" + }, + { + SlotTypeEnterpriseandDatacenter3E3FormFactorSlot, + L"Enterprise and Datacenter 3'E3 Form Factor Slot" } }; =20 @@ -1628,6 +1685,96 @@ TABLE_ITEM SystemSlotDataBusWidthTable[] =3D { } }; =20 +TABLE_ITEM SystemSlotPhysicalWidthTable[] =3D { + { + 0x01, + L" Other" + }, + { + 0x02, + L" Unknown" + }, + { + 0x03, + L" 8 bit" + }, + { + 0x04, + L" 16 bit" + }, + { + 0x05, + L" 32 bit" + }, + { + 0x06, + L" 64 bit" + }, + { + 0x07, + L" 128 bit" + }, + { + 0x08, + L" 1x or x1" + }, + { + 0x09, + L" 2x or x2" + }, + { + 0x0A, + L" 4x or x4" + }, + { + 0x0B, + L" 8x or x8" + }, + { + 0x0C, + L" 12x or x12" + }, + { + 0x0D, + L" 16x or x16" + }, + { + 0x0E, + L" 32x or x32" + } +}; + +TABLE_ITEM SystemSlotInformationTable[] =3D { + { + 0x00, + L" Others" + }, + { + 0x01, + L" Gen 1" + }, + { + 0x02, + L" Gen 2" + }, + { + 0x03, + L" Gen 3" + }, + { + 0x04, + L" Gen 4" + }, + { + 0x05, + L" Gen 5" + }, + { + 0x06, + L" Gen 6" + } +}; + TABLE_ITEM SystemSlotCurrentUsageTable[] =3D { { 0x01, @@ -1670,6 +1817,30 @@ TABLE_ITEM SystemSlotLengthTable[] =3D { }, }; =20 +TABLE_ITEM SystemSlotHeightTable[] =3D { + { + 0x00, + L" Not applicable" + }, + { + 0x01, + L" Other" + }, + { + 0x02, + L" Unkown" + }, + { + 0x03, + L" Full height" + }, + { + 0x04, + L" Low-Profile" + }, + +}; + TABLE_ITEM SlotCharacteristics1Table[] =3D { { 0, @@ -1722,6 +1893,22 @@ TABLE_ITEM SlotCharacteristics2Table[] =3D { { 3, L" PCIe slot supports bifurcation" + }, + { + 4, + L" Slot supports async/surprise removal" + }, + { + 5, + L" Flexbus slot, CXL 1.0 capable" + }, + { + 6, + L" Flexbus slot, CXL 2.0 capable" + }, + { + 7, + L" Reserved" } }; =20 @@ -4208,6 +4395,57 @@ DisplaySlotCharacteristics2 ( PRINT_BITS_INFO (SlotCharacteristics2Table, Chara2); } =20 +/** + Display System Slots (Type 9) Information. + + @param[in] Width The key of the structure. + @param[in] Option The optional information. +**/ +VOID +DisplaySystemSlotInformation ( + IN UINT8 Width, + IN UINT8 Option + ) +{ + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_S= YSTEM_SLOT_INFORMATION), gShellDebug1HiiHandle); + PRINT_INFO_OPTION (Width, Option); + PRINT_TABLE_ITEM (SystemSlotInformationTable, Width); +} + +/** + Display System Slots (Type 9) Physical Width. + + @param[in] Width The key of the structure. + @param[in] Option The optional information. +**/ +VOID +DisplaySystemSlotPhysicalWidth ( + IN UINT8 Width, + IN UINT8 Option + ) +{ + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_S= YSTEM_SLOT_PHYSICAL_WIDTH), gShellDebug1HiiHandle); + PRINT_INFO_OPTION (Width, Option); + PRINT_TABLE_ITEM (SystemSlotPhysicalWidthTable, Width); +} + +/** + Display System Slots (Type 9) slot height. + + @param[in] Length The key of the structure. + @param[in] Option The optional information. +**/ +VOID +DisplaySystemSlotHeight ( + IN UINT8 Length, + IN UINT8 Option + ) +{ + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_S= YSTEM_SLOT_HEIGHT), gShellDebug1HiiHandle); + PRINT_INFO_OPTION (Length, Option); + PRINT_TABLE_ITEM (SystemSlotHeightTable, Length); +} + /** Display On Board Devices Information (Type 10) types. =20 diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTa= ble.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h index 5111d35f63..5f062762b3 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h @@ -415,6 +415,42 @@ DisplaySlotCharacteristics2 ( IN UINT8 Option ); =20 +/** + Display System Slots (Type 9) Information. + + @param[in] Width The key of the structure. + @param[in] Option The optional information. +**/ +VOID +DisplaySystemSlotInformation ( + IN UINT8 Width, + IN UINT8 Option + ); + +/** + Display System Slots (Type 9) Physical Width. + + @param[in] Width The key of the structure. + @param[in] Option The optional information. +**/ +VOID +DisplaySystemSlotPhysicalWidth ( + IN UINT8 Width, + IN UINT8 Option + ); + +/** + Display System Slots (Type 9) slot height. + + @param[in] Length The key of the structure. + @param[in] Option The optional information. +**/ +VOID +DisplaySystemSlotHeight ( + IN UINT8 Length, + IN UINT8 Option + ); + /** Display On Board Devices Information (Type 10) types. =20 diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosV= iewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smb= iosViewStrings.uni index 9433e8a25f..a8728d6abc 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStri= ngs.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStri= ngs.uni @@ -294,7 +294,7 @@ #string STR_SMBIOSVIEW_PRINTINFO_MEM_SIZE #language = en-US " Memory Size: %d MB\r\n" #string STR_SMBIOSVIEW_PRINTINFO_MEM_MODULE_DOUBLE_BANK #language = en-US "The memory module has a Double-bank connection\r\n" #string STR_SMBIOSVIEW_PRINTINFO_MEM_MODULE_SINGLE_BANK #language = en-US "The memory module has a Single-bank connection\r\n" -#string STR_SMBIOSVIEW_PRINTINFO_SLOT_ID #language = en-US " Slot Id:" +#string STR_SMBIOSVIEW_PRINTINFO_SLOT_ID #language = en-US "Slot Id:" #string STR_SMBIOSVIEW_PRINTINFO_LOGICAL_MICRO_CHAN #language = en-US " the logical Micro Channel slot number is:" #string STR_SMBIOSVIEW_PRINTINFO_ONE_VAR_D #language = en-US " %d\r\n" #string STR_SMBIOSVIEW_PRINTINFO_ERROR_NOT_1_15 #language = en-US " error, not 1-15.\r\n" @@ -412,6 +412,9 @@ #string STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_LENGTH #language = en-US "System Slot Length: " #string STR_SMBIOSVIEW_QUERYTABLE_SLOT_CHARACTERISTICS #language = en-US "Slot characteristics 1: " #string STR_SMBIOSVIEW_QUERYTABLE_SLOT_CHARACTERISTICS_2 #language = en-US "Slot characteristics 2: " +#string STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_INFORMATION #language = en-US "System Slot Information: " +#string STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_HEIGHT #language = en-US "System Slot Height: " +#string STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_PHYSICAL_WIDTH #language = en-US "System Slot Physical Width: " #string STR_SMBIOSVIEW_QUERYTABLE_ONBOARD_DEVICE_TYPE #language = en-US "Onboard Device Type: " #string STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_EVENT_LOG_TYPE #language = en-US "System Event Log Type: " #string STR_SMBIOSVIEW_QUERYTABLE_EVENT_LOG_VAR_DATA_FORMAT #language = en-US "Event Log Variable Data Format Types: " --=20 2.32.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#88572): https://edk2.groups.io/g/devel/message/88572 Mute This Topic: https://groups.io/mt/90330104/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-