From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.96]) by mx.groups.io with SMTP id smtpd.web12.1670.1663050166495091101 for ; Mon, 12 Sep 2022 23:22:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=ECOqTZpR; spf=pass (domain: os.amperecomputing.com, ip: 40.107.223.96, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Po1iLV3eQ42KGogrsSNtxrlhFsf1TnDgvwxMGnWHxslvtZCp/viDxtJL2wVCPFh01YIYJh13PEiAJ1QDDPJK86rKmF1Q4XISqQ64dQQN2JIeMC/Ks46HDwmV9lnZseWEQerTCJp7YQhbKf8GDulAjbzCgCyXs8umj/9HSq76GIhqf2PjLIHJ/tVkr0KkVf7M+Afn9yxHxo2KD+Ue1RBxDDhGnTSsPSu+9zpAlPjEBDPSkk2SeznKA9PVpulegplNytvk5C6fqE9gif22tbK7YSXZLqP28779Jr0WbcdSKgDdeogHB0pt8W1RNSWTSQY/kbGj8Hdo0Ym1l6mfJGqKxg== 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=q71BDSLAKgQbysV2TLhvR33Qf+5f6rYWyAKlEyJ1L+M=; b=jT2lMxwytfoVMpelmnprkiXVIYfSM5mYnta1PGrnPGN5ZtGiOc1SfqpyHgM8XU/IZaQ70koDM8753QJk9GEspRTkePlhFkkNOO/rmuWRLnmI6rPalwnpO52U0/Zoo8IgneEyiHlbXgkb7P3tzZc5ZDdKrOP6azx70m1D1dPw3ccSCr9nW9GX5MhfRxd4cs64oYqASiZ+4QjV2D3jRujESdQemReIC3hHGEihmYxydSwGgiNHqAc9TP6F7BnPrLswZdloKQhYRCDrvOLZIPz6i9a+eYNfWWcJGJy35c7Pqr7SMkV3R8Ezj2/UkT4r10e2wQGQOgBFQSnphUg7oamj7Q== 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=q71BDSLAKgQbysV2TLhvR33Qf+5f6rYWyAKlEyJ1L+M=; b=ECOqTZpRu5i/hf079bXHfJyCnDBFr5uGszo1nDhBgegr/AAzkhYaotViRWPhBDjxrpJEGxVp32WLR1YeWcwJXB7Dd47RssKsP/noac67Y0sH2BpD/oiwdbe7uGT24MkhLn6qCgVcCA7LN1viliwHWbQ2QHAASSGD3ddDOCHXQxU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by MN2PR01MB5854.prod.exchangelabs.com (2603:10b6:208:195::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 06:22:43 +0000 Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::fc6b:4f56:8f32:dfa5]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::fc6b:4f56:8f32:dfa5%4]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 06:22:43 +0000 From: "Nhi Pham" 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: [PATCH v3 1/6] ArmPkg/ProcessorSubClassDxe: Get processor version from OemMiscLib Date: Tue, 13 Sep 2022 13:19:42 +0700 Message-Id: <20220913061947.735951-2-nhi@os.amperecomputing.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220913061947.735951-1-nhi@os.amperecomputing.com> References: <20220913061947.735951-1-nhi@os.amperecomputing.com> X-ClientProxiedBy: SG2PR06CA0194.apcprd06.prod.outlook.com (2603:1096:4:1::26) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) Return-Path: nhi@os.amperecomputing.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7287:EE_|MN2PR01MB5854:EE_ X-MS-Office365-Filtering-Correlation-Id: c8cb99bd-c959-4779-0bd9-08da95505d40 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8RC67Tk0TWx8D6z5AbglE4XDNLF2IIs8+lyhIBRK+hp9VY3Wh0uxC1Tc2UmhTQzk+TqSi1md7TP0tfRfdVzyLGVhNFBbwoilNyctCVg76U+6UvGGJ/mbXW8J8W7g9O6+M2Tf61OGvMRnaGE1voYh67EjzAJVVipsSGQFSTFChrumFAuHizu4fB7zsDOl3cDqIq0mFRSuXwYad8Jm6fYc55YnJhiKZdchGE0KiBTaYZGwcLWoup94s+uRL4NFS1LOPIHnPStbtiJwDThDcJO8YysIwvvqDKrkF4OMvg4Uu54ZQY6s32rjISkOnBDPqCf2QIjH0ADiTFVL2mog2z6wtB/5+BLpsznuNnv620+lCngyRh/dJIaO5If3WZml4NqEWR9g9N0+vRshxhCe6fNvtIK8zeD8fNs6mkW3ACsp7oGUXHJw+9ouoptRQMKdfuABg1xhDz8cmO0OHsOo+T6jRpNbS08e4WQzBEjCVlINlx2d1ZW9IxNOHKX45K8TtpZjGn+8WYPJ+E1PwsNAzLAdJepnS6zJqWeFOJPdTLx4H/HK2CKYs1tP/07uDWq4ctSqoBkeLOwI6P6zuLAujJvgoy1IebOXR4G4VRGEOlVaYpR1NFwesMngbnvKdVq/9ovRdy2pIFAi4DYHTq+zk6tyD/U/kQJ/0UrFEY4IW9HyF8Wy/f3tP7X53KWHEcTcI+i2EtBigcuCN41B/YQDI0S4WliBw6kSr+WQvJNsKIIJYI1hsWzCILJywQWfczTyyjn7I0O8iBAfJt9ckjI1wzkCZQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB7287.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(396003)(39850400004)(366004)(346002)(376002)(451199015)(26005)(478600001)(1076003)(6486002)(186003)(19627235002)(5660300002)(2616005)(6512007)(38100700002)(316002)(2906002)(8936002)(4326008)(41300700001)(66946007)(38350700002)(8676002)(83380400001)(66476007)(66556008)(52116002)(86362001)(6506007)(54906003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?aZUE2u+rB3wjILEsJW7oSrNdegLN18KKFUM67lneoShfEWzl0xUYIlo66sGq?= =?us-ascii?Q?/vfYRf6nCMUO8nO/sJIZtXuDl3VNnnitoY035qyqsMdl1/UgmWfNssNiq0i1?= =?us-ascii?Q?HbmU5dzCHsRoi7Yn8JaEKwLUvlRWatbKjD333b/gYfxZFzf9oLvPcW4DpDdi?= =?us-ascii?Q?ra6H+BIrjnnFXRuveQZMBqJ/qYZMsZtaQEXyFH+dTOH9bmF62RFggHLzBnX8?= =?us-ascii?Q?KB7SX412VvhCoPfPCVdAEf7YzqeagRNletD+OuWI3gm0sw3GE/ZwS0oSxp4O?= =?us-ascii?Q?PbSSLExxdlUdYhbw5xdADX4p7mIVVLrfvfByQG4qJ8QzHw7lwiy7CW49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O8uUnp5txS8z81Jd9nTCVLRA+Ek2e0fM/kxfrY5p+6rtbkNGUxqphYK?= =?us-ascii?Q?lUBueLByImcaimWWc4udNYlo4Ozl3na2S3uVDehph7GpyOTDQ72U8EfyAucN?= =?us-ascii?Q?TQRF69fTdz5hsjQfjbKeFe1+5B3WOFpsBymq4CiQKd2b6a2KP7oRrzASv0c5?= =?us-ascii?Q?CUNdOr3O7ZyDYyJH3HoxwQbai3LQopYOl4cT7W5Cts0eda8nmXA5PhSAfP9g?= =?us-ascii?Q?MK3LUXUmRjAWGnv4/n4av0sRYfZw/DLJIA0mvFnUa80WFVOTst4kfP2S3roz?= =?us-ascii?Q?uadm4MBrt7B3urRXVT++KL4Go/L3SNDQC4Zn7nngvs0IFEgen90gcWtPf7Gu?= =?us-ascii?Q?RhK59413ahXIEXtCuupq55hehzU8FFfnRNzZe2nlTa1OUf0i9Y5QszWY1R/3?= =?us-ascii?Q?eclLswmPPRYPCdrhZk8eDYA=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8cb99bd-c959-4779-0bd9-08da95505d40 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 06:22:43.1370 (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: 9dp91L6nP1xsgiZaWrVTbe50a0Epaw4vdOraI88jWYXPNwSAATUlngUng+rs9gsqAL0tk359DdXEBzBuavsWMPa+Ov5TgpTq0I19xQ7QcAk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR01MB5854 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain From: Minh Nguyen In some scenarios, the processor version may be updated dynamically from pre-UEFI firmware during booting. But the processor version is fixed with PCD (PcdProcessorVersion), so it can not be updated it dynamically. This patch will support setting that value both statically and dynamically. Signed-off-by: Nhi Pham Reviewed-by: Rebecca Cran Reviewed-by: Sami Mujawar Acked-by: Ard Biesheuvel --- ArmPkg/Include/Library/OemMiscLib.h | 2 ++ ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c | 8 +++++= ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/O= emMiscLib.h index 47cb30d84a62..330bb4b014de 100644 --- a/ArmPkg/Include/Library/OemMiscLib.h +++ b/ArmPkg/Include/Library/OemMiscLib.h @@ -1,5 +1,6 @@ /** @file=0D *=0D +* Copyright (c) 2022, Ampere Computing LLC. All rights reserved.=0D * Copyright (c) 2021, NUVIA Inc. All rights reserved.=0D * Copyright (c) 2015, Hisilicon Limited. All rights reserved.=0D * Copyright (c) 2015, Linaro Limited. All rights reserved.=0D @@ -58,6 +59,7 @@ typedef enum { SkuNumberType03,=0D ProcessorPartNumType04,=0D ProcessorSerialNumType04,=0D + ProcessorVersionType04,=0D SmbiosHiiStringFieldMax=0D } OEM_MISC_SMBIOS_HII_STRING_FIELD;=0D =0D diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass= .c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c index 0b9af9bd7e1c..3b12e26abf6e 100644 --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c @@ -1,6 +1,7 @@ /** @file=0D ProcessorSubClass.c=0D =0D + Copyright (c) 2022, Ampere Computing LLC. All rights reserved.=0D Copyright (c) 2021, NUVIA Inc. All rights reserved.
=0D Copyright (c) 2015, Hisilicon Limited. All rights reserved.=0D Copyright (c) 2015, Linaro Limited. All rights reserved.=0D @@ -512,7 +513,6 @@ AllocateType4AndSetProcessorInformationStrings ( PartNumber =3D STRING_TOKEN (STR_PROCESSOR_PART_NUMBER);=0D =0D SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorManufacturer, ProcessorManu= );=0D - SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorVersion, ProcessorVersion);= =0D SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorAssetTag, AssetTag);=0D =0D if (StrLen ((CHAR16 *)FixedPcdGetPtr (PcdProcessorSerialNumber)) > 0) {= =0D @@ -527,6 +527,12 @@ AllocateType4AndSetProcessorInformationStrings ( OemUpdateSmbiosInfo (mHiiHandle, PartNumber, ProcessorPartNumType04);= =0D }=0D =0D + if (StrLen ((CHAR16 *)FixedPcdGetPtr (PcdProcessorVersion)) > 0) {=0D + HiiSetString (mHiiHandle, ProcessorVersion, (CHAR16 *)FixedPcdGetPtr (= PcdProcessorVersion), NULL);=0D + } else {=0D + OemUpdateSmbiosInfo (mHiiHandle, ProcessorVersion, ProcessorVersionTyp= e04);=0D + }=0D +=0D // Processor Designation=0D StringBufferSize =3D sizeof (CHAR16) * SMBIOS_STRING_MAX_LENGTH;=0D ProcessorStr =3D AllocateZeroPool (StringBufferSize);=0D --=20 2.25.1