From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.131]) by mx.groups.io with SMTP id smtpd.web10.13707.1678689855488867229 for ; Sun, 12 Mar 2023 23:44:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=AFBs42eZ; spf=pass (domain: os.amperecomputing.com, ip: 40.107.220.131, mailfrom: tinhnguyen@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ms+BPbo4Hqq0NT75uC3MUgU9NfsWsI1hw/5RlYcXA7RPruexUzirxVplWfrlxhHUIqhvpXdWHdbGMk2VAm25+xY6A/1MEMiLxCojkZ6s4i3KDYacG7iMc/DkPtZQqz4ERDIB5oJyL2TFtpRx+d/KmQ7TbOcpiUFLM2n4wukyPOiDbCkZDhmPlAl9+f1eU1v67ZcWrQzBE9Hgm5h5aKn38Zdzfj42lv5ID3/DB3bNOwqWsNebysE98fRAi5jdJHJa7q5OcxSqAZx4BYZgXyuGZLNYTfxDLJPYvJBWQsByYBImIwRssVpUxrZf0JYgZ11ll4InmU5WoH3cTmR4z9Yn1Q== 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=1Vvvj6WKjdtYstL8XL1qn3+NdftpyqOcbaadCEwRij0=; b=E7hWVix6OUgPw1hZz8x/t5WIBAb1GRjFDnJHPTE36agEWUjcCrzZzHOx0csPJ4oTruViZrBCwxcLh82GAOzGWpg/AX0r2a/jwUpk8QNH+5YMtNO96HMAY5TOBehQQQL+9Kix8wGfCCfm7UOia2UbomJuR2R/jelZ+z0rjJoOO826z1edNbLgpxh+AtSJE4w0zlrQiG9nVuEq1HpgWg2WLgWq3Hx5YUDQafdRCKzAteOy+H/g3aSS4i3CE1fyOH5hJynlDh0c+H3CLbeYEQhI6XZdJsT6GtkiAaAyHxqgTJpYszjrpk4ZYqWadZBZr59lZTJegG2KZr8RFUOP0uljDg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1Vvvj6WKjdtYstL8XL1qn3+NdftpyqOcbaadCEwRij0=; b=AFBs42eZQQp9Cpj8MpOBGcjyzEcUB/xtOjgEdJctJJ0SshhYxRooEEQSi6cSSQVkHHS08AaQhSIbOqmv+UV8at4TJ9XxHH4hNF3fO3tH0YDAr0RD7CCxlAAoJV5e9NxSP7LU8tWgtWyCNz5ymqqtsni3BMNbh4Mze1OQO5dxNhA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB7506.prod.exchangelabs.com (2603:10b6:510:f5::22) by CY4PR0101MB2904.prod.exchangelabs.com (2603:10b6:910:46::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Mon, 13 Mar 2023 06:44:10 +0000 Received: from PH0PR01MB7506.prod.exchangelabs.com ([fe80::c431:46ee:f0b7:3818]) by PH0PR01MB7506.prod.exchangelabs.com ([fe80::c431:46ee:f0b7:3818%8]) with mapi id 15.20.6178.024; Mon, 13 Mar 2023 06:44:09 +0000 From: "Tinh Nguyen" To: devel@edk2.groups.io Cc: patches@amperecomputing.com, quic_llindhol@quicinc.com, ardb+tianocore@kernel.org, Tinh Nguyen , Nhi Pham Subject: [PATCH 1/1] ArmPkg/SmbiosMiscDxe: Adjust the priority of getting firmware version Date: Mon, 13 Mar 2023 13:43:21 +0700 Message-Id: <20230313064321.170866-1-tinhnguyen@os.amperecomputing.com> X-Mailer: git-send-email 2.39.2 X-ClientProxiedBy: SI2PR01CA0015.apcprd01.prod.exchangelabs.com (2603:1096:4:191::15) To PH0PR01MB7506.prod.exchangelabs.com (2603:10b6:510:f5::22) Return-Path: tinhnguyen@os.amperecomputing.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7506:EE_|CY4PR0101MB2904:EE_ X-MS-Office365-Filtering-Correlation-Id: c3fbaf91-245c-46c4-232c-08db238e597f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xi/IV3v4sIbjbV6haZXprjp5IBQs1j7/XCeHzzYa/gduH1mNZd8Xv3+hM2NbEoXJbtxqEKoNUc6OmuH3P8eq2G5Xoy+HstysGC25LRliC2/b8ie8UPpHxbBYprKeZJQg8NTWYtqaXPzezXXlYMUk6HEi+CMR0f5g3xLTj7TQxvDTjHJOZ00GNSOZtobPLE6c/sqp4mH3ComVA2MrtM/AFaTsC8MuG3iWC3c9+ICsCftmP/Q/CNhHslEeScD72/iuz/wgw/erwvjX+2dF4vtdBzKnYUQXf3rK5QbCvSbt1+/lbMcpQ2HyL57XyVqU0Ha0yqe6rCx9VuEuYfr451H4KGfGu3kptq4jQCsxUG5T6rGa28dNxbm5LBGVt9Cg9vQDd5IBPkrjvdAgG1/bw2Fv1ATBRfByCKv5jyoMgp0RwdQhKbqYxMOCIIQdOZUBaOBGRWhowMoSVPGhqqUzB2m/4OZ139rzlLJCnUATdWTTFwDeHqDAX3MA8bgHvYLbcd3i6dVKuGDcSbDULI37ogeMjslrhYBNHOkUF58Z/UUz5rU+7wlkt5pGDgexe81zKalmrtBtEzc8SFow19qr6ntoVBXpWBqwz2GFyZEIw4xtSwvKmYjX3WsbvCutvIMYruYXsVa/as1L3BRjCSQP/Y3sG3CIq7jrbpgEnyhvTMRHKMhI/fnAp7+fETS7ugO/2mRl5IyyL48mPymjqYuWc/JbsQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB7506.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(396003)(346002)(366004)(376002)(136003)(39840400004)(451199018)(83380400001)(54906003)(26005)(478600001)(38350700002)(38100700002)(316002)(6512007)(6486002)(2616005)(8936002)(6506007)(41300700001)(186003)(6666004)(1076003)(107886003)(52116002)(5660300002)(66476007)(8676002)(66556008)(86362001)(2906002)(4326008)(6916009)(66946007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?a+CXvOKkBqn3T1VmIPV9LD7jgZuNTo48QYulDJ079T36+HQfWjmmpJ6XDUiM?= =?us-ascii?Q?C4VxzoOrNTLllhajByyMaJf8gMxhdUhh2rfaZyBQ4UNlQGGGGx7IMgmBta75?= =?us-ascii?Q?MlKBYDU1rkeMQITESMvbLVLrGBcjtcE1vdNxqjy4j8peds69Khj9vlTze3uc?= =?us-ascii?Q?6OdTu+XMiPNKAXVIvbYaJiERw9xU0bI5kYVrkejTXYz8P/vBp69piKvuOkZT?= =?us-ascii?Q?UClmDR/pqK9bdEk8jw5RUJ7vOEa0KhwT3ZlRpMNvLYPgsJ1G/hnGsdveiHMT?= =?us-ascii?Q?I2viul3t8Wj1b2+cSWzZ/kIGPiGc6C5U4E7IIWtlfWZ1+0cr85dqj02xrfmz?= =?us-ascii?Q?7CdO6Y/j0buMyVhL9moQnJc8AR/Tkhys8nWaSp4t29Bw3pH9fPEHQ3SqMLjy?= =?us-ascii?Q?oH/GPYVMfMQeuIFdSnuGMn7gems3wcvMNp/CEgfmgfsI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4xs0+2NUrpOfS2vIU4CRnXRWBhrw8j9sZgldUGerxyMP+HFXr?= =?us-ascii?Q?mweokwvAs9zC7FZd9jA+loB2B9ECgtoue0DjwK40zyVZldgP6vcwP+J3Wyvz?= =?us-ascii?Q?UxdhE6ub47tvtES13qcIi3jLmEb1L6YLuzVykHGxsHaf+22pTtWv6E45BaHv?= =?us-ascii?Q?en8NrCRPyVSBIe5VxhFKfSbmMStighWCRg2y8uvFJ/dWvxGNKtaB1+2Q85Op?= =?us-ascii?Q?FtMvQCWo4TBHOtKIdKu8D3d8wfrbrlGzFh9YOaHyJoFkZb+3GHo/McqIKGxS?= =?us-ascii?Q?XJp1ibtdwjnq0rqPe2TfaDx0H+C8S3LzoGF2rD5nEFm2?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3fbaf91-245c-46c4-232c-08db238e597f X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7506.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 06:44:09.8920 (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: ShlByvaIJQOXi5A0JVsB4+ixh7KPnA+iT3IQ5Ric6B+60yJCfWLEnV40ayLfpsmnGbfsu8npaiegWJYcX/M2l4jecc/xcyPfaS4P8zDTvpArbQI/npw/qodTVgqGVRYh X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0101MB2904 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain The BIOS Firmware Version in the SMBIOS Type 0 can be fetched from the fixed PcdFirmwareVersionString or platform specific OemMiscLib. In fact, the support from OemMiscLib comes into play when the firmware version may be modified at boot time for extended information. Therefore, the priority of getting the version from OemMiscLib should be higher. In case there is no modification in the OemMiscLib, we have to keep HII string STR_MISC_BIOS_VERSION empty or 'Not Specified' to indicate that the firmware version should be fetched from the PcdFirmwareVersionString. Reviewed-by: Nhi Pham Signed-off-by: Tinh Nguyen --- ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 36= ++++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFun= ction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFuncti= on.c index 66ead22a6e2c..31a3f6cde544 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c @@ -1,6 +1,6 @@ /** @file=0D =0D - Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
=0D + Copyright (c) 2022 - 2023, Ampere Computing LLC. All rights reserved.=0D Copyright (c) 2021, NUVIA Inc. All rights reserved.
=0D Copyright (c) 2009, Intel Corporation. All rights reserved.
=0D Copyright (c) 2015, Hisilicon Limited. All rights reserved.
=0D @@ -170,6 +170,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) { EFI_STRING_ID TokenToGet;=0D SMBIOS_TABLE_TYPE0 *SmbiosRecord;=0D SMBIOS_TABLE_TYPE0 *InputData;=0D + CHAR16 *DefaultVersionString;=0D =0D //=0D // First check for invalid parameters.=0D @@ -187,17 +188,30 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) { HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Vendor, NULL);=0D }=0D =0D - Version =3D GetBiosVersion ();=0D + DefaultVersionString =3D HiiGetString (=0D + mSmbiosMiscHiiHandle,=0D + STRING_TOKEN (STR_MISC_BIOS_VERSION),=0D + NULL=0D + );=0D =0D - if (StrLen (Version) > 0) {=0D - TokenToUpdate =3D STRING_TOKEN (STR_MISC_BIOS_VERSION);=0D - HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);=0D - } else {=0D - OemUpdateSmbiosInfo (=0D - mSmbiosMiscHiiHandle,=0D - STRING_TOKEN (STR_MISC_BIOS_VERSION),=0D - BiosVersionType00=0D - );=0D + OemUpdateSmbiosInfo (=0D + mSmbiosMiscHiiHandle,=0D + STRING_TOKEN (STR_MISC_BIOS_VERSION),=0D + BiosVersionType00=0D + );=0D +=0D + Version =3D HiiGetString (=0D + mSmbiosMiscHiiHandle,=0D + STRING_TOKEN (STR_MISC_BIOS_VERSION),=0D + NULL=0D + );=0D +=0D + if (((StrCmp (Version, DefaultVersionString) =3D=3D 0) || (StrLen (Versi= on) =3D=3D 0))) {=0D + Version =3D GetBiosVersion ();=0D + if (StrLen (Version) > 0) {=0D + TokenToUpdate =3D STRING_TOKEN (STR_MISC_BIOS_VERSION);=0D + HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL);=0D + }=0D }=0D =0D Char16String =3D GetBiosReleaseDate ();=0D --=20 2.39.2