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.67]) by mx.groups.io with SMTP id smtpd.web10.6372.1595282007102005793 for ; Mon, 20 Jul 2020 14:53:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@vmware.com header.s=selector2 header.b=xjflIOMg; spf=pass (domain: vmware.com, ip: 40.107.220.67, mailfrom: awarkentin@vmware.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IeArz6TMRc7l0D82wrzngj5Dczz/EgPo/IAG7oFll5MAZ38T+ffro7CZuCMy255tOSMoVEpBhX+oLoVSsRYHrLMzNdxh3P7cb5HqfDV8jQceCc1ToKmzIIOFfSI9qxeQM4Sgk6xF+en/mWRqOuhNR5F6TWUbBqbkqeiGxCyoqI3zo+3bcQQXc74m0b2okaXvj5VtInBFZiugy8Uh7mHf4ebOQMEuM/eYvkb662pcLCjBe1y4PYt1dpi8nDkV0Z9l1+f+kZ2lPQ6qazkCo9xDtwCVi94DioTLCIHih58aDurUFqMQ8vfe9zy5aqDS0OxfNjgFK+tGKxAPjZ9Wr6m0Sg== 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=NmTLUTby43sUn1EuEWQcoO8q1tRemJxxy87oNXrIZJM=; b=VQvonrapLOu80ceegYX2jLiK2EWOVrvOlQpTcnCNRV2lfwVeokfyryNB9w7QWugKWLgEIPQmOpaPFzOCV9OFAzEq+l9QvkjZOgGm9+pvMBMKCAeul1iqCN6FRLfQFpgNf1ypYz7h1SeSEphEhAE+Zxl3/RMZCFYZCmU6oXMeO+SZy6sB/FPpmZ6vM/nEEolK22A7Rh/ZSrD5N5H9X4OL6LP+bPK34E4jyQszai+1zJkSaAkjXeZ4Y5xcz5im/fhMw+H91ZvI5KsiWNbr/cb4EallOEELiDs9+a2Vt1z/3GEUsJ5Z1Wh7+BYxGyoaZOvoSVFXUokdz7DH/bBaTK7paQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NmTLUTby43sUn1EuEWQcoO8q1tRemJxxy87oNXrIZJM=; b=xjflIOMgvUJ8g/mRXed/OO313XUv2DH5Vv0IWFpNqFUK7YTE1G/kROJIsKuR82MErHgBzhIxZT33EJOQivEOjmmY4EjJ+bVwSiUIbrRBbVO4AYw0p41/GTyYnDDlqAr/IpkbQSkWlu+rgtkBdH5KL7NB4FvVn9p5fSM0muRmZCk= Received: from BN6PR05MB3411.namprd05.prod.outlook.com (2603:10b6:405:43::23) by BN7PR05MB4545.namprd05.prod.outlook.com (2603:10b6:406:fa::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.17; Mon, 20 Jul 2020 21:53:22 +0000 Received: from BN6PR05MB3411.namprd05.prod.outlook.com ([fe80::e1ef:31eb:c802:aef0]) by BN6PR05MB3411.namprd05.prod.outlook.com ([fe80::e1ef:31eb:c802:aef0%3]) with mapi id 15.20.3216.017; Mon, 20 Jul 2020 21:53:22 +0000 From: "Andrei Warkentin" To: Samer El-Haj-Mahmoud , "devel@edk2.groups.io" CC: Leif Lindholm , Pete Batard , Ard Biesheuvel Subject: Re: [edk2-platform][PATCH v1 3/7] Platforms/RaspberryPi: SMBIOS Type 0 fixes Thread-Topic: [edk2-platform][PATCH v1 3/7] Platforms/RaspberryPi: SMBIOS Type 0 fixes Thread-Index: AQHWXsH0hDqvjHfOTkmXSdtVaJPwLKkRAtPO Date: Mon, 20 Jul 2020 21:53:22 +0000 Message-ID: References: <20200720181646.2891-1-Samer.El-Haj-Mahmoud@arm.com>,<20200720181646.2891-4-Samer.El-Haj-Mahmoud@arm.com> In-Reply-To: <20200720181646.2891-4-Samer.El-Haj-Mahmoud@arm.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=vmware.com; x-originating-ip: [98.214.99.181] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 32d4bac9-0b69-45fc-129c-08d82cf7523f x-ms-traffictypediagnostic: BN7PR05MB4545: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SZmiXFLRPYQxWHwklBvheCD28yJUHRlNrnLNq0/0nIJnJ1KTWyvDij9ArW4e3PyYZs0KLkVmvnWn6UOyW6PG4hj1zsPTjfgdXnTAzHRu4lbeqOFzIZWK212DcV9NFOYBYb3ED4+N7UYu9nilYwEGzmprshosBalLPoeOiF5fDIImKWPv/RnwBxNh5W8bBooeg5FVpP7LSF7esGm5sZCE+z4gW4qEA6Vd1uFCNDuYKvVZnXS197Ra/IlZlo4FEpY2EsJDybp1pXeItFTPJx0IPhKd58Gvu10+QZ4hcTtc6DyQJnyzfns95vY0eCaQxJVjr1UPZ0OGXx8kR/0bP8aMWQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR05MB3411.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(376002)(346002)(366004)(39860400002)(8936002)(316002)(71200400001)(4326008)(186003)(478600001)(52536014)(110136005)(2906002)(54906003)(26005)(45080400002)(19627405001)(8676002)(64756008)(66556008)(66476007)(66946007)(76116006)(53546011)(7696005)(33656002)(6506007)(83380400001)(55016002)(5660300002)(9686003)(86362001)(66446008);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: P6pCjj3fvuV+b3ulgv8G969FKhNy4pCzCPU2IuSTk+uWHv4eynh68tONLuMijDX+yjzC6FDUTQU/lg1t6FcvWMu2EpEZbDnjtEl53a5HzhH7jAqy+F6mcnjjuXUGOQPTnElGNO/iBoQpYiBXnvNwF94huDJiWxtLkeIVllu87zBPyMjzA1ZXW+ttJhQOhNfxh38FZjs40tRtdwRwqFGtz4L7BTnkY3fWdC2XWAoCY1myvEzQSvNOckVg+hMaSBCEfgX6mVNwGB/Hxdb4ZLr8m3KcKgSNRjHACNkZBL5Oh6dLJl+IznwUTDUP1Vmh9OPRMPSjoujc6npSyphFpSQFlBSYPmv9QaMSMvyZv1bV66x1dDKS8gn+e+tKpTIvnBvm00qih28iVItkM50ZAcpyc7h0Qu5TYAYpKvdCYNKYLxsgv/uQwCOUXVPHHdGYcoOj7WNTUaVZMIQqaNKdpeX5dznGACDgxk1Dz+GH4qLuq3x5czoiOptKoKu5P0X/zHqw x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR05MB3411.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32d4bac9-0b69-45fc-129c-08d82cf7523f X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2020 21:53:22.0115 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: FqzmhGdt8uBNtmvzeezlaXW1oz4OwD6Vv2ZPvozD9ijv0VxbsQ8rHLGwDr320MQPyqef2n4aOLDiUBIclclHWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR05MB4545 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BN6PR05MB34114879EB41086C9B7FA469B97B0BN6PR05MB3411namp_" --_000_BN6PR05MB34114879EB41086C9B7FA469B97B0BN6PR05MB3411namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Andrei Warkentin ________________________________ From: Samer El-Haj-Mahmoud Sent: Monday, July 20, 2020 1:16 PM To: devel@edk2.groups.io Cc: Leif Lindholm ; Pete Batard ; Andrei W= arkentin ; Ard Biesheuvel Subject: [edk2-platform][PATCH v1 3/7] Platforms/RaspberryPi: SMBIOS Type 0= fixes Various fixes and enhancements for SMBIOS Type 0: - Use PCDs to report the BIOS Segment and Size - Report Extended BiosSize - Set BiosIsUpgradable (it is!) - Clear FunctionKeyNetworkBootIsSupported Cc: Leif Lindholm Cc: Pete Batard Cc: Andrei Warkentin Cc: Ard Biesheuvel Signed-off-by: Samer El-Haj-Mahmoud --- Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf | 6 = +++++- Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 17 = +++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.inf b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.i= nf index 59b2fefdf0fd..817b902b1fad 100644 --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf @@ -1,10 +1,11 @@ #/** @file # -# SMBIOS Table for ARM platform +# SMBIOS Table for the RaspberryPi platform # # Copyright (c) 2017, Andrei Warkentin # Copyright (c) Microsoft Corporation. All rights reserved. # Copyright (c) 2013 Linaro.org +# Copyright (c) 2020, ARM Limited. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -51,8 +52,11 @@ [Depex] gEfiSmbiosProtocolGuid AND gRaspberryPiFirmwareProtocolGuid [Pcd] + gArmTokenSpaceGuid.PcdFdBaseAddress + gArmTokenSpaceGuid.PcdFdSize gArmTokenSpaceGuid.PcdSystemMemorySize gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString + gRaspberryPiTokenSpaceGuid.PcdFdtSize gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c index 170f1843f90b..21feab3e47a5 100644 --- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c @@ -54,11 +54,11 @@ STATIC RASPBERRY_PI_FIRMWARE_PROTOCOL *mFwProtocol; ************************************************************************/ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 =3D { { EFI_SMBIOS_TYPE_BIOS_INFORMATION, sizeof (SMBIOS_TABLE_TYPE0), 0 }, - 1, // Vendor String - 2, // BiosVersion String - 0x0, // BiosSegment - 3, // BiosReleaseDate String - 0x1F, // BiosSize + 1, // Vendor String + 2, // BiosVersion St= ring + (UINT16) (FixedPcdGet32 (PcdFdBaseAddress) / 0x10000), // BiosSegment + 3, // BiosReleaseDat= e String + (UINT8) (FixedPcdGet32 (PcdFdSize) / 0x10000), // BiosSize (in 6= 4KB) { // BiosCharacteristics 0, // Reserved :2; ///< Bits 0-1. 0, // Unknown :1; @@ -66,11 +66,11 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 =3D { 0, // IsaIsSupported :1; 0, // McaIsSupported :1; 0, // EisaIsSupported :1; - 0, // PciIsSupported :1; + 0, // PciIsSupported :1; /// No PCIe support si= nce we hide ECAM from the OS 0, // PcmciaIsSupported :1; 0, // PlugAndPlayIsSupported :1; 0, // ApmIsSupported :1; - 0, // BiosIsUpgradable :1; + 1, // BiosIsUpgradable :1; 0, // BiosShadowingAllowed :1; 0, // VlVesaIsSupported :1; 0, // EscdSupportIsAvailable :1; @@ -104,7 +104,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 =3D { // Boot1394IsSupported :1; // SmartBatteryIsSupported :1; // BIOSCharacteristicsExtensionBytes[1] - 0x0e, // BiosBootSpecIsSupported :1; + 0x0c, // BiosBootSpecIsSupported :1; // FunctionKeyNetworkBootIsSupported :1; // TargetContentDistributionEnabled :1; // UefiSpecificationSupported :1; @@ -115,6 +115,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 =3D { 0, // SystemBiosMinorRelease 0, // EmbeddedControllerFirmwareMajorRelease 0, // EmbeddedControllerFirmwareMinorRelease + { (UINT16) ((FixedPcdGet32 (PcdFdSize) + FixedPcdGet32 (PcdFdtSize)) / 0= x100000) }, // BiosSize (in MB since Bits 15:14 =3D 00b) }; CHAR8 mBiosVendor[128] =3D "EDK2"; -- 2.17.1 --_000_BN6PR05MB34114879EB41086C9B7FA469B97B0BN6PR05MB3411namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Reviewed-by: Andrei Warken= tin <awarkentin@vmware.com>

From: Samer El-Haj-Mahmoud = <Samer.El-Haj-Mahmoud@arm.com>
Sent: Monday, July 20, 2020 1:16 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Leif Lindholm <leif@nuviainc.com>; Pete Batard <pete@ak= eo.ie>; Andrei Warkentin <awarkentin@vmware.com>; Ard Biesheuvel &= lt;ard.biesheuvel@arm.com>
Subject: [edk2-platform][PATCH v1 3/7] Platforms/RaspberryPi: SMBIOS= Type 0 fixes
 
Various fixes and enhancements for SMBIOS Type 0:<= br>  - Use PCDs to report the BIOS Segment and Size
 - Report Extended BiosSize
 - Set BiosIsUpgradable (it is!)
 - Clear FunctionKeyNetworkBootIsSupported

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Pete Batard <pete@akeo.ie>
Cc: Andrei Warkentin <awarkentin@vmware.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com> ---
 Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf = |  6 +++++-
 Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c&nb= sp;  | 17 +++++++++--------
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.inf b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.i= nf
index 59b2fefdf0fd..817b902b1fad 100644
--- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf<= br> +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf<= br> @@ -1,10 +1,11 @@
 #/** @file
 #
-#  SMBIOS Table for ARM platform
+#  SMBIOS Table for the RaspberryPi platform
 #
 #  Copyright (c) 2017, Andrei Warkentin <andrey.warkentin@gma= il.com>
 #  Copyright (c) Microsoft Corporation. All rights reserved.
 #  Copyright (c) 2013 Linaro.org
+#  Copyright (c) 2020, ARM Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -51,8 +52,11 @@ [Depex]
   gEfiSmbiosProtocolGuid AND gRaspberryPiFirmwareProtocolGuid  
 [Pcd]
+  gArmTokenSpaceGuid.PcdFdBaseAddress
+  gArmTokenSpaceGuid.PcdFdSize
   gArmTokenSpaceGuid.PcdSystemMemorySize
   gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor
   gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
+  gRaspberryPiTokenSpaceGuid.PcdFdtSize
   gRaspberryPiTokenSpaceGuid.PcdRamMoreThan3GB
   gRaspberryPiTokenSpaceGuid.PcdRamLimitTo3GB
diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosD= xe.c b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c index 170f1843f90b..21feab3e47a5 100644
--- a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c +++ b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c @@ -54,11 +54,11 @@ STATIC RASPBERRY_PI_FIRMWARE_PROTOCOL *mFwProtocol;
 *********************************************************************= ***/
 SMBIOS_TABLE_TYPE0 mBIOSInfoType0 =3D {
   { EFI_SMBIOS_TYPE_BIOS_INFORMATION, sizeof (SMBIOS_TABLE_TYPE0= ), 0 },
-  1,           = ;         // Vendor String
-  2,           = ;         // BiosVersion String
-  0x0,          &nb= sp;       // BiosSegment
-  3,           = ;         // BiosReleaseDate String=
-  0x1F,          &n= bsp;      // BiosSize
+  1,           = ;            &n= bsp;            = ;            &n= bsp;    // Vendor String
+  2,           = ;            &n= bsp;            = ;            &n= bsp;    // BiosVersion String
+  (UINT16) (FixedPcdGet32 (PcdFdBaseAddress) / 0x10000), // BiosSegme= nt
+  3,           = ;            &n= bsp;            = ;            &n= bsp;    // BiosReleaseDate String
+  (UINT8) (FixedPcdGet32 (PcdFdSize) / 0x10000),   &nb= sp;     // BiosSize (in 64KB)
   {          &= nbsp;          // BiosCharacte= ristics
     0,    //  Reserved  =             &nb= sp;           :2;  /= //< Bits 0-1.
     0,    //  Unknown  &= nbsp;           &nbs= p;            :1; @@ -66,11 +66,11 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 =3D {
     0,    //  IsaIsSupported =             &nb= sp;      :1;
     0,    //  McaIsSupported =             &nb= sp;      :1;
     0,    //  EisaIsSupported = ;            &n= bsp;     :1;
-    0,    //  PciIsSupported  = ;            &n= bsp;     :1;
+    0,    //  PciIsSupported  = ;            &n= bsp;     :1; /// No PCIe support since we hide ECAM fro= m the OS
     0,    //  PcmciaIsSupported&nb= sp;            =     :1;
     0,    //  PlugAndPlayIsSupport= ed            :1;      0,    //  ApmIsSupported =             &nb= sp;      :1;
-    0,    //  BiosIsUpgradable &nb= sp;            =     :1;
+    1,    //  BiosIsUpgradable &nb= sp;            =     :1;
     0,    //  BiosShadowingAllowed=             &nb= sp; :1;
     0,    //  VlVesaIsSupported&nb= sp;            =     :1;
     0,    //  EscdSupportIsAvailab= le            :1; @@ -104,7 +104,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 =3D {
           //  Boot1= 394IsSupported          &= nbsp;    :1;
           //  Smart= BatteryIsSupported         &nb= sp; :1;
           //  BIOSC= haracteristicsExtensionBytes[1]
-    0x0e, //  BiosBootSpecIsSupported   = ;           :1;
+    0x0c, //  BiosBootSpecIsSupported   = ;           :1;
           //  Funct= ionKeyNetworkBootIsSupported    :1;
           //  Targe= tContentDistributionEnabled     :1;
           //  UefiS= pecificationSupported         =   :1;
@@ -115,6 +115,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 =3D {
   0,          =              //= SystemBiosMinorRelease
   0,          =              //= EmbeddedControllerFirmwareMajorRelease
   0,          =              //= EmbeddedControllerFirmwareMinorRelease
+  { (UINT16) ((FixedPcdGet32 (PcdFdSize) + FixedPcdGet32 (PcdFdtSize)= ) / 0x100000) }, // BiosSize (in MB since Bits 15:14 =3D 00b)
 };
 
 CHAR8 mBiosVendor[128]  =3D "EDK2";
--
2.17.1

--_000_BN6PR05MB34114879EB41086C9B7FA469B97B0BN6PR05MB3411namp_--