]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiPayloadPkg: Create gUniversalPayloadSmbiosTableGuid Hob
authorZhiguang Liu <zhiguang.liu@intel.com>
Thu, 1 Apr 2021 08:21:27 +0000 (16:21 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 16 Jun 2021 05:20:19 +0000 (05:20 +0000)
From SysTableInfo Hob, get Smbios table address, and create
gUniversalPayloadSmbiosTableGuid Hob to store it. Remove directly adding
smbios table to ConfigurationTable.
Dxe module SmbiosDxe will parse it and install smbios table from it.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf

index a746d0581ee3c969d876d870126402c7923d4cb0..56b85b8e6d89553412621ddeda3122ce0fa907ca 100644 (file)
@@ -2,7 +2,7 @@
   This driver will report some MMIO/IO resources to dxe core, extract smbios and acpi\r
   tables from bootloader.\r
 \r
-  Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -129,15 +129,6 @@ BlDxeEntryPoint (
     ASSERT_EFI_ERROR (Status);\r
   }\r
 \r
-  //\r
-  // Install Smbios Table\r
-  //\r
-  if (SystemTableInfo->SmbiosTableBase != 0 && SystemTableInfo->SmbiosTableSize != 0) {\r
-    DEBUG ((DEBUG_ERROR, "Install Smbios Table at 0x%lx, length 0x%x\n", SystemTableInfo->SmbiosTableBase, SystemTableInfo->SmbiosTableSize));\r
-    Status = gBS->InstallConfigurationTable (&gEfiSmbiosTableGuid, (VOID *)(UINTN)SystemTableInfo->SmbiosTableBase);\r
-    ASSERT_EFI_ERROR (Status);\r
-  }\r
-\r
   //\r
   // Find the frame buffer information and update PCDs\r
   //\r
index cebc81135565f783f5cc62cd81e62fa0f985941e..30f41f8c3950fb14504f63787e45310d1bb0976a 100644 (file)
@@ -3,7 +3,7 @@
 #\r
 # Report some MMIO/IO resources to dxe core, extract smbios and acpi tables\r
 #\r
-#  Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
@@ -43,7 +43,6 @@
 \r
 [Guids]\r
   gEfiAcpiTableGuid\r
-  gEfiSmbiosTableGuid\r
   gUefiSystemTableInfoGuid\r
   gUefiAcpiBoardInfoGuid\r
   gEfiGraphicsInfoHobGuid\r
index 805f5448d9a1ee3396654ec6283576fb1aeb5814..80f66a3fd547ccc060c728ed17672acaf9aad998 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -234,6 +234,7 @@ BuildHobFromBl (
   EFI_PEI_GRAPHICS_INFO_HOB        *NewGfxInfo;\r
   EFI_PEI_GRAPHICS_DEVICE_INFO_HOB GfxDeviceInfo;\r
   EFI_PEI_GRAPHICS_DEVICE_INFO_HOB *NewGfxDeviceInfo;\r
+  UNIVERSAL_PAYLOAD_SMBIOS_TABLE   *SmBiosTableHob;\r
 \r
   //\r
   // Parse memory info and build memory HOBs\r
@@ -276,6 +277,15 @@ BuildHobFromBl (
     DEBUG ((DEBUG_INFO, "Detected Acpi Table at 0x%lx, length 0x%x\n", SysTableInfo.AcpiTableBase, SysTableInfo.AcpiTableSize));\r
     DEBUG ((DEBUG_INFO, "Detected Smbios Table at 0x%lx, length 0x%x\n", SysTableInfo.SmbiosTableBase, SysTableInfo.SmbiosTableSize));\r
   }\r
+  //\r
+  // Creat SmBios table Hob\r
+  //\r
+  SmBiosTableHob = BuildGuidHob (&gUniversalPayloadSmbiosTableGuid, sizeof (UNIVERSAL_PAYLOAD_SMBIOS_TABLE));\r
+  ASSERT (SmBiosTableHob != NULL);\r
+  SmBiosTableHob->Header.Revision = UNIVERSAL_PAYLOAD_SMBIOS_TABLE_REVISION;\r
+  SmBiosTableHob->Header.Length = sizeof (UNIVERSAL_PAYLOAD_SMBIOS_TABLE);\r
+  SmBiosTableHob->SmBiosEntryPoint = SysTableInfo.SmbiosTableBase;\r
+  DEBUG ((DEBUG_INFO, "Create smbios table gUniversalPayloadSmbiosTableGuid guid hob\n"));\r
 \r
   //\r
   // Create guid hob for acpi board information\r
index 2c84d6ed53dcecc31306cb964fe8b27a12241a9b..e7d0d15118cba5eb62ae7c9257eca566ee146be6 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-* Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>\r
+* Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>\r
 *\r
 *  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 *\r
@@ -31,6 +31,7 @@
 #include <Guid/MemoryMapInfoGuid.h>\r
 #include <Guid/AcpiBoardInfoGuid.h>\r
 #include <Guid/GraphicsInfoHob.h>\r
+#include <UniversalPayload/SmbiosTable.h>\r
 \r
 \r
 #define LEGACY_8259_MASK_REGISTER_MASTER  0x21\r
index cc59f1903bd52d68b24ff7884f7946e02c0d35d8..fc5b5ce9d401a97f71042a1962f4434f2f3fcfe1 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #  This is the first module for UEFI payload.\r
 #\r
-#  Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>\r
 #  Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>\r
 #\r
 #  SPDX-License-Identifier: BSD-2-Clause-Patent\r
@@ -64,6 +64,7 @@
   gEfiGraphicsInfoHobGuid\r
   gEfiGraphicsDeviceInfoHobGuid\r
   gUefiAcpiBoardInfoGuid\r
+  gUniversalPayloadSmbiosTableGuid\r
 \r
 [FeaturePcd.IA32]\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode      ## CONSUMES\r