public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements
@ 2022-08-23 10:59 Nhi Pham
  2022-08-23 10:59 ` [PATCH 1/6] ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib Nhi Pham
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Nhi Pham @ 2022-08-23 10:59 UTC (permalink / raw)
  To: devel, quic_llindhol, ardb+tianocore, sami.mujawar, quic_rcran
  Cc: patches, Nhi Pham

This patchset is to update the ArmPkg/SMBIOS for fixes and improvements.

Minh Nguyen (5):
  ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib
  ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call
  ArmPkg/SmbiosMiscDxe: Fix typo of "AssetTagType02"
  ArmPkg/SmbiosMiscDxe: Remove redundant updates in SMBIOS Type 2
  ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib

Nhi Pham (1):
  ArmPkg/SmbiosMiscDxe: Support fetching System UUID

 ArmPkg/Include/Library/OemMiscLib.h                                              | 37 +++++++++++++++-
 ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c                              | 46 ++++++++++++++++++++
 ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c                 |  8 +++-
 ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c          |  6 +--
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c            | 32 +++++++++-----
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c    |  3 +-
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 13 +-----
 7 files changed, 117 insertions(+), 28 deletions(-)

-- 
2.25.1


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

* [PATCH 1/6] ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib
  2022-08-23 10:59 [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
@ 2022-08-23 10:59 ` Nhi Pham
  2022-08-23 16:21   ` Sami Mujawar
  2022-08-23 10:59 ` [PATCH 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call Nhi Pham
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Nhi Pham @ 2022-08-23 10:59 UTC (permalink / raw)
  To: devel, quic_llindhol, ardb+tianocore, sami.mujawar, quic_rcran
  Cc: patches, Minh Nguyen, Nhi Pham

From: Minh Nguyen <minhn@amperecomputing.com>

In some scenarios, the processor version may be updated dynamically
from pre-UEFI firmware during booting. But the processor version is
fixed with PCD (PcdProcessorVersion), so it can not be updated it
dynamically. This patch will support setting that value both
statically and dynamically.

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
---
 ArmPkg/Include/Library/OemMiscLib.h                              | 2 ++
 ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index 47cb30d84a62..330bb4b014de 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -1,5 +1,6 @@
 /** @file
 *
+*  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
 *  Copyright (c) 2021, NUVIA Inc. All rights reserved.
 *  Copyright (c) 2015, Hisilicon Limited. All rights reserved.
 *  Copyright (c) 2015, Linaro Limited. All rights reserved.
@@ -58,6 +59,7 @@ typedef enum {
   SkuNumberType03,
   ProcessorPartNumType04,
   ProcessorSerialNumType04,
+  ProcessorVersionType04,
   SmbiosHiiStringFieldMax
 } OEM_MISC_SMBIOS_HII_STRING_FIELD;
 
diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
index 0b9af9bd7e1c..524b37b10479 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
@@ -1,6 +1,7 @@
 /** @file
   ProcessorSubClass.c
 
+  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
   Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
   Copyright (c) 2015, Hisilicon Limited. All rights reserved.
   Copyright (c) 2015, Linaro Limited. All rights reserved.
@@ -512,7 +513,6 @@ AllocateType4AndSetProcessorInformationStrings (
   PartNumber       = STRING_TOKEN (STR_PROCESSOR_PART_NUMBER);
 
   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 (PcdProcessorAssetTag, AssetTag);
 
   if (StrLen ((CHAR16 *)FixedPcdGetPtr (PcdProcessorSerialNumber)) > 0) {
@@ -527,6 +527,12 @@ AllocateType4AndSetProcessorInformationStrings (
     OemUpdateSmbiosInfo (mHiiHandle, PartNumber, ProcessorPartNumType04);
   }
 
+  if (StrLen ((CHAR16 *)FixedPcdGetPtr (PcdProcessorVersion)) > 0) {
+    HiiSetString (mHiiHandle, PartNumber, (CHAR16 *)FixedPcdGetPtr (PcdProcessorVersion), NULL);
+  } else {
+    OemUpdateSmbiosInfo (mHiiHandle, ProcessorVersion, ProcessorVersionType04);
+  }
+
   // Processor Designation
   StringBufferSize = sizeof (CHAR16) * SMBIOS_STRING_MAX_LENGTH;
   ProcessorStr     = AllocateZeroPool (StringBufferSize);
-- 
2.25.1


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

* [PATCH 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call
  2022-08-23 10:59 [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
  2022-08-23 10:59 ` [PATCH 1/6] ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib Nhi Pham
@ 2022-08-23 10:59 ` Nhi Pham
  2022-08-23 16:28   ` Sami Mujawar
  2022-08-23 10:59 ` [PATCH 3/6] ArmPkg/SmbiosMiscDxe: Support fetching System UUID Nhi Pham
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Nhi Pham @ 2022-08-23 10:59 UTC (permalink / raw)
  To: devel, quic_llindhol, ardb+tianocore, sami.mujawar, quic_rcran
  Cc: patches, Minh Nguyen, Nhi Pham

From: Minh Nguyen <minhn@amperecomputing.com>

According to "SMC Calling Convention" specification, section 7.4,
return value of Arm Architecture Calls is stored at first argument of
SMC aguments (ARM_SMC_ARGS). This value can be negative values indicating
error or positive values (including zero) indicating success. Positive
value would contain information of respective Function ID (Section 7.3.4
and 7.4.4).

For that reason, "SMCCC_VERSION" and "SMCCC_ARCH_FEATURES"
Function ID calls read return value from "SmcCallStatus" variable
(Args.Arg0 - first argument of SMC call). But "SMCCC_ARCH_SOC_ID"
Function ID call is reading return value from "SmcParam" variable
(Args.Arg1 - second argument of SMC call) so it leads to unexpected
results of "Jep106Code" and "SocRevision". This patch is to correct it.

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
---
 ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
index e0010a40e489..b961be213358 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
@@ -2,7 +2,7 @@
   Functions for processor information common to ARM and AARCH64.
 
   Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
-  Copyright (c) 2021, Ampere Computing LLC. All rights reserved.<BR>
+  Copyright (c) 2021 - 2022, Ampere Computing LLC. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -131,7 +131,7 @@ SmbiosGetSmcArm64SocId (
   SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL);
 
   if (SmcCallStatus >= 0) {
-    *Jep106Code = (INT32)SmcParam;
+    *Jep106Code = SmcCallStatus;
   } else {
     Status = EFI_UNSUPPORTED;
   }
@@ -140,7 +140,7 @@ SmbiosGetSmcArm64SocId (
   SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL);
 
   if (SmcCallStatus >= 0) {
-    *SocRevision = (INT32)SmcParam;
+    *SocRevision = SmcCallStatus;
   } else {
     Status = EFI_UNSUPPORTED;
   }
-- 
2.25.1


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

* [PATCH 3/6] ArmPkg/SmbiosMiscDxe: Support fetching System UUID
  2022-08-23 10:59 [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
  2022-08-23 10:59 ` [PATCH 1/6] ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib Nhi Pham
  2022-08-23 10:59 ` [PATCH 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call Nhi Pham
@ 2022-08-23 10:59 ` Nhi Pham
  2022-08-23 16:31   ` Sami Mujawar
  2022-08-23 10:59 ` [PATCH 4/6] ArmPkg/SmbiosMiscDxe: Fix typo of "AssetTagType02" Nhi Pham
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Nhi Pham @ 2022-08-23 10:59 UTC (permalink / raw)
  To: devel, quic_llindhol, ardb+tianocore, sami.mujawar, quic_rcran
  Cc: patches, Nhi Pham

This adds an API to OemMiscLib for fetching the system UUID according to
the platform.

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
---
 ArmPkg/Include/Library/OemMiscLib.h                                           | 12 ++++++++++++
 ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c                           | 18 ++++++++++++++++++
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c |  3 ++-
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index 330bb4b014de..d87737db9c2b 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -235,4 +235,16 @@ OemGetChassisNumPowerCords (
   VOID
   );
 
+/**
+  Fetches the system UUID.
+
+  @param[out] SystemUuid     The pointer to the buffer to store the System UUID.
+
+**/
+VOID
+EFIAPI
+OemGetSystemUuid (
+  OUT GUID  *SystemUuid
+  );
+
 #endif // OEM_MISC_LIB_H_
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
index 98970407a65e..32f6d55c1a9a 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
@@ -1,6 +1,7 @@
 /** @file
 *  OemMiscLib.c
 *
+*  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
 *  Copyright (c) 2021, NUVIA Inc. All rights reserved.
 *  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
 *  Copyright (c) 2018, Linaro Limited. All rights reserved.
@@ -10,6 +11,7 @@
 **/
 
 #include <Uefi.h>
+#include <Guid/ZeroGuid.h>
 #include <Library/BaseMemoryLib.h>
 #include <Library/DebugLib.h>
 #include <Library/HiiLib.h>
@@ -236,3 +238,19 @@ OemGetChassisNumPowerCords (
   ASSERT (FALSE);
   return 1;
 }
+
+/**
+  Fetches the system UUID.
+
+  @param[out] SystemUuid     The pointer to the buffer to store the System UUID.
+
+**/
+VOID
+EFIAPI
+OemGetSystemUuid (
+  OUT GUID  *SystemUuid
+  )
+{
+  ASSERT (FALSE);
+  CopyGuid (SystemUuid, &gZeroGuid);
+}
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
index 5cf72644d0b2..22fb5eccaa63 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
@@ -4,6 +4,7 @@
 
   Based on files under Nt32Pkg/MiscSubClassPlatformDxe/
 
+  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.<BR>
   Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
   Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
   Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
@@ -160,7 +161,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscSystemManufacturer) {
 
   SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE1);
 
