]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: Display SMBIOS Type38 fields in smbiosview in formatted view
authorPrakash.K <prakashk@ami.com>
Thu, 24 Nov 2022 05:12:13 +0000 (10:42 +0530)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 18 Jan 2023 02:21:19 +0000 (02:21 +0000)
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 <vasudevans@ami.com>
Cc: Sundaresan Selvaraj <sundaresans@ami.com>
Cc: Gayathri Thunuguntla <gayathrit@ami.com>
Signed-off-by: Prakash K <prakashk@ami.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni

index e936ee8ea96aa752a1814155b2aec1dcff9e387a..2611601230b9e544baee44a1ae076b5aa2ade563 100644 (file)
@@ -1177,10 +1177,31 @@ SmbiosPrintStructure (
     //\r
     case 38:\r
       DisplayIPMIDIBMCInterfaceType (Struct->Type38->InterfaceType, Option);\r
-      PRINT_STRUCT_VALUE_H (Struct, Type38, IPMISpecificationRevision);\r
+\r
+      ShellPrintHiiEx (\r
+        -1,\r
+        -1,\r
+        NULL,\r
+        STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_IPMI_SPECIFICATION_REVISION),\r
+        gShellDebug1HiiHandle,\r
+        RShiftU64 ((UINT64)Struct->Type38->IPMISpecificationRevision, 4), \\r
+        Struct->Type38->IPMISpecificationRevision & 0x0F\r
+        );\r
+\r
       PRINT_STRUCT_VALUE_H (Struct, Type38, I2CSlaveAddress);\r
-      PRINT_STRUCT_VALUE_H (Struct, Type38, NVStorageDeviceAddress);\r
-      PRINT_STRUCT_VALUE_LH (Struct, Type38, BaseAddress);\r
+\r
+      if (Struct->Type38->NVStorageDeviceAddress == 0xFF) {\r
+        ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NV_STORAGE_DEVICE_NOT_PRESENT), gShellDebug1HiiHandle);\r
+      } else {\r
+        PRINT_STRUCT_VALUE_H (Struct, Type38, NVStorageDeviceAddress);\r
+      }\r
+\r
+      if (Struct->Type38->InterfaceType == IPMIDeviceInfoInterfaceTypeSSIF) {\r
+        ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BASE_ADDRESS), gShellDebug1HiiHandle, RShiftU64 ((UINT64)Struct->Type38->BaseAddress, 1));\r
+      } else {\r
+        PRINT_STRUCT_VALUE_LH (Struct, Type38, BaseAddress);\r
+      }\r
+\r
       break;\r
 \r
     //\r
index 1ab0e3dd60ea35434f450e94407c1cc927d5ddca..05f7a61d9de0754249656ac47715ba60f0de5b4a 100644 (file)
 #string STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CONFIG_PLAT_SW      #language en-US "Family configurable via platform software support\r\n"\r
 #string STR_SMBIOSVIEW_PRINTINFO_TPM_DEVICE_CONFIG_OEM          #language en-US "Family configurable via OEM proprietary mechanism\r\n"\r
 #string STR_SMBIOSVIEW_PRINTINFO_BITS_06_63                     #language en-US "Bits 6:63 are reserved\r\n"\r
+#string STR_SMBIOSVIEW_PRINTINFO_IPMI_SPECIFICATION_REVISION    #language en-US "IPMISpecificationRevision: %d.%d\n"\r
+#string STR_SMBIOSVIEW_PRINTINFO_NV_STORAGE_DEVICE_NOT_PRESENT  #language en-US "NVStorageDevice: Not Present\n"\r
+#string STR_SMBIOSVIEW_PRINTINFO_BASE_ADDRESS                   #language en-US "BaseAddress: 0x%x\n"\r
 \r