From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.136]) by mx.groups.io with SMTP id smtpd.web11.87220.1638331943491250419 for ; Tue, 30 Nov 2021 20:12:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=TP9ehieq; spf=pass (domain: os.amperecomputing.com, ip: 40.107.92.136, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GmsNbWBsOpCkBT6galUmectIBStzQU1nIvfCtazqJ3zjsmG6SzDDJRn3scNvWLpmZLdi7fZVK1vTKSMZm+f+bG3/xq49oz/oOpv1S2twL31HcbENp/jmZ7sqhetkpfofCCwVQ8qIcBawVKu0KABOvQ7ChRWn1C0KaVkRHjvCmUNapf2Tcb9Fq/+zR6v0a1QTrieYNQteiZ9jy0IHSjmoZR0cdCgsiL0en88PyqOK22+Sy+gf7PufOtNn5crgod7ntgysH35ud3A5XPcABqlL9zIp7jOBJdwUbQXwCGBZD8CIsS5kpd6p5IucFGJK8k2079zFOPx3+DCyiMipYDTlDg== 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=H5g9UG3ZUvDedFaFjWQjg3ZHgHZfzty4MBiia+BLsr8=; b=OOL8v2gzYnx51gozTKgwkMPTozjXHUUVO0l10IEMDRDxnNljor80BOyPBroY5pW0yIgPs5wDDjokL1B9j1eRnujOU2R9Qu8kiY8e5zCbYKBRlogAuIdFzJp2Mv3FzwU3RkU77T6C2+T7LSzgTNFONlzjGQ2wniNxZa2rK7ZqqvhydhZr2ZFDPqFFq8Qr89RaE7Zk6d0mu/80r4s/FiU2YR51yfJftH8DL6k3FaPNBrV5i2eIvwEKX4yQy+aQZdcj6Lm6VnYMk3UrTPhoR5zveot9dgRevjmhG38S9J+fOG3bGcSw3uhR3VnjbtLUAS9wDFJO8aFh8m+aN1DxxMljHw== 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=H5g9UG3ZUvDedFaFjWQjg3ZHgHZfzty4MBiia+BLsr8=; b=TP9ehieqgkwt9/1YZpXSsjuSSSTuBX+8AGl2MsjJ0sZuDvvAg70FLwlgICRVkW/dax0vg3C741u+EmoZSMiJzMQ3YHm1Dc1r5dvnmekQCsXgLqz8U9doIOsVBC6Wk3aLSFQCG+di5pICAl7aZTirRkB/+usjHin0DSvyA5vs/o4= 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 PH0PR01MB6539.prod.exchangelabs.com (2603:10b6:510:96::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Wed, 1 Dec 2021 04:12:22 +0000 Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::254c:9533:7f35:aee]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::254c:9533:7f35:aee%5]) with mapi id 15.20.4734.024; Wed, 1 Dec 2021 04:12:22 +0000 From: "Nhi Pham" To: devel@edk2.groups.io Cc: patches@amperecomputing.com, Nhi Pham , Leif Lindholm , Ard Biesheuvel , Rebecca Cran Subject: [PATCH 3/3] ArmPkg/ProcessorSubClassDxe: Get serial and part number from OemMiscLib Date: Wed, 1 Dec 2021 11:10:31 +0700 Message-Id: <20211201041031.31824-4-nhi@os.amperecomputing.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211201041031.31824-1-nhi@os.amperecomputing.com> References: <20211201041031.31824-1-nhi@os.amperecomputing.com> X-ClientProxiedBy: SG2PR01CA0124.apcprd01.prod.exchangelabs.com (2603:1096:4:40::28) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) Return-Path: nhi@os.amperecomputing.com MIME-Version: 1.0 Received: from sw004.amperecomputing.com (118.69.219.201) by SG2PR01CA0124.apcprd01.prod.exchangelabs.com (2603:1096:4:40::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.22 via Frontend Transport; Wed, 1 Dec 2021 04:12:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 286f3ac8-1f23-4a74-44e4-08d9b480c5dd X-MS-TrafficTypeDiagnostic: PH0PR01MB6539: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Hi6i8FYBEQAEwNsVTFMP1n7njQsFyuTW/DOZWeYAvrt8DraJwCIqirUJAncP3XxtJH/9gPW0mGofqqqTYCSOhWO0osvzpItdH0xAk+dEx1SUFNzgiQ24MU5d2dRkAJS2BQWSHSR5kFig+SauDn/ePu0O+rzsbHxv3WjDeDE0SwNQFmxTXYJWabtQWXzC4Ek8r8SdgytPRF9BhjHwnuiUObmUkr7mjrIzY//Xu2mHOerBxims8n58Cj/lH2gjcG/V1/KhYvDRmblaOMrxvJ+l2kqoAMS4EWubaHtqPy7akSZCVyv3ARnNpp9o+DhApfBe7zKbZWtDbwabYIAMBoCj80YBIbbsPS6NjvLwbJ6TnVjUw1UGKEeQ1OoSOPlUsjNyUWU2mL2Eny6xIzd6sqB5qCVF8hkvhhd06j21Ka97q11Ro93ossbbuXhvSdyDThigAbeEhyoRmUnQuOrb7IqHa7T153L2X4rqazJvPxyuDWgByGZjIN8/hAeo5QVzSwzs7iIujgWj6xg5nvH4fLAKRs17nUCzQ3OKeEcitxvqi9peNwvbT+iQVVyFZlx9iozqWYWwnUNyy7faZfqu+MCqZttuQdHBNDWnO5E1cpjN9fkK2wyVe3nYGJ9+y+TqsocRAoxdAGGlKBtZpzU2A6kj1FL15n9/xsJuKsqb7Pv+uNawHoVO8BZjCqMd9eYhWzMQqwnNerzz2xxTFkd7dbwvmQ== 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:(4636009)(366004)(6916009)(6666004)(6512007)(6506007)(1076003)(66556008)(8936002)(186003)(26005)(66476007)(38350700002)(66946007)(38100700002)(4326008)(52116002)(8676002)(956004)(54906003)(6486002)(86362001)(2616005)(5660300002)(316002)(19627235002)(83380400001)(2906002)(508600001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?1oJkfKEdiHZujGjuKalnFIfuHCoouNHOg/kWseEJpdubMKDoWhB6yojlBimp?= =?us-ascii?Q?rfUIIV8h+UoNanHQEFvsIb7Y/chJYcR8h4kohADR35AAWBPMjlOD3C0WCHhz?= =?us-ascii?Q?OpG2OHL4jmooLQPkqoT0cxy3SDPhBdN/2Szmu0rm6QdapJyF03VjhuMs/4+N?= =?us-ascii?Q?cyhnDIEHAsu8NBAyAyKkvlABdkN7oyqBgtJYoiGaEfQnrMrgqTHrcozRfL7z?= =?us-ascii?Q?YEq93IusMuuuYrImYTftBOAvymvQYc88wQ32Ze9xnEwmRB3wM8ZXX0EN0INM?= =?us-ascii?Q?sBJ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SCL6duqtpTXXNaR?= =?us-ascii?Q?kyFlfINAsAAOpdVR5jODCutiRH/L6n47TI16JJdWO4tsVP94uZCs5PJxFv8W?= =?us-ascii?Q?LR13xFQ3xvSkGyVPlNrZ2ItpGUgNhcjnkmVtdA3zvqhsBF8BnuXBIuL7LNR/?= =?us-ascii?Q?1/WImqUtSWyucL4rT4pI5kENE3/+z+shLxcBsXyeBmh7I1WE4QM1AlE78OIW?= =?us-ascii?Q?D50q0zK1EYdAQoB+K2+uUNxB9Z8dSfcRy2fteh+FaP64ipdd/QoQGVfTwW4t?= =?us-ascii?Q?pBsSBwOrCY20qIyZl/Z7qFEfgHL2YaPveZckwCfchqrK+L8ZdJvQgdnW5tLj?= =?us-ascii?Q?QXyEfeHuU0GM6uzWdMJGi7bT7A5qOiJgbcm5n5aOOu9pn+Y5Txkz5Q/HsoW4?= =?us-ascii?Q?gLlMxkOQs3yGx9KaPX0np5Vg5UkzQlX2MUipAoNv9k1ESXJSd+oLDX8tG/zz?= =?us-ascii?Q?E4pPUkwAhNUsc9Xakrxq9BjxUgeWnoz16lBIQQ61YJScLMnmbcSbcRrlxcvP?= =?us-ascii?Q?OSdKQw=3D=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 286f3ac8-1f23-4a74-44e4-08d9b480c5dd X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2021 04:12:22.1208 (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: 0WdAXMErYrvLSSGBIHlwqqZ7MKfBT1dsp3NTZ3G27lYXGxNSO7gehpD+YX3o0vovJ/Ae08u8LrOAt8AiDNd5Sv1A0MrXTCvkCi2F5TTj/Q8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6539 Content-Type: text/plain Currently, the serial and part number of a processor are filled with fixed PCDs. However, they may be updated dynamically according to the information being passed from a the pre-UEFI firmware during booting. So, this patch is to support updating these string fields from OemMiscLib if the PCDs are empty. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Rebecca Cran Signed-off-by: Nhi Pham --- ArmPkg/Include/Library/OemMiscLib.h | 2 ++ ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h index aa68c0a92632..5f0effa9cc17 100644 --- a/ArmPkg/Include/Library/OemMiscLib.h +++ b/ArmPkg/Include/Library/OemMiscLib.h @@ -60,6 +60,8 @@ typedef enum ChassisTypeType03, ManufacturerType03, SkuNumberType03, + ProcessorPartNumType04, + ProcessorSerialNumType04, SmbiosHiiStringFieldMax } OEM_MISC_SMBIOS_HII_STRING_FIELD; diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c index fb484086a457..8d884d313bd4 100644 --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c @@ -493,9 +493,19 @@ AllocateType4AndSetProcessorInformationStrings ( SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorManufacturer, ProcessorManu); SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorVersion, ProcessorVersion); - SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorSerialNumber, SerialNumber); SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorAssetTag, AssetTag); - SET_HII_STRING_IF_PCD_NOT_EMPTY (PcdProcessorPartNumber, PartNumber); + + if (StrLen ((CHAR16 *)PcdGetPtr (PcdProcessorSerialNumber)) > 0) { + HiiSetString (mHiiHandle, SerialNumber, (CHAR16 *)PcdGetPtr (PcdProcessorSerialNumber), NULL); + } else { + OemUpdateSmbiosInfo (mHiiHandle, SerialNumber, ProcessorSerialNumType04); + } + + if (StrLen ((CHAR16 *)PcdGetPtr (PcdProcessorPartNumber)) > 0) { + HiiSetString (mHiiHandle, PartNumber, (CHAR16 *)PcdGetPtr (PcdProcessorPartNumber), NULL); + } else { + OemUpdateSmbiosInfo (mHiiHandle, PartNumber, ProcessorPartNumType04); + } // Processor Designation StringBufferSize = sizeof (CHAR16) * SMBIOS_STRING_MAX_LENGTH; -- 2.17.1