public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS
@ 2021-12-01  4:10 Nhi Pham
  2021-12-01  4:10 ` [PATCH 1/3] ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition Nhi Pham
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Nhi Pham @ 2021-12-01  4:10 UTC (permalink / raw)
  To: devel; +Cc: patches, Nhi Pham, Leif Lindholm, Ard Biesheuvel, Rebecca Cran

This patchset leverages the OemUpdateSmbiosInfo API functions from
OemMiscLib for updating some HII string fields in the SMBIOS Type 1/2/4
because they may be updated dynamically during UEFI booting with the
data being passed from the pre-UEFI firmware.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Rebecca Cran <rebecca@nuviainc.com>
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>

Nhi Pham (3):
  ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition
  ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib
  ArmPkg/ProcessorSubClassDxe: Get serial and part number from
    OemMiscLib

 ArmPkg/Include/Library/OemMiscLib.h               |  5 +++++
 .../ProcessorSubClassDxe/ProcessorSubClass.c      | 14 ++++++++++++--
 .../Type01/MiscSystemManufacturerFunction.c       | 10 ++++++++++
 .../Type02/MiscBaseBoardManufacturerFunction.c    | 15 +++++++++++++++
 .../Type01/MiscSystemManufacturer.uni             |  1 -
 5 files changed, 42 insertions(+), 3 deletions(-)

-- 
2.17.1


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

* [PATCH 1/3] ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition
  2021-12-01  4:10 [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Nhi Pham
@ 2021-12-01  4:10 ` Nhi Pham
  2021-12-15 17:08   ` [edk2-devel] " Sami Mujawar
  2021-12-01  4:10 ` [PATCH 2/3] ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib Nhi Pham
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Nhi Pham @ 2021-12-01  4:10 UTC (permalink / raw)
  To: devel; +Cc: patches, Nhi Pham, Leif Lindholm, Ard Biesheuvel, Rebecca Cran

This patch removes duplicate HII string definition in the
MiscSystemManufacturer.uni.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Rebecca Cran <rebecca@nuviainc.com>
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
---
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni | 1 -
 1 file changed, 1 deletion(-)

diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni
index 8038f0e4b0bf..2b3b19cab2ea 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni
@@ -13,7 +13,6 @@
 
 #string STR_MISC_SYSTEM_MANUFACTURER   #language en-US  "Not Specified"
 #string STR_MISC_SYSTEM_PRODUCT_NAME   #language en-US  "Not Specified"
-#string STR_MISC_SYSTEM_PRODUCT_NAME   #language en-US  "Not Specified"
 #string STR_MISC_SYSTEM_VERSION        #language en-US  "Not Specified"
 #string STR_MISC_SYSTEM_SERIAL_NUMBER  #language en-US  "Not Specified"
 #string STR_MISC_SYSTEM_SKU_NUMBER     #language en-US  "Not Specified"
-- 
2.17.1


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

* [PATCH 2/3] ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib
  2021-12-01  4:10 [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Nhi Pham
  2021-12-01  4:10 ` [PATCH 1/3] ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition Nhi Pham
@ 2021-12-01  4:10 ` Nhi Pham
  2021-12-15 17:19   ` [edk2-devel] " Sami Mujawar
  2021-12-01  4:10 ` [PATCH 3/3] ArmPkg/ProcessorSubClassDxe: Get serial and part number " Nhi Pham
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Nhi Pham @ 2021-12-01  4:10 UTC (permalink / raw)
  To: devel; +Cc: patches, Nhi Pham, Leif Lindholm, Ard Biesheuvel, Rebecca Cran

Typically, the information of the SMBIOS type 1/2/3 is fetched from an
FRU device during UEFI booting intead of fixed PCDs. Therefore, this
patch is to add more HII string fields in the OemMiscLib and support
updating these SMBIOS types with the strings provided by the OemMiscLib
if the PCDs are empty.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Rebecca Cran <rebecca@nuviainc.com>
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
---
 ArmPkg/Include/Library/OemMiscLib.h                                              |  3 +++
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c    | 10 ++++++++++
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 15 +++++++++++++++
 3 files changed, 28 insertions(+)

diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index 0b03fe8d4de3..aa68c0a92632 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -44,11 +44,14 @@ typedef enum
     SerialNumType01,
     UuidType01,
     SystemManufacturerType01,
+    VersionType01,
     SkuNumberType01,
     FamilyType01,
     AssertTagType02,
     SerialNumberType02,
     BoardManufacturerType02,
+    ProductNameType02,
+    VersionType02,
     SkuNumberType02,
     ChassisLocationType02,
     AssetTagType03,
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
index 2c69c2593f5d..2c73d63444fe 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
@@ -75,12 +75,22 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscSystemManufacturer)
   if (StrLen (Product) > 0) {
     TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME);
     HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Product, NULL);
