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.139]) by mx.groups.io with SMTP id smtpd.web11.87219.1638331941356440176 for ; Tue, 30 Nov 2021 20:12:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=PIjhlyTc; spf=pass (domain: os.amperecomputing.com, ip: 40.107.92.139, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lUH38ftRq+QeUXG2sEfqSjmzYD1XxpaH+LECmKrC2chyD0QyLMJZwtBvq6myyd/QNrdZYuE4pjtAZ1FobcvKeSj/y+TKNonUUEk0YI30A8wBPn/pRtbQ2133uhVIGc/TEu5tDxGcJB3MAWukYQQFzIQ2MSQeDaU6JPQVstAr+qLrBXYoIlRfyYncnjlp5HyBfa7maGY06qnjDUQG6lH9SAlVaied2vXfpp/xeqxguHAUIfw/K9fXjtkiNQu31W3YompR7P5T3vfSkGWvMk3DGByAwbBkOM+YeB5xY0MR3qAfe5VmHg9yaOG/iCMWOCVslkNfomlyvwrH4aMW2dkPpg== 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=wIeCotFKoZFcYIjw2Rm/hKH/GsPJqQN5YsrYUBIC70o=; b=jfGDes107IZBbdMFmB00qCljqmT/MB9d6ZzZLlvT2W/w5b+C5BTRMWCP1fdAzqRU9kef8R4gSHzxO70Pdg5cvI5P5oVteErJrDmO1DLeadaXAgAjYI9JOJ9aiHYaUI2c4OBlF6mymdMElXoAJls8mUlD0vkqHdEZoO2ysDWTyB6Ncsu019Vk+IH7fRMlOfgFeW6u8olhdxojRTwkET+YGSEp5cee1OY8HEQ1ZChOEq6PnH3V6oWNwxWiywfC3tvaPV4JnW5SdiXXEAPenvL6sfii7xF7CFwRfrIhHhS9q8Ff9JTDozemPk5iTU7vfbtlkMy3By5Z+OFcfO4XOYwR4Q== 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=wIeCotFKoZFcYIjw2Rm/hKH/GsPJqQN5YsrYUBIC70o=; b=PIjhlyTcXiRhZRkL54obDgSyfXgne8Zq4yrtfkU1zgHicPlmsAefUmDGCD3LUAKXsvIB/4ltvHnJEM2yVtbPLnhTvlElFIVVm8mfWbRYzh6dnUOnDSmWALqbUabtSB4TsD9gw8p0B811U9F9zn+L9FSpL2PFnW50pkwe5tP5UPk= 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:20 +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:20 +0000 From: "Nhi Pham" To: devel@edk2.groups.io Cc: patches@amperecomputing.com, Nhi Pham , Leif Lindholm , Ard Biesheuvel , Rebecca Cran Subject: [PATCH 2/3] ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib Date: Wed, 1 Dec 2021 11:10:30 +0700 Message-Id: <20211201041031.31824-3-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:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 58dbc4f2-724f-4ae4-fb9b-08d9b480c48d X-MS-TrafficTypeDiagnostic: PH0PR01MB6539: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cJmNhQmna8EAO9erX9wj+SN3SuBKjgJuTabcX+19V1eVyU6tx9dweeRt1by0d8YKohcaxDor48a+x/BSQ7v6Z1A7XOgKXiCOiE0+pK0V8FImMTKUWK2z5+zmMnesCyL75+yTYKrfZXBJCI19F7HMR154KQJj4YPIhH445do8Aloou0X1exaENU45GGL+qM6W0UXMBDTMRXwsuIjHIbcYGL/gG8H8zOItzXq/oF0Qavr1cwHi6WMKOw/pwF5kpIjvzxyEOWMCYW5iNhhSw5Oq0Zds31AvvSONuhXX/rOqnKtk8OHTfAFhFrzQA8oseRw2iyMbHxV5g8hlLzzyuOeagI5r0C1ktRZYoGHPP5GSI+nGY2YjvMzIeYpEoRj+DGTQ0Pz77ZaOy8wuDLZJ5pwUdP1zPKb6zfL5ntfaWyxhEZYVi5p+swHlr/7iBfcrTHe8+BE7vs2JA1uv3CKa29XfrKpQoB7aUWXOxzj2B5UuxiOQCCjksV0Vn3ogIuN9ctgA+awAeuqg5pTNN9VYef0RiyOWyZf0H6KXxMHE3n1m2KZ4Mc9vaADm7V2vMiKcFX4BUUnXMwtNXqL2y3OY99s+drkvnjtzHsG2p5dr+qJqhmYCGgwYIsRy0Gl2abmi1Co8BnoW/SqY1qhet0XmL2Ugps5uyMXq7kHQgKwJnoOQEHqzatfo8ZwU1JwATbKrCHwuf+JXvZCFcMPVODsHj8TtRA== 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)(45954011)(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?+JQFaeUtjRp8k6Q+wVi58nOFOTfR23ZW94SsYpYx/aeJ5uUf6C3ngUsTZVeo?= =?us-ascii?Q?K56GWuEuN0iKIVlEhperC9BUrNgGL9uBMVTU3MnGhE0zJfCgCZ+L3doOFwxX?= =?us-ascii?Q?81IlzlXiTzo/hHHyOIo4C/jlplW47D/OgIqr1dwX+TUNA5sMPPhZC8EUnF5+?= =?us-ascii?Q?hyykkhYIUGHR2AbljLKKFqUkFPfUUchcD/f+2h0gToxMUZE5UxgGoyrZtoWE?= =?us-ascii?Q?jjdRNK/WDlcEdakvbOu5MZQJu2w/YiSWUh3JuiTc8WhCO1/jxv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aE+Hl33h+f67qVbz+umADCz2+8eDwublW6SOKBZvGbRm6TlNj?= =?us-ascii?Q?IFz1vTTtjxh96sOs1EU+i6b1N6h3mnJI8B9jNHjzWM//JxoPvD2roScLWAhW?= =?us-ascii?Q?uq5CMAVSYbMmSnBEs4YGFaFMmOYzf1G/QqfUxr28Tk3qJ9z7FWS4KSOBa7Tc?= =?us-ascii?Q?1m7ceuVpS1286d4adFu/d0iuTlFxcfLcu9ENHNRuChkAuvU8jOsaJqNBfmC2?= =?us-ascii?Q?rFljbs5JI5N19WqC/RqlyGgfyej3Y6TSINNBthCRpdhhqhgEmK6C7z25JOZA?= =?us-ascii?Q?5XPb9h1+seLaeoQRZM0w4x4j5Al85LgSxW/ZBv/gHjiB2wOWMem4lKgPl7F1?= =?us-ascii?Q?lM3luio8Tmm+YsKMeZ1K599wBzAT8Rtn6aApnTVC+js1eQBUZpujrPtSbvnn?= =?us-ascii?Q?JUNzaHCkMwucvg+9eCNC47DGHIaL8+jy1lca1pGnNACBcFEhBvOjufIlAs50?= =?us-ascii?Q?wH44SDII03k69TiZMSv7EFVWQ7dERTeMzyOwnQVwKWJuJMsb/lADKtzM1+iC?= =?us-ascii?Q?bAlDRgrCuQ/aHgvBcsNQCmgDews=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58dbc4f2-724f-4ae4-fb9b-08d9b480c48d 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:19.8647 (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: dkkk388GZqrFijeNznrVdCw86unhI0mCJ55wQyy5waXJcYffMmTngUiHfuMZ3sDBpXah/SzE0SqkUox1OlKGwwU2AwG7c7jyJlrOCY5KOf4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6539 Content-Type: text/plain Typically, the information of the SMBIOS type 1/2/3 is fetched from an FRU device during UEFI booting intead of fixed PCDs. Therefore, this patch is to add more HII string fields in the OemMiscLib and support updating these SMBIOS types with the strings provided by the 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 | 3 +++ ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c | 10 ++++++++++ ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 15 +++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h index 0b03fe8d4de3..aa68c0a92632 100644 --- a/ArmPkg/Include/Library/OemMiscLib.h +++ b/ArmPkg/Include/Library/OemMiscLib.h @@ -44,11 +44,14 @@ typedef enum SerialNumType01, UuidType01, SystemManufacturerType01, + VersionType01, SkuNumberType01, FamilyType01, AssertTagType02, SerialNumberType02, BoardManufacturerType02, + ProductNameType02, + VersionType02, SkuNumberType02, ChassisLocationType02, AssetTagType03, diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c index 2c69c2593f5d..2c73d63444fe 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c @@ -75,12 +75,22 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscSystemManufacturer) if (StrLen (Product) > 0) { TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Product, NULL); + } else { + OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, + STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME), + ProductNameType01 + ); } pVersion = (CHAR16 *) PcdGetPtr (PcdSystemVersion); if (StrLen (pVersion) > 0) { TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_VERSION); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, pVersion, NULL); + } else { + OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, + STRING_TOKEN (STR_MISC_SYSTEM_VERSION), + VersionType01 + ); } OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c index 097777a23904..7f397d8d2aaa 100644 --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c @@ -79,18 +79,33 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBaseBoardManufacturer) if (StrLen (BaseBoardManufacturer) > 0) { TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, BaseBoardManufacturer, NULL); + } else { + OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, + STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER), + BoardManufacturerType02 + ); } BaseBoardProductName = (CHAR16 *) PcdGetPtr (PcdBaseBoardProductName); if (StrLen (BaseBoardProductName) > 0) { TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, BaseBoardProductName, NULL); + } else { + OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, + STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME), + ProductNameType02 + ); } Version = (CHAR16 *) PcdGetPtr (PcdBaseBoardVersion); if (StrLen (Version) > 0) { TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION); HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL); + } else { + OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, + STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION), + VersionType02 + ); } OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, -- 2.17.1