public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Andrei Warkentin" <awarkentin@vmware.com>
To: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Leif Lindholm <leif@nuviainc.com>, Pete Batard <pete@akeo.ie>,
	Ard Biesheuvel <ard.biesheuvel@arm.com>
Subject: Re: [edk2-platform][PATCH v1 3/7] Platforms/RaspberryPi: SMBIOS Type 0 fixes
Date: Mon, 20 Jul 2020 21:53:22 +0000	[thread overview]
Message-ID: <BN6PR05MB34114879EB41086C9B7FA469B97B0@BN6PR05MB3411.namprd05.prod.outlook.com> (raw)
In-Reply-To: <20200720181646.2891-4-Samer.El-Haj-Mahmoud@arm.com>

[-- Attachment #1: Type: text/plain, Size: 5524 bytes --]

Reviewed-by: Andrei Warkentin <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@akeo.ie>; Andrei Warkentin <awarkentin@vmware.com>; Ard Biesheuvel <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:
 - 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   | 17 +++++++++--------
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf b/Platform/RaspberryPi/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
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 <andrey.warkentin@gmail.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/PlatformSmbiosDxe.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 = {
   { 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 String
+  (UINT16) (FixedPcdGet32 (PcdFdBaseAddress) / 0x10000), // BiosSegment
+  3,                                                     // BiosReleaseDate String
+  (UINT8) (FixedPcdGet32 (PcdFdSize) / 0x10000),         // BiosSize (in 64KB)
   {                     // BiosCharacteristics
     0,    //  Reserved                          :2;  ///< Bits 0-1.
     0,    //  Unknown                           :1;
@@ -66,11 +66,11 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = {
     0,    //  IsaIsSupported                    :1;
     0,    //  McaIsSupported                    :1;
     0,    //  EisaIsSupported                   :1;
-    0,    //  PciIsSupported                    :1;
+    0,    //  PciIsSupported                    :1; /// No PCIe support since 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 = {
           //  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 = {
   0,                       // SystemBiosMinorRelease
   0,                       // EmbeddedControllerFirmwareMajorRelease
   0,                       // EmbeddedControllerFirmwareMinorRelease
+  { (UINT16) ((FixedPcdGet32 (PcdFdSize) + FixedPcdGet32 (PcdFdtSize)) / 0x100000) }, // BiosSize (in MB since Bits 15:14 = 00b)
 };

 CHAR8 mBiosVendor[128]  = "EDK2";
--
2.17.1


[-- Attachment #2: Type: text/html, Size: 11514 bytes --]

  reply	other threads:[~2020-07-20 21:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 18:16 [edk2-platform][PATCH v1 0/7] Platform/RaspberryPi : SMBIOS fixes and cleanup Samer El-Haj-Mahmoud
2020-07-20 18:16 ` [edk2-platform][PATCH v1 1/7] Platforms/RaspberryPi: Fix NULL AssetTag in SMBIOS Samer El-Haj-Mahmoud
2020-07-20 21:52   ` Andrei Warkentin
2020-07-20 18:16 ` [edk2-platform][PATCH v1 2/7] Platforms/RaspberryPi: SMBIOS Type 2 and Type 3 fixes Samer El-Haj-Mahmoud
2020-07-20 21:53   ` Andrei Warkentin
2020-07-20 18:16 ` [edk2-platform][PATCH v1 3/7] Platforms/RaspberryPi: SMBIOS Type 0 fixes Samer El-Haj-Mahmoud
2020-07-20 21:53   ` Andrei Warkentin [this message]
2020-07-20 18:16 ` [edk2-platform][PATCH v1 4/7] Platforms/RaspberryPi: SMBIOS Type 4 fixes Samer El-Haj-Mahmoud
2020-07-20 21:55   ` Andrei Warkentin
2020-07-20 18:16 ` [edk2-platform][PATCH v1 5/7] Platforms/RaspberryPi: SMBIOS Type 7 fixes Samer El-Haj-Mahmoud
2020-07-20 21:54   ` Andrei Warkentin
2020-07-20 18:16 ` [edk2-platform][PATCH v1 6/7] Platforms/RaspberryPi: SMBIOS Memory Types fixes Samer El-Haj-Mahmoud
2020-07-20 21:55   ` Andrei Warkentin
2020-07-20 18:16 ` [edk2-platform][PATCH v1 7/7] Platforms/RaspberryPi: SMBIOS minor cleanup Samer El-Haj-Mahmoud
2020-08-12 16:27   ` Pete Batard
2020-08-13 13:47 ` [edk2-platform][PATCH v1 0/7] Platform/RaspberryPi : SMBIOS fixes and cleanup Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN6PR05MB34114879EB41086C9B7FA469B97B0@BN6PR05MB3411.namprd05.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox