public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif@nuviainc.com>
To: Pete Batard <pete@akeo.ie>
Cc: devel@edk2.groups.io, ard.biesheuvel@arm.com
Subject: Re: [edk2-platforms][PATCH v2 1/1] Platforms/RaspberryPi: Fix BIOS Release Date and System Manufacturer
Date: Mon, 3 Aug 2020 14:40:31 +0100	[thread overview]
Message-ID: <20200803134031.GZ31778@vanye> (raw)
In-Reply-To: <20200803121426.11420-2-pete@akeo.ie>

On Mon, Aug 03, 2020 at 13:14:26 +0100, Pete Batard wrote:
> Per SMBIOS specs, The Type 0 BIOS Release Date is not a free form field but
> must be specified in a US middle-endian format (mm/dd/yyyy), so make sure
> we populate it accordingly by using the recently introduced TimeBaseLib
> macros. This is required for platforms like Windows, that fail to parse the
> date otherwise.
> 
> Also, the system manufacturer should not be set to the same value as the
> board manufacturer for the Type 1 strings, as, on the Raspberry Pi, this is
> not representative of the actual manufacturer of the system, which is the
> Raspberry Pi Foundation always.
> 
> Signed-off-by: Pete Batard <pete@akeo.ie>

Reviewed-by: Leif Lindholm <leif@nuviainc.com>

Pushed as 0f08b94dbdf0.
Thanks!

> ---
>  Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
> index d5fb843d43ce..ff7203585acb 100644
> --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
> +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
> @@ -119,11 +119,12 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = {
>  
>  CHAR8 mBiosVendor[128]  = "EDK2";
>  CHAR8 mBiosVersion[128] = "EDK2-DEV";
> +CHAR8 mBiosDate[12]     = "00/00/0000";
>  
>  CHAR8 *mBIOSInfoType0Strings[] = {
>    mBiosVendor,              // Vendor
>    mBiosVersion,             // Version
> -  __DATE__ " " __TIME__,    // Release Date
> +  mBiosDate,                // Release Date
>    NULL
>  };
>  
> @@ -149,7 +150,7 @@ CHAR8 mSysInfoSerial[sizeof (UINT64) * 2 + 1];
>  CHAR8 mSysInfoSKU[sizeof (UINT64) * 2 + 1];
>  
>  CHAR8 *mSysInfoType1Strings[] = {
> -  mSysInfoManufName,
> +  "Raspberry Pi Foundation",
>    mSysInfoProductName,
>    mSysInfoVersionName,
>    mSysInfoSerial,
> @@ -626,6 +627,9 @@ BIOSInfoUpdateSmbiosType0 (
>    INTN   i;
>    INTN   State = 0;
>    INTN   Value[2];
> +  INTN   Year = TIME_BUILD_YEAR;
> +  INTN   Month = TIME_BUILD_MONTH;
> +  INTN   Day = TIME_BUILD_DAY;
>  
>    // Populate the Firmware major and minor.
>    Status = mFwProtocol->GetFirmwareRevision (&EpochSeconds);
> @@ -648,6 +652,10 @@ BIOSInfoUpdateSmbiosType0 (
>      mBiosVendor, sizeof (mBiosVendor));
>    UnicodeStrToAsciiStrS ((CHAR16*)PcdGetPtr (PcdFirmwareVersionString),
>      mBiosVersion, sizeof (mBiosVersion));
> +  ASSERT (Year >= 0 && Year <= 9999);
> +  ASSERT (Month >= 1 && Month <= 12);
> +  ASSERT (Day >= 1 && Day <= 31);
> +  AsciiSPrint (mBiosDate, sizeof (mBiosDate), "%02d/%02d/%04d", Month, Day, Year);
>  
>    // Look for a "x.y" numeric string anywhere in mBiosVersion and
>    // try to parse it to populate the BIOS major and minor.
> -- 
> 2.21.0.windows.1
> 

      reply	other threads:[~2020-08-03 13:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03 12:14 [edk2-platforms][PATCH v2 0/1] Platforms/RaspberryPi: Fix BIOS Release Date and System Manufacturer Pete Batard
2020-08-03 12:14 ` [edk2-platforms][PATCH v2 1/1] " Pete Batard
2020-08-03 13:40   ` Leif Lindholm [this message]

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=20200803134031.GZ31778@vanye \
    --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