public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Zhiguang Liu" <zhiguang.liu@intel.com>
To: devel@edk2.groups.io
Cc: Maurice Ma <maurice.ma@intel.com>, Guo Dong <guo.dong@intel.com>,
	Benjamin You <benjamin.you@intel.com>, Ray Ni <ray.ni@intel.com>
Subject: [Patch V4 9/9] UefiPayloadPkg: Creat gPldAcpiTableGuid Hob
Date: Thu, 10 Jun 2021 09:33:18 +0800	[thread overview]
Message-ID: <20210610013318.1885-10-zhiguang.liu@intel.com> (raw)
In-Reply-To: <20210610013318.1885-1-zhiguang.liu@intel.com>

>From SysTableInfo Hob, get ACPI table address, and creat gPldAcpiTableGuid Hob
to store it. Remove diretly adding ACPI table to ConfigurationTable.
Dxe ACPI driver will parse it and install ACPI table from Guid Hob.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
---
 UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c           | 17 -----------------
 UefiPayloadPkg/BlSupportDxe/BlSupportDxe.h           |  5 +----
 UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf         |  1 -
 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c   | 11 +++++++++++
 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h   |  2 +-
 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf |  1 +
 UefiPayloadPkg/UefiPayloadPkg.fdf                    |  4 ++++
 7 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
index 56b85b8e6d..ffd3427fb3 100644
--- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
+++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c
@@ -99,7 +99,6 @@ BlDxeEntryPoint (
 {
   EFI_STATUS Status;
   EFI_HOB_GUID_TYPE          *GuidHob;
-  SYSTEM_TABLE_INFO          *SystemTableInfo;
   EFI_PEI_GRAPHICS_INFO_HOB  *GfxInfo;
   ACPI_BOARD_INFO            *AcpiBoardInfo;
 
@@ -113,22 +112,6 @@ BlDxeEntryPoint (
   Status = ReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFED00000, SIZE_1KB, 0, ImageHandle); // HPET
   ASSERT_EFI_ERROR (Status);
 
-  //
-  // Find the system table information guid hob
-  //
-  GuidHob = GetFirstGuidHob (&gUefiSystemTableInfoGuid);
-  ASSERT (GuidHob != NULL);
-  SystemTableInfo = (SYSTEM_TABLE_INFO *)GET_GUID_HOB_DATA (GuidHob);
-
-  //
-  // Install Acpi Table
-  //
-  if (SystemTableInfo->AcpiTableBase != 0 && SystemTableInfo->AcpiTableSize != 0) {
-    DEBUG ((DEBUG_ERROR, "Install Acpi Table at 0x%lx, length 0x%x\n", SystemTableInfo->AcpiTableBase, SystemTableInfo->AcpiTableSize));
-    Status = gBS->InstallConfigurationTable (&gEfiAcpiTableGuid, (VOID *)(UINTN)SystemTableInfo->AcpiTableBase);
-    ASSERT_EFI_ERROR (Status);
-  }
-
   //
   // Find the frame buffer information and update PCDs
   //
diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.h b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.h
index 512105fafd..3332a30eae 100644
--- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.h
+++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.h
@@ -1,7 +1,7 @@
 /** @file
   The header file of bootloader support DXE.
 
-Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -19,12 +19,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Library/IoLib.h>
 #include <Library/HobLib.h>
 
-#include <Guid/Acpi.h>
 #include <Guid/SmBios.h>
 #include <Guid/SystemTableInfoGuid.h>
 #include <Guid/AcpiBoardInfoGuid.h>
 #include <Guid/GraphicsInfoHob.h>
 
-#include <IndustryStandard/Acpi.h>
-
 #endif
diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
index 30f41f8c39..1ccb250991 100644
--- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
+++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf
@@ -42,7 +42,6 @@
   HobLib
 
 [Guids]
-  gEfiAcpiTableGuid
   gUefiSystemTableInfoGuid
   gUefiAcpiBoardInfoGuid
   gEfiGraphicsInfoHobGuid
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
index 80f66a3fd5..f44e0ea7f0 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -235,6 +235,7 @@ BuildHobFromBl (
   EFI_PEI_GRAPHICS_DEVICE_INFO_HOB GfxDeviceInfo;
   EFI_PEI_GRAPHICS_DEVICE_INFO_HOB *NewGfxDeviceInfo;
   UNIVERSAL_PAYLOAD_SMBIOS_TABLE   *SmBiosTableHob;
+  UNIVERSAL_PAYLOAD_ACPI_TABLE     *AcpiTableHob;
 
   //
   // Parse memory info and build memory HOBs
@@ -287,6 +288,16 @@ BuildHobFromBl (
   SmBiosTableHob->SmBiosEntryPoint = SysTableInfo.SmbiosTableBase;
   DEBUG ((DEBUG_INFO, "Create smbios table gUniversalPayloadSmbiosTableGuid guid hob\n"));
 
+  // 
+  // Creat ACPI table Hob
+  //
+  AcpiTableHob = BuildGuidHob (&gUniversalPayloadAcpiTableGuid, sizeof (UNIVERSAL_PAYLOAD_ACPI_TABLE));
+  ASSERT (AcpiTableHob != NULL);
+  AcpiTableHob->Header.Revision = UNIVERSAL_PAYLOAD_ACPI_TABLE_REVISION;
+  AcpiTableHob->Header.Length = sizeof (UNIVERSAL_PAYLOAD_ACPI_TABLE);
+  AcpiTableHob->Rsdp = SysTableInfo.AcpiTableBase;
+  DEBUG ((DEBUG_INFO, "Create smbios table gUniversalPayloadAcpiTableGuid guid hob\n"));
+
   //
   // Create guid hob for acpi board information
   //
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
index e7d0d15118..a4c9da128e 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
@@ -32,7 +32,7 @@
 #include <Guid/AcpiBoardInfoGuid.h>
 #include <Guid/GraphicsInfoHob.h>
 #include <UniversalPayload/SmbiosTable.h>
-
+#include <UniversalPayload/AcpiTable.h>
 
 #define LEGACY_8259_MASK_REGISTER_MASTER  0x21
 #define LEGACY_8259_MASK_REGISTER_SLAVE   0xA1
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
index fc5b5ce9d4..8d42925fcd 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
@@ -65,6 +65,7 @@
   gEfiGraphicsDeviceInfoHobGuid
   gUefiAcpiBoardInfoGuid
   gUniversalPayloadSmbiosTableGuid
+  gUniversalPayloadAcpiTableGuid
 
 [FeaturePcd.IA32]
   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode      ## CONSUMES
diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf
index 8fc509024b..ed7fbcaddb 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -175,6 +175,10 @@ INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
 INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
 INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
 
+#
+# ACPI Support
+#
+INF  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
 
 #
 # Shell
-- 
2.30.0.windows.2


  parent reply	other threads:[~2021-06-10  1:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10  1:33 [Patch V4 0/9] Create multiple Hobs for Universal Payload Zhiguang Liu
2021-06-10  1:33 ` [Patch V4 1/9] MdeModulePkg: Add Universal Payload general definition header file Zhiguang Liu
2021-06-10  1:33 ` [Patch V4 2/9] MdeModulePkg: Add new structure for the PCI Root Bridge Info Hob Zhiguang Liu
2021-06-10  1:33 ` [Patch V4 3/9] UefiPayloadPkg: UefiPayload retrieve PCI root bridge from Guid Hob Zhiguang Liu
2021-06-10  1:33 ` [Patch V4 4/9] MdeModulePkg: Add new structure for the Universal Payload SMBios Table Info Hob Zhiguang Liu
2021-06-10  1:33 ` [Patch V4 5/9] MdeModulePkg/Universal/SmbiosDxe: Scan for existing tables Zhiguang Liu
2021-06-10  1:33 ` [Patch V4 6/9] UefiPayloadPkg: Creat gPldSmbiosTableGuid Hob Zhiguang Liu
2021-06-10  2:58   ` Guo Dong
2021-06-10  1:33 ` [Patch V4 7/9] MdeModulePkg: Add new structure for the Universal Payload ACPI Table Info Hob Zhiguang Liu
2021-06-10  1:33 ` [Patch V4 8/9] MdeModulePkg/ACPI: Install ACPI table from HOB Zhiguang Liu
2021-06-10  1:33 ` Zhiguang Liu [this message]
2021-06-10  3:00   ` [Patch V4 9/9] UefiPayloadPkg: Creat gPldAcpiTableGuid Hob Guo Dong
2021-06-10  9:13 ` 回复: [edk2-devel] [Patch V4 0/9] Create multiple Hobs for Universal Payload gaoliming
2021-06-10  9:48   ` Zhiguang Liu
2021-06-15 12:00     ` Patrick Rudolph
2021-06-16  1:07       ` 回复: " Zhiguang Liu

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=20210610013318.1885-10-zhiguang.liu@intel.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