-  CopyGuid (&SmbiosRecord->Uuid, &InputData->Uuid);
+  OemGetSystemUuid (&SmbiosRecord->Uuid);
 
   OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
   UnicodeStrToAsciiStrS (Manufacturer, OptionalStrStart, ManuStrLen + 1);
-- 
2.25.1


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

* [PATCH 4/6] ArmPkg/SmbiosMiscDxe: Fix typo of "AssetTagType02"
  2022-08-23 10:59 [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
                   ` (2 preceding siblings ...)
  2022-08-23 10:59 ` [PATCH 3/6] ArmPkg/SmbiosMiscDxe: Support fetching System UUID Nhi Pham
@ 2022-08-23 10:59 ` Nhi Pham
  2022-08-23 16:34   ` Sami Mujawar
  2022-08-23 10:59 ` [PATCH 5/6] ArmPkg/SmbiosMiscDxe: Remove redundant updates in SMBIOS Type 2 Nhi Pham
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Nhi Pham @ 2022-08-23 10:59 UTC (permalink / raw)
  To: devel, quic_llindhol, ardb+tianocore, sami.mujawar, quic_rcran
  Cc: patches, Minh Nguyen, Nhi Pham

From: Minh Nguyen <minhn@amperecomputing.com>

This patch fixes typo from "AssertTagType02"
to "AssetTagType02".

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
---
 ArmPkg/Include/Library/OemMiscLib.h                                              | 2 +-
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index d87737db9c2b..1936619d9b5b 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -44,7 +44,7 @@ typedef enum {
   VersionType01,
   SkuNumberType01,
   FamilyType01,
-  AssertTagType02,
+  AssetTagType02,
   SerialNumberType02,
   BoardManufacturerType02,
   ProductNameType02,
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
index 870610b17243..f61546955f12 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
@@ -4,6 +4,7 @@
 
   Based on files under Nt32Pkg/MiscSubClassPlatformDxe/
 
+  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.<BR>
   Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
   Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
   Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
@@ -112,7 +113,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBaseBoardManufacturer) {
   OemUpdateSmbiosInfo (
     mSmbiosMiscHiiHandle,
     STRING_TOKEN (STR_MISC_BASE_BOARD_ASSET_TAG),
-    AssertTagType02
+    AssetTagType02
     );
   OemUpdateSmbiosInfo (
     mSmbiosMiscHiiHandle,
-- 
2.25.1


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

* [PATCH 5/6] ArmPkg/SmbiosMiscDxe: Remove redundant updates in SMBIOS Type 2
  2022-08-23 10:59 [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
                   ` (3 preceding siblings ...)
  2022-08-23 10:59 ` [PATCH 4/6] ArmPkg/SmbiosMiscDxe: Fix typo of "AssetTagType02" Nhi Pham
@ 2022-08-23 10:59 ` Nhi Pham
  2022-08-23 16:36   ` Sami Mujawar
  2022-08-23 10:59 ` [PATCH 6/6] ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib Nhi Pham
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Nhi Pham @ 2022-08-23 10:59 UTC (permalink / raw)
  To: devel, quic_llindhol, ardb+tianocore, sami.mujawar, quic_rcran
  Cc: patches, Minh Nguyen, Nhi Pham

From: Minh Nguyen <minhn@amperecomputing.com>

This patch removes redundant updates of "BoardManufacturerType02"
and "SerialNumberType02".

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
---
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
index f61546955f12..3441e7798860 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
@@ -120,16 +120,6 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBaseBoardManufacturer) {
     STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER),
     SerialNumberType02
     );
-  OemUpdateSmbiosInfo (
-    mSmbiosMiscHiiHandle,
-    STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER),
-    BoardManufacturerType02
-    );
-  OemUpdateSmbiosInfo (
-    mSmbiosMiscHiiHandle,
-    STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER),
-    SerialNumberType02
-    );
   OemUpdateSmbiosInfo (
     mSmbiosMiscHiiHandle,
     STRING_TOKEN (STR_MISC_BASE_BOARD_SKU_NUMBER),
-- 
2.25.1


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

* [PATCH 6/6] ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib
  2022-08-23 10:59 [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
                   ` (4 preceding siblings ...)
  2022-08-23 10:59 ` [PATCH 5/6] ArmPkg/SmbiosMiscDxe: Remove redundant updates in SMBIOS Type 2 Nhi Pham
@ 2022-08-23 10:59 ` Nhi Pham
  2022-08-23 16:57   ` Sami Mujawar
  2022-08-23 14:24 ` [edk2-devel] [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements Rebecca Cran
  2022-08-23 15:57 ` PierreGondois
  7 siblings, 1 reply; 16+ messages in thread
From: Nhi Pham @ 2022-08-23 10:59 UTC (permalink / raw)
  To: devel, quic_llindhol, ardb+tianocore, sami.mujawar, quic_rcran
  Cc: patches, Minh Nguyen, Nhi Pham

From: Minh Nguyen <minhn@amperecomputing.com>

In some scenarios, the information of Bios Version, Bios Release
and Embedded Controller Firmware Release are fetched during UEFI
booting. This patch supports updating those fields dynamically
when the PCDs are empty.

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
---
 ArmPkg/Include/Library/OemMiscLib.h                                   | 21 +++++++++++++
 ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c                   | 28 +++++++++++++++++
 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 32 +++++++++++++-------
 3 files changed, 70 insertions(+), 11 deletions(-)

diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
index 1936619d9b5b..541274999e5c 100644
--- a/ArmPkg/Include/Library/OemMiscLib.h
+++ b/ArmPkg/Include/Library/OemMiscLib.h
@@ -37,6 +37,7 @@ typedef struct {
 } OEM_MISC_PROCESSOR_DATA;
 
 typedef enum {
+  BiosVersionType00,
   ProductNameType01,
   SerialNumType01,
   UuidType01,
@@ -247,4 +248,24 @@ OemGetSystemUuid (
   OUT GUID  *SystemUuid
   );
 
+/** Fetches the BIOS release.
+
+  @return The BIOS release.
+**/
+UINT16
+EFIAPI
+OemGetBiosRelease (
+  VOID
+  );
+
+/** Fetches the embedded controller firmware release.
+
+  @return The embedded controller firmware release.
+**/
+UINT16
+EFIAPI
+OemGetEmbeddedControllerFirmwareRelease (
+  VOID
+  );
+
 #endif // OEM_MISC_LIB_H_
diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
index 32f6d55c1a9a..788ccab9e8c1 100644
--- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
+++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
@@ -254,3 +254,31 @@ OemGetSystemUuid (
   ASSERT (FALSE);
   CopyGuid (SystemUuid, &gZeroGuid);
 }
+
+/** Fetches the BIOS release.
+
+  @return The BIOS release.
+**/
+UINT16
+EFIAPI
+OemGetBiosRelease (
+  VOID
+  )
+{
+  ASSERT (FALSE);
+  return 0xFFFF;
+}
+
+/** Fetches the embedded controller firmware release.
+
+  @return The embedded controller firmware release.
+**/
+UINT16
+EFIAPI
+OemGetEmbeddedControllerFirmwareRelease (
+  VOID
+  )
+{
+  ASSERT (FALSE);
+  return 0xFFFF;
+}
diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
index b49c4b754cab..e9106a8a2fec 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
@@ -1,5 +1,6 @@
 /** @file
 
+  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.<BR>
   Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
   Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
   Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
@@ -13,6 +14,7 @@
 #include <Library/DebugLib.h>
 #include <Library/HiiLib.h>
 #include <Library/MemoryAllocationLib.h>
+#include <Library/OemMiscLib.h>
 #include <Library/PrintLib.h>
 #include <Library/UefiBootServicesTableLib.h>
 
@@ -191,11 +193,11 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
     TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
     HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
   } else {
-    Version = (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString);
-    if (StrLen (Version) > 0) {
-      TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
-      HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
-    }
+      OemUpdateSmbiosInfo (
+        mSmbiosMiscHiiHandle,
+        STRING_TOKEN (STR_MISC_BIOS_VERSION),
+        BiosVersionType00
+        );
   }
 
   Char16String = GetBiosReleaseDate ();
@@ -251,13 +253,21 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
     }
   }
 
-  SmbiosRecord->SystemBiosMajorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) >> 8);
-  SmbiosRecord->SystemBiosMinorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) & 0xFF);
+  if (PcdGet16 (PcdSystemBiosRelease) != 0xFFFF) {
+    SmbiosRecord->SystemBiosMajorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) >> 8);
+    SmbiosRecord->SystemBiosMinorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) & 0xFF);
+  } else {
+    SmbiosRecord->SystemBiosMajorRelease = (UINT8)(OemGetBiosRelease () >> 8);
+    SmbiosRecord->SystemBiosMinorRelease = (UINT8)(OemGetBiosRelease () & 0xFF);
+  }
 
-  SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = (UINT16)
-                                                         (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) >> 8);
-  SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = (UINT16)
-                                                         (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) & 0xFF);
+  if (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) != 0xFFFF) {
+    SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = (UINT16)(PcdGet16 (PcdEmbeddedControllerFirmwareRelease) >> 8);
+    SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = (UINT16)(PcdGet16 (PcdEmbeddedControllerFirmwareRelease) & 0xFF);
+  } else {
+    SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = (UINT16)(OemGetEmbeddedControllerFirmwareRelease () >> 8);
+    SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = (UINT16)(OemGetEmbeddedControllerFirmwareRelease () & 0xFF);
+  }
 
   OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
   UnicodeStrToAsciiStrS (Vendor, OptionalStrStart, VendorStrLen + 1);
-- 
2.25.1


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

* Re: [edk2-devel] [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements
  2022-08-23 10:59 [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
                   ` (5 preceding siblings ...)
  2022-08-23 10:59 ` [PATCH 6/6] ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib Nhi Pham
@ 2022-08-23 14:24 ` Rebecca Cran
  2022-08-23 15:57 ` PierreGondois
  7 siblings, 0 replies; 16+ messages in thread
From: Rebecca Cran @ 2022-08-23 14:24 UTC (permalink / raw)
  To: devel, nhi, quic_llindhol, ardb+tianocore, sami.mujawar,
	quic_rcran; +Cc: patches

Thanks. For the series:

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

On 8/23/22 04:59, Nhi Pham via groups.io wrote:
> This patchset is to update the ArmPkg/SMBIOS for fixes and improvements.
>
> Minh Nguyen (5):
>    ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib
>    ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call
>    ArmPkg/SmbiosMiscDxe: Fix typo of "AssetTagType02"
>    ArmPkg/SmbiosMiscDxe: Remove redundant updates in SMBIOS Type 2
>    ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib
>
> Nhi Pham (1):
>    ArmPkg/SmbiosMiscDxe: Support fetching System UUID
>
>   ArmPkg/Include/Library/OemMiscLib.h                                              | 37 +++++++++++++++-
>   ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c                              | 46 ++++++++++++++++++++
>   ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c                 |  8 +++-
>   ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c          |  6 +--
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c            | 32 +++++++++-----
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c    |  3 +-
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 13 +-----
>   7 files changed, 117 insertions(+), 28 deletions(-)
>


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

* Re: [edk2-devel] [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements
  2022-08-23 10:59 [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
                   ` (6 preceding siblings ...)
  2022-08-23 14:24 ` [edk2-devel] [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements Rebecca Cran
@ 2022-08-23 15:57 ` PierreGondois
  7 siblings, 0 replies; 16+ messages in thread
From: PierreGondois @ 2022-08-23 15:57 UTC (permalink / raw)
  To: devel, nhi, quic_llindhol, ardb+tianocore, sami.mujawar,
	quic_rcran

Hello,
Some of the patches are modifying:
   ArmPkg/Universal/Smbios/SmbiosMiscDxe/

This folder has been ignored by the EccCheck done in the CI in order to
enable uncrustify:
   https://edk2.groups.io/g/devel/topic/87268735#83984
Indeed, the EccCheck is only run on the code which is modified, and a lot
of code was modified to enable uncrustify, ignoring this folder was the
easiest solution.

The EccCheck doesn't support the declaration of functions with macros.
For intance at:
   https://github.com/tianocore/edk2/blob/dfdba857a6b6a708e754ddb1a04086a3402acdef/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFunction.c#L38
the following errors should normally be triggered:
- "The body of a function should be contained by open and close braces that must be in the first column"
- "Function name does not follow the rules: 1. First character should be upper case 2. Must contain lower case characters 3. No white space characters"
- "Any optional functional modifiers should exist and next to the return type"

This is just to be sure everyone is aware of the situation,
Regards,
Pierre


On 8/23/22 12:59, Nhi Pham via groups.io wrote:
> This patchset is to update the ArmPkg/SMBIOS for fixes and improvements.
> 
> Minh Nguyen (5):
>    ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib
>    ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call
>    ArmPkg/SmbiosMiscDxe: Fix typo of "AssetTagType02"
>    ArmPkg/SmbiosMiscDxe: Remove redundant updates in SMBIOS Type 2
>    ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib
> 
> Nhi Pham (1):
>    ArmPkg/SmbiosMiscDxe: Support fetching System UUID
> 
>   ArmPkg/Include/Library/OemMiscLib.h                                              | 37 +++++++++++++++-
>   ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c                              | 46 ++++++++++++++++++++
>   ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c                 |  8 +++-
>   ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c          |  6 +--
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c            | 32 +++++++++-----
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c    |  3 +-
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 13 +-----
>   7 files changed, 117 insertions(+), 28 deletions(-)
> 

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

* Re: [PATCH 1/6] ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib
  2022-08-23 10:59 ` [PATCH 1/6] ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib Nhi Pham
@ 2022-08-23 16:21   ` Sami Mujawar
  2022-08-24 16:10     ` Nhi Pham
  0 siblings, 1 reply; 16+ messages in thread
From: Sami Mujawar @ 2022-08-23 16:21 UTC (permalink / raw)
  To: Nhi Pham, devel, quic_llindhol, ardb+tianocore, quic_rcran
  Cc: patches, Minh Nguyen, nd@arm.com

Hi Nhi,

Thank you for this patch.

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar

On 23/08/2022 11:59 am, Nhi Pham wrote:
> From: Minh Nguyen <minhn@amperecomputing.com>
>
> In some scenarios, the processor version may be updated dynamically
> from pre-UEFI firmware during booting. But the processor version is
> fixed with PCD (PcdProcessorVersion), so it can not be updated it
> dynamically. This patch will support setting that value both
> statically and dynamically.
>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
> ---
>   ArmPkg/Include/Library/OemMiscLib.h                              | 2 ++
>   ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c | 8 +++++++-
>   2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
> index 47cb30d84a62..330bb4b014de 100644
> --- a/ArmPkg/Include/Library/OemMiscLib.h
> +++ b/ArmPkg/Include/Library/OemMiscLib.h
> @@ -1,5 +1,6 @@
>   /** @file
>
>   *
>
> +*  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
>
>   *  Copyright (c) 2021, NUVIA Inc. All rights reserved.
>
>   *  Copyright (c) 2015, Hisilicon Limited. All rights reserved.
>
>   *  Copyright (c) 2015, Linaro Limited. All rights reserved.
>
> @@ -58,6 +59,7 @@ typedef enum {
>     SkuNumberType03,
>
>     ProcessorPartNumType04,
>
>     ProcessorSerialNumType04,
>
> +  ProcessorVersionType04,
>
>     SmbiosHiiStringFieldMax
>
>   } OEM_MISC_SMBIOS_HII_STRING_FIELD;
>
>   
>
> diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
> index 0b9af9bd7e1c..524b37b10479 100644
> --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
> +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
> @@ -1,6 +1,7 @@
>   /** @file
>
>     ProcessorSubClass.c
>
>   
>
> +  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
>
>     Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
>
>     Copyright (c) 2015, Hisilicon Limited. All rights reserved.
>
>     Copyright (c) 2015, Linaro Limited. All rights reserved.
>
> @@ -512,7 +513,6 @@ AllocateType4AndSetProcessorInformationStrings (
>     PartNumber       = STRING_TOKEN (STR_PROCESSOR_PART_NUMBER);
>
>   
>
>     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 (PcdProcessorAssetTag, AssetTag);
>
>   
>
>     if (StrLen ((CHAR16 *)FixedPcdGetPtr (PcdProcessorSerialNumber)) > 0) {
>
> @@ -527,6 +527,12 @@ AllocateType4AndSetProcessorInformationStrings (
>       OemUpdateSmbiosInfo (mHiiHandle, PartNumber, ProcessorPartNumType04);
>
>     }
>
>   
>
> +  if (StrLen ((CHAR16 *)FixedPcdGetPtr (PcdProcessorVersion)) > 0) {
>
> +    HiiSetString (mHiiHandle, PartNumber, (CHAR16 *)FixedPcdGetPtr (PcdProcessorVersion), NULL);
[SAMI] Should the second parameter be ProcessorVersion?
>
> +  } else {
>
> +    OemUpdateSmbiosInfo (mHiiHandle, ProcessorVersion, ProcessorVersionType04);
>
> +  }
>
> +
>
>     // Processor Designation
>
>     StringBufferSize = sizeof (CHAR16) * SMBIOS_STRING_MAX_LENGTH;
>
>     ProcessorStr     = AllocateZeroPool (StringBufferSize);
>

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

* Re: [PATCH 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call
  2022-08-23 10:59 ` [PATCH 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call Nhi Pham
@ 2022-08-23 16:28   ` Sami Mujawar
  0 siblings, 0 replies; 16+ messages in thread
From: Sami Mujawar @ 2022-08-23 16:28 UTC (permalink / raw)
  To: Nhi Pham, devel, quic_llindhol, ardb+tianocore, quic_rcran
  Cc: patches, Minh Nguyen, nd@arm.com

Hi Nhi,

Thank you for this fix.

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

Regards,

Sami Mujawar

On 23/08/2022 11:59 am, Nhi Pham wrote:
> From: Minh Nguyen <minhn@amperecomputing.com>
>
> According to "SMC Calling Convention" specification, section 7.4,
> return value of Arm Architecture Calls is stored at first argument of
> SMC aguments (ARM_SMC_ARGS). This value can be negative values indicating
> error or positive values (including zero) indicating success. Positive
> value would contain information of respective Function ID (Section 7.3.4
> and 7.4.4).
>
> For that reason, "SMCCC_VERSION" and "SMCCC_ARCH_FEATURES"
> Function ID calls read return value from "SmcCallStatus" variable
> (Args.Arg0 - first argument of SMC call). But "SMCCC_ARCH_SOC_ID"
> Function ID call is reading return value from "SmcParam" variable
> (Args.Arg1 - second argument of SMC call) so it leads to unexpected
> results of "Jep106Code" and "SocRevision". This patch is to correct it.
>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
> ---
>   ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
> index e0010a40e489..b961be213358 100644
> --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
> +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
> @@ -2,7 +2,7 @@
>     Functions for processor information common to ARM and AARCH64.
>
>   
>
>     Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
>
> -  Copyright (c) 2021, Ampere Computing LLC. All rights reserved.<BR>
>
> +  Copyright (c) 2021 - 2022, Ampere Computing LLC. All rights reserved.<BR>
>
>   
>
>     SPDX-License-Identifier: BSD-2-Clause-Patent
>
>   
>
> @@ -131,7 +131,7 @@ SmbiosGetSmcArm64SocId (
>     SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL);
>
>   
>
>     if (SmcCallStatus >= 0) {
>
> -    *Jep106Code = (INT32)SmcParam;
>
> +    *Jep106Code = SmcCallStatus;
>
>     } else {
>
>       Status = EFI_UNSUPPORTED;
>
>     }
>
> @@ -140,7 +140,7 @@ SmbiosGetSmcArm64SocId (
>     SmcCallStatus = ArmCallSmc1 (SMCCC_ARCH_SOC_ID, &SmcParam, NULL, NULL);
>
>   
>
>     if (SmcCallStatus >= 0) {
>
> -    *SocRevision = (INT32)SmcParam;
>
> +    *SocRevision = SmcCallStatus;
>
>     } else {
>
>       Status = EFI_UNSUPPORTED;
>
>     }
>

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

* Re: [PATCH 3/6] ArmPkg/SmbiosMiscDxe: Support fetching System UUID
  2022-08-23 10:59 ` [PATCH 3/6] ArmPkg/SmbiosMiscDxe: Support fetching System UUID Nhi Pham
@ 2022-08-23 16:31   ` Sami Mujawar
  0 siblings, 0 replies; 16+ messages in thread
From: Sami Mujawar @ 2022-08-23 16:31 UTC (permalink / raw)
  To: Nhi Pham, devel, quic_llindhol, ardb+tianocore, quic_rcran
  Cc: patches, nd@arm.com

Hi Nhi,

These change look good to me.

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

Regards,

Sami Mujawar

On 23/08/2022 11:59 am, Nhi Pham wrote:
> This adds an API to OemMiscLib for fetching the system UUID according to
> the platform.
>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
> ---
>   ArmPkg/Include/Library/OemMiscLib.h                                           | 12 ++++++++++++
>   ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c                           | 18 ++++++++++++++++++
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c |  3 ++-
>   3 files changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
> index 330bb4b014de..d87737db9c2b 100644
> --- a/ArmPkg/Include/Library/OemMiscLib.h
> +++ b/ArmPkg/Include/Library/OemMiscLib.h
> @@ -235,4 +235,16 @@ OemGetChassisNumPowerCords (
>     VOID
>
>     );
>
>   
>
> +/**
>
> +  Fetches the system UUID.
>
> +
>
> +  @param[out] SystemUuid     The pointer to the buffer to store the System UUID.
>
> +
>
> +**/
>
> +VOID
>
> +EFIAPI
>
> +OemGetSystemUuid (
>
> +  OUT GUID  *SystemUuid
>
> +  );
>
> +
>
>   #endif // OEM_MISC_LIB_H_
>
> diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
> index 98970407a65e..32f6d55c1a9a 100644
> --- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
> +++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
> @@ -1,6 +1,7 @@
>   /** @file
>
>   *  OemMiscLib.c
>
>   *
>
> +*  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
>
>   *  Copyright (c) 2021, NUVIA Inc. All rights reserved.
>
>   *  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
>
>   *  Copyright (c) 2018, Linaro Limited. All rights reserved.
>
> @@ -10,6 +11,7 @@
>   **/
>
>   
>
>   #include <Uefi.h>
>
> +#include <Guid/ZeroGuid.h>
>
>   #include <Library/BaseMemoryLib.h>
>
>   #include <Library/DebugLib.h>
>
>   #include <Library/HiiLib.h>
>
> @@ -236,3 +238,19 @@ OemGetChassisNumPowerCords (
>     ASSERT (FALSE);
>
>     return 1;
>
>   }
>
> +
>
> +/**
>
> +  Fetches the system UUID.
>
> +
>
> +  @param[out] SystemUuid     The pointer to the buffer to store the System UUID.
>
> +
>
> +**/
>
> +VOID
>
> +EFIAPI
>
> +OemGetSystemUuid (
>
> +  OUT GUID  *SystemUuid
>
> +  )
>
> +{
>
> +  ASSERT (FALSE);
>
> +  CopyGuid (SystemUuid, &gZeroGuid);
>
> +}
>
> diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
> index 5cf72644d0b2..22fb5eccaa63 100644
> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c
> @@ -4,6 +4,7 @@
>   
>
>     Based on files under Nt32Pkg/MiscSubClassPlatformDxe/
>
>   
>
> +  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.<BR>
>
>     Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
>
>     Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
>
>     Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
>
> @@ -160,7 +161,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscSystemManufacturer) {
>   
>
>     SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE1);
>
>   
>
> -  CopyGuid (&SmbiosRecord->Uuid, &InputData->Uuid);
>
> +  OemGetSystemUuid (&SmbiosRecord->Uuid);
>
>   
>
>     OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
>
>     UnicodeStrToAsciiStrS (Manufacturer, OptionalStrStart, ManuStrLen + 1);
>

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

* Re: [PATCH 4/6] ArmPkg/SmbiosMiscDxe: Fix typo of "AssetTagType02"
  2022-08-23 10:59 ` [PATCH 4/6] ArmPkg/SmbiosMiscDxe: Fix typo of "AssetTagType02" Nhi Pham
@ 2022-08-23 16:34   ` Sami Mujawar
  0 siblings, 0 replies; 16+ messages in thread
From: Sami Mujawar @ 2022-08-23 16:34 UTC (permalink / raw)
  To: Nhi Pham, devel, quic_llindhol, ardb+tianocore, quic_rcran
  Cc: patches, Minh Nguyen, nd@arm.com

Hi Nhi,

Thank you for this fix.

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

Regards,

Sami Mujawar

On 23/08/2022 11:59 am, Nhi Pham wrote:
> From: Minh Nguyen <minhn@amperecomputing.com>
>
> This patch fixes typo from "AssertTagType02"
> to "AssetTagType02".
>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
> ---
>   ArmPkg/Include/Library/OemMiscLib.h                                              | 2 +-
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 3 ++-
>   2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
> index d87737db9c2b..1936619d9b5b 100644
> --- a/ArmPkg/Include/Library/OemMiscLib.h
> +++ b/ArmPkg/Include/Library/OemMiscLib.h
> @@ -44,7 +44,7 @@ typedef enum {
>     VersionType01,
>
>     SkuNumberType01,
>
>     FamilyType01,
>
> -  AssertTagType02,
>
> +  AssetTagType02,
>
>     SerialNumberType02,
>
>     BoardManufacturerType02,
>
>     ProductNameType02,
>
> diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
> index 870610b17243..f61546955f12 100644
> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
> @@ -4,6 +4,7 @@
>   
>
>     Based on files under Nt32Pkg/MiscSubClassPlatformDxe/
>
>   
>
> +  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.<BR>
>
>     Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
>
>     Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
>
>     Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
>
> @@ -112,7 +113,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBaseBoardManufacturer) {
>     OemUpdateSmbiosInfo (
>
>       mSmbiosMiscHiiHandle,
>
>       STRING_TOKEN (STR_MISC_BASE_BOARD_ASSET_TAG),
>
> -    AssertTagType02
>
> +    AssetTagType02
>
>       );
>
>     OemUpdateSmbiosInfo (
>
>       mSmbiosMiscHiiHandle,
>

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

* Re: [PATCH 5/6] ArmPkg/SmbiosMiscDxe: Remove redundant updates in SMBIOS Type 2
  2022-08-23 10:59 ` [PATCH 5/6] ArmPkg/SmbiosMiscDxe: Remove redundant updates in SMBIOS Type 2 Nhi Pham
@ 2022-08-23 16:36   ` Sami Mujawar
  0 siblings, 0 replies; 16+ messages in thread
From: Sami Mujawar @ 2022-08-23 16:36 UTC (permalink / raw)
  To: Nhi Pham, devel, quic_llindhol, ardb+tianocore, quic_rcran
  Cc: patches, Minh Nguyen, nd@arm.com

Hi Nhi,

Thank you for this patch.

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

Regards,

Sami Mujawar

On 23/08/2022 11:59 am, Nhi Pham wrote:
> From: Minh Nguyen <minhn@amperecomputing.com>
>
> This patch removes redundant updates of "BoardManufacturerType02"
> and "SerialNumberType02".
>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
> ---
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 10 ----------
>   1 file changed, 10 deletions(-)
>
> diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
> index f61546955f12..3441e7798860 100644
> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c
> @@ -120,16 +120,6 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBaseBoardManufacturer) {
>       STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER),
>
>       SerialNumberType02
>
>       );
>
> -  OemUpdateSmbiosInfo (
>
> -    mSmbiosMiscHiiHandle,
>
> -    STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER),
>
> -    BoardManufacturerType02
>
> -    );
>
> -  OemUpdateSmbiosInfo (
>
> -    mSmbiosMiscHiiHandle,
>
> -    STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER),
>
> -    SerialNumberType02
>
> -    );
>
>     OemUpdateSmbiosInfo (
>
>       mSmbiosMiscHiiHandle,
>
>       STRING_TOKEN (STR_MISC_BASE_BOARD_SKU_NUMBER),
>

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

* Re: [PATCH 6/6] ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib
  2022-08-23 10:59 ` [PATCH 6/6] ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib Nhi Pham
@ 2022-08-23 16:57   ` Sami Mujawar
  0 siblings, 0 replies; 16+ messages in thread
From: Sami Mujawar @ 2022-08-23 16:57 UTC (permalink / raw)
  To: Nhi Pham, devel, quic_llindhol, ardb+tianocore, quic_rcran
  Cc: patches, Minh Nguyen, nd@arm.com

Hi Nhi,

Thank you for this patch.

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

Regards,

Sami Mujawar

On 23/08/2022 11:59 am, Nhi Pham wrote:
> From: Minh Nguyen <minhn@amperecomputing.com>
>
> In some scenarios, the information of Bios Version, Bios Release
> and Embedded Controller Firmware Release are fetched during UEFI
> booting. This patch supports updating those fields dynamically
> when the PCDs are empty.
>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
> ---
>   ArmPkg/Include/Library/OemMiscLib.h                                   | 21 +++++++++++++
>   ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c                   | 28 +++++++++++++++++
>   ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 32 +++++++++++++-------
>   3 files changed, 70 insertions(+), 11 deletions(-)
>
> diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h
> index 1936619d9b5b..541274999e5c 100644
> --- a/ArmPkg/Include/Library/OemMiscLib.h
> +++ b/ArmPkg/Include/Library/OemMiscLib.h
> @@ -37,6 +37,7 @@ typedef struct {
>   } OEM_MISC_PROCESSOR_DATA;
>
>   
>
>   typedef enum {
>
> +  BiosVersionType00,
>
>     ProductNameType01,
>
>     SerialNumType01,
>
>     UuidType01,
>
> @@ -247,4 +248,24 @@ OemGetSystemUuid (
>     OUT GUID  *SystemUuid
>
>     );
>
>   
>
> +/** Fetches the BIOS release.
>
> +
>
> +  @return The BIOS release.
>
> +**/
>
> +UINT16
>
> +EFIAPI
>
> +OemGetBiosRelease (
>
> +  VOID
>
> +  );
>
> +
>
> +/** Fetches the embedded controller firmware release.
>
> +
>
> +  @return The embedded controller firmware release.
>
> +**/
>
> +UINT16
>
> +EFIAPI
>
> +OemGetEmbeddedControllerFirmwareRelease (
>
> +  VOID
>
> +  );
>
> +
>
>   #endif // OEM_MISC_LIB_H_
>
> diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
> index 32f6d55c1a9a..788ccab9e8c1 100644
> --- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
> +++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c
> @@ -254,3 +254,31 @@ OemGetSystemUuid (
>     ASSERT (FALSE);
>
>     CopyGuid (SystemUuid, &gZeroGuid);
>
>   }
>
> +
>
> +/** Fetches the BIOS release.
>
> +
>
> +  @return The BIOS release.
>
> +**/
>
> +UINT16
>
> +EFIAPI
>
> +OemGetBiosRelease (
>
> +  VOID
>
> +  )
>
> +{
>
> +  ASSERT (FALSE);
>
> +  return 0xFFFF;
>
> +}
>
> +
>
> +/** Fetches the embedded controller firmware release.
>
> +
>
> +  @return The embedded controller firmware release.
>
> +**/
>
> +UINT16
>
> +EFIAPI
>
> +OemGetEmbeddedControllerFirmwareRelease (
>
> +  VOID
>
> +  )
>
> +{
>
> +  ASSERT (FALSE);
>
> +  return 0xFFFF;
>
> +}
>
> diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
> index b49c4b754cab..e9106a8a2fec 100644
> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
> @@ -1,5 +1,6 @@
>   /** @file
>
>   
>
> +  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.<BR>
>
>     Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
>
>     Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
>
>     Copyright (c) 2015, Hisilicon Limited. All rights reserved.<BR>
>
> @@ -13,6 +14,7 @@
>   #include <Library/DebugLib.h>
>
>   #include <Library/HiiLib.h>
>
>   #include <Library/MemoryAllocationLib.h>
>
> +#include <Library/OemMiscLib.h>
>
>   #include <Library/PrintLib.h>
>
>   #include <Library/UefiBootServicesTableLib.h>
>
>   
>
> @@ -191,11 +193,11 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
>       TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
>
>       HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
>
>     } else {
>
> -    Version = (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString);
>
> -    if (StrLen (Version) > 0) {
>
> -      TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
>
> -      HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);
>
> -    }
>
> +      OemUpdateSmbiosInfo (
>
> +        mSmbiosMiscHiiHandle,
>
> +        STRING_TOKEN (STR_MISC_BIOS_VERSION),
>
> +        BiosVersionType00
>
> +        );
>
>     }
>
>   
>
>     Char16String = GetBiosReleaseDate ();
>
> @@ -251,13 +253,21 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
>       }
>
>     }
>
>   
>
> -  SmbiosRecord->SystemBiosMajorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) >> 8);
>
> -  SmbiosRecord->SystemBiosMinorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) & 0xFF);
>
> +  if (PcdGet16 (PcdSystemBiosRelease) != 0xFFFF) {
>
> +    SmbiosRecord->SystemBiosMajorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) >> 8);
>
> +    SmbiosRecord->SystemBiosMinorRelease = (UINT8)(PcdGet16 (PcdSystemBiosRelease) & 0xFF);
>
> +  } else {
>
> +    SmbiosRecord->SystemBiosMajorRelease = (UINT8)(OemGetBiosRelease () >> 8);
>
> +    SmbiosRecord->SystemBiosMinorRelease = (UINT8)(OemGetBiosRelease () & 0xFF);
>
> +  }
>
>   
>
> -  SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = (UINT16)
>
> -                                                         (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) >> 8);
>
> -  SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = (UINT16)
>
> -                                                         (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) & 0xFF);
>
> +  if (PcdGet16 (PcdEmbeddedControllerFirmwareRelease) != 0xFFFF) {
>
> +    SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = (UINT16)(PcdGet16 (PcdEmbeddedControllerFirmwareRelease) >> 8);
>
> +    SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = (UINT16)(PcdGet16 (PcdEmbeddedControllerFirmwareRelease) & 0xFF);
>
> +  } else {
>
> +    SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = (UINT16)(OemGetEmbeddedControllerFirmwareRelease () >> 8);
>
> +    SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = (UINT16)(OemGetEmbeddedControllerFirmwareRelease () & 0xFF);
>
> +  }
>
>   
>
>     OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
>
>     UnicodeStrToAsciiStrS (Vendor, OptionalStrStart, VendorStrLen + 1);
>

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

* Re: [PATCH 1/6] ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib
  2022-08-23 16:21   ` Sami Mujawar
@ 2022-08-24 16:10     ` Nhi Pham
  0 siblings, 0 replies; 16+ messages in thread
From: Nhi Pham @ 2022-08-24 16:10 UTC (permalink / raw)
  To: Sami Mujawar, Nhi Pham, devel, quic_llindhol, ardb+tianocore,
	quic_rcran
  Cc: patches, Minh Nguyen, nd@arm.com

Hi Sami,

On 8/23/2022 11:21 PM, Sami Mujawar wrote:
> Hi Nhi,
>
> Thank you for this patch.
>
> Please find my response inline marked [SAMI].
>
> Regards,
>
> Sami Mujawar
>
> On 23/08/2022 11:59 am, Nhi Pham wrote:
>> From: Minh Nguyen <minhn@amperecomputing.com>
>>
>> In some scenarios, the processor version may be updated dynamically
>> from pre-UEFI firmware during booting. But the processor version is
>> fixed with PCD (PcdProcessorVersion), so it can not be updated it
>> dynamically. This patch will support setting that value both
>> statically and dynamically.
>>
>> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
>> ---
>> ArmPkg/Include/Library/OemMiscLib.h | 2 ++
>> ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c | 8 
>> +++++++-
>>   2 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/ArmPkg/Include/Library/OemMiscLib.h 
>> b/ArmPkg/Include/Library/OemMiscLib.h
>> index 47cb30d84a62..330bb4b014de 100644
>> --- a/ArmPkg/Include/Library/OemMiscLib.h
>> +++ b/ArmPkg/Include/Library/OemMiscLib.h
>> @@ -1,5 +1,6 @@
>>   /** @file
>>
>>   *
>>
>> +*  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
>>
>>   *  Copyright (c) 2021, NUVIA Inc. All rights reserved.
>>
>>   *  Copyright (c) 2015, Hisilicon Limited. All rights reserved.
>>
>>   *  Copyright (c) 2015, Linaro Limited. All rights reserved.
>>
>> @@ -58,6 +59,7 @@ typedef enum {
>>     SkuNumberType03,
>>
>>     ProcessorPartNumType04,
>>
>>     ProcessorSerialNumType04,
>>
>> +  ProcessorVersionType04,
>>
>>     SmbiosHiiStringFieldMax
>>
>>   } OEM_MISC_SMBIOS_HII_STRING_FIELD;
>>
>>
>> diff --git 
>> a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c 
>> b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
>> index 0b9af9bd7e1c..524b37b10479 100644
>> --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
>> +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
>> @@ -1,6 +1,7 @@
>>   /** @file
>>
>>     ProcessorSubClass.c
>>
>>
>> +  Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
>>
>>     Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
>>
>>     Copyright (c) 2015, Hisilicon Limited. All rights reserved.
>>
>>     Copyright (c) 2015, Linaro Limited. All rights reserved.
>>
>> @@ -512,7 +513,6 @@ AllocateType4AndSetProcessorInformationStrings (
>>     PartNumber       = STRING_TOKEN (STR_PROCESSOR_PART_NUMBER);
>>
>>
>>     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 (PcdProcessorAssetTag, AssetTag);
>>
>>
>>     if (StrLen ((CHAR16 *)FixedPcdGetPtr (PcdProcessorSerialNumber)) 
>> > 0) {
>>
>> @@ -527,6 +527,12 @@ AllocateType4AndSetProcessorInformationStrings (
>>       OemUpdateSmbiosInfo (mHiiHandle, PartNumber, 
>> ProcessorPartNumType04);
>>
>>     }
>>
>>
>> +  if (StrLen ((CHAR16 *)FixedPcdGetPtr (PcdProcessorVersion)) > 0) {
>>
>> +    HiiSetString (mHiiHandle, PartNumber, (CHAR16 *)FixedPcdGetPtr 
>> (PcdProcessorVersion), NULL);
> [SAMI] Should the second parameter be ProcessorVersion?

Good catch. Will fix it.

Thanks,

Nhi

>>
>> +  } else {
>>
>> +    OemUpdateSmbiosInfo (mHiiHandle, ProcessorVersion, 
>> ProcessorVersionType04);
>>
>> +  }
>>
>> +
>>
>>     // Processor Designation
>>
>>     StringBufferSize = sizeof (CHAR16) * SMBIOS_STRING_MAX_LENGTH;
>>
>>     ProcessorStr     = AllocateZeroPool (StringBufferSize);
>>

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

end of thread, other threads:[~2022-08-24 16:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-23 10:59 [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements Nhi Pham
2022-08-23 10:59 ` [PATCH 1/6] ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib Nhi Pham
2022-08-23 16:21   ` Sami Mujawar
2022-08-24 16:10     ` Nhi Pham
2022-08-23 10:59 ` [PATCH 2/6] ArmPkg: Correct return value of "SMCCC_ARCH_SOC_ID" Function ID call Nhi Pham
2022-08-23 16:28   ` Sami Mujawar
2022-08-23 10:59 ` [PATCH 3/6] ArmPkg/SmbiosMiscDxe: Support fetching System UUID Nhi Pham
2022-08-23 16:31   ` Sami Mujawar
2022-08-23 10:59 ` [PATCH 4/6] ArmPkg/SmbiosMiscDxe: Fix typo of "AssetTagType02" Nhi Pham
2022-08-23 16:34   ` Sami Mujawar
2022-08-23 10:59 ` [PATCH 5/6] ArmPkg/SmbiosMiscDxe: Remove redundant updates in SMBIOS Type 2 Nhi Pham
2022-08-23 16:36   ` Sami Mujawar
2022-08-23 10:59 ` [PATCH 6/6] ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib Nhi Pham
2022-08-23 16:57   ` Sami Mujawar
2022-08-23 14:24 ` [edk2-devel] [PATCH 0/6] ArmPkg/SMBIOS fixes and improvements Rebecca Cran
2022-08-23 15:57 ` PierreGondois

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