From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web12.11578.1596462037223379141 for ; Mon, 03 Aug 2020 06:40:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=mQ8Vi0X5; spf=pass (domain: nuviainc.com, ip: 209.85.221.68, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f68.google.com with SMTP id r12so34198877wrj.13 for ; Mon, 03 Aug 2020 06:40:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VDhEhrnM8vIHgK4EF8Qc+Q9fKwmsPhByoTqX3b9a4a8=; b=mQ8Vi0X5xklDLe2QPvKRdL4nMPxccJfNmLWUJyeStDaYyefC4fYfJ0O12E53ejAQWZ Xpr8RpbqIvY88/SKNlZ3z2lX5IbeAIp5yy56JFTPN4B7dfa44prAYSXf5p16syxjhQul SPAIXVaLCOS47kfgRY4vPhrLmbe1E/Ulduhn37ylf3hBFR9qLZ2PtyAGkwnoNmwu+zSY X1NdDYQ0A0FF9Ei2y6m7yY11b8Tiu5Q7B8uAoW6Nc41EXmKpiJm8ihEKr1dkuNhEMM1t OFDrFKKHbYR3Wh9RQz2DHS3eZiDceju+rpajYsT75rpuN1fkDDDA29J2ip1+WKF0TGqF vfig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VDhEhrnM8vIHgK4EF8Qc+Q9fKwmsPhByoTqX3b9a4a8=; b=i1+CdusZISeyWmEAMvMoYKicWeKGyrczQzD9MpHYgWUbRLXDmHWDFCZXLOcsYza1/r S1m4u0twpUMOVo2xduku7NW52DFicIk3pnRxgu58mCdxLgQFGA6H9BPLfhK3WZhGzAmY LSVehp4n6IR2cEuAnPh6lexMclLlF3hh81g0DLKX5Xwi/FFp0xI06Zi+UYIkkxb4c9ox bT9zS714uysAhLuLMXC6CbQqq8rSVXMn3obK0zt7Ji/wuE1m/LKWJgQETBWQ9VnY+y+w PJJrZazIY5za58+ljA9TBea/pXFHQQoHhPtiE+HxUvuRQHhSy/C/QMNqzaGg1Y6u4r1X //rA== X-Gm-Message-State: AOAM530dvMF66Q/BnvOTeLsbOUiOm6EUr1YWe7w/2fouIrPJY8TOjeWo 0zEd4auHSXjO4iD3yP7ighFYpA== X-Google-Smtp-Source: ABdhPJzI7pdxGVomcvfgjQaBhlC5NKyDEo3Evj9qT55dV+dfQ8mlhoUWbnB2Awj8ILmHFXgydrjnQQ== X-Received: by 2002:a5d:56c9:: with SMTP id m9mr14950096wrw.311.1596462035752; Mon, 03 Aug 2020 06:40:35 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id o30sm25122460wra.67.2020.08.03.06.40.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 06:40:33 -0700 (PDT) Date: Mon, 3 Aug 2020 14:40:31 +0100 From: "Leif Lindholm" To: Pete Batard 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 Message-ID: <20200803134031.GZ31778@vanye> References: <20200803121426.11420-1-pete@akeo.ie> <20200803121426.11420-2-pete@akeo.ie> MIME-Version: 1.0 In-Reply-To: <20200803121426.11420-2-pete@akeo.ie> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Reviewed-by: Leif Lindholm 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 >