+  } else {
+    OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,
+      STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME),
+      ProductNameType01
+      );
   }
 
   pVersion = (CHAR16 *) PcdGetPtr (PcdSystemVersion);
   if (StrLen (pVersion) > 0) {
     TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_VERSION);
     HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, pVersion, NULL);
+  } else {
+    OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,
+      STRING_TOKEN (STR_MISC_SYSTEM_VERSION),
+      VersionType01
+      );
   }
 
   OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
index 097777a23904..7f397d8d2aaa 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
@@ -79,18 +79,33 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBaseBoardManufacturer)
   if (StrLen (BaseBoardManufacturer) > 0) {
     TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER);
     HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, BaseBoardManufacturer, NULL);
+  } else {
+    OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,
+      STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER),
+      BoardManufacturerType02
+      );
   }
 
   BaseBoardProductName = (CHAR16 *) PcdGetPtr (PcdBaseBoardProductName);
   if (StrLen (BaseBoardProductName) > 0) {
     TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME);
     HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, BaseBoardProductName, NULL);
+  } else {
+    OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,
+      STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME),
+      ProductNameType02
+      );
   }
 
   Version = (CHAR16 *) PcdGetPtr (PcdBaseBoardVersion);
   if (StrLen (Version) > 0) {
     TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION);
     HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
+  } else {
+    OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,
+      STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION),
+      VersionType02
+      );
   }
 
   OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,
-- 
2.17.1


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

* [PATCH 3/3] ArmPkg/ProcessorSubClassDxe: Get serial and part number from OemMiscLib
  2021-12-01  4:10 [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Nhi Pham
  2021-12-01  4:10 ` [PATCH 1/3] ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition Nhi Pham
  2021-12-01  4:10 ` [PATCH 2/3] ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib Nhi Pham
@ 2021-12-01  4:10 ` Nhi Pham
  2021-12-15 18:47   ` [edk2-devel] " Sami Mujawar
  2021-12-15  8:40 ` [edk2-devel] [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Ard Biesheuvel
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Nhi Pham @ 2021-12-01  4:10 UTC (permalink / raw)
  To: devel; +Cc: patches, Nhi Pham, Leif Lindholm, Ard Biesheuvel, Rebecca Cran

Currently, the serial and part number of a processor are filled with
fixed PCDs. However, they may be updated dynamically according to the
information being passed from a the pre-UEFI firmware during booting.
So, this patch is to support updating these string fields from
OemMiscLib if the PCDs are empty.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Rebecca Cran <rebecca@nuviainc.com>
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
---
 ArmPkg/Include/Library/OemMiscLib.h                              |  2 ++
 ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c | 14 ++++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index aa68c0a92632..5f0effa9cc17 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -60,6 +60,8 @@ typedef enum
     ChassisTypeType03,
     ManufacturerType03,
     SkuNumberType03,
+    ProcessorPartNumType04,
+    ProcessorSerialNumType04,
     SmbiosHiiStringFieldMax
 } OEM_MISC_SMBIOS_HII_STRING_FIELD;
 
diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
index fb484086a457..8d884d313bd4 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
@@ -493,9 +493,19 @@ AllocateType4AndSetProcessorInformationStrings (
 
   SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorManufacturer, ProcessorManu);
   SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorVersion, ProcessorVersion);
-  SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorSerialNumber, SerialNumber);
   SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorAssetTag, AssetTag);
-  SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorPartNumber, PartNumber);
+
+  if (StrLen ((CHAR16 *)PcdGetPtr (PcdProcessorSerialNumber)) > 0) {
+    HiiSetString (mHiiHandle, SerialNumber, (CHAR16 *)PcdGetPtr (PcdProcessorSerialNumber), NULL);
+  } else {
+    OemUpdateSmbiosInfo (mHiiHandle, SerialNumber, ProcessorSerialNumType04);
+  }
+
+  if (StrLen ((CHAR16 *)PcdGetPtr (PcdProcessorPartNumber)) > 0) {
+    HiiSetString (mHiiHandle, PartNumber, (CHAR16 *)PcdGetPtr (PcdProcessorPartNumber), NULL);
+  } else {
+    OemUpdateSmbiosInfo (mHiiHandle, PartNumber, ProcessorPartNumType04);
+  }
 
   // Processor Designation
   StringBufferSize = sizeof (CHAR16) * SMBIOS_STRING_MAX_LENGTH;
-- 
2.17.1


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

* Re: [edk2-devel] [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS
  2021-12-01  4:10 [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Nhi Pham
                   ` (2 preceding siblings ...)
  2021-12-01  4:10 ` [PATCH 3/3] ArmPkg/ProcessorSubClassDxe: Get serial and part number " Nhi Pham
@ 2021-12-15  8:40 ` Ard Biesheuvel
  2021-12-15 16:40 ` Rebecca Cran
  2021-12-15 17:06 ` Sami Mujawar
  5 siblings, 0 replies; 11+ messages in thread
From: Ard Biesheuvel @ 2021-12-15  8:40 UTC (permalink / raw)
  To: edk2-devel-groups-io, Nhi Pham
  Cc: patches, Leif Lindholm, Ard Biesheuvel, Rebecca Cran

On Wed, 1 Dec 2021 at 05:12, Nhi Pham via groups.io
<nhi=os.amperecomputing.com@groups.io> wrote:
>
> This patchset leverages the OemUpdateSmbiosInfo API functions from
> OemMiscLib for updating some HII string fields in the SMBIOS Type 1/2/4
> because they may be updated dynamically during UEFI booting with the
> data being passed from the pre-UEFI firmware.
>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Rebecca Cran <rebecca@nuviainc.com>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
>

Anyone care to review this?

> Nhi Pham (3):
>   ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition
>   ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib
>   ArmPkg/ProcessorSubClassDxe: Get serial and part number from
>     OemMiscLib
>
>  ArmPkg/Include/Library/OemMiscLib.h               |  5 +++++
>  .../ProcessorSubClassDxe/ProcessorSubClass.c      | 14 ++++++++++++--
>  .../Type01/MiscSystemManufacturerFunction.c       | 10 ++++++++++
>  .../Type02/MiscBaseBoardManufacturerFunction.c    | 15 +++++++++++++++
>  .../Type01/MiscSystemManufacturer.uni             |  1 -
>  5 files changed, 42 insertions(+), 3 deletions(-)
>
> --
> 2.17.1
>
>
>
> 
>
>

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

* Re: [edk2-devel] [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS
  2021-12-01  4:10 [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Nhi Pham
                   ` (3 preceding siblings ...)
  2021-12-15  8:40 ` [edk2-devel] [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Ard Biesheuvel
@ 2021-12-15 16:40 ` Rebecca Cran
  2021-12-15 17:06 ` Sami Mujawar
  5 siblings, 0 replies; 11+ messages in thread
From: Rebecca Cran @ 2021-12-15 16:40 UTC (permalink / raw)
  To: devel, nhi; +Cc: patches, Leif Lindholm, Ard Biesheuvel

For the series:


Reviewed-by: Rebecca Cran <rebecca@nuviainc.com>


-- 
Rebecca Cran


On 11/30/21 9:10 PM, Nhi Pham via groups.io wrote:
> This patchset leverages the OemUpdateSmbiosInfo API functions from
> OemMiscLib for updating some HII string fields in the SMBIOS Type 1/2/4
> because they may be updated dynamically during UEFI booting with the
> data being passed from the pre-UEFI firmware.
>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Rebecca Cran <rebecca@nuviainc.com>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
>
> Nhi Pham (3):
>    ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition
>    ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib
>    ArmPkg/ProcessorSubClassDxe: Get serial and part number from
>      OemMiscLib
>
>   ArmPkg/Include/Library/OemMiscLib.h               |  5 +++++
>   .../ProcessorSubClassDxe/ProcessorSubClass.c      | 14 ++++++++++++--
>   .../Type01/MiscSystemManufacturerFunction.c       | 10 ++++++++++
>   .../Type02/MiscBaseBoardManufacturerFunction.c    | 15 +++++++++++++++
>   .../Type01/MiscSystemManufacturer.uni             |  1 -
>   5 files changed, 42 insertions(+), 3 deletions(-)
>

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

* Re: [edk2-devel] [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS
  2021-12-01  4:10 [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Nhi Pham
                   ` (4 preceding siblings ...)
  2021-12-15 16:40 ` Rebecca Cran
@ 2021-12-15 17:06 ` Sami Mujawar
  2021-12-16  3:53   ` Nhi Pham
  5 siblings, 1 reply; 11+ messages in thread
From: Sami Mujawar @ 2021-12-15 17:06 UTC (permalink / raw)
  To: devel, nhi; +Cc: patches, Leif Lindholm, Ard Biesheuvel, Rebecca Cran, nd

Hi Nhi,

These patches do not cleanly apply. I guess you would need to run 
uncrustify for these patches.

Can you check, please?

Regards,

Sami Mujawar


On 01/12/2021 04:10 AM, Nhi Pham via groups.io wrote:
> This patchset leverages the OemUpdateSmbiosInfo API functions from
> OemMiscLib for updating some HII string fields in the SMBIOS Type 1/2/4
> because they may be updated dynamically during UEFI booting with the
> data being passed from the pre-UEFI firmware.
>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Rebecca Cran <rebecca@nuviainc.com>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
>
> Nhi Pham (3):
>    ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition
>    ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib
>    ArmPkg/ProcessorSubClassDxe: Get serial and part number from
>      OemMiscLib
>
>   ArmPkg/Include/Library/OemMiscLib.h               |  5 +++++
>   .../ProcessorSubClassDxe/ProcessorSubClass.c      | 14 ++++++++++++--
>   .../Type01/MiscSystemManufacturerFunction.c       | 10 ++++++++++
>   .../Type02/MiscBaseBoardManufacturerFunction.c    | 15 +++++++++++++++
>   .../Type01/MiscSystemManufacturer.uni             |  1 -
>   5 files changed, 42 insertions(+), 3 deletions(-)
>


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

* Re: [edk2-devel] [PATCH 1/3] ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition
  2021-12-01  4:10 ` [PATCH 1/3] ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition Nhi Pham
@ 2021-12-15 17:08   ` Sami Mujawar
  0 siblings, 0 replies; 11+ messages in thread
From: Sami Mujawar @ 2021-12-15 17:08 UTC (permalink / raw)
  To: devel, nhi; +Cc: patches, Leif Lindholm, Ard Biesheuvel, Rebecca Cran, nd

Hi Nhi,

Thank you for this patch.
This change looks good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 01/12/2021 04:10 AM, Nhi Pham via groups.io wrote:
> This patch removes duplicate HII string definition in the
> MiscSystemManufacturer.uni.
>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Rebecca Cran <rebecca@nuviainc.com>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
> ---
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni
> index 8038f0e4b0bf..2b3b19cab2ea 100644
> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni
> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturer.uni
> @@ -13,7 +13,6 @@
>   
>   #string STR_MISC_SYSTEM_MANUFACTURER   #language en-US  "Not Specified"
>   #string STR_MISC_SYSTEM_PRODUCT_NAME   #language en-US  "Not Specified"
> -#string STR_MISC_SYSTEM_PRODUCT_NAME   #language en-US  "Not Specified"
>   #string STR_MISC_SYSTEM_VERSION        #language en-US  "Not Specified"
>   #string STR_MISC_SYSTEM_SERIAL_NUMBER  #language en-US  "Not Specified"
>   #string STR_MISC_SYSTEM_SKU_NUMBER     #language en-US  "Not Specified"


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

* Re: [edk2-devel] [PATCH 2/3] ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib
  2021-12-01  4:10 ` [PATCH 2/3] ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib Nhi Pham
@ 2021-12-15 17:19   ` Sami Mujawar
  0 siblings, 0 replies; 11+ messages in thread
From: Sami Mujawar @ 2021-12-15 17:19 UTC (permalink / raw)
  To: devel, nhi; +Cc: patches, Leif Lindholm, Ard Biesheuvel, Rebecca Cran, nd

Hi Nhi,

Other than the code style issue (which I believe uncrustify will 
complain about), this patch looks good to me.

With that fixed.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar


On 01/12/2021 04:10 AM, Nhi Pham via groups.io wrote:
> Typically, the information of the SMBIOS type 1/2/3 is fetched from an
> FRU device during UEFI booting intead of fixed PCDs. Therefore, this
> patch is to add more HII string fields in the OemMiscLib and support
> updating these SMBIOS types with the strings provided by the OemMiscLib
> if the PCDs are empty.
>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Rebecca Cran <rebecca@nuviainc.com>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
> ---
>   ArmPkg/Include/Library/OemMiscLib.h                                              |  3 +++
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c    | 10 ++++++++++
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 15 +++++++++++++++
>   3 files changed, 28 insertions(+)
>
> diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
> index 0b03fe8d4de3..aa68c0a92632 100644
> --- a/ArmPkg/Include/Library/OemMiscLib.h
> +++ b/ArmPkg/Include/Library/OemMiscLib.h
> @@ -44,11 +44,14 @@ typedef enum
>       SerialNumType01,
>       UuidType01,
>       SystemManufacturerType01,
> +    VersionType01,
>       SkuNumberType01,
>       FamilyType01,
>       AssertTagType02,
>       SerialNumberType02,
>       BoardManufacturerType02,
> +    ProductNameType02,
> +    VersionType02,
>       SkuNumberType02,
>       ChassisLocationType02,
>       AssetTagType03,
> diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
> index 2c69c2593f5d..2c73d63444fe 100644
> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
> @@ -75,12 +75,22 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscSystemManufacturer)
>     if (StrLen (Product) > 0) {
>       TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME);
>       HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Product, NULL);
> +  } else {
> +    OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,
> +      STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME),
> +      ProductNameType01
> +      );
[SAMI] I think uncrustify would fail here, similar issue at other places.
>     }
>   
>     pVersion = (CHAR16 *) PcdGetPtr (PcdSystemVersion);
>     if (StrLen (pVersion) > 0) {
>       TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_VERSION);
>       HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, pVersion, NULL);
> +  } else {
> +    OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,
> +      STRING_TOKEN (STR_MISC_SYSTEM_VERSION),
> +      VersionType01
> +      );
>     }
>   
>     OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,
> diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
> index 097777a23904..7f397d8d2aaa 100644
> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
> @@ -79,18 +79,33 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBaseBoardManufacturer)
>     if (StrLen (BaseBoardManufacturer) > 0) {
>       TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER);
>       HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, BaseBoardManufacturer, NULL);
> +  } else {
> +    OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,
> +      STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER),
> +      BoardManufacturerType02
> +      );
>     }
>   
>     BaseBoardProductName = (CHAR16 *) PcdGetPtr (PcdBaseBoardProductName);
>     if (StrLen (BaseBoardProductName) > 0) {
>       TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME);
>       HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, BaseBoardProductName, NULL);
> +  } else {
> +    OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,
> +      STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME),
> +      ProductNameType02
> +      );
>     }
>   
>     Version = (CHAR16 *) PcdGetPtr (PcdBaseBoardVersion);
>     if (StrLen (Version) > 0) {
>       TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION);
>       HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
> +  } else {
> +    OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,
> +      STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION),
> +      VersionType02
> +      );
>     }
>   
>     OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,


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

