From: "Guo Dong" <guo.dong@intel.com>
To: "Ma, Maurice" <maurice.ma@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Ni, Ray" <ray.ni@intel.com>, "You, Benjamin" <benjamin.you@intel.com>
Subject: Re: [edk2-devel] [PATCH 1/1] UefiPayloadPkg: Add PCI root bridge info hob support for SBL
Date: Thu, 30 Sep 2021 20:17:36 +0000 [thread overview]
Message-ID: <BYAPR11MB36228B8AF2F59743E48621539EAA9@BYAPR11MB3622.namprd11.prod.outlook.com> (raw)
In-Reply-To: <c533e34cea5a32165c2755cb646b8ccd96d1c1fb.1633020774.git.maurice.ma@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
-----Original Message-----
From: Ma, Maurice <maurice.ma@intel.com>
Sent: Thursday, September 30, 2021 9:59 AM
To: devel@edk2.groups.io
Cc: Ma, Maurice <maurice.ma@intel.com>; Ni, Ray <ray.ni@intel.com>; Dong, Guo <guo.dong@intel.com>; You, Benjamin <benjamin.you@intel.com>
Subject: [edk2-devel] [PATCH 1/1] UefiPayloadPkg: Add PCI root bridge info hob support for SBL
Current UefiPayloadPkg can suport PCI root bridge info HOB provided by bootloader. For UniversalPayload, bootloader can directly provide this HOB for payload consumption. However, for legacy UEFI payload, it is required to migrate the HOB information from bootloader HOB space to UEFI payload HOB space. This patch added the missing part for the bootloader ParseLib in order to support both legacy and universal UEFI payload.
This patch was tested on Slim Bootloader with latest UEFI payload, and it worked as expected.
Cc: Ray Ni <ray.ni@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
---
UefiPayloadPkg/Include/Library/BlParseLib.h | 14 ++++++
.../Library/CbParseLib/CbParseLib.c | 16 +++++++
.../Library/SblParseLib/SblParseLib.c | 47 ++++++++++++++++++-
.../Library/SblParseLib/SblParseLib.inf | 1 +
.../UefiPayloadEntry/UefiPayloadEntry.c | 8 ++++
5 files changed, 84 insertions(+), 2 deletions(-)
diff --git a/UefiPayloadPkg/Include/Library/BlParseLib.h b/UefiPayloadPkg/Include/Library/BlParseLib.h
index 1244190d4e87..49eac3124818 100644
--- a/UefiPayloadPkg/Include/Library/BlParseLib.h
+++ b/UefiPayloadPkg/Include/Library/BlParseLib.h
@@ -116,4 +116,18 @@ ParseGfxDeviceInfo (
OUT EFI_PEI_GRAPHICS_DEVICE_INFO_HOB *GfxDeviceInfo ); +/**+ Parse and handle the misc info provided by bootloader++ @retval RETURN_SUCCESS The misc information was parsed successfully.+ @retval RETURN_NOT_FOUND Could not find required misc info.+ @retval RETURN_OUT_OF_RESOURCES Insufficant memory space.++**/+RETURN_STATUS+EFIAPI+ParseMiscInfo (+ VOID+ );+ #endifdiff --git a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
index 4f90687e407e..f81aa0f301d8 100644
--- a/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
+++ b/UefiPayloadPkg/Library/CbParseLib/CbParseLib.c
@@ -560,3 +560,19 @@ ParseGfxDeviceInfo (
return RETURN_NOT_FOUND; } +/**+ Parse and handle the misc info provided by bootloader++ @retval RETURN_SUCCESS The misc information was parsed successfully.+ @retval RETURN_NOT_FOUND Could not find required misc info.+ @retval RETURN_OUT_OF_RESOURCES Insufficant memory space.++**/+RETURN_STATUS+EFIAPI+ParseMiscInfo (+ VOID+ )+{+ return RETURN_SUCCESS;+}diff --git a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
index 7214fd87d20c..ccdcbfc07db9 100644
--- a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
+++ b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.c
@@ -1,7 +1,7 @@
/** @file This library will parse the Slim Bootloader to get required information. - Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>+ Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/@@ -15,7 +15,7 @@
#include <Library/HobLib.h> #include <Library/BlParseLib.h> #include <IndustryStandard/Acpi.h>-+#include <UniversalPayload/PciRootBridges.h> /** This function retrieves the parameter base address from boot loader.@@ -221,3 +221,46 @@ ParseGfxDeviceInfo (
return RETURN_SUCCESS; } +/**+ Parse and handle the misc info provided by bootloader++ @retval RETURN_SUCCESS The misc information was parsed successfully.+ @retval RETURN_NOT_FOUND Could not find required misc info.+ @retval RETURN_OUT_OF_RESOURCES Insufficant memory space.++**/+RETURN_STATUS+EFIAPI+ParseMiscInfo (+ VOID+ )+{+ RETURN_STATUS Status;+ UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *BlRootBridgesHob;+ UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *PldRootBridgesHob;++ Status = RETURN_NOT_FOUND;+ BlRootBridgesHob = (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *) GetGuidHobDataFromSbl (+ &gUniversalPayloadPciRootBridgeInfoGuid+ );+ if (BlRootBridgesHob != NULL) {+ //+ // Migrate bootloader root bridge info hob from bootloader to payload.+ //+ PldRootBridgesHob = BuildGuidHob (+ &gUniversalPayloadPciRootBridgeInfoGuid,+ BlRootBridgesHob->Header.Length+ );+ ASSERT (PldRootBridgesHob != NULL);+ if (PldRootBridgesHob != NULL) {+ CopyMem (PldRootBridgesHob, BlRootBridgesHob, BlRootBridgesHob->Header.Length);+ DEBUG ((DEBUG_INFO, "Create PCI root bridge info guid hob\n"));+ Status = RETURN_SUCCESS;+ } else {+ Status = RETURN_OUT_OF_RESOURCES;+ }+ }++ return Status;+}+diff --git a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf
index 665a5a8adcef..535cca58a63c 100644
--- a/UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf
+++ b/UefiPayloadPkg/Library/SblParseLib/SblParseLib.inf
@@ -41,6 +41,7 @@
gLoaderMemoryMapInfoGuid gEfiGraphicsInfoHobGuid gEfiGraphicsDeviceInfoHobGuid+ gUniversalPayloadPciRootBridgeInfoGuid [Pcd] gUefiPayloadPkgTokenSpaceGuid.PcdBootloaderParameterdiff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
index f2ac3d2c6925..5a1e5786687a 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -321,6 +321,14 @@ BuildHobFromBl (
return Status; } + //+ // Parse the misc info provided by bootloader+ //+ Status = ParseMiscInfo ();+ if (EFI_ERROR (Status)) {+ DEBUG ((DEBUG_WARN, "Error when parsing misc info, Status = %r\n", Status));+ }+ // // Parse platform specific information. //--
2.29.2.windows.2
next prev parent reply other threads:[~2021-09-30 20:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-30 16:59 [edk2-devel] [PATCH 1/1] UefiPayloadPkg: Add PCI root bridge info hob support for SBL Ma, Maurice
2021-09-30 20:17 ` Guo Dong [this message]
[not found] <16A9A81A14316DB1.3292@groups.io>
2021-09-30 17:06 ` Ma, Maurice
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=BYAPR11MB36228B8AF2F59743E48621539EAA9@BYAPR11MB3622.namprd11.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