From: "Sami Mujawar" <sami.mujawar@arm.com>
To: devel@edk2.groups.io, nhi@os.amperecomputing.com
Cc: patches@amperecomputing.com, Leif Lindholm <leif@nuviainc.com>,
Ard Biesheuvel <ardb+tianocore@kernel.org>,
Rebecca Cran <rebecca@nuviainc.com>, nd <nd@arm.com>
Subject: Re: [edk2-devel] [PATCH 3/3] ArmPkg/ProcessorSubClassDxe: Get serial and part number from OemMiscLib
Date: Wed, 15 Dec 2021 18:47:06 +0000 [thread overview]
Message-ID: <51d23b78-a05a-7c48-4931-f12378e3989b@arm.com> (raw)
In-Reply-To: <20211201041031.31824-4-nhi@os.amperecomputing.com>
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;
next prev parent reply other threads:[~2021-12-15 18:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Sami Mujawar [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51d23b78-a05a-7c48-4931-f12378e3989b@arm.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox