From nobody Sun Nov 24 03:56:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+93932+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+93932+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1663554150891806.4504836106669; Sun, 18 Sep 2022 19:22:30 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id PVGqYY1788612xyFuUtoYHVQ; Sun, 18 Sep 2022 19:22:30 -0700 X-Received: from NAM04-BN8-obe.outbound.protection.outlook.com (NAM04-BN8-obe.outbound.protection.outlook.com [40.107.100.117]) by mx.groups.io with SMTP id smtpd.web11.15634.1663554149503314356 for ; Sun, 18 Sep 2022 19:22:29 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hvcXoDSFYm1XCtIMyaJgOgF350Fpb8L7cLdH524Rvpmi7Tux4OKkmPwR8muuo5yR7S5IoU9apXLYgYa+R2qZk8pVudv8+xpoRr9UgKseMqANEmB5j0BJgxb3t1peg+QZIqarmlKhEn4D5fWYz1hVeD3ffx7PO/JQZH842V6OUG2fPfruvDzXmpTkzKVKle2lAZjv9ky8CXb961+KpPcjruX/5DfmbDRczOtxmLf+c7HH+XzZDb9lGDm4mTRzawhegg/Oz2kwvvt0Fnm4iyVuowi7BOkT8Kz57uK8Z4G6q7dqJo9EilUlq3YpL7UqkmjL9zMJXjSPr2vi4UG8iePG5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rxFp5F6wcddgQ77hT2EmOauK4rAynwNSUMyflRNyZas=; b=hcGjNpVUiw+IPLmWppRJ0d6KVccbPC/VOS0cC+MQP96Wv0+0DLtsmsFSK0WY9p9vHXl+9u0gWoNgJXHHvwvud8HV1MIq3G8Eo//Q6kmJ+2oL58FOf6Ll3WGk+a4GRKWugaHebzp8knVlzTeY0xo4688YZUAfwv6sjLxpZth3C0kQnToAOqmlDTddNVAiV8hZm9JNGmiJ98JcAHYCbj5QwyCB+yRhlF9PKvI3QC7AM7EoEm71bf4d9u+nJv/i0ULzx0MHrWbJ8ZxmOsTENVbZ/1LLV0DCTZ2pSYP/pWm7NY7UjS0N09Z3E4WiVo//VdGusUrDWp/F0KRx0qx8O7UroQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none X-Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by CO1PR01MB6791.prod.exchangelabs.com (2603:10b6:303:f7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.16; Mon, 19 Sep 2022 02:22:27 +0000 X-Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::441a:930:ac15:1ce9]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::441a:930:ac15:1ce9%4]) with mapi id 15.20.5632.019; Mon, 19 Sep 2022 02:22:27 +0000 From: "Nhi Pham via groups.io" To: devel@edk2.groups.io, quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, sami.mujawar@arm.com, quic_rcran@quicinc.com Cc: patches@amperecomputing.com, Minh Nguyen , Nhi Pham , Rebecca Cran , Ard Biesheuvel Subject: [edk2-devel] [PATCH v4 6/6] ArmPkg/SmbiosMiscDxe: Get SMBIOS information from OemMiscLib Date: Mon, 19 Sep 2022 09:19:50 +0700 Message-Id: <20220919021950.2110333-7-nhi@os.amperecomputing.com> In-Reply-To: <20220919021950.2110333-1-nhi@os.amperecomputing.com> References: <20220919021950.2110333-1-nhi@os.amperecomputing.com> X-ClientProxiedBy: SG2PR02CA0071.apcprd02.prod.outlook.com (2603:1096:4:54::35) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7287:EE_|CO1PR01MB6791:EE_ X-MS-Office365-Filtering-Correlation-Id: ebef48fb-ba08-411f-61aa-08da99e5cb9d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: hjkHOZv+Ud7c+DqIXhLIYVbBGh+FnQ4WY78Th6JFK5M+cGBThXjVRFapmxARTkmbsgjIqV6LaZGZyio8iBE0cda4IdlF2nOFR7Ef/K/bLFyBOrCLmVH+c9aYHSZEYzwmpJvN51vxZxrKnjLNcpR1ceN09OQNLPsr2rhiraE2ncWxUOQgOsk61x2sZVXxasn5+icSNjQSzjsdC68kreYsXazZWUtX5LGvwK+UIHu6pRo8fZWBSKl7TtNqUEyl4nJJA80RYR/wzzhl6lPGmEy87MiAlNPXt+vZUibEpJla7qLu9ERoKV09DgSGJCbefYiznVIUZzNqxcCLpIEpw5r9XlNeGt1IfAgKdxH+L/ioQL3rw3kT4AbVN17BNToqNMkA9FK9e5C8SkXAGyQnaAt59seNrpLItkRGFdP5RHn8pjMGogtvcZtFLZKnlTm8+cz5mlZ/1dPVncjnfW6DUWJG8LsqqoUaExhFeegrcyxTqAvmn/Rfr8upkvP8ZTWdtvSbwwYgLSTOpvb/TNfSe6kFthU7pGepyctmGTbdxHxkN8cBacp+zadb/Svri/jPdhx6ECNHEHBKjEL5dLYXjgYODo9IyeTJPVtAuBQR5jJ34pDu6DuO4Ehy1UhKUKz+4f60Y+dZgT4lbJdKs0Pvrot8+QpnvfeFId4WY5NoBJ0AkRMFW2sSVYdXpXOZvsXkrDrcGfLmuyb3IiVwxKBFAXwJDwijiCZJjNinzNdkGx8UQkQT93qdMSfhbnmlW458IdLEHwTViEH5RKte17Z6yZsFBWgcuiIM5Feq8pT7aAGL8qo= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bTsXghUjAxOYgVW9zPP6lqljPO0rQ3M9hdqYwz+xYG012WXhtFubZVrAnANI?= =?us-ascii?Q?iUtcgFE5cHRkMhbrhBTS1vH02EN+YJhpmWS6TlYXbzbKXmJL+Cp+blTaROyC?= =?us-ascii?Q?yyMWM0e7+Qw5jlnkU3VA/D9VGjAJLcDRIW0CFh7sqOWXRivNpn/xxdRrqTMj?= =?us-ascii?Q?yI5ROeS34pK44RszzmFKXTnXdzJymgeL5fEPZjWd8kwrHea79iqpON8tozXZ?= =?us-ascii?Q?PKsHX4Pr3sI6KMhKuII/sUVqTJz+1cMWYKBpMB7M/q5bVsOp0Pse+igIah6d?= =?us-ascii?Q?+uKuc65MuAiJeJmk2ur2TIlz2SvTy3ohlefG7Ua7/Tptn9cQxEvvcnJjz0rE?= =?us-ascii?Q?E6IAGZ8DpQJ9sHxYF9wrdcqjRMg68z/aCX65jkDG/5b60YN3QwwQWSFqDloY?= =?us-ascii?Q?I1XtN4pNxwlEjoHrQj2AU92uu01bQE4t1kiyYlmTvFUJH9NgwMXjbVQckeYO?= =?us-ascii?Q?sTufy+mahJeLfkJhLXlpyZYWvuTYFkjkw1NC0HAhN7JQfKaDFbSTtLEp0utF?= =?us-ascii?Q?KpQj2JEpjiFalLBS5bY9OySpsJIoQXJGbx7o56esw9g2MnyGL0lpkKM31mGc?= =?us-ascii?Q?kpnCNEjzfL5feyxM20JZMt5r7JT1/I+E5lKuis5PnzcIiiAnjGuYsvl4Zpny?= =?us-ascii?Q?6NB7BfN3XtLEgAF/6XOTk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u?= =?us-ascii?Q?4sqWIIqG1wZ1L1F5I1bRPYcEIBNudF+pFQMQElciP7p+g54aIX5f7IoZ6F5j?= =?us-ascii?Q?LCcSuK9FY6wEcyJ3/a+fStA=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: ebef48fb-ba08-411f-61aa-08da99e5cb9d X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 02:22:27.1339 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dYjU3B52+Vu8txboUNVI9qXk8vBA3fbtkfLbetVpn9pMRFi0SwznfSbbSUan/C7jKLdpDJALIY+1k0tOSPiJ8q1sUnsGBwj8BZ+8v6nH6rs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR01MB6791 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,nhi@os.amperecomputing.com X-Gm-Message-State: D1LNc3NydPl8UZoWPW3aWL6Sx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1663554150; bh=uwXHBtP5mt7EOssAJLI7YcQA/BCrO+DEZwyGdohMcC4=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=j8XA1J0eCaSXidOdbOJVOCNDgzxgNNLt54hDCh7A+MVMZQLDl/YMJg76aAZ6C3gpO4G nZHlyOnUVgoG7Y9BVRx10QHT/4N6Bg9majROzWk25sY1IMeEhCYvwYR7RC7Z52NRCFQHY CeBg7CmpA1FZrCPVeLjND/zDngYVEsnNAig= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1663554151286100001 Content-Type: text/plain; charset="utf-8" From: Minh Nguyen In some scenarios, the information of Bios Version, Bios Release and Embedded Controller Firmware Release are fetched during UEFI booting. This patch supports updating those fields dynamically when the PCDs are empty. Signed-off-by: Nhi Pham Reviewed-by: Rebecca Cran Reviewed-by: Sami Mujawar Acked-by: Ard Biesheuvel --- ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf | 5= ++++ ArmPkg/Include/Library/OemMiscLib.h | 21= ++++++++++++++ ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c | 29= ++++++++++++++++++++ ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 22= +++++++-------- 4 files changed, 66 insertions(+), 11 deletions(-) diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf b/Ar= mPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf index 8653f57720d1..7286ed61142a 100644 --- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf +++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf @@ -30,6 +30,11 @@ [Packages] [LibraryClasses] BaseMemoryLib DebugLib + PcdLib =20 [Guids] gZeroGuid + +[Pcd] + gArmTokenSpaceGuid.PcdEmbeddedControllerFirmwareRelease + gArmTokenSpaceGuid.PcdSystemBiosRelease diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/O= emMiscLib.h index 1936619d9b5b..541274999e5c 100644 --- a/ArmPkg/Include/Library/OemMiscLib.h +++ b/ArmPkg/Include/Library/OemMiscLib.h @@ -37,6 +37,7 @@ typedef struct { } OEM_MISC_PROCESSOR_DATA; =20 typedef enum { + BiosVersionType00, ProductNameType01, SerialNumType01, UuidType01, @@ -247,4 +248,24 @@ OemGetSystemUuid ( OUT GUID *SystemUuid ); =20 +/** Fetches the BIOS release. + + @return The BIOS release. +**/ +UINT16 +EFIAPI +OemGetBiosRelease ( + VOID + ); + +/** Fetches the embedded controller firmware release. + + @return The embedded controller firmware release. +**/ +UINT16 +EFIAPI +OemGetEmbeddedControllerFirmwareRelease ( + VOID + ); + #endif // OEM_MISC_LIB_H_ diff --git a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c b/ArmPkg/U= niversal/Smbios/OemMiscLibNull/OemMiscLib.c index 32f6d55c1a9a..a5d635da9e11 100644 --- a/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c +++ b/ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLib.c @@ -16,6 +16,7 @@ #include #include #include +#include =20 /** Gets the CPU frequency of the specified processor. =20 @@ -254,3 +255,31 @@ OemGetSystemUuid ( ASSERT (FALSE); CopyGuid (SystemUuid, &gZeroGuid); } + +/** Fetches the BIOS release. + + @return The BIOS release. +**/ +UINT16 +EFIAPI +OemGetBiosRelease ( + VOID + ) +{ + ASSERT (FALSE); + return PcdGet16 (PcdSystemBiosRelease); +} + +/** Fetches the embedded controller firmware release. + + @return The embedded controller firmware release. +**/ +UINT16 +EFIAPI +OemGetEmbeddedControllerFirmwareRelease ( + VOID + ) +{ + ASSERT (FALSE); + return PcdGet16 (PcdEmbeddedControllerFirmwareRelease); +} diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFun= ction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFuncti= on.c index b49c4b754cab..e1310f331009 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c @@ -1,5 +1,6 @@ /** @file =20 + Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
Copyright (c) 2021, NUVIA Inc. All rights reserved.
Copyright (c) 2009, Intel Corporation. All rights reserved.
Copyright (c) 2015, Hisilicon Limited. All rights reserved.
@@ -13,6 +14,7 @@ #include #include #include +#include #include #include =20 @@ -191,11 +193,11 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) { TokenToUpdate =3D STRING_TOKEN (STR_MISC_BIOS_VERSION); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL); } else { - Version =3D (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString); - if (StrLen (Version) > 0) { - TokenToUpdate =3D STRING_TOKEN (STR_MISC_BIOS_VERSION); - HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL); - } + OemUpdateSmbiosInfo ( + mSmbiosMiscHiiHandle, + STRING_TOKEN (STR_MISC_BIOS_VERSION), + BiosVersionType00 + ); } =20 Char16String =3D GetBiosReleaseDate (); @@ -251,13 +253,11 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) { } } =20 - SmbiosRecord->SystemBiosMajorRelease =3D (UINT8)(PcdGet16 (PcdSystemBios= Release) >> 8); - SmbiosRecord->SystemBiosMinorRelease =3D (UINT8)(PcdGet16 (PcdSystemBios= Release) & 0xFF); + SmbiosRecord->SystemBiosMajorRelease =3D (UINT8)(OemGetBiosRelease () >>= 8); + SmbiosRecord->SystemBiosMinorRelease =3D (UINT8)(OemGetBiosRelease () & = 0xFF); =20 - SmbiosRecord->EmbeddedControllerFirmwareMajorRelease =3D (UINT16) - (PcdGet16 (PcdEmb= eddedControllerFirmwareRelease) >> 8); - SmbiosRecord->EmbeddedControllerFirmwareMinorRelease =3D (UINT16) - (PcdGet16 (PcdEmb= eddedControllerFirmwareRelease) & 0xFF); + SmbiosRecord->EmbeddedControllerFirmwareMajorRelease =3D (UINT16)(OemGet= EmbeddedControllerFirmwareRelease () >> 8); + SmbiosRecord->EmbeddedControllerFirmwareMinorRelease =3D (UINT16)(OemGet= EmbeddedControllerFirmwareRelease () & 0xFF); =20 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); UnicodeStrToAsciiStrS (Vendor, OptionalStrStart, VendorStrLen + 1); --=20 2.25.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 (#93932): https://edk2.groups.io/g/devel/message/93932 Mute This Topic: https://groups.io/mt/93773967/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-