From nobody Mon Apr 29 16:11:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62857+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62857+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1595269018; cv=none; d=zohomail.com; s=zohoarc; b=Om1Uq3V1bLaFgBcGPc9+FB0MtOTAlv9Z5Zk7zl9Pov23DOOqzed792Ek53RflDUDOBruU5g4m+O5zP+9UgbBkURJlf5ygiHqJfSEp/0k9TERW1L+jcQsW9NjoQTetZIQdw72I5DP3JWF8SsWjwIJQj7DojoZSiT9yTLAsSisZyk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595269018; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=fPT4ymtrGklomZuyV12OzlNvhT1PWnsO2CPW7d6mpRc=; b=oKeWvRoN5H+6T2hM2XbMt8rsx+hU/0CKruQM5aAOdODM6eiJLufEIsQBHbFjd2RS9yWTwzo5b+Dam1Vgtr512JYGydlMhMn+dz//VZ8knyfcWTsal6ZzH/2I3yolvjex4AVX6gCAk5W/1khdtU7fDbAFQdrultwYihZtEhW6Tro= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62857+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1595269017933161.99170544571314; Mon, 20 Jul 2020 11:16:57 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id KiWaYY1788612xgcBcyvJNI7; Mon, 20 Jul 2020 11:16:57 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.1504.1595269016756613853 for ; Mon, 20 Jul 2020 11:16:56 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B537B113E; Mon, 20 Jul 2020 11:16:55 -0700 (PDT) X-Received: from U203705.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 750BF3F66F; Mon, 20 Jul 2020 11:16:55 -0700 (PDT) From: "Samer El-Haj-Mahmoud" To: devel@edk2.groups.io Cc: Leif Lindholm , Pete Batard , Andrei Warkentin , Ard Biesheuvel Subject: [edk2-devel] [edk2-platform][PATCH v1 1/7] Platforms/RaspberryPi: Fix NULL AssetTag in SMBIOS Date: Mon, 20 Jul 2020 14:16:40 -0400 Message-Id: <20200720181646.2891-2-Samer.El-Haj-Mahmoud@arm.com> In-Reply-To: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com> References: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,samer.el-haj-mahmoud@arm.com X-Gm-Message-State: fLRkHFfQHAymGWX8r8a403AXx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1595269017; bh=6+KMlUxlpGjVENZGH0ZdQFdGFhFWS46EOsN/R1/Kb2w=; h=Cc:Date:From:Reply-To:Subject:To; b=NlGfsWxbofKxjPa/iL9y4iWENK8QOZGNhIi7GEE+ETflnXTjP6rb2yQIrv614mRYdBd ruD/xtR3F0tsecAjC4FNJK1CBpwi3ykw+nTlhH7TH/7inYrKiH9J4rsCj9TRI33k1OUhj BgMDpQc+ETCglBFWHrT+2iYH6XbGtK3+GjU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Commit 6d4fed696d004a6aeb795369aa38d4ce1d39f308 added support for reporting AssetTag in RPi SMBIOS Types 2 and 3. The default AssetTag is an empty string. SMBIOS does not allow empty strings to be referenced from the corresponding string field. This caused breakage in parsing SMBIOS Types 2 and 3 fields that follow the AssetTag field. The issue caused an FWTS test failure, as reported in: https://github.com/pftf/RPi4/issues/75 The fix is to detect if no AssetTag is set in the UEFI variable, and if so, change the AssetTag SMBIOS field to an empty blank space. Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Signed-off-by: Samer El-Haj-Mahmoud Reviewed-by: Andrei Warkentin --- Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 8 +++= ++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c index d5fb843d43ce..6eef66f125f8 100644 --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c @@ -793,7 +793,13 @@ BoardInfoUpdateSmbiosType2 ( if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "Failed to get Asset Tag: %r\n", Status)); } - UnicodeStrToAsciiStrS(AssetTagVar, mChassisAssetTag, sizeof(mChassisAsse= tTag)); + + if (AssetTagVar[0] =3D=3D L'\0') { + // SMBIOS referenced strings cannot be NULL. If no AssetTag is set, de= fault to a blank space. + UnicodeStrToAsciiStrS(L" ", mChassisAssetTag, sizeof(mChassisAssetTag)= ); + } else { + UnicodeStrToAsciiStrS(AssetTagVar, mChassisAssetTag, sizeof(mChassisAs= setTag)); + } DEBUG ((DEBUG_INFO, "System Asset Tag : %a\n", mChassisAssetTag)); =20 LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mBoardInfoType2, mBoardInfoTyp= e2Strings, NULL); --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62857): https://edk2.groups.io/g/devel/message/62857 Mute This Topic: https://groups.io/mt/75687844/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon Apr 29 16:11:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62858+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62858+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1595269019; cv=none; d=zohomail.com; s=zohoarc; b=P07+fLjcW/7BmYD6ZbnjL2WcX2S8kpKWIMq/QaQe2T05bFA/Ca1OcaONs7kXFNb+M5JxVKLCmgNxpMQ73tRtTHZ57GdnGQdti0MDWfQpihuWMPHwue9kcI7yFtKd9zbgk+pB4s9QCd2Ph7gQe7QBcX9R+0pmwCaRGFCKhMelR3w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595269019; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=G3aEe8vnDSvaqd4BrPfI/eekkBRYYO1dfprwjV1XM30=; b=VktMb4TnvJj92Aotoamlvrro/VoZiqMi9H6qazVhnInnoLmhyzBb4TP3LlA4TvTVBDHSP0aTg8789naMwy9r0TqJJu2Yb0WV3qTo7K8gawapyTDpPmD4EUAtoXm8XMY+hpkpa4IRFcF8XhDGDSbzinznhOEanV62cEGHoyRU8p4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62858+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1595269019521313.9828982936234; Mon, 20 Jul 2020 11:16:59 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id DjTxYY1788612xqA6ziZ6IBH; Mon, 20 Jul 2020 11:16:59 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.1521.1595269016991604188 for ; Mon, 20 Jul 2020 11:16:57 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0E48912FC; Mon, 20 Jul 2020 11:16:56 -0700 (PDT) X-Received: from U203705.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C52D63F66F; Mon, 20 Jul 2020 11:16:55 -0700 (PDT) From: "Samer El-Haj-Mahmoud" To: devel@edk2.groups.io Cc: Leif Lindholm , Pete Batard , Andrei Warkentin , Ard Biesheuvel Subject: [edk2-devel] [edk2-platform][PATCH v1 2/7] Platforms/RaspberryPi: SMBIOS Type 2 and Type 3 fixes Date: Mon, 20 Jul 2020 14:16:41 -0400 Message-Id: <20200720181646.2891-3-Samer.El-Haj-Mahmoud@arm.com> In-Reply-To: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com> References: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,samer.el-haj-mahmoud@arm.com X-Gm-Message-State: d77cGyKW1xxaj36hw8uAkFOox1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1595269019; bh=Iq8gH3wBL/LlhaiMQCISxdKX5PPFLvgGc+V/pt+WkTE=; h=Cc:Date:From:Reply-To:Subject:To; b=QK7ClOoKsUVIcE3zvdZ4NMeLpQ1JvPeoPXoaZVfapS/NmXwFWX0JJjAnP1Sw50xZYOm GUQI8XAgxO0NcGbozdGHsAQrJrBz+LZvHxpUhmR1Nvpco4aHC2L0y8HkEuVG5ynTw7OI5 nsSDwgy+ubAjnKy4P3mn6mOR0FAjd+1RcPk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Various fixes for SMBIOS Types 2 and 3: - Add LocationInChassis string to Type 2 - Update Type 3 NumberofPowerCords to 1 - Add ChassisHandle refernce to Type2. This requires moving the Type 3 population to happen before Type 2 Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Signed-off-by: Samer El-Haj-Mahmoud Reviewed-by: Andrei Warkentin --- Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 41 ++= ++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c index 6eef66f125f8..170f1843f90b 100644 --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c @@ -176,7 +176,7 @@ SMBIOS_TABLE_TYPE2 mBoardInfoType2 =3D { 0, // HotSwappable :1; 0, // Reserved :3; }, - 0, // LocationInChassis String + 6, // LocationInChassis String 0, // ChassisHandle; BaseBoardTypeMotherBoard, // BoardType; 0, // NumberOfContainedObjectHandles; @@ -191,6 +191,7 @@ CHAR8 *mBoardInfoType2Strings[] =3D { mSysInfoVersionName, mSysInfoSerial, mChassisAssetTag, + "Internal", NULL }; =20 @@ -210,7 +211,7 @@ SMBIOS_TABLE_TYPE3 mEnclosureInfoType3 =3D { ChassisSecurityStatusNone,// SecurityStatus; { 0, 0, 0, 0 }, // OemDefined[4]; 0, // Height; - 0, // NumberofPowerCords; + 1, // NumberofPowerCords; 0, // ContainedElementCount; 0, // ContainedElementRecordLength; { { 0 } }, // ContainedElements[1]; @@ -782,9 +783,22 @@ BoardInfoUpdateSmbiosType2 ( VOID ) { - UINTN Size; - CHAR16 AssetTagVar[ASSET_TAG_STR_STORAGE_SIZE] =3D L""; - EFI_STATUS Status; + + LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mBoardInfoType2, mBoardInfoTyp= e2Strings, NULL); +} + +/*********************************************************************** + SMBIOS data update TYPE3 Enclosure Information +************************************************************************/ +VOID +EnclosureInfoUpdateSmbiosType3 ( + VOID + ) +{ + UINTN Size; + EFI_STATUS Status; + EFI_SMBIOS_HANDLE SmbiosHandle; + CHAR16 AssetTagVar[ASSET_TAG_STR_STORAGE_SIZE] =3D L""; =20 Size =3D sizeof(AssetTagVar); Status =3D gRT->GetVariable(L"AssetTag", @@ -802,18 +816,10 @@ BoardInfoUpdateSmbiosType2 ( } DEBUG ((DEBUG_INFO, "System Asset Tag : %a\n", mChassisAssetTag)); =20 - LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mBoardInfoType2, mBoardInfoTyp= e2Strings, NULL); -} + LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mEnclosureInfoType3, mEnclosur= eInfoType3Strings, &SmbiosHandle); =20 -/*********************************************************************** - SMBIOS data update TYPE3 Enclosure Information -************************************************************************/ -VOID -EnclosureInfoUpdateSmbiosType3 ( - VOID - ) -{ - LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mEnclosureInfoType3, mEnclosur= eInfoType3Strings, NULL); + // Set Type2 ChassisHandle to point to the newly added Type3 handle + mBoardInfoType2.ChassisHandle =3D (UINT16) SmbiosHandle; } =20 /*********************************************************************** @@ -982,9 +988,10 @@ PlatformSmbiosDriverEntryPoint ( =20 SysInfoUpdateSmbiosType1 (); =20 + EnclosureInfoUpdateSmbiosType3 (); // Add Type 3 first to get chassis ha= ndle for use in Type 2 + BoardInfoUpdateSmbiosType2 (); =20 - EnclosureInfoUpdateSmbiosType3 (); =20 ProcessorInfoUpdateSmbiosType4 (4); //One example for creating and upd= ating =20 --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62858): https://edk2.groups.io/g/devel/message/62858 Mute This Topic: https://groups.io/mt/75687845/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon Apr 29 16:11:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62856+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62856+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1595269019; cv=none; d=zohomail.com; s=zohoarc; b=mRXX/dxoQPsi/d2pjCgE/MSLiYupssal7euz4Kt5XVspV/otTa5jACovL0la7i7NoG0o1Kr8Wbu0iwXtHsYCwv90xmZuVYQC1ffquno3dT64XM1bNM/mjstRECiEMavusfXcrYRBwKRzGL3LL17SRDX1ASlrA/rLFDUWaUpjT+Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595269019; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=s5YZysMzH21ytF1YM7a1VN5lqdw8nUcm8WkcnpCeAUo=; b=HGlLbMrUF0hO7KWQJ8w2OD6BkM8J9p0vPlgZecLPEydXnEjUcVTqSuoXLcWksspDps1afqqn5crrsOp4e0kVML1oiFlRy5b1r/f/fpHXfTjieYTgsfMOxa+pSuiqXw3mxHOVCURbRj78JWMRXe0YoQlbdEOIhRcgKd0CtyfwogQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62856+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1595269019918163.68480218233674; Mon, 20 Jul 2020 11:16:59 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id MnBSYY1788612xWcHRWjEf5y; Mon, 20 Jul 2020 11:16:59 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.1520.1595269016690378724 for ; Mon, 20 Jul 2020 11:16:56 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 644BA142F; Mon, 20 Jul 2020 11:16:56 -0700 (PDT) X-Received: from U203705.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1E2EC3F66F; Mon, 20 Jul 2020 11:16:56 -0700 (PDT) From: "Samer El-Haj-Mahmoud" To: devel@edk2.groups.io Cc: Leif Lindholm , Pete Batard , Andrei Warkentin , Ard Biesheuvel Subject: [edk2-devel] [edk2-platform][PATCH v1 3/7] Platforms/RaspberryPi: SMBIOS Type 0 fixes Date: Mon, 20 Jul 2020 14:16:42 -0400 Message-Id: <20200720181646.2891-4-Samer.El-Haj-Mahmoud@arm.com> In-Reply-To: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com> References: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,samer.el-haj-mahmoud@arm.com X-Gm-Message-State: u8WENac6oLNHNlYJC0VoBGwgx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1595269019; bh=0p9j4ucYKARB9c21cnAUtuhz5B0HUBe3LV7oYWrDDRY=; h=Cc:Date:From:Reply-To:Subject:To; b=i4jypl0rSXgDV6l2T1gvQzyXDPtKMfp8cKjx0Bq/qUfKg5cOml4b8cwTXj+HeChAlJI /qPUMLn7tzml3BtLupV+dJWBRCmDZ492mNnXvq/WE3c5EYCNy0KeF6UNvkrRSrIBRfJrH 9s2s1zpVc86djOKokKNsVWaHhbH5OqYGp8w= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Various fixes and enhancements for SMBIOS Type 0: - Use PCDs to report the BIOS Segment and Size - Report Extended BiosSize - Set BiosIsUpgradable (it is!) - Clear FunctionKeyNetworkBootIsSupported Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Signed-off-by: Samer El-Haj-Mahmoud Reviewed-by: Andrei Warkentin --- Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf | 6 = +++++- Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 17 = +++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.inf b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.i= nf index 59b2fefdf0fd..817b902b1fad 100644 --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf @@ -1,10 +1,11 @@ #/** @file # -# SMBIOS Table for ARM platform +# SMBIOS Table for the RaspberryPi platform # # Copyright (c) 2017, Andrei Warkentin # Copyright (c) Microsoft Corporation. All rights reserved. # Copyright (c) 2013 Linaro.org +# Copyright (c) 2020, ARM Limited. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -51,8 +52,11 @@ [Depex] gEfiSmbiosProtocolGuid AND gRaspberryPiFirmwareProtocolGuid =20 [Pcd] + gArmTokenSpaceGuid.PcdFdBaseAddress + gArmTokenSpaceGuid.PcdFdSize gArmTokenSpaceGuid.PcdSystemMemorySize gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString + gRaspberryPiTokenSpaceGuid.PcdFdtSize gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c index 170f1843f90b..21feab3e47a5 100644 --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c @@ -54,11 +54,11 @@ STATIC RASPBERRY_PI_FIRMWARE_PROTOCOL *mFwProtocol; ************************************************************************/ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 =3D { { EFI_SMBIOS_TYPE_BIOS_INFORMATION, sizeof (SMBIOS_TABLE_TYPE0), 0 }, - 1, // Vendor String - 2, // BiosVersion String - 0x0, // BiosSegment - 3, // BiosReleaseDate String - 0x1F, // BiosSize + 1, // Vendor String + 2, // BiosVersion St= ring + (UINT16) (FixedPcdGet32 (PcdFdBaseAddress) / 0x10000), // BiosSegment + 3, // BiosReleaseDat= e String + (UINT8) (FixedPcdGet32 (PcdFdSize) / 0x10000), // BiosSize (in 6= 4KB) { // BiosCharacteristics 0, // Reserved :2; ///< Bits 0-1. 0, // Unknown :1; @@ -66,11 +66,11 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 =3D { 0, // IsaIsSupported :1; 0, // McaIsSupported :1; 0, // EisaIsSupported :1; - 0, // PciIsSupported :1; + 0, // PciIsSupported :1; /// No PCIe support si= nce we hide ECAM from the OS 0, // PcmciaIsSupported :1; 0, // PlugAndPlayIsSupported :1; 0, // ApmIsSupported :1; - 0, // BiosIsUpgradable :1; + 1, // BiosIsUpgradable :1; 0, // BiosShadowingAllowed :1; 0, // VlVesaIsSupported :1; 0, // EscdSupportIsAvailable :1; @@ -104,7 +104,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 =3D { // Boot1394IsSupported :1; // SmartBatteryIsSupported :1; // BIOSCharacteristicsExtensionBytes[1] - 0x0e, // BiosBootSpecIsSupported :1; + 0x0c, // BiosBootSpecIsSupported :1; // FunctionKeyNetworkBootIsSupported :1; // TargetContentDistributionEnabled :1; // UefiSpecificationSupported :1; @@ -115,6 +115,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 =3D { 0, // SystemBiosMinorRelease 0, // EmbeddedControllerFirmwareMajorRelease 0, // EmbeddedControllerFirmwareMinorRelease + { (UINT16) ((FixedPcdGet32 (PcdFdSize) + FixedPcdGet32 (PcdFdtSize)) / 0= x100000) }, // BiosSize (in MB since Bits 15:14 =3D 00b) }; =20 CHAR8 mBiosVendor[128] =3D "EDK2"; --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62856): https://edk2.groups.io/g/devel/message/62856 Mute This Topic: https://groups.io/mt/75687843/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon Apr 29 16:11:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62859+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62859+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1595269018; cv=none; d=zohomail.com; s=zohoarc; b=krbXXs2Rk/s+Lpb3iZlUjwJ6i4D/8/P/vjQkyGVJEaO66u5s8KZNfkvMAEZXXp1Heebce5JsPDh+kZ7+p3KdwFjea6Mx7+AiyFfrUb8pMXCEEpeKRuzkAeBSCF/f1ViNL9L+ewdJWnGge4lgcLNRmd44XjPawyJ3jNqrzK7AS6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595269018; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=L/Gj4A5Ai89r625Urv54nzo6emc6XgTTVlXvucl9glE=; b=QyG/+7JO23Go701G56vYSLkDKatnJCrRNFbNVX0GzUO4IgOSgsrZXNbeJYYJ4av6qEeQjtlUxIjLaW0ucR84ykiLku3g3fWrGa2QYvpzvNn3Hspt5omHxNRk/vnWk6ow1Msc1wmGsQX7qXsH0W5VUrS9m6NAHbIECZ+7+Fuqjlk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62859+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1595269018572188.6875718326155; Mon, 20 Jul 2020 11:16:58 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 0WC4YY1788612xZ9sS3SKYhP; Mon, 20 Jul 2020 11:16:58 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.1522.1595269017051079711 for ; Mon, 20 Jul 2020 11:16:57 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B19CD14BF; Mon, 20 Jul 2020 11:16:56 -0700 (PDT) X-Received: from U203705.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 742E83F66F; Mon, 20 Jul 2020 11:16:56 -0700 (PDT) From: "Samer El-Haj-Mahmoud" To: devel@edk2.groups.io Cc: Leif Lindholm , Pete Batard , Andrei Warkentin , Ard Biesheuvel Subject: [edk2-devel] [edk2-platform][PATCH v1 4/7] Platforms/RaspberryPi: SMBIOS Type 4 fixes Date: Mon, 20 Jul 2020 14:16:43 -0400 Message-Id: <20200720181646.2891-5-Samer.El-Haj-Mahmoud@arm.com> In-Reply-To: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com> References: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,samer.el-haj-mahmoud@arm.com X-Gm-Message-State: ngraTKVTSULob25mqT69RCRnx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1595269018; bh=N+44i5M1YR9lFTOV3KI2qFT/F2dJA40IPomnZfBh0EY=; h=Cc:Date:From:Reply-To:Subject:To; b=THerCK2JMvtrPsJlpTyYTMix7TajIb1lsgGCqGUV8zo5FK70YGjp4l1ZABAFz4x9CT7 GzzIJ0kP0BmbQJqDOWMkAW+gpJKQYnyMpKp9/MgPlZWs95kLh/W2YCkWmnVf0+2NRFgBy d7qH5z9MJXCyhJT7pBKe9MhboKz4sxbigNg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Various fixes and enhancements for SMBIOS Type 4: - Fix ProcessorId to correctly report the Arm64 MIDR_EL1 value - Change ProcessorUpgrade from Other to None - Add comments for ProcessorCharacteristics fields - Add CoreCount2, EnabledCoreCount2, and ThreadCount2 - Set LxCacheHandle to 0xFFFF Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Signed-off-by: Samer El-Haj-Mahmoud Reviewed-by: Andrei Warkentin --- Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf | 1 + Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 87 = ++++++++------------ 2 files changed, 34 insertions(+), 54 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.inf b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.i= nf index 817b902b1fad..2b24b22c25fc 100644 --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf @@ -31,6 +31,7 @@ [Packages] EmbeddedPkg/EmbeddedPkg.dec =20 [LibraryClasses] + ArmLib UefiBootServicesTableLib MemoryAllocationLib BaseMemoryLib diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c index 21feab3e47a5..4dcdec5615dc 100644 --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -230,55 +231,13 @@ CHAR8 *mEnclosureInfoType3Strings[] =3D { ************************************************************************/ SMBIOS_TABLE_TYPE4 mProcessorInfoType4 =3D { { EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE4), 0}, - 1, // Socket String - CentralProcessor, // ProcessorType; = ///< The enumeration value from PROCESSOR_TYPE_DATA. + 1, // Socket String + CentralProcessor, // ProcessorType; ///< The enu= meration value from PROCESSOR_TYPE_DATA. ProcessorFamilyIndicatorFamily2, // ProcessorFamily; ///< The enu= meration value from PROCESSOR_FAMILY2_DATA. - 2, // ProcessorManufacture String; - { // ProcessorId; - { // PROCESSOR_SIGNATURE - 0, // ProcessorSteppingId:4; - 0, // ProcessorModel: 4; - 0, // ProcessorFamily: 4; - 0, // ProcessorType: 2; - 0, // ProcessorReserved1: 2; - 0, // ProcessorXModel: 4; - 0, // ProcessorXFamily: 8; - 0, // ProcessorReserved2: 4; - }, - - { // PROCESSOR_FEATURE_FLAGS - 0, // ProcessorFpu :1; - 0, // ProcessorVme :1; - 0, // ProcessorDe :1; - 0, // ProcessorPse :1; - 0, // ProcessorTsc :1; - 0, // ProcessorMsr :1; - 0, // ProcessorPae :1; - 0, // ProcessorMce :1; - 0, // ProcessorCx8 :1; - 0, // ProcessorApic :1; - 0, // ProcessorReserved1 :1; - 0, // ProcessorSep :1; - 0, // ProcessorMtrr :1; - 0, // ProcessorPge :1; - 0, // ProcessorMca :1; - 0, // ProcessorCmov :1; - 0, // ProcessorPat :1; - 0, // ProcessorPse36 :1; - 0, // ProcessorPsn :1; - 0, // ProcessorClfsh :1; - 0, // ProcessorReserved2 :1; - 0, // ProcessorDs :1; - 0, // ProcessorAcpi :1; - 0, // ProcessorMmx :1; - 0, // ProcessorFxsr :1; - 0, // ProcessorSse :1; - 0, // ProcessorSse2 :1; - 0, // ProcessorSs :1; - 0, // ProcessorReserved3 :1; - 0, // ProcessorTm :1; - 0, // ProcessorReserved4 :2; - } + 2, // ProcessorManufacture String; + { // ProcessorId; + { 0x00, 0x00, 0x00, 0x00 }, + { 0x00, 0x00, 0x00, 0x00 } }, 3, // ProcessorVersion String; { // Voltage; @@ -293,18 +252,31 @@ SMBIOS_TABLE_TYPE4 mProcessorInfoType4 =3D { 0, // MaxSpeed; 0, // CurrentSpeed; 0x41, // Status; - ProcessorUpgradeOther, // ProcessorUpgrade; ///< The enumeration v= alue from PROCESSOR_UPGRADE. - 0, // L1CacheHandle; - 0, // L2CacheHandle; - 0, // L3CacheHandle; + ProcessorUpgradeNone, // ProcessorUpgrade; ///< The enumeratio= n value from PROCESSOR_UPGRADE. + 0xFFFF, // L1CacheHandle; + 0xFFFF, // L2CacheHandle; + 0xFFFF, // L3CacheHandle; 0, // SerialNumber; 0, // AssetTag; 0, // PartNumber; 4, // CoreCount; 4, // EnabledCoreCount; 4, // ThreadCount; - 0x6C, // ProcessorCharacteristics; + 0x6C, // ProcessorCharacteristics; ///< The enumeratio= n value from PROCESSOR_CHARACTERISTIC_FLAGS + // ProcessorReserved1 :1; + // ProcessorUnknown :1; + // Processor64BitCapble :1; + // ProcessorMultiCore :1; + // ProcessorHardwareThread :1; + // ProcessorExecuteProtection :1; + // ProcessorEnhancedVirtualization :1; + // ProcessorPowerPerformanceCtrl :1; + // Processor128bitCapble :1; + // ProcessorReserved2 :7; ProcessorFamilyARM, // ARM Processor Family; + 0, // CoreCount2; + 0, // EnabledCoreCount2; + 0, // ThreadCount2; }; =20 CHAR8 mCpuName[128] =3D "Unknown ARM CPU"; @@ -832,11 +804,15 @@ ProcessorInfoUpdateSmbiosType4 ( ) { EFI_STATUS Status; - UINT32 Rate; + UINT32 Rate; + UINT64 *ProcessorId; =20 mProcessorInfoType4.CoreCount =3D (UINT8)MaxCpus; + mProcessorInfoType4.CoreCount2 =3D (UINT8)MaxCpus; mProcessorInfoType4.EnabledCoreCount =3D (UINT8)MaxCpus; + mProcessorInfoType4.EnabledCoreCount2 =3D (UINT8)MaxCpus; mProcessorInfoType4.ThreadCount =3D (UINT8)MaxCpus; + mProcessorInfoType4.ThreadCount2 =3D (UINT8)MaxCpus; =20 Status =3D mFwProtocol->GetMaxClockRate (RPI_MBOX_CLOCK_RATE_ARM, &Rate); if (Status !=3D EFI_SUCCESS) { @@ -856,6 +832,9 @@ ProcessorInfoUpdateSmbiosType4 ( =20 AsciiStrCpyS (mCpuName, sizeof (mCpuName), mFwProtocol->GetCpuName (-1)); =20 + ProcessorId =3D (UINT64 *)&(mProcessorInfoType4.ProcessorId); + *ProcessorId =3D ArmReadMidr(); + LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mProcessorInfoType4, mProcesso= rInfoType4Strings, NULL); } =20 --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62859): https://edk2.groups.io/g/devel/message/62859 Mute This Topic: https://groups.io/mt/75687846/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon Apr 29 16:11:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62860+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62860+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1595269020; cv=none; d=zohomail.com; s=zohoarc; b=SbuBMaeOsdqK9d6JgV0ucbLKqHhRRPaJRfZYL4fZ/vt1MAdxY1YOD9xWdyaUFu16SaKiOj7qDTP2QzRVkTRVzjN1ke0ICq+oZZak4PZ6h+M6IGip8xeU19Z24oJLaQNV7fge2RqO+GRsz+xWH7kqvdSJOYdUNh4G9wZzES+btqk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595269020; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=UUZEYpQap1CPyFHIl8YlTp8LnrBG/v/jetQjXFqUZYI=; b=PwxxF41FoSLEJCXuVZP75UAtm7uUA3ElV35vzfoyw9TONeQbO2DJDQzwNjdNy5zpW0QFUUM6bChYvCaXsDZWQgUBUDx//R5pyRq4Xpz2ENJa4BwkQ3JVFlmZorVkhdXq0SBRjBqyTY/G7n9BV6vtoHl1AtgSbzRv5rfzCi933Fs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62860+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1595269020772251.55271004594374; Mon, 20 Jul 2020 11:17:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id V3tmYY1788612xFBjQ4b4q9l; Mon, 20 Jul 2020 11:17:00 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.1505.1595269017479440490 for ; Mon, 20 Jul 2020 11:16:57 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0C0851500; Mon, 20 Jul 2020 11:16:57 -0700 (PDT) X-Received: from U203705.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C244C3F66F; Mon, 20 Jul 2020 11:16:56 -0700 (PDT) From: "Samer El-Haj-Mahmoud" To: devel@edk2.groups.io Cc: Leif Lindholm , Pete Batard , Andrei Warkentin , Ard Biesheuvel Subject: [edk2-devel] [edk2-platform][PATCH v1 5/7] Platforms/RaspberryPi: SMBIOS Type 7 fixes Date: Mon, 20 Jul 2020 14:16:44 -0400 Message-Id: <20200720181646.2891-6-Samer.El-Haj-Mahmoud@arm.com> In-Reply-To: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com> References: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,samer.el-haj-mahmoud@arm.com X-Gm-Message-State: uKNBgevkXFoTv4JO5qxViXhux1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1595269020; bh=zPMFvZXWFKkHzvkdCbaVzWMXEKq2zEwcQYhYjTyGGQE=; h=Cc:Date:From:Reply-To:Subject:To; b=lq1WaeDrFBoodYhVAVa03fpCSMgqaMnoMKa3cREAgASpUki97lWZWI4VqdrmtSfIxQD AD/HvKBNVaVXcEBxwNinSrj8Ta9uIWlJYqA0nT4c8A06k1kmy6ruierV26vSQAJinvwYa 580i/y6ixzJm8kQCm8VWvWh0HF6MOKJljO8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Various fixes and enhancements for SMBIOS Type 7: - Break into 3 instances (L1 Instruction, L1 Data, and L2 cache) - Use correct values for RPi4 and RPi3 SoCs - Add Type 4 association with type 7 handles Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Signed-off-by: Samer El-Haj-Mahmoud Reviewed-by: Andrei Warkentin --- Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 146 += +++++++++++++++++-- 1 file changed, 133 insertions(+), 13 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c index 4dcdec5615dc..4ee8ae6ebfc9 100644 --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c @@ -291,12 +291,24 @@ CHAR8 *mProcessorInfoType4Strings[] =3D { /*********************************************************************** SMBIOS data definition TYPE7 Cache Information ************************************************************************/ -SMBIOS_TABLE_TYPE7 mCacheInfoType7 =3D { +SMBIOS_TABLE_TYPE7 mCacheInfoType7_L1I =3D { { EFI_SMBIOS_TYPE_CACHE_INFORMATION, sizeof (SMBIOS_TABLE_TYPE7), 0 }, 1, // SocketDesignation String - 0x018A, // Cache Configuration - 0x00FF, // Maximum Size 256k - 0x00FF, // Install Size 256k + 0x380, // Cache Configuration + //Cache Level :3 (L1) + //Cache Socketed :1 (Not Socketed) + //Reserved :1 + //Location :2 (Internal) + //Enabled/Disabled :1 (Enabled) + //Operational Mode :2 (Unknown) + //Reserved :6 +#if (RPI_MODEL =3D=3D 4) + 0x0030, // Maximum Size (RPi4: 48KB) + 0x0030, // Install Size (RPi4: 48KB) +#else + 0x0010, // Maximum Size (RPi3: 16KB) + 0x0010, // Install Size (RPi3: 16KB) +#endif { // Supported SRAM Type 0, //Other :1 0, //Unknown :1 @@ -317,16 +329,115 @@ SMBIOS_TABLE_TYPE7 mCacheInfoType7 =3D { 0, //Asynchronous :1 0 //Reserved :9 }, - 0, // Cache Speed unknown - CacheErrorMultiBit, // Error Correction Multi - CacheTypeUnknown, // System Cache Type - CacheAssociativity2Way // Associativity + 0, // Cache Speed unknown + CacheErrorParity, // Error Correction + CacheTypeInstruction, // System Cache Type + CacheAssociativity2Way // Associativity (RPi4 L1 Instruction cache i= s 3-way set associative, but SMBIOS spec does not define that) }; -CHAR8 *mCacheInfoType7Strings[] =3D { - "Cache1", +CHAR8 *mCacheInfoType7Strings_L1I[] =3D { + "L1 Instruction", NULL }; =20 +SMBIOS_TABLE_TYPE7 mCacheInfoType7_L1D =3D { + { EFI_SMBIOS_TYPE_CACHE_INFORMATION, sizeof (SMBIOS_TABLE_TYPE7), 0 }, + 1, // SocketDesignation String + 0x180, // Cache Configuration + //Cache Level :3 (L1) + //Cache Socketed :1 (Not Socketed) + //Reserved :1 + //Location :2 (Internal) + //Enabled/Disabled :1 (Enabled) + //Operational Mode :2 (WB) + //Reserved :6 +#if (RPI_MODEL =3D=3D 4) + 0x0020, // Maximum Size (RPi4: 32KB) + 0x0020, // Install Size (RPi4: 32KB) +#else + 0x0010, // Maximum Size (RPi3: 16KB) + 0x0010, // Install Size (RPi3: 16KB) +#endif + { // Supported SRAM Type + 0, //Other :1 + 0, //Unknown :1 + 0, //NonBurst :1 + 1, //Burst :1 + 0, //PiplelineBurst :1 + 1, //Synchronous :1 + 0, //Asynchronous :1 + 0 //Reserved :9 + }, + { // Current SRAM Type + 0, //Other :1 + 0, //Unknown :1 + 0, //NonBurst :1 + 1, //Burst :1 + 0, //PiplelineBurst :1 + 1, //Synchronous :1 + 0, //Asynchronous :1 + 0 //Reserved :9 + }, + 0, // Cache Speed unknown + CacheErrorSingleBit, // Error Correction + CacheTypeData, // System Cache Type +#if (RPI_MODEL =3D=3D 4) + CacheAssociativity2Way // Associativity +#else + CacheAssociativity4Way // Associativity +#endif +}; +CHAR8 *mCacheInfoType7Strings_L1D[] =3D { + "L1 Data", + NULL +}; + +SMBIOS_TABLE_TYPE7 mCacheInfoType7_L2 =3D { + { EFI_SMBIOS_TYPE_CACHE_INFORMATION, sizeof (SMBIOS_TABLE_TYPE7), 0 }, + 1, // SocketDesignation String + 0x0181, // Cache Configuration + //Cache Level :3 (L2) + //Cache Socketed :1 (Not Socketed) + //Reserved :1 + //Location :2 (Internal) + //Enabled/Disabled :1 (Enabled) + //Operational Mode :2 (WB) + //Reserved :6 +#if (RPI_MODEL =3D=3D 4) + 0x0400, // Maximum Size (RPi4: 1MB) + 0x0400, // Install Size (RPi4: 1MB) +#else + 0x0200, // Maximum Size (RPi3: 512KB) + 0x0200, // Install Size (RPi3: 512KB) +#endif + { // Supported SRAM Type + 0, //Other :1 + 0, //Unknown :1 + 0, //NonBurst :1 + 1, //Burst :1 + 0, //PiplelineBurst :1 + 1, //Synchronous :1 + 0, //Asynchronous :1 + 0 //Reserved :9 + }, + { // Current SRAM Type + 0, //Other :1 + 0, //Unknown :1 + 0, //NonBurst :1 + 1, //Burst :1 + 0, //PiplelineBurst :1 + 1, //Synchronous :1 + 0, //Asynchronous :1 + 0 //Reserved :9 + }, + 0, // Cache Speed unknown + CacheErrorSingleBit, // Error Correction Multi + CacheTypeUnified, // System Cache Type + CacheAssociativity16Way // Associativity +}; +CHAR8 *mCacheInfoType7Strings_L2[] =3D { + "L2", + NULL +}; /*********************************************************************** SMBIOS data definition TYPE9 System Slot Information ************************************************************************/ @@ -846,7 +957,17 @@ CacheInfoUpdateSmbiosType7 ( VOID ) { - LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mCacheInfoType7, mCacheInfoTyp= e7Strings, NULL); + EFI_SMBIOS_HANDLE SmbiosHandle; + + LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mCacheInfoType7_L1I, mCacheInf= oType7Strings_L1I, NULL); + + LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mCacheInfoType7_L1D, mCacheInf= oType7Strings_L1D, &SmbiosHandle); + // Set Type4 L1CacheHandle to point to the newly added L1 Data Cache + mProcessorInfoType4.L1CacheHandle =3D (UINT16) SmbiosHandle; + + LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mCacheInfoType7_L2, mCacheInfo= Type7Strings_L2, &SmbiosHandle); + // Set Type4 L2CacheHandle to point to the newly added L2 Cache + mProcessorInfoType4.L2CacheHandle =3D (UINT16) SmbiosHandle; } =20 /*********************************************************************** @@ -972,11 +1093,10 @@ PlatformSmbiosDriverEntryPoint ( =20 BoardInfoUpdateSmbiosType2 (); =20 + CacheInfoUpdateSmbiosType7 (); // Add Type 7 first to get Cache handle f= or use in Type 4 =20 ProcessorInfoUpdateSmbiosType4 (4); //One example for creating and upd= ating =20 - CacheInfoUpdateSmbiosType7 (); - SysSlotInfoUpdateSmbiosType9 (); =20 OemStringsUpdateSmbiosType11 (); --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62860): https://edk2.groups.io/g/devel/message/62860 Mute This Topic: https://groups.io/mt/75687847/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon Apr 29 16:11:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62861+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62861+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1595269020; cv=none; d=zohomail.com; s=zohoarc; b=NOJhO/eh7pGXmdSb3kwafQaRjjdaI9JhptDQd32We8w56ZvWwNwDrs6YGwMV+zO8kOKKnyoylkc1Y2npRYYdM5F4L+L+Q8x8d6OZMdqmF23v8wW5saua60qdaqFccbziy5EEl4tBr7WCDkCOB8BTSFc2Ju2+l/reitZkWKGEYao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595269020; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=po31xvrUreZ7p86Eo2YPyEF4ocGMsIYu7VkjafuqcHw=; b=Q70l2jKUe4hBpKt3QIMM/xh90MKryYxDL+TrG4HGeB0VtilmMoJMeiGJwvGNVh3NYce1SYQDXcrZK6Zky+Tz0uEVI5EK1z+g0YlfiOaNut1KxYb0uSDoqkmW0Swsmuzraa3atiKEPG2RbAxPhPhMzhpJbfxWl5ijKBPHDMMBfMg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62861+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1595269020431288.39510306084344; Mon, 20 Jul 2020 11:17:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id y4d1YY1788612x1DBeKlwEsK; Mon, 20 Jul 2020 11:17:00 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.1506.1595269017640168140 for ; Mon, 20 Jul 2020 11:16:57 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5C998106F; Mon, 20 Jul 2020 11:16:57 -0700 (PDT) X-Received: from U203705.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1B73C3F66F; Mon, 20 Jul 2020 11:16:57 -0700 (PDT) From: "Samer El-Haj-Mahmoud" To: devel@edk2.groups.io Cc: Leif Lindholm , Pete Batard , Andrei Warkentin , Ard Biesheuvel Subject: [edk2-devel] [edk2-platform][PATCH v1 6/7] Platforms/RaspberryPi: SMBIOS Memory Types fixes Date: Mon, 20 Jul 2020 14:16:45 -0400 Message-Id: <20200720181646.2891-7-Samer.El-Haj-Mahmoud@arm.com> In-Reply-To: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com> References: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,samer.el-haj-mahmoud@arm.com X-Gm-Message-State: 3hq0N9wNnAKWD3Jh41I89L3qx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1595269020; bh=zVyA4vhNYt1k9Gk6dgKTuL4r62kgb+zAZzBHbykudNw=; h=Cc:Date:From:Reply-To:Subject:To; b=Aouc4RIZKR9kBIjprvq9Uy8LH1EvNfxWENEm7BUzYltFeY3UB3W3oPrR37o3MWtJiWu /SmH7GC3j/5pQSUNNcykKJ9yEdH5H8HEL4s6YUaVBXaNG7I68qs9oPrZsaHXc6khwfC/I SbqJGGl8ksBz4oRYjFdhponiDcrXMd9hIpk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Various fixes and enhancements for SMBIOS memory structures (Types 16, 17, and 19): - Type 16: - Update MaximumCapacity dynamically - Keep ExtendedMaximumCapacity at 0 (not used, per spec) - Type 17: - Update Size and VolatileSize dynamically - Change FormFactor from Unknown to Chip - Set DeviceSet to 0 (not part of set) instead of 0xFF (unknown) - Fix the DeviceLocator, BankLocator, and Manufacturer strings - Update MemoryType correctly for RPi4 and RPi3 - Add additional SMBIOS fields from 3.3 definition - Type 19: - Update MemoryArrayHandle to point to Type 16 handle Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Signed-off-by: Samer El-Haj-Mahmoud Reviewed-by: Andrei Warkentin --- Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 115 += +++++++++++++------ 1 file changed, 83 insertions(+), 32 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c index 4ee8ae6ebfc9..d382797602ce 100644 --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c @@ -496,10 +496,10 @@ SMBIOS_TABLE_TYPE16 mPhyMemArrayInfoType16 =3D { MemoryArrayLocationSystemBoard, // Location; ///< = The enumeration value from MEMORY_ARRAY_LOCATION. MemoryArrayUseSystemMemory, // Use; ///< = The enumeration value from MEMORY_ARRAY_USE. MemoryErrorCorrectionUnknown, // MemoryErrorCorrection; ///< = The enumeration value from MEMORY_ERROR_CORRECTION. - 0x40000000, // MaximumCapacity; + 0x00000000, // MaximumCapacity; 0xFFFE, // MemoryErrorInformationHandle; 1, // NumberOfMemoryDevices; - 0x40000000ULL, // ExtendedMaximumCapacity; + 0x00000000ULL, // ExtendedMaximumCapacity; }; CHAR8 *mPhyMemArrayInfoType16Strings[] =3D { NULL @@ -510,18 +510,23 @@ CHAR8 *mPhyMemArrayInfoType16Strings[] =3D { ************************************************************************/ SMBIOS_TABLE_TYPE17 mMemDevInfoType17 =3D { { EFI_SMBIOS_TYPE_MEMORY_DEVICE, sizeof (SMBIOS_TABLE_TYPE17), 0 }, - 0, // MemoryArrayHandle; // Should match SMBIOS_TABLE_TYPE16.Ha= ndle, initialized at runtime, refer to PhyMemArrayInfoUpdateSmbiosType16() - 0xFFFE, // MemoryErrorInformationHandle; - 0xFFFF, // TotalWidth; - 0xFFFF, // DataWidth; - 0x0400, // Size; // When bit 15 is 0: Size in MB - // When bit 15 is 1: Size in KB, and continues in ExtendedSi= ze - MemoryFormFactorUnknown, // FormFactor; ///< The enu= meration value from MEMORY_FORM_FACTOR. - 0xff, // DeviceSet; - 1, // DeviceLocator String - 2, // BankLocator String - MemoryTypeDram, // MemoryType; ///< The enum= eration value from MEMORY_DEVICE_TYPE. - { // TypeDetail; + 0, // MemoryArrayHandle; // Should match SMBIOS_TABLE= _TYPE16.Handle, initialized at runtime, refer to PhyMemArrayInfoUpdateSmbio= sType16() + 0xFFFE, // MemoryErrorInformationHandle; (not provided) + 0xFFFF, // TotalWidth; (unknown) + 0xFFFF, // DataWidth; (unknown) + 0xFFFF, // Size; // When bit 15 is 0: Size in MB + // When bit 15 is 1: Size in KB, and continues in = ExtendedSize + // initialized at runtime, refer to PhyMemArrayInf= oUpdateSmbiosType16() + MemoryFormFactorChip, // FormFactor; ///< The enumer= ation value from MEMORY_FORM_FACTOR. + 0, // DeviceSet; + 1, // DeviceLocator String + 0, // BankLocator String +#if (RPI_MODEL =3D=3D 4) + MemoryTypeLpddr4, // MemoryType; ///< The enumer= ation value from MEMORY_DEVICE_TYPE. +#else + MemoryTypeLpddr2, // MemoryType; ///< The enumer= ation value from MEMORY_DEVICE_TYPE. +#endif + { // TypeDetail; 0, // Reserved :1; 0, // Other :1; 1, // Unknown :1; @@ -539,19 +544,42 @@ SMBIOS_TABLE_TYPE17 mMemDevInfoType17 =3D { 0, // Unbuffered :1; 0, // Reserved1 :1; }, - 0, // Speed; - 3, // Manufacturer String - 0, // SerialNumber String - 0, // AssetTag String - 0, // PartNumber String - 0, // Attributes; - 0, // ExtendedSize; - 0, // ConfiguredMemoryClockSpeed; + 0, // Speed; (unknown) + 2, // Manufacturer String + 0, // SerialNumber String + 0, // AssetTag String + 0, // PartNumber String + 0, // Attributes; (unknown rank) + 0, // ExtendedSize; (since Size < 32GB-1) + 0, // ConfiguredMemoryClockSpeed; (unknown) + 0, // MinimumVoltage; (unknown) + 0, // MaximumVoltage; (unknown) + 0, // ConfiguredVoltage; (unknown) + MemoryTechnologyDram, // MemoryTechnology ///< The enume= ration value from MEMORY_DEVICE_TECHNOLOGY + {{ // MemoryOperatingModeCapability + 0, // Reserved :1; + 0, // Other :1; + 0, // Unknown :1; + 1, // VolatileMemory :1; + 0, // ByteAccessiblePersistentMemory :1; + 0, // BlockAccessiblePersistentMemory :1; + 0 // Reserved :10; + }}, + 0, // FirwareVersion + 0, // ModuleManufacturerID (unknown) + 0, // ModuleProductID (unknown) + 0, // MemorySubsystemControllerManufacturerID (unknow= n) + 0, // MemorySubsystemControllerProductID (unknown) + 0, // NonVolatileSize + 0xFFFFFFFFFFFFFFFFULL,// VolatileSize // initialized at runtime, refer t= o PhyMemArrayInfoUpdateSmbiosType16() + 0, // CacheSize + 0, // LogicalSize (since MemoryType is not MemoryType= LogicalNonVolatileDevice) + 0, // ExtendedSpeed, + 0 // ExtendedConfiguredMemorySpeed }; CHAR8 *mMemDevInfoType17Strings[] =3D { - "OS Virtual Memory", - "malloc", - "OSV", + "SDRAM", + "Micron", NULL }; =20 @@ -562,10 +590,10 @@ SMBIOS_TABLE_TYPE19 mMemArrMapInfoType19 =3D { { EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS, sizeof (SMBIOS_TABLE_TYPE= 19), 0 }, 0x00000000, // StartingAddress; 0x00000000, // EndingAddress; - 0, // MemoryArrayHandle; + 0, // MemoryArrayHandle; // Should match SMBIOS_TABLE_TYPE16.Ha= ndle, initialized at runtime, refer to PhyMemArrayInfoUpdateSmbiosType16() 1, // PartitionWidth; - 0, // ExtendedStartingAddress; - 0, // ExtendedEndingAddress; + 0, // ExtendedStartingAddress; // not used + 0, // ExtendedEndingAddress; // not used }; CHAR8 *mMemArrMapInfoType19Strings[] =3D { NULL @@ -1000,14 +1028,37 @@ PhyMemArrayInfoUpdateSmbiosType16 ( VOID ) { - EFI_SMBIOS_HANDLE MemArraySmbiosHande; + EFI_SMBIOS_HANDLE MemArraySmbiosHandle; + EFI_STATUS Status; + UINT32 InstalledMB =3D 0; =20 - LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mPhyMemArrayInfoType16, mPhyMe= mArrayInfoType16Strings, &MemArraySmbiosHande); + // + // Update memory size fields: + // - Type 16 MaximumCapacity in KB + // - Type 17 size in MB (since bit 15 =3D 0) + // - Type 17 VolatileSize in Bytes + // + + // The minimum RAM size used on any Raspberry Pi model is 256 MB + mMemDevInfoType17.Size =3D 256; + + Status =3D mFwProtocol->GetModelInstalledMB (&InstalledMB); + if (Status !=3D EFI_SUCCESS) { + DEBUG ((DEBUG_WARN, "Couldn't get the board memory size - defaulting t= o 256 MB: %r\n", Status)); + } else { + mMemDevInfoType17.Size =3D InstalledMB; // Size in MB + } + + mPhyMemArrayInfoType16.MaximumCapacity =3D mMemDevInfoType17.Size * 1024= ; // Size in KB + mMemDevInfoType17.VolatileSize =3D MultU64x32 (mMemDevInfoType17.Size, 1= 024 * 1024); // Size in Bytes + + LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*)&mPhyMemArrayInfoType16, mPhyMe= mArrayInfoType16Strings, &MemArraySmbiosHandle); =20 // - // Update the memory device information + // Update the memory device information and memory array map with the ne= wly added type 16 handle // - mMemDevInfoType17.MemoryArrayHandle =3D MemArraySmbiosHande; + mMemDevInfoType17.MemoryArrayHandle =3D MemArraySmbiosHandle; + mMemArrMapInfoType19.MemoryArrayHandle =3D MemArraySmbiosHandle; } =20 /*********************************************************************** --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62861): https://edk2.groups.io/g/devel/message/62861 Mute This Topic: https://groups.io/mt/75687848/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Mon Apr 29 16:11:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62862+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62862+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1595269021; cv=none; d=zohomail.com; s=zohoarc; b=gsDg+dwbZJ59UF5B3aVg6o1SZ5jTcHwWtEeWSaN0jY/WOLbx1lR9OVUYN1InyP4znbuJ70XMSmLRlkIeOIApcJKbmpoQ0geaYuOuEcvh3wD4RhxuGwPefI/DgiWFa4VEldBJJU990LOGWT1HMJk44PQWXV8SaFa3n7hlPtFjMhs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595269021; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=ACTObcoNWx66JxNcNz/Rf++K/Ln2zFTxJLaVVhLySbI=; b=LQHxds51Hud+3PyyFIXicWIHxgaZQxXDhsVjabcU0UVc5ZhboDwn//10s9ty980ompShmTKpF1zfGwOFzgGiQUBKOuh3vk6tb0f0rldMHT1kswIAQDQG9gTaAHHwpCA9Qb/IzFuSPhH9+kcgQp7SAqDxGE9/jE47rx7TQOWj/N8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62862+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1595269021909755.0072049176125; Mon, 20 Jul 2020 11:17:01 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id AwYHYY1788612xor3nC1BGnW; Mon, 20 Jul 2020 11:17:01 -0700 X-Received: from foss.arm.com (foss.arm.com []) by mx.groups.io with SMTP id smtpd.web12.1505.1595269017479440490 for ; Mon, 20 Jul 2020 11:16:58 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B4C0E113E; Mon, 20 Jul 2020 11:16:57 -0700 (PDT) X-Received: from U203705.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6D7583F66F; Mon, 20 Jul 2020 11:16:57 -0700 (PDT) From: "Samer El-Haj-Mahmoud" To: devel@edk2.groups.io Cc: Leif Lindholm , Pete Batard , Andrei Warkentin , Ard Biesheuvel Subject: [edk2-devel] [edk2-platform][PATCH v1 7/7] Platforms/RaspberryPi: SMBIOS minor cleanup Date: Mon, 20 Jul 2020 14:16:46 -0400 Message-Id: <20200720181646.2891-8-Samer.El-Haj-Mahmoud@arm.com> In-Reply-To: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com> References: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,samer.el-haj-mahmoud@arm.com X-Gm-Message-State: r6wRqvxwapIRGavG2nkuFsgEx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1595269021; bh=N75jJGyDIod332KksosHHXUweqUtUzCEPpweqsqbk+8=; h=Cc:Date:From:Reply-To:Subject:To; b=IOlco6yuAHGCSyb2K/3Yv/IeD3QR/9Yxt8uj0soes6XbG04gK5pymMVr547WEOdIr0u DrGslD4joSjA6JByEZLQmcYvyuPI73hwwVqeymYSFwT45Q6uaSiqtL/0MJ+2Wndl4EtCO uVnx4btvrKAijz/muPE6fPJK/6wNQwYtTFc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Minor code cleanup: - Update file header to list SBBR required/recommended tables - Rename DataSmbiosHande to DataSmbiosHandle - Remove SMBIOS_HANDLE_PI_RESERVED from Type 11 template for consistency. This is already done in LogSmbiosData(). Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Signed-off-by: Samer El-Haj-Mahmoud Reviewed-by: Pete Batard --- Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 43 ++= ++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c index d382797602ce..d955291c5bb7 100644 --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c @@ -1,20 +1,27 @@ /** @file * - * Static SMBIOS Table for ARM platform + * Static SMBIOS Table for the RaspberryPi platform * Derived from EmulatorPkg package * - * Note SMBIOS 2.7.1 Required structures: - * BIOS Information (Type 0) - * System Information (Type 1) - * Board Information (Type 2) - * System Enclosure (Type 3) - * Processor Information (Type 4) - CPU Driver - * Cache Information (Type 7) - For cache that is external to processor - * System Slots (Type 9) - If system has slots - * Physical Memory Array (Type 16) - * Memory Device (Type 17) - For each socketed system-memory Device - * Memory Array Mapped Address (Type 19) - One per contiguous block per P= hysical Memroy Array - * System Boot Information (Type 32) + * Note - Arm SBBR ver 1.2 required and recommended SMBIOS structures: + * BIOS Information (Type 0) + * System Information (Type 1) + * Board Information (Type 2) - Recommended + * System Enclosure (Type 3) + * Processor Information (Type 4) - CPU Driver + * Cache Information (Type 7) - For cache that is external to processor + * Port Information (Type 8) - Recommended for platforms with physical = ports + * System Slots (Type 9) - If system has slots + * OEM Strings (Type 11) - Recommended + * BIOS Language Information (Type 13) - Recommended + * System Event Log (Type 15) - Recommended (does not exit on RPi) + * Physical Memory Array (Type 16) + * Memory Device (Type 17) - For each socketed system-memory Device + * Memory Array Mapped Address (Type 19) - One per contiguous block per= Physical Memroy Array + * System Boot Information (Type 32) + * IPMI Device Information (Type 38) - Required for platforms with IPMI= v1.0 BMC Host Interface (not applicable to RPi) + * Onboard Devices Extended Information (Type 41) - Recommended + * Redfish Host Interface (Type 42) - Required for platforms supporting= Redfish Host Interface (not applicable to RPi) * * Copyright (c) 2017-2018, Andrey Warkentin * Copyright (c) 2013, Linaro.org @@ -480,7 +487,7 @@ CHAR8 *mSysSlotInfoType9Strings[] =3D { ************************************************************************/ =20 SMBIOS_TABLE_TYPE11 mOemStringsType11 =3D { - { EFI_SMBIOS_TYPE_OEM_STRINGS, sizeof (SMBIOS_TABLE_TYPE11), SMBIOS_HAND= LE_PI_RESERVED }, + { EFI_SMBIOS_TYPE_OEM_STRINGS, sizeof (SMBIOS_TABLE_TYPE11), 0 }, 1 // StringCount }; CHAR8 *mOemStringsType11Strings[] =3D { @@ -641,7 +648,7 @@ CHAR8 *mBootInfoType32Strings[] =3D { @param Template Fixed SMBIOS structure, required. @param StringPack Array of strings to convert to an SMBIOS string pac= k. NULL is OK. - @param DataSmbiosHande The new SMBIOS record handle . + @param DataSmbiosHandle The new SMBIOS record handle. NULL is OK. **/ =20 @@ -650,7 +657,7 @@ EFIAPI LogSmbiosData ( IN EFI_SMBIOS_TABLE_HEADER *Template, IN CHAR8 **StringPack, - OUT EFI_SMBIOS_HANDLE *DataSmbiosHande + OUT EFI_SMBIOS_HANDLE *DataSmbiosHandle ) { EFI_STATUS Status; @@ -716,8 +723,8 @@ LogSmbiosData ( Record ); =20 - if ((Status =3D=3D EFI_SUCCESS) && (DataSmbiosHande !=3D NULL)) { - *DataSmbiosHande =3D SmbiosHandle; + if ((Status =3D=3D EFI_SUCCESS) && (DataSmbiosHandle !=3D NULL)) { + *DataSmbiosHandle =3D SmbiosHandle; } =20 ASSERT_EFI_ERROR (Status); --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62862): https://edk2.groups.io/g/devel/message/62862 Mute This Topic: https://groups.io/mt/75687850/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-