* Re: [edk2-devel] [PATCH 3/3] ArmPkg/ProcessorSubClassDxe: Get serial and part number from OemMiscLib
  2021-12-01  4:10 ` [PATCH 3/3] ArmPkg/ProcessorSubClassDxe: Get serial and part number " Nhi Pham
@ 2021-12-15 18:47   ` Sami Mujawar
  0 siblings, 0 replies; 11+ messages in thread
From: Sami Mujawar @ 2021-12-15 18:47 UTC (permalink / raw)
  To: devel, nhi; +Cc: patches, Leif Lindholm, Ard Biesheuvel, Rebecca Cran, nd

Hi Nhi,

I have a minor suggestion to use FixedPcdGetPtr(), other than that this 
patch looks good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 01/12/2021 04:10 AM, Nhi Pham via groups.io wrote:
> Currently, the serial and part number of a processor are filled with
> fixed PCDs. However, they may be updated dynamically according to the
> information being passed from a the pre-UEFI firmware during booting.
> So, this patch is to support updating these string fields from
> OemMiscLib if the PCDs are empty.
>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Rebecca Cran <rebecca@nuviainc.com>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
> ---
>   ArmPkg/Include/Library/OemMiscLib.h                              |  2 ++
>   ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c | 14 ++++++++++++--
>   2 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
> index aa68c0a92632..5f0effa9cc17 100644
> --- a/ArmPkg/Include/Library/OemMiscLib.h
> +++ b/ArmPkg/Include/Library/OemMiscLib.h
> @@ -60,6 +60,8 @@ typedef enum
>       ChassisTypeType03,
>       ManufacturerType03,
>       SkuNumberType03,
> +    ProcessorPartNumType04,
> +    ProcessorSerialNumType04,
>       SmbiosHiiStringFieldMax
>   } OEM_MISC_SMBIOS_HII_STRING_FIELD;
>   
> diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
> index fb484086a457..8d884d313bd4 100644
> --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
> +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
> @@ -493,9 +493,19 @@ AllocateType4AndSetProcessorInformationStrings (
>   
>     SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorManufacturer, ProcessorManu);
>     SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorVersion, ProcessorVersion);
> -  SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorSerialNumber, SerialNumber);
>     SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorAssetTag, AssetTag);
> -  SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorPartNumber, PartNumber);
> +
> +  if (StrLen ((CHAR16 *)PcdGetPtr (PcdProcessorSerialNumber)) > 0) {
> +    HiiSetString (mHiiHandle, SerialNumber, (CHAR16 *)PcdGetPtr (PcdProcessorSerialNumber), NULL);
[SAMI] Can FixedPcdGetPtr() be used here instead of PcdGetPtr()?
> +  } else {
> +    OemUpdateSmbiosInfo (mHiiHandle, SerialNumber, ProcessorSerialNumType04);
> +  }
> +
> +  if (StrLen ((CHAR16 *)PcdGetPtr (PcdProcessorPartNumber)) > 0) {
> +    HiiSetString (mHiiHandle, PartNumber, (CHAR16 *)PcdGetPtr (PcdProcessorPartNumber), NULL);
> +  } else {
> +    OemUpdateSmbiosInfo (mHiiHandle, PartNumber, ProcessorPartNumType04);
> +  }
>   
>     // Processor Designation
>     StringBufferSize = sizeof (CHAR16) * SMBIOS_STRING_MAX_LENGTH;


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

* Re: [edk2-devel] [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS
  2021-12-15 17:06 ` Sami Mujawar
@ 2021-12-16  3:53   ` Nhi Pham
  0 siblings, 0 replies; 11+ messages in thread
From: Nhi Pham @ 2021-12-16  3:53 UTC (permalink / raw)
  To: Sami Mujawar, devel
  Cc: patches, Leif Lindholm, Ard Biesheuvel, Rebecca Cran, nd

Hi Sami,

On 16/12/2021 00:06, Sami Mujawar wrote:
> Hi Nhi,
>
> These patches do not cleanly apply. I guess you would need to run 
> uncrustify for these patches.
>
> Can you check, please?

Sure, will fix all coding style issues found by uncrustify and change to 
use FixedPcdGetPtr() instead of PcdGetPtr() as your suggestion in the 
PATCH 3/3.

Thanks,

Nhi

>
> Regards,
>
> Sami Mujawar
>
>
> On 01/12/2021 04:10 AM, Nhi Pham via groups.io wrote:
>> This patchset leverages the OemUpdateSmbiosInfo API functions from
>> OemMiscLib for updating some HII string fields in the SMBIOS Type 1/2/4
>> because they may be updated dynamically during UEFI booting with the
>> data being passed from the pre-UEFI firmware.
>>
>> Cc: Leif Lindholm <leif@nuviainc.com>
>> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
>> Cc: Rebecca Cran <rebecca@nuviainc.com>
>> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
>>
>> Nhi Pham (3):
>>    ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition
>>    ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib
>>    ArmPkg/ProcessorSubClassDxe: Get serial and part number from
>>      OemMiscLib
>>
>>   ArmPkg/Include/Library/OemMiscLib.h               |  5 +++++
>>   .../ProcessorSubClassDxe/ProcessorSubClass.c      | 14 ++++++++++++--
>>   .../Type01/MiscSystemManufacturerFunction.c       | 10 ++++++++++
>>   .../Type02/MiscBaseBoardManufacturerFunction.c    | 15 +++++++++++++++
>>   .../Type01/MiscSystemManufacturer.uni             |  1 -
>>   5 files changed, 42 insertions(+), 3 deletions(-)
>>
>

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

end of thread, other threads:[~2021-12-16  3:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-01  4:10 [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Nhi Pham
2021-12-01  4:10 ` [PATCH 1/3] ArmPkg/SmbiosMiscDxe: Remove duplicate HII string definition Nhi Pham
2021-12-15 17:08   ` [edk2-devel] " Sami Mujawar
2021-12-01  4:10 ` [PATCH 2/3] ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib Nhi Pham
2021-12-15 17:19   ` [edk2-devel] " Sami Mujawar
2021-12-01  4:10 ` [PATCH 3/3] ArmPkg/ProcessorSubClassDxe: Get serial and part number " Nhi Pham
2021-12-15 18:47   ` [edk2-devel] " Sami Mujawar
2021-12-15  8:40 ` [edk2-devel] [PATCH 0/3] ArmPkg/SMBIOS: Update HII string settings for SMBIOS Ard Biesheuvel
2021-12-15 16:40 ` Rebecca Cran
2021-12-15 17:06 ` Sami Mujawar
2021-12-16  3:53   ` Nhi Pham

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