* [edk2-platforms][PATCH v2 0/1] Platforms/RaspberryPi: Fix BIOS Release Date and System Manufacturer @ 2020-08-03 12:14 Pete Batard 2020-08-03 12:14 ` [edk2-platforms][PATCH v2 1/1] " Pete Batard 0 siblings, 1 reply; 3+ messages in thread From: Pete Batard @ 2020-08-03 12:14 UTC (permalink / raw) To: devel; +Cc: ard.biesheuvel, leif Changes from v1: * Use the newly introduced EmbeddedPkg/Include/Library/TimeBaseLib.h macros. Pete Batard (1): Platforms/RaspberryPi: Fix BIOS Release Date and System Manufacturer Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.21.0.windows.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [edk2-platforms][PATCH v2 1/1] Platforms/RaspberryPi: Fix BIOS Release Date and System Manufacturer 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 ` Pete Batard 2020-08-03 13:40 ` Leif Lindholm 0 siblings, 1 reply; 3+ messages in thread From: Pete Batard @ 2020-08-03 12:14 UTC (permalink / raw) To: devel; +Cc: ard.biesheuvel, leif 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> --- 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 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [edk2-platforms][PATCH v2 1/1] Platforms/RaspberryPi: Fix BIOS Release Date and System Manufacturer 2020-08-03 12:14 ` [edk2-platforms][PATCH v2 1/1] " Pete Batard @ 2020-08-03 13:40 ` Leif Lindholm 0 siblings, 0 replies; 3+ messages in thread From: Leif Lindholm @ 2020-08-03 13:40 UTC (permalink / raw) To: Pete Batard; +Cc: devel, ard.biesheuvel 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 > ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-03 13:40 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox