From 6c1988af7683f3234dfd06a6a99deb3ea6946c39 Mon Sep 17 00:00:00 2001 From: "Prakash.K" Date: Thu, 24 Nov 2022 10:42:13 +0530 Subject: ShellPkg: Display SMBIOS Type38 fields in smbiosview in formatted view In smbiosview command in shell, below are the fields of SMBIOS Type38 table which can be displayed in formatted manner. 1. Base Address 1. IPMI Specification Version. 2. NV Storage Device Address. Base Address: As per spec, the value in Base Address field of SMBIOS type38 table should be right shifted by 1 if the interface type is SSIF. IPMI Specification Version: If the value in IPMI Specification Version field is 15H, it should be displayed 1.5. NV Storage Device Address: If the value in NV Storage Device Address field is 0xFF, it should be displayed as "No storage device is Present". Cc: Vasudevan Sambandan Cc: Sundaresan Selvaraj Cc: Gayathri Thunuguntla Signed-off-by: Prakash K Reviewed-by: Liming Gao --- .../SmbiosView/PrintInfo.c | 27 +++++++++++++++++++--- .../SmbiosView/SmbiosViewStrings.uni | 3 +++ 2 files changed, 27 insertions(+), 3 deletions(-) (limited to 'ShellPkg') diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c index e936ee8ea9..2611601230 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c @@ -1177,10 +1177,31 @@ SmbiosPrintStructure ( // case 38: DisplayIPMIDIBMCInterfaceType (Struct->Type38->InterfaceType, Option); - PRINT_STRUCT_VALUE_H (Struct, Type38, IPMISpecificationRevision); + + ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_IPMI_SPECIFICATION_REVISION), + gShellDebug1HiiHandle, + RShiftU64 ((UINT64)Struct->Type38->IPMISpecificationRevision, 4), \ + Struct->Type38->IPMISpecificationRevision & 0x0F + ); + PRINT_STRUCT_VALUE_H (Struct, Type38, I2CSlaveAddress); - PRINT_STRUCT_VALUE_H (Struct, Type38, NVStorageDeviceAddress); - PRINT_STRUCT_VALUE_LH (Struct, Type38, BaseAddress); + + if (Struct->Type38->NVStorageDeviceAddress == 0xFF) { + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NV_STORAGE_DEVICE_NOT_PRESENT), gShellDebug1HiiHandle); + } else { + PRINT_STRUCT_VALUE_H (Struct, Type38, NVStorageDeviceAddress); + } + + if (Struct->Type38->InterfaceType == IPMIDeviceInfoInterfaceTypeSSIF) { + ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BASE_ADDRESS), gShellDebug1HiiHandle, RShiftU64 ((UINT64)Struct->Type38->BaseAddress, 1)); + } else { + PRINT_STRUCT_VALUE_LH (Struct, Type38, BaseAddress); + } + break; // diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni index 1ab0e3dd60..05f7a61d9d 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni @@ -506,4 +506,7 @@ #string STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CONFIG_PLAT_SW #language en-US "Family configurable via platform software support\r\n" #string STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CONFIG_OEM #language en-US "Family configurable via OEM proprietary mechanism\r\n" #string STR_SMBIOSVIEW_PRINTINFO_BITS_06_63 #language en-US "Bits 6:63 are reserved\r\n" +#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" -- cgit v1.2.3