From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.64]) by mx.groups.io with SMTP id smtpd.web10.166.1609882982968099288 for ; Tue, 05 Jan 2021 13:43:04 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=phPqGTRX; spf=pass (domain: arm.com, ip: 40.107.5.64, mailfrom: samer.el-haj-mahmoud@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9YRUiotHqT+Mpu+dg42klzS1O17go+zEQs9ONMsCCTw=; b=phPqGTRXd6Kcox5xfN06IN949GzOTUAc1sIoQ/OfvCc8MYF8hf9hxIvBndIR7SdWwnjCWoKYF+Yu34agyu4eHaKvc6zJFjmNAUgDKe705RZFglPgCJTqrbKFq4pT3nVyBukx2rCFEf2DP+Vi8rxI0zm6gGC+E3HH5QiO/o5ISwM= Received: from AS8PR04CA0026.eurprd04.prod.outlook.com (2603:10a6:20b:310::31) by VI1PR0802MB2496.eurprd08.prod.outlook.com (2603:10a6:800:b8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.24; Tue, 5 Jan 2021 21:42:57 +0000 Received: from AM5EUR03FT062.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:310:cafe::2f) by AS8PR04CA0026.outlook.office365.com (2603:10a6:20b:310::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.20 via Frontend Transport; Tue, 5 Jan 2021 21:42:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT062.mail.protection.outlook.com (10.152.17.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.21 via Frontend Transport; Tue, 5 Jan 2021 21:42:57 +0000 Received: ("Tessian outbound 6af064f543d4:v71"); Tue, 05 Jan 2021 21:42:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 94043a18647a807a X-CR-MTA-TID: 64aa7808 Received: from af4a64bae0ca.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5BF9B014-BC2F-4453-9AA6-3CB5373FE70A.1; Tue, 05 Jan 2021 21:42:51 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id af4a64bae0ca.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 05 Jan 2021 21:42:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bf1yP7VjrY2/OTh6sOUd0QlIpsVv8nypXutycof63LcPNJvjwejQ7XVo7SO5oEu2fUu5+MKy2jC2HYvohcYJjwGFdGztyp2bNmt07WUREplASVyUyADrOjBN7qHffVGQh7aojU2ENTaj+Rl0mN2qPTNtIikwD4cxQAjuKpX0cgzpHORpxiOkXN0Nk3LS2UV9bhHBPepIytq+pq/c2Nmn0tTdSpwIVtyTSj/CV/pzEsWDNkSjpViIsGVmkfcccu00ziiw4ymBFE7SCFQwnAzojFpRHTuqhDowuc85u7sYOkKLMAp36QSSw4zId/aS2qiJPb40KRagMWt241sWPPXhlw== 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-SenderADCheck; bh=9YRUiotHqT+Mpu+dg42klzS1O17go+zEQs9ONMsCCTw=; b=EOAV4RdnNBAWkRDpgjn77Im4MV1deDJ0alTyThcW8NOvNWU/SMxG8DEyVGelFcUgxwcF06JimGR4bHZArqRsjCeWW9ZsRP7SvJ1A+IO5KA8Bike2xpFnTHCnn748YBt96kDiQLaG3sB4ElLcY31uGzjPk8ATScrHarinSGA8bkPN+Z74U5yGB/iUBtQPHCJMRTOIn/sXH9+q3P4PlpUdY1bE7fYd1uHVnGD2DgFRoI8KEOnjRRvSevFLsfPVeEYZCApq9gRCAs3abZjemT0KKcgSJo5xF5zJ2g4ui8Kl/9ArmsJaS/4P+XLDNAnTECCIzLkNdbUR/A/1p+nvzkq6Cg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9YRUiotHqT+Mpu+dg42klzS1O17go+zEQs9ONMsCCTw=; b=phPqGTRXd6Kcox5xfN06IN949GzOTUAc1sIoQ/OfvCc8MYF8hf9hxIvBndIR7SdWwnjCWoKYF+Yu34agyu4eHaKvc6zJFjmNAUgDKe705RZFglPgCJTqrbKFq4pT3nVyBukx2rCFEf2DP+Vi8rxI0zm6gGC+E3HH5QiO/o5ISwM= Received: from DB7PR08MB3260.eurprd08.prod.outlook.com (2603:10a6:5:21::23) by DBBPR08MB6203.eurprd08.prod.outlook.com (2603:10a6:10:201::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.23; Tue, 5 Jan 2021 21:42:48 +0000 Received: from DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::a1f1:ccfd:b17f:a490]) by DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::a1f1:ccfd:b17f:a490%5]) with mapi id 15.20.3721.023; Tue, 5 Jan 2021 21:42:48 +0000 From: "Samer El-Haj-Mahmoud" To: "devel@edk2.groups.io" , "rebecca@nuviainc.com" CC: Leif Lindholm , Ard Biesheuvel , Sami Mujawar , Liming Gao , Michael D Kinney , Zhiguang Liu , Samer El-Haj-Mahmoud Subject: Re: [edk2-devel] [PATCH v5 12/23] ArmPkg: Add Universal/Smbios/SmbiosMiscDxe/Type00 Thread-Topic: [edk2-devel] [PATCH v5 12/23] ArmPkg: Add Universal/Smbios/SmbiosMiscDxe/Type00 Thread-Index: AQHW4u3EDEsHlh9uFUuRQz9579FtsKoZiRAQ Date: Tue, 5 Jan 2021 21:42:48 +0000 Message-ID: References: <20210104225830.12606-1-rebecca@nuviainc.com> <20210104225830.12606-13-rebecca@nuviainc.com> In-Reply-To: <20210104225830.12606-13-rebecca@nuviainc.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; x-originating-ip: [99.132.126.10] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: cf679cf4-729d-4e6f-fe65-08d8b1c2ddba x-ms-traffictypediagnostic: DBBPR08MB6203:|VI1PR0802MB2496: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:6430;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: tIdhj2tAu2OIE9qOJvPolplIq+v8PSCwd213VFei7BycH3ZL4LFTZT6ktt8RlS6oXiJuFDekmMnDtAHRetShydKWsWRFs0qilJfrmLTsAIOdy5YqKHAkXY1FAwZXYI9is7V0rluMVOokddFTwLIdUKs/vbK/k/QnkY5BxOSgoqlBYjjUn36XHxjKa+WrlAb/ZU1eb9HnlOWm2jQ8DShnoP5HsYGYL5qTyjfezjIL+Hf3FhRhqaS2Zc4rRud8p3e2Uc1f4cyJ0Llom6zgaFV4H0vI8ktmp4oGIlDixGEMYugshGFK5i/GCGZHFiHLAh9H2KtJZyDlX44jjoaFVwCKqFTXqlcaDMfvu833jkg+zocwpfBncfs/vhQ+3GKwwsb3e3ySafoMD6LxRnZ0b17u72tOtmxsMHxSnlXX2eipudJ7FTZAhpcDjNTbRRIASPGMI1h6hL7cT90Uff/p4yNYtg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR08MB3260.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(346002)(396003)(136003)(39850400004)(376002)(52536014)(4326008)(71200400001)(6506007)(76116006)(19627235002)(83380400001)(26005)(8936002)(30864003)(316002)(7696005)(54906003)(110136005)(966005)(55016002)(33656002)(2906002)(5660300002)(478600001)(53546011)(186003)(66946007)(9686003)(86362001)(66446008)(66476007)(8676002)(66556008)(64756008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?xjPwevAsec2NcvDw3dJarninaZiPRA1yX1W+HgTfJbFdtuGUDITTTj77vUdF?= =?us-ascii?Q?VKdpFMtGnG4Oea6Zq4+WIA0F5m5mb3mLXje5NtHJmbgup3kKkmE35spNv1xg?= =?us-ascii?Q?LhkX/2bKtMBDP5WK0Aey7bJOlBf011ScJue84UriIs0n5zN74wRMcJ85E2OO?= =?us-ascii?Q?1DWajlKpMiEQLCFapmSEgKxFIC8raAUWVYW0UmiQ1LRvYpPImM+WUSZh95xZ?= =?us-ascii?Q?y2XO86VSJ3pl7MtsFzFMaA8CEnhNiWlL+ETJMfk5Vacm/hTi35R38H95CatT?= =?us-ascii?Q?kGsdyIanjKowFePlwZakARZ/w6aruVFcJ9+BZUGsqzhZRtG55N3KJt6PiiHf?= =?us-ascii?Q?izjGdKohRydFonPfubsl/QUJD2uQToiILelnxwLc3olJ+Jn3k3bYu97y7Jf6?= =?us-ascii?Q?N1ud0G4hZuvNcqPrwVC5wy/+V+yRqD4cOvSaOF+EwloQY/PDQ4r6d5NnW/nh?= =?us-ascii?Q?qoFGBQTesVaB8pWIaN/twffqhuOB+wA4CStz2DyiQqxOlCEfWMYLHcXp197k?= =?us-ascii?Q?LyYQwnmXzvhHzJAsKKABmavoV+KmJSa8YqBbdBV3K8eBY+A13cTXOylBsBMB?= =?us-ascii?Q?RZkUTl5lYFX7TIhXbribACFf1JXGt83CdeGwQcMY8YxdxsDqPdRZgLA4WHa7?= =?us-ascii?Q?dRBPpBRZ00/XvTODjRnw5vMFzR1EcF9Q92Q1KhT6fgx21RaW4Ne7gg76dBy/?= =?us-ascii?Q?fFsertAlrG3X4Hd3bXEPe7ouS2zW9jONMuMUfExBRmAi4tG++LfBTemxlD5b?= =?us-ascii?Q?89HmwdvoZU7r50DKLQxzp50f78JPV59HqNGSt+RssRCNDKa3UXu33oKV3NWM?= =?us-ascii?Q?LeNObTRGHEN2V40pmlREbBsyKdNkvcgc46GPLNJGesqpGnZ3fjz9Umc9w4F0?= =?us-ascii?Q?YXnzlv2KMAjV6qa1DZnXs+LyAukbUdfY7JZiLSmV4VJz42pxcj55uPQA8Z0e?= =?us-ascii?Q?dltaf2wTTcEJzJwZaP2NEZOOlIful5aPE2sw64uAnhw=3D?= MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6203 Original-Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; Return-Path: Samer.El-Haj-Mahmoud@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 2f212646-1f6a-44e9-b744-08d8b1c2d89c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sxNAKqkQZAQcLkhOX++v37Pm8dtD+bUX2fbGjcvtG1E3t2TU2doMOJItc6nqXmUYY0FSGLXsyoxLpAg53lNWhiPC1X/z5Cpdw5BDZUdRVGUX2ii0cvSAbg3FAVcTRbyq1p/hbZJNPoaU1xC4haoOCepyFmqhTjOVkpWZTtO0NwObtEUFuRGe7UeuuaoBeKcKTZZlrfS6vw0uDathAupODc/BGLABX6fhSNxkGP/FAWS7gmo8fsZAPF3e0WoemdISPQrhe3G1ouu0IZE1Na7dpTQPIKzB/+bC51KECM4Ei9pREDxdvkr82SkEdBkEOrc9mg5ruOvHI2qdhYxAloPStSeX4YCk2p6ZE5hiHjKgQf/T5V2ttC4VSKvdW1AtC+REKmOVYHFbcALxcuKYgp6FaPg+kF/5MXFsxEtIcwDL69D6lF0jadi83Irj894ds4LrLxf1PBhBT7RwcmCdU/tORVBywCuxEeR0nlxLFMnSWZHt6siZMgzrXUK/uom1vPbV2D+IoGfoU2rQwMfHevPCMGFEL8ixQiPRXRkJuxZ8uJ8= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(136003)(376002)(396003)(39850400004)(346002)(46966006)(8676002)(81166007)(53546011)(86362001)(82740400003)(186003)(336012)(9686003)(26005)(47076005)(55016002)(2906002)(356005)(4326008)(33656002)(30864003)(6506007)(7696005)(8936002)(110136005)(70586007)(54906003)(966005)(19627235002)(70206006)(83380400001)(52536014)(316002)(82310400003)(5660300002)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2021 21:42:57.3976 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf679cf4-729d-4e6f-fe65-08d8b1c2ddba X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2496 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Rebecca > Cran via groups.io > Sent: Monday, January 4, 2021 5:58 PM > To: devel@edk2.groups.io > Cc: Rebecca Cran ; Leif Lindholm > ; Ard Biesheuvel ; Sami > Mujawar ; Liming Gao > ; Michael D Kinney > ; Zhiguang Liu > Subject: [edk2-devel] [PATCH v5 12/23] ArmPkg: Add > Universal/Smbios/SmbiosMiscDxe/Type00 > > This code provides information for the SMBIOS Type 0 table. > > Signed-off-by: Rebecca Cran > --- > ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorData.c > | 92 +++++++ > > ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunctio > n.c | 281 ++++++++++++++++++++ > ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendor.uni > | 17 ++ > 3 files changed, 390 insertions(+) > > diff --git > a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorData.c > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorData.c > new file mode 100644 > index 000000000000..3b0d907c3996 > --- /dev/null > +++ > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorData.c > @@ -0,0 +1,92 @@ > +/** @file > + This file provides Smbios Type0 Data > + > + Based on the files under Nt32Pkg/MiscSubClassPlatformDxe/ > + > + Copyright (c) 2006 - 2009, Intel Corporation. All rights > + reserved.
Copyright (c) 2015, Hisilicon Limited. All rights > + reserved.
Copyright (c) 2015, Linaro Limited. All rights > + reserved.
> + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > + > +#include "SmbiosMisc.h" > + > + > +// > +// Static (possibly build generated) Bios Vendor data. > +// > +MISC_SMBIOS_TABLE_DATA(SMBIOS_TABLE_TYPE0, MiscBiosVendor) =3D { > + { // Hdr > + EFI_SMBIOS_TYPE_BIOS_INFORMATION, // Type, > + 0, // Length, > + 0 // Handle > + }, > + 1, // Vendor > + 2, // BiosVersion > + 0xE000, // BiosSegment > + 3, // BiosReleaseDate > + 0, // BiosSize > + { // BiosCharacteristics > + 0, // Reserved = :2 > + 0, // Unknown = :1 > + 0, // BiosCharacteristicsNo= tSupported :1 > + 0, // IsaIsSupported = :1 > + 0, // McaIsSupported = :1 > + 0, // EisaIsSupported = :1 > + 1, // PciIsSupported = :1 Not all platforms support PCI. Can any of these be overridden by a platfor= m PCD? May not worth it as these flags are not really used by any OS/user s= oftware because they are often incorrect. > + 0, // PcmciaIsSupported = :1 > + 1, // PlugAndPlayIsSupporte= d :1 > + 0, // ApmIsSupported = :1 > + 1, // BiosIsUpgradable = :1 > + 1, // BiosShadowingAllowed = :1 > + 0, // VlVesaIsSupported = :1 > + 0, // EscdSupportIsAvailabl= e :1 > + 1, // BootFromCdIsSupported= :1 > + 1, // SelectableBootIsSuppo= rted :1 > + 0, // RomBiosIsSocketed = :1 > + 0, // BootFromPcmciaIsSuppo= rted :1 > + 1, // EDDSpecificationIsSup= ported :1 Should be 0. This is x86 legacy Enhanced Disk Drive Spec > + 0, // JapaneseNecFloppyIsSu= pported :1 > + 0, // JapaneseToshibaFloppy= IsSupported :1 > + 0, // Floppy525_360IsSuppor= ted :1 > + 0, // Floppy525_12IsSupport= ed :1 > + 0, // Floppy35_720IsSupport= ed :1 > + 0, // Floppy35_288IsSupport= ed :1 > + 0, // PrintScreenIsSupporte= d :1 > + 0, // Keyboard8042IsSupport= ed :1 > + 0, // SerialIsSupported = :1 > + 0, // PrinterIsSupported = :1 > + 0, // CgaMonoIsSupported = :1 > + 0, // NecPc98 = :1 > + 0 // ReservedForVendor = :32 > + }, > + > + { > + 0x03, // BIOSCharacteristics= ExtensionBytes[0] > + // { // BiosReserved > + // 1, // AcpiIsSupported= :1 > + // 1, // UsbLegacyIsSupp= orted :1 Should be 0. This is x86 legacy USB BIOS support > + // 0, // AgpIsSupported = :1 > + // 0, // I20BootIsSuppor= ted :1 > + // 0, // Ls120BootIsSupp= orted :1 > + // 0, // AtapiZipDriveBo= otIsSupported :1 > + // 0, // Boot1394IsSuppo= rted :1 > + // 0 // SmartBatteryIsS= upported :1 > + // }, > + 0x0D //BIOSCharacteristicsE= xtensionBytes[1] > + // { //SystemReserved > + // 1, //BiosBootSpecIsSu= pported :1 Should be 0. "BIOS Boot Spec" is the legacy "BBS 1.01" spec, which is not = supported on Arm UEFI systems (it is only supported on legacy BIOS x86 syst= ems) > + // 0, //FunctionKeyNetwo= rkBootIsSupported :1 > + // 1, //TargetContentDis= tributionEnabled :1 > + // 1, //UefiSpecificatio= nSupported :1 > + // 0, //VirtualMachineSu= pported :1 > + // 0 //ExtensionByte2Re= served :3 > + // }, > + }, > + 0xFF, // SystemBiosMajorReleas= e; > + 0xFF, // SystemBiosMinorReleas= e; > + 0xFF, // EmbeddedControllerFirmwa= reMajorRelease; > + 0xFF // EmbeddedControllerFirmwa= reMinorRelease; These 4 fields are important and must be populated. Windows for example re= quire these not to be 0xFF (see https://docs.microsoft.com/en-us/windows-ha= rdware/design/compatibility/whcp-specifications-policies , Systems.pdf, und= er System.Fundamentals.SMBIOS). The RPi for instance populates the SystemBi= os Major/Minor fields from as values derived from PcdFirmwareVersionString,= although that is platform specific (see for instance Platform/RaspberryPi/= Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c). The best approach in my opi= nion is to let the platforms pass these values using either dynamic PCDs or= an Oem library call. > +}; > diff --git > a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFuncti > on.c > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFuncti > on.c > new file mode 100644 > index 000000000000..4074b10d70f2 > --- /dev/null > +++ > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFuncti > o > +++ n.c > @@ -0,0 +1,281 @@ > +/** @file > + This driver parses the mMiscSubclassDataTable structure and reports > + any generated data to the DataHub. > + > + Copyright (c) 2009, Intel Corporation. All rights reserved.
> + Copyright (c) 2015, Hisilicon Limited. All rights reserved.
> + Copyright (c) 2015, Linaro Limited. All rights reserved.
> + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include "SmbiosMisc.h" > +typedef struct { > + CONST CHAR8* MonthStr; > + UINT32 MonthInt; > +} MONTH_DESCRIPTION; > + > +STATIC CONST > +MONTH_DESCRIPTION mMonthDescription[] =3D { > + { "Jan", 1 }, > + { "Feb", 2 }, > + { "Mar", 3 }, > + { "Apr", 4 }, > + { "May", 5 }, > + { "Jun", 6 }, > + { "Jul", 7 }, > + { "Aug", 8 }, > + { "Sep", 9 }, > + { "Oct", 10 }, > + { "Nov", 11 }, > + { "Dec", 12 }, > + { "???", 1 }, // Use 1 as default month }; > + > +/** > + Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a byte, wi= th > '64k' > + as the unit. > + > + @param Value Pointer to Base2_Data > + > + @retval > + > +**/ > +UINT8 > +Base2ToByteWith64KUnit ( > + IN UINTN Value > + ) > +{ > + UINT8 Size; > + > + Size =3D ((Value + (SIZE_64KB - 1)) >> 16); > + > + return Size; > +} > + > +/** > + Returns the date and time this file (and firmware) was built. > + > + @param[out] *Time Pointer to the EFI_TIME structure to fill in. > +**/ > +VOID > +GetReleaseTime ( > + OUT EFI_TIME *Time > + ) > +{ > + CONST CHAR8 *ReleaseDate =3D __DATE__; > + CONST CHAR8 *ReleaseTime =3D __TIME__; > + UINTN i; > + > + for (i =3D 0; i < 12; i++) { > + if (AsciiStrnCmp (ReleaseDate, mMonthDescription[i].MonthStr, 3) = =3D=3D 0) { > + break; > + } > + } > + > + Time->Month =3D mMonthDescription[i].MonthInt; > + Time->Day =3D AsciiStrDecimalToUintn (ReleaseDate + 4); > + Time->Year =3D AsciiStrDecimalToUintn (ReleaseDate + 7); > + Time->Hour =3D AsciiStrDecimalToUintn (ReleaseTime); > + Time->Minute =3D AsciiStrDecimalToUintn (ReleaseTime + 3); > + Time->Second =3D AsciiStrDecimalToUintn (ReleaseTime + 6); } > + > +/** > + Fetches the firmware ('BIOS') release date from the > + FirmwareVersionInfo HOB. > + > + @return The release date as a UTF-16 string **/ > +CHAR16 * > +GetBiosReleaseDate ( > + VOID > + ) > +{ > + CHAR16 *ReleaseDate; > + EFI_TIME BuildTime; > + > + ReleaseDate =3D AllocateZeroPool ((sizeof (CHAR16)) * > + SMBIOS_STRING_MAX_LENGTH); if (ReleaseDate =3D=3D NULL) { > + return NULL; > + } > + > + GetReleaseTime (&BuildTime); > + > + (VOID)UnicodeSPrintAsciiFormat (ReleaseDate, > + (sizeof (CHAR16)) * SMBIOS_STRING_MAX_LENGTH, > + "%02d/%02d/%4d", > + BuildTime.Month, > + BuildTime.Day, > + BuildTime.Year > + ); > + > + return ReleaseDate; > +} > + > +/** > + Fetches the firmware ('BIOS') version from the > + FirmwareVersionInfo HOB. > + > + @return The version as a UTF-16 string **/ > +CHAR16 * > +GetBiosVersion ( > + VOID > + ) > +{ > + CHAR16 *ReleaseString; > + > + ReleaseString =3D > + (CHAR16 *)FixedPcdGetPtr (PcdFirmwareVersionString); > + > + return ReleaseString; > +} > + > + > +/** > + This function makes boot time changes to the contents of the > + MiscBiosVendor (Type 0). > + > + @param RecordData Pointer to copy of RecordData from= the Data > Table. > + > + @retval EFI_SUCCESS All parameters were valid. > + @retval EFI_UNSUPPORTED Unexpected RecordType value. > + @retval EFI_INVALID_PARAMETER Invalid parameter was found. > + > +**/ > +MISC_SMBIOS_TABLE_FUNCTION (MiscBiosVendor) { > + CHAR8 *OptionalStrStart; > + CHAR8 *StrStart; > + UINTN VendorStrLen; > + UINTN VerStrLen; > + UINTN DateStrLen; > + UINTN BiosPhysicalSize; > + CHAR16 *Vendor; > + CHAR16 *Version; > + CHAR16 *ReleaseDate; > + CHAR16 *Char16String; > + EFI_STATUS Status; > + EFI_STRING_ID TokenToUpdate; > + EFI_STRING_ID TokenToGet; > + SMBIOS_TABLE_TYPE0 *SmbiosRecord; > + EFI_SMBIOS_HANDLE SmbiosHandle; > + SMBIOS_TABLE_TYPE0 *InputData; > + > + // > + // First check for invalid parameters. > + // > + if (RecordData =3D=3D NULL) { > + return EFI_INVALID_PARAMETER; > + } > + > + InputData =3D (SMBIOS_TABLE_TYPE0 *)RecordData; > + > + Vendor =3D (CHAR16 *) PcdGetPtr (PcdFirmwareVendor); > + > + if (StrLen (Vendor) > 0) { > + TokenToUpdate =3D STRING_TOKEN (STR_MISC_BIOS_VENDOR); > + HiiSetString (mHiiHandle, TokenToUpdate, Vendor, NULL); } > + > + Version =3D GetBiosVersion(); > + > + if (StrLen (Version) > 0) { > + TokenToUpdate =3D STRING_TOKEN (STR_MISC_BIOS_VERSION); > + HiiSetString (mHiiHandle, TokenToUpdate, Version, NULL); } else { > + Version =3D (CHAR16 *) PcdGetPtr (PcdFirmwareVersionString); > + if (StrLen (Version) > 0) { > + TokenToUpdate =3D STRING_TOKEN (STR_MISC_BIOS_VERSION); > + HiiSetString (mHiiHandle, TokenToUpdate, Version, NULL); > + } > + } > + > + Char16String =3D GetBiosReleaseDate (); if (StrLen(Char16String) > 0= ) > + { > + TokenToUpdate =3D STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE); > + HiiSetString (mHiiHandle, TokenToUpdate, Char16String, NULL); } > + > + TokenToGet =3D STRING_TOKEN (STR_MISC_BIOS_VENDOR); Vendor =3D > + HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); > + VendorStrLen =3D StrLen (Vendor); > + > + TokenToGet =3D STRING_TOKEN (STR_MISC_BIOS_VERSION); Version =3D > + HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); VerStrLen > + =3D StrLen (Version); > + > + TokenToGet =3D STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE); > ReleaseDate > + =3D HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); > + DateStrLen =3D StrLen (ReleaseDate); > + > + // > + // Now update the BiosPhysicalSize > + // > + BiosPhysicalSize =3D FixedPcdGet32 (PcdFdSize); > + > + // > + // Two zeros following the last string. > + // > + SmbiosRecord =3D AllocateZeroPool (sizeof (SMBIOS_TABLE_TYPE0) + > VendorStrLen + 1 + > + VerStrLen + 1 + > + DateStrLen + 1 + 1); if > + (SmbiosRecord =3D=3D NULL) { > + Status =3D EFI_OUT_OF_RESOURCES; > + goto Exit; > + } > + > + (VOID)CopyMem (SmbiosRecord, InputData, sizeof > (SMBIOS_TABLE_TYPE0)); > + > + SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE0); > + SmbiosRecord->BiosSegment =3D (UINT16)(FixedPcdGet32 > (PcdFdBaseAddress) > + / SIZE_64KB); if (BiosPhysicalSize < SIZE_16MB) { > + SmbiosRecord->BiosSize =3D Base2ToByteWith64KUnit (BiosPhysicalSize= ) > + - 1; } else { > + SmbiosRecord->BiosSize =3D 0xFF; > + if (BiosPhysicalSize <=3D 0x3FFF) { > + SmbiosRecord->ExtendedBiosSize.Size =3D BiosPhysicalSize / SIZE_1= MB; > + SmbiosRecord->ExtendedBiosSize.Unit =3D 0; // Size is in MB > + } else { > + SmbiosRecord->ExtendedBiosSize.Size =3D BiosPhysicalSize / SIZE_1= GB; > + SmbiosRecord->ExtendedBiosSize.Unit =3D 1; // Size is in GB > + } > + } > + The SMBIOS spec does not say not to populate the Extended BIOS Size when t= he Size is < 16MB. You should always populate the Extended BIOS Size > + OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); > + UnicodeStrToAsciiStrS (Vendor, OptionalStrStart, VendorStrLen + 1); > + StrStart =3D OptionalStrStart + VendorStrLen + 1; UnicodeStrToAsciiSt= rS > + (Version, StrStart, VerStrLen + 1); StrStart +=3D VerStrLen + 1; > + UnicodeStrToAsciiStrS (ReleaseDate, StrStart, DateStrLen + 1); // // > + Now we have got the full smbios record, call smbios protocol to add th= is > record. > + // > + Status =3D LogSmbiosData ((UINT8*)SmbiosRecord, &SmbiosHandle); if > + (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type00 Table Log Failed! > %r \n", > + __FUNCTION__, __LINE__, Status)); } > + > + FreePool (SmbiosRecord); > + > +Exit: > + if (Vendor !=3D NULL) { > + FreePool (Vendor); > + } > + > + if (Version !=3D NULL) { > + FreePool (Version); > + } > + > + if (ReleaseDate !=3D NULL) { > + FreePool (ReleaseDate); > + } > + > + if (Char16String !=3D NULL) { > + FreePool (Char16String); > + } > + > + return Status; > +} > diff --git > a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendor.uni > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendor.uni > new file mode 100644 > index 000000000000..ba981e3db391 > --- /dev/null > +++ > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendor.uni > @@ -0,0 +1,17 @@ > +/** @file > + Based on files under Nt32Pkg/MiscSubClassPlatformDxe/ > + > + Copyright (c) 2006 - 2010, Intel Corporation. All rights > + reserved.
Copyright (c) 2015, Hisilicon Limited. All rights > + reserved.
Copyright (c) 2015, Linaro Limited. All rights > + reserved.
> + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +/=3D# > + > +#string STR_MISC_BIOS_VENDOR #language en-US "Not Specified" > +#string STR_MISC_BIOS_VERSION #language en-US "Not Specified" > +#string STR_MISC_BIOS_RELEASE_DATE #language en-US "Not Specified" > +#string STR_MISC_BIOS_VENDOR #language en-US "Not Specified" > +#string STR_MISC_BIOS_RELEASE_DATE #language en-US "12/02/2020" > -- > 2.26.2 > > > >=20 > IMPORTANT NOTICE: The contents of this email and any attachments are confi= dential and may also be privileged. If you are not the intended recipient, = please notify the sender immediately and do not disclose the contents to an= y other person, use it for any purpose, or store or copy the information in= any medium. Thank you.