Re: [edk2-devel] GitHub PR Code Review process now active

2024-06-05 Thread Guo Dong

Hi Mike,

Glad to see EDK2 PR code review process is active.
In Slim Bootloader project, it runs BaseTools/Scripts/PatchCheck.py to check 
the PR commit message when running QEMU CI test  
Maybe you could refer 
https://github.com/slimbootloader/slimbootloader/blob/48a24b87824321c053cccf367c7c3637ff581fdf/.azurepipelines/azure-pipelines.yml#L38
 to check if EDK2 could use similar check.

Thanks,
Guo

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Michael D Kinney
Sent: Wednesday, June 5, 2024 3:21 PM
To: devel@edk2.groups.io
Cc: Kinney, Michael D 
Subject: Re: [edk2-devel] GitHub PR Code Review process now active

Hello,

The PR code review process has been active for a little over a week now.

There have been about 17 PRs merged since the switch and it appears to have 
been mostly working well. I also note that the emails per day on this mailing 
list is much smaller as the code reviews have migrated to PRs.

A few issues have been noted:

1) Contributors that are not EDK II Maintainers do not have permissions
   to assign reviewers 

   * Mitigation #1: EDK II Maintainers review new PRs and assign reviewers
   * Mitigation #2: Use CODEOWNERS to auto assign maintainers.  WIP.

* EDK II Maintainers must review the commit message in each commit and
  to make sure it follows the required commit message format and has
  an appropriate Signed-off-by tag. GitHub does not provide a way to
  provide review comments for a commit message. Instead, feedback on
  commit messages must be provided in the main PR conversation and quote
  commit message that requires changes as required.

* Slow CI Performance

  This appears to be due to longer than expected queues in Azure Pipelines.
  Azure Pipelines is working through the backlog. It may help if the
  number of requests to rebase and number of new commits to open PRs are
  reduced. The Tools/CI team will continue to collect data and determine
  if other changes are needed to reduce the CI overhead.

* Some PRs have been merged using the "Rebase and Merge" button in the
  PR after all required reviews completed and all CI checks pass. Instead,
  the "push" label should continue to be used. There does not appear to be
  any unexpected side effects from the "Rebase and Merge" button, but that
  option is not available if the PR needs to be rebased. This is what
  Mergify handles through a merge queue, so the easiest way to merge right
  now is the "push" label.

  If the most recent commit was not performed by an EDK II Maintainers, then
  Mergify attempt to rebase may fail.

Mitigation #1: EDK II Maintainer perform a rebase
Mitigation #2: Update Mergify to use a bot account with write permission
   to perform rebase operations.

  There was feedback earlier in the year that the git commit history does
  not indicate which maintainer was the committer.  Instead it always shows
  Mergify.

  The use of GitHub Merge Queues will be evaluated to see if it can be used
  instead of Mergify and remove the need for the "push" label and allow the
  "Rebase and Merge" button to be used and avoid the Mergify permission issues.

* Some PRs do not complete all CI checks waiting for "Workflow Approval".
  this can occur when a PR is updated by an outside collaborator that does
  not have any previous "Workflow Approvals" accepted.

  Mitigation #1: EDK II Maintainers review PRs and accept the "Workflow 
Approval"
 if the PR looks like a good change request.
  Mitigation #2: Relax the edk2 repo configuration settings related to workflows

* When a PR needs to be rebased, there are 2 options available through the
  Web UI:

  * Update with merge commit (Never use - generates PatchCheck errors)
  * Update with rebase (Only use this one)

  If Update with merge commit is accidently applied, then redo again
  Using "Update with rebase"

Please provide feedback if you are seeing other issues or have other 
suggestions to improve the process.

Thanks,

Mike

> -Original Message-
> From: Kinney, Michael D 
> Sent: Monday, June 3, 2024 12:38 PM
> To: Neal Gompa ; devel@edk2.groups.io
> Cc: Kinney, Michael D 
> Subject: RE: [edk2-devel] GitHub PR Code Review process now active
> 
> The reason to allow a draft PR is to allow contributors to run all the 
> CI tests to see if they pass and resolve issues before starting a review.
> 
> The CI tests include combinations of OS/compiler that not all 
> contributors have available.
> 
> Mike
> 
> > -Original Message-
> > From: Neal Gompa 
> > Sent: Monday, June 3, 2024 11:47 AM
> > To: devel@edk2.groups.io; Kinney, Michael D 
> > 
> > Subject: Re: [edk2-devel] GitHub PR Code Review process now active
> >
> > Hmm, I don't see a setting for it anymore, maybe that's not a thing
> anymore?
> >
> > I seemingly recall that draft PRs didn't get CI runs, but if that's 
> > not a thing anymore, then that's fine.
> >
> > That said, draft PRs cannot be reviewed, so we should not be 

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix LoadDxeCore for payload size > 16MB

2024-06-05 Thread Guo Dong


Reviewed-by: Guo Dong mailto:guo.d...@intel.com>>


From: Guo, Gua 
Sent: Wednesday, June 5, 2024 7:22 AM
To: Tan, Lean Sheng ; devel@edk2.groups.io; Witt, 
Sebastian ; Rhodes, Sean ; 
Lu, James ; Dong, Guo 
Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix LoadDxeCore for payload 
size > 16MB

Please send PR also.

From: Lean Sheng Tan mailto:sheng@9elements.com>>
Sent: Wednesday, June 5, 2024 10:18:27 PM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>>; Witt, Sebastian 
mailto:sebastian.w...@siemens.com>>; Guo, Gua 
mailto:gua@intel.com>>; Rhodes, Sean 
mailto:sean@starlabs.systems>>; Lu, James 
mailto:james...@intel.com>>; Dong, Guo 
mailto:guo.d...@intel.com>>
Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix LoadDxeCore for payload 
size > 16MB

+ edk2 payload maintainers

Best Regards,
Lean Sheng Tan

[http://static.9elements.com/logo-signature.png]
9elements GmbH, Kortumstraße 19-21, 44787 Bochum, Germany
Email: sheng@9elements.com<mailto:sheng@9elements.com>
Phone: +49 234 68 94 188
Mobile: +49 176 76 113842

Registered office: Bochum
Commercial register: Amtsgericht Bochum, HRB 17519
Management: Sebastian German, Eray Bazaar

Data protection information according to Art. 13 
GDPR<https://9elements.com/privacy>


On Mon, 3 Jun 2024 at 23:20, Witt, Sebastian via groups.io<http://groups.io> 
mailto:siemens@groups.io>> wrote:

Fix calculation of first section in FileFindSection for FILE2 headers in 
UefiPayloadEntry module.

Signed-of-by: Sebastian Witt 
mailto:sebastian.w...@siemens.com>>
---
 UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c 
b/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c
index 898d610951..9cb6edefcf 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/LoadDxeCore.c
@@ -211,13 +211,14 @@ FileFindSection (

   if (IS_FFS_FILE2 (FileHeader)) {
 FileSize = FFS_FILE2_SIZE (FileHeader);
+Section = (EFI_COMMON_SECTION_HEADER *)(((EFI_FFS_FILE_HEADER2 
*)FileHeader) + 1);
   } else {
 FileSize = FFS_FILE_SIZE (FileHeader);
+Section = (EFI_COMMON_SECTION_HEADER *)(FileHeader + 1);
   }

   FileSize -= sizeof (EFI_FFS_FILE_HEADER);

-  Section = (EFI_COMMON_SECTION_HEADER *)(FileHeader + 1);
   Index   = 0;
   while (Index < FileSize) {
 if (Section->Type == SectionType) {
--
2.39.2







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119490): https://edk2.groups.io/g/devel/message/119490
Mute This Topic: https://groups.io/mt/106471262/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Update ReadMe.md to swig install

2024-05-15 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Guo, Gua  
Sent: Wednesday, May 15, 2024 3:23 AM
To: devel@edk2.groups.io
Cc: Guo, Gua ; Chiu, Chasel ; Dong, 
Guo ; Rhodes, Sean ; Lu, James 

Subject: [PATCH v1 1/1] UefiPayloadPkg: Update ReadMe.md to swig install

From: Gua Guo 

Update ReadMe.md for swig install process in windows OS.

Cc: Chasel Chiu 
Cc: Guo Dong 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 

Signed-off-by: Gua Guo 
---
 UefiPayloadPkg/Readme.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/Readme.md b/UefiPayloadPkg/Readme.md index 
cb7f39b3f7..4149eab90d 100644
--- a/UefiPayloadPkg/Readme.md
+++ b/UefiPayloadPkg/Readme.md
@@ -55,11 +55,13 @@ FIT Format URL: 
https://universalpayload.github.io/spec/chapter2-payload-image-f
 ```   - FIT - Windows+  ```+  Download and install swig by 
https://swig.org/ and also set install path into environment variable+  ``` 
  ```powershell   Set-ExecutionPolicy Bypass -Scope Process -Force; 
[System.Net.ServicePointManager]::SecurityProtocol = 
[System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object 
System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) 
  choco install dtc-msys2   pip3 install pefile-  pip3 install swig 
  pip3 install pylibfdt   ``` - Ubuntu-- 
2.39.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118926): https://edk2.groups.io/g/devel/message/118926
Mute This Topic: https://groups.io/mt/106111413/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 09/10] UefiPayloadPkg/UefiPayloadPkg.dsc: Include SmmRelocationLib

2024-04-15 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Wu, Jiaxin  
Sent: Monday, April 15, 2024 6:30 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Rhodes, Sean ; Lu, 
James ; Guo, Gua ; Ni, Ray 

Subject: [PATCH v2 09/10] UefiPayloadPkg/UefiPayloadPkg.dsc: Include 
SmmRelocationLib

This patch just includes SmmRelocationLib in UefiPayloadPkg.

Cc: Guo Dong 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Cc: Ray Ni 
Signed-off-by: Jiaxin Wu 
Reviewed-by: Gua Guo 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 433fb51a56..328b7fd4fe 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -313,10 +313,12 @@
   
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
   
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
   CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf
   
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
   FdtLib|MdePkg/Library/BaseFdtLib/BaseFdtLib.inf
+  SmmRelocationLib|UefiCpuPkg/Library/SmmRelocationLib/SmmRelocationLib.inf
+
 [LibraryClasses.common]
 !if $(BOOTSPLASH_IMAGE)
   SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
   BmpSupportLib|MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf
 !endif
-- 
2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117792): https://edk2.groups.io/g/devel/message/117792
Mute This Topic: https://groups.io/mt/105535815/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v3 13/24] UefiPayloadPkg: Prepare UefiPayloadPkg to use the AmdSvsmLib library

2024-04-12 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Tom Lendacky  
Sent: Friday, March 8, 2024 8:30 AM
To: devel@edk2.groups.io
Cc: Ard Biesheuvel ; Aktas, Erdem 
; Gerd Hoffmann ; Yao, Jiewen 
; Laszlo Ersek ; Liming Gao 
; Kinney, Michael D ; Xu, 
Min M ; Liu, Zhiguang ; Kumar, 
Rahul R ; Ni, Ray ; Michael Roth 
; Guo, Gua ; Dong, Guo 
; Lu, James ; Rhodes, Sean 

Subject: [PATCH v3 13/24] UefiPayloadPkg: Prepare UefiPayloadPkg to use the 
AmdSvsmLib library

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4654

The MpInitLib library will be updated to use the new AmdSvsmLib library.
To prevent any build breakage, update the UefiPayloadPkg DSC file to include 
the AmdSvsmLib NULL library.

Cc: Gua Guo 
Cc: Guo Dong 
Cc: James Lu 
Cc: Sean Rhodes 
Acked-by: Gerd Hoffmann 
Signed-off-by: Tom Lendacky 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 433fb51a5695..e1b9d5ecf182 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -313,6 +313,7 @@ [LibraryClasses]
   
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
   
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
   CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf
+  AmdSvsmLib|UefiCpuPkg/Library/AmdSvsmLibNull/AmdSvsmLibNull.inf
   
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
   FdtLib|MdePkg/Library/BaseFdtLib/BaseFdtLib.inf
 [LibraryClasses.common]
--
2.43.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117718): https://edk2.groups.io/g/devel/message/117718
Mute This Topic: https://groups.io/mt/104810720/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel][PATCH V2] UefiPayloadPkg: Fix boot shell issue for universal UEFI payload

2023-05-12 Thread Guo Dong


Hi Liming,
I know EDK2 is code freeze now. This patch fixes the UEFI payload boot to shell 
bug and it got reviewed and should have no impact to other packages.
Do you think we could merge it for this stable release?
https://github.com/tianocore/edk2/pull/4377

Thanks,
Guo

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Guo Dong
Sent: Friday, May 12, 2023 3:44 PM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Rhodes, Sean 
; Lu, James ; Guo, Gua 

Subject: [edk2-devel][PATCH V2] UefiPayloadPkg: Fix boot shell issue for 
universal UEFI payload

From: Guo Dong 

After moving BDS driver to a new FV for universal UEFI payload, the shell boot 
option path is not correct since it used the BDS FV instead of DXE FV in its 
device path.
This patch would find the correct FV by reading shell file.
It also removed PcdShellFile by using gUefiShellFileGuid.

Signed-off-by: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Reviewed-by: James Lu 
Reviewed-by: Gua Guo 
---
 UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c  | 82 
+++---
 UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  5 
+++--
 UefiPayloadPkg/UefiPayloadPkg.dec|  3 
---
 3 files changed, 78 insertions(+), 12 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index 62637ae6aa..1660d6c330 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
+++ c
@@ -2,7 +2,7 @@
   This file include all platform action which can be customized   by IBV/OEM. 
-Copyright (c) 2015 - 2021, Intel Corporation. All rights 
reserved.+Copyright (c) 2015 - 2023, Intel Corporation. All rights 
reserved. SPDX-License-Identifier: BSD-2-Clause-Patent  **/@@ -11,6 +11,7 
@@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include "PlatformConsole.h" #include  #include 
+#include   /**   Signal EndOfDxe 
event and install SMM Ready to lock protocol.@@ -89,6 +90,77 @@ 
PlatformFindLoadOption (
   return -1; } +/**+  Get the FV device path for the shell file.++  @return   
A pointer to device path structure.+**/+EFI_DEVICE_PATH_PROTOCOL 
*+BdsGetShellFvDevicePath (+  VOID+  )+{+  UINTN  
FvHandleCount;+  EFI_HANDLE *FvHandleBuffer;+  UINTN
  Index;+  EFI_STATUS Status;+  
EFI_FIRMWARE_VOLUME2_PROTOCOL  *Fv;+  UINTN  Size;+  
UINT32 AuthenticationStatus;+  EFI_DEVICE_PATH_PROTOCOL 
  *DevicePath;+  EFI_FV_FILETYPEFoundType;+  
EFI_FV_FILE_ATTRIBUTES FileAttributes;++  Status = EFI_SUCCESS;+  
gBS->LocateHandleBuffer (+ ByProtocol,+ 
,+ NULL,+ ,+  
   + );++  for (Index = 0; Index < FvHandleCount; 
Index++) {+Size   = 0;+gBS->HandleProtocol (+   
FvHandleBuffer[Index],+   ,+   
(VOID **)+   );+Status = Fv->ReadFile (+   Fv,+  
 ,+   NULL,+ 
  ,+   ,+   ,+
   +   );+if (!EFI_ERROR 
(Status)) {+  //+  // Found the shell file+  //+  break;+}+ 
 }++  if (EFI_ERROR (Status)) {+if (FvHandleCount) {+  FreePool 
(FvHandleBuffer);+}++return NULL;+  }++  DevicePath = 
DevicePathFromHandle (FvHandleBuffer[Index]);++  if (FvHandleCount) {+
FreePool (FvHandleBuffer);+  }++  return DevicePath;+}+ /**   Register a boot 
option using a file GUID in the FV. @@ -109,15 +181,11 @@ 
PlatformRegisterFvBootOption (
   EFI_BOOT_MANAGER_LOAD_OPTION   *BootOptions;   UINTN 
 BootOptionCount;   MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  FileNode;-  
EFI_LOADED_IMAGE_PROTOCOL  *LoadedImage;   EFI_DEVICE_PATH_PROTOCOL 
  *DevicePath; -  Status = gBS->HandleProtocol (gImageHandle, 
, (VOID **));-  ASSERT_EFI_ERROR 
(Status);-   EfiInitializeFwVolDevicepathNode (, FileGuid);   
DevicePath = AppendDevicePathNode (- DevicePathFromHandle 
(LoadedImage->DeviceHandle),+ BdsGetShellFvDevicePath (),   
   (EFI_DEVICE_PATH_PROTOCOL *)  ); @@ -248,7 
+316,7 @@ PlatformBootManagerAfterConsole (
   //   // Register UEFI Shell   //-  PlatformRegisterFvBootOption (PcdGetPtr 
(PcdShellFile), L"UEFI Shell", LOAD_OPTION_ACTIVE);+  
PlatformRegisterFvBootOption (, L"UEFI Shell", 
LOAD_OPTION_ACTIVE);if (FixedPcdGetBool (PcdBootManagerEscape)) { Print 
(diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 

[edk2-devel][PATCH V2] UefiPayloadPkg: Fix boot shell issue for universal UEFI payload

2023-05-12 Thread Guo Dong
From: Guo Dong 

After moving BDS driver to a new FV for universal UEFI payload,
the shell boot option path is not correct since it used the BDS
FV instead of DXE FV in its device path.
This patch would find the correct FV by reading shell file.
It also removed PcdShellFile by using gUefiShellFileGuid.

Signed-off-by: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Reviewed-by: James Lu 
Reviewed-by: Gua Guo 
---
 UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c  | 82 
+++---
 UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  5 
+++--
 UefiPayloadPkg/UefiPayloadPkg.dec|  3 
---
 3 files changed, 78 insertions(+), 12 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index 62637ae6aa..1660d6c330 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -2,7 +2,7 @@
   This file include all platform action which can be customized
   by IBV/OEM.
 
-Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2023, Intel Corporation. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -11,6 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include "PlatformConsole.h"
 #include 
 #include 
+#include 
 
 /**
   Signal EndOfDxe event and install SMM Ready to lock protocol.
@@ -89,6 +90,77 @@ PlatformFindLoadOption (
   return -1;
 }
 
+/**
+  Get the FV device path for the shell file.
+
+  @return   A pointer to device path structure.
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+BdsGetShellFvDevicePath (
+  VOID
+  )
+{
+  UINTN  FvHandleCount;
+  EFI_HANDLE *FvHandleBuffer;
+  UINTN  Index;
+  EFI_STATUS Status;
+  EFI_FIRMWARE_VOLUME2_PROTOCOL  *Fv;
+  UINTN  Size;
+  UINT32 AuthenticationStatus;
+  EFI_DEVICE_PATH_PROTOCOL   *DevicePath;
+  EFI_FV_FILETYPEFoundType;
+  EFI_FV_FILE_ATTRIBUTES FileAttributes;
+
+  Status = EFI_SUCCESS;
+  gBS->LocateHandleBuffer (
+ ByProtocol,
+ ,
+ NULL,
+ ,
+ 
+ );
+
+  for (Index = 0; Index < FvHandleCount; Index++) {
+Size   = 0;
+gBS->HandleProtocol (
+   FvHandleBuffer[Index],
+   ,
+   (VOID **)
+   );
+Status = Fv->ReadFile (
+   Fv,
+   ,
+   NULL,
+   ,
+   ,
+   ,
+   
+   );
+if (!EFI_ERROR (Status)) {
+  //
+  // Found the shell file
+  //
+  break;
+}
+  }
+
+  if (EFI_ERROR (Status)) {
+if (FvHandleCount) {
+  FreePool (FvHandleBuffer);
+}
+
+return NULL;
+  }
+
+  DevicePath = DevicePathFromHandle (FvHandleBuffer[Index]);
+
+  if (FvHandleCount) {
+FreePool (FvHandleBuffer);
+  }
+
+  return DevicePath;
+}
+
 /**
   Register a boot option using a file GUID in the FV.
 
@@ -109,15 +181,11 @@ PlatformRegisterFvBootOption (
   EFI_BOOT_MANAGER_LOAD_OPTION   *BootOptions;
   UINTN  BootOptionCount;
   MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  FileNode;
-  EFI_LOADED_IMAGE_PROTOCOL  *LoadedImage;
   EFI_DEVICE_PATH_PROTOCOL   *DevicePath;
 
-  Status = gBS->HandleProtocol (gImageHandle, , 
(VOID **));
-  ASSERT_EFI_ERROR (Status);
-
   EfiInitializeFwVolDevicepathNode (, FileGuid);
   DevicePath = AppendDevicePathNode (
- DevicePathFromHandle (LoadedImage->DeviceHandle),
+ BdsGetShellFvDevicePath (),
  (EFI_DEVICE_PATH_PROTOCOL *)
  );
 
@@ -248,7 +316,7 @@ PlatformBootManagerAfterConsole (
   //
   // Register UEFI Shell
   //
-  PlatformRegisterFvBootOption (PcdGetPtr (PcdShellFile), L"UEFI Shell", 
LOAD_OPTION_ACTIVE);
+  PlatformRegisterFvBootOption (, L"UEFI Shell", 
LOAD_OPTION_ACTIVE);
 
   if (FixedPcdGetBool (PcdBootManagerEscape)) {
 Print (
diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index f9626175e2..a3951b7a7e 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -1,7 +1,7 @@
 ## @file
 #  Include all platform action which can be customized by IBV/OEM.
 #
-#  Copyright (c) 2012 - 2021, Intel Corporation. All rights reserved.
+#  Copyright (c) 2012 - 2023, Intel Corporation. All rights reserved.
 #  SPDX-License

Re: [edk2-devel][PATCH] UefiPayloadPkg: Fix boot shell issue for universal UEFI payload

2023-05-12 Thread Guo Dong

Hi Mike,
Thanks to share the details. I think you are right the "buffer" need be freed 
using ReadSection().
I don't really want to read the shell file, so I would update this patch to use 
ReadFile() which supports NULL for the file buffer.

Thanks,
Guo
-Original Message-
From: Mike Maslenkin  
Sent: Thursday, May 11, 2023 1:00 PM
To: devel@edk2.groups.io; Dong, Guo 
Cc: Ni, Ray ; Rhodes, Sean ; Lu, James 
; Guo, Gua 
Subject: Re: [edk2-devel][PATCH] UefiPayloadPkg: Fix boot shell issue for 
universal UEFI payload

Hi Guo,
thanks for your explanation.

I may be wrong, but there is a different logic used.
Passing pointer to NULL means request for callee allocation.
I assume EFI_FIRMWARE_VOLUME2_PROTOCOL implemented in 
MdeModulePkg/Core/Dxe/FwVol.
So, Fv->ReadSection() actually is FvReadFileSection() call [1].
This function passes pointer to pointer to buffer (aka void **) into
GetSection() function.
edk2 contains only one implementation of this function in 
MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c
And the code [2] handling Buffer variable is below:

  if (*Buffer != NULL) {
//
// Caller allocated buffer.  Fill to size and return required size...
//
if (*BufferSize < CopySize) {
  Status   = EFI_WARN_BUFFER_TOO_SMALL;
  CopySize = *BufferSize;
}
  } else {
//
// Callee allocated buffer.  Allocate buffer and return size.
//
*Buffer = AllocatePool (CopySize);
if (*Buffer == NULL) {
  Status = EFI_OUT_OF_RESOURCES;
  goto GetSection_Done;
}
  }

Same pattern used in FvReadFile() implementation.

[1]  
https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/Dxe/FwVol/FwVolRead.c#L508
[2]  
https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c#L1339

Regards,
Mike

On Thu, May 11, 2023 at 8:16 PM Guo Dong  wrote:
>
>
> Hi Mike,
> Thanks for your comments.
> The "Buffer" is initialized to NULL for ReadSection call, we don't need free 
> "Buffer" since there is no data really read to Buffer.
> With "Buffer" set to NULL, it just test if the file exists in the FV. If it 
> exists, it will return success with file size.
>
> Thanks,
> Guo
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Mike 
> Maslenkin
> Sent: Wednesday, May 10, 2023 12:14 AM
> To: devel@edk2.groups.io; Dong, Guo 
> Cc: Ni, Ray ; Rhodes, Sean ; 
> Lu, James ; Guo, Gua 
> Subject: Re: [edk2-devel][PATCH] UefiPayloadPkg: Fix boot shell issue 
> for universal UEFI payload
>
> Hi, Guo Dong
>
> Don't you need to free "Buffer" after Fv->ReadSection() call ?
>
> Regards,
> Mike.
>
> On Wed, May 10, 2023 at 6:58 AM Guo Dong  wrote:
> >
> > From: Guo Dong 
> >
> > After moving BDS driver to a new FV for universal UEFI payload, the 
> > shell boot option path is not correct since it used the BDS FV 
> > instead of DXE FV in its device path.
> > This patch would find the correct FV by reading shell file.
> > It also removed PcdShellFile by using gUefiShellFileGuid.
> >
> > Signed-off-by: Guo Dong 
> > Cc: Ray Ni 
> > Cc: Sean Rhodes 
> > Cc: James Lu 
> > Cc: Gua Guo 
> > ---
> >  UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c  | 
> > 76 
> > ++--
> >  UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 
> >  5 +++--
> >  UefiPayloadPkg/UefiPayloadPkg.dec| 
> >  3 ---
> >  3 files changed, 73 insertions(+), 11 deletions(-)
> >
> > diff --git
> > a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
> > c 
> > b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
> > c
> > index 62637ae6aa..cf72783af1 100644
> > ---
> > a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
> > c
> > +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana
> > +++ ge
> > +++ r.c
> > @@ -2,7 +2,7 @@
> >This file include all platform action which can be customized
> >by IBV/OEM.
> >
> > -Copyright (c) 2015 - 2021, Intel Corporation. All rights 
> > reserved.
> > +Copyright (c) 2015 - 2023, Intel Corporation. All rights 
> > +reserved.
> >  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >  **/
> > @@ -11,6 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent 
> > #include "PlatformConsole.h"
> >  #include 
> >  #include 
> > +#include 
> >
> >  /**
> >Signal EndOfDxe eve

Re: [edk2-devel][PATCH] UefiPayloadPkg: Fix boot shell issue for universal UEFI payload

2023-05-11 Thread Guo Dong

Hi Mike,
Thanks for your comments.
The "Buffer" is initialized to NULL for ReadSection call, we don't need free 
"Buffer" since there is no data really read to Buffer.
With "Buffer" set to NULL, it just test if the file exists in the FV. If it 
exists, it will return success with file size.

Thanks,
Guo
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Mike Maslenkin
Sent: Wednesday, May 10, 2023 12:14 AM
To: devel@edk2.groups.io; Dong, Guo 
Cc: Ni, Ray ; Rhodes, Sean ; Lu, James 
; Guo, Gua 
Subject: Re: [edk2-devel][PATCH] UefiPayloadPkg: Fix boot shell issue for 
universal UEFI payload

Hi, Guo Dong

Don't you need to free "Buffer" after Fv->ReadSection() call ?

Regards,
Mike.

On Wed, May 10, 2023 at 6:58 AM Guo Dong  wrote:
>
> From: Guo Dong 
>
> After moving BDS driver to a new FV for universal UEFI payload, the 
> shell boot option path is not correct since it used the BDS FV instead 
> of DXE FV in its device path.
> This patch would find the correct FV by reading shell file.
> It also removed PcdShellFile by using gUefiShellFileGuid.
>
> Signed-off-by: Guo Dong 
> Cc: Ray Ni 
> Cc: Sean Rhodes 
> Cc: James Lu 
> Cc: Gua Guo 
> ---
>  UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c  | 
> 76 
> ++--
>  UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  
> 5 +++--
>  UefiPayloadPkg/UefiPayloadPkg.dec|  
> 3 ---
>  3 files changed, 73 insertions(+), 11 deletions(-)
>
> diff --git 
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> index 62637ae6aa..cf72783af1 100644
> --- 
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManage
> +++ r.c
> @@ -2,7 +2,7 @@
>This file include all platform action which can be customized
>by IBV/OEM.
>
> -Copyright (c) 2015 - 2021, Intel Corporation. All rights 
> reserved.
> +Copyright (c) 2015 - 2023, Intel Corporation. All rights 
> +reserved.
>  SPDX-License-Identifier: BSD-2-Clause-Patent
>
>  **/
> @@ -11,6 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  
> #include "PlatformConsole.h"
>  #include 
>  #include 
> +#include 
>
>  /**
>Signal EndOfDxe event and install SMM Ready to lock protocol.
> @@ -89,6 +90,72 @@ PlatformFindLoadOption (
>return -1;
>  }
>
> +
> +EFI_DEVICE_PATH_PROTOCOL *
> +BdsGetShellFvDevicePath (
> +  VOID
> +  )
> +{
> +  UINTN FvHandleCount;
> +  EFI_HANDLE*FvHandleBuffer;
> +  UINTN Index;
> +  EFI_STATUSStatus;
> +  EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
> +  UINTN Size;
> +  UINT32AuthenticationStatus;
> +  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
> +  VOID  *Buffer;
> +
> +  Status = EFI_SUCCESS;
> +  gBS->LocateHandleBuffer (
> + ByProtocol,
> + ,
> + NULL,
> + ,
> + 
> + );
> +
> +  for (Index = 0; Index < FvHandleCount; Index++) {
> +Buffer = NULL;
> +Size   = 0;
> +gBS->HandleProtocol (
> +   FvHandleBuffer[Index],
> +   ,
> +   (VOID **) 
> +   );
> +Status = Fv->ReadSection (
> +   Fv,
> +   ,
> +   EFI_SECTION_PE32,
> +   0,
> +   ,
> +   ,
> +   
> +   );
> +if (!EFI_ERROR (Status)) {
> +  //
> +  // Found the shell file
> +  //
> +  break;
> +}
> +  }
> +
> +  if (EFI_ERROR (Status)) {
> +if (FvHandleCount) {
> +  FreePool (FvHandleBuffer);
> +}
> +return NULL;
> +  }
> +
> +  DevicePath = DevicePathFromHandle (FvHandleBuffer[Index]);
> +
> +  if (FvHandleCount) {
> +FreePool (FvHandleBuffer);
> +  }
> +
> +  return DevicePath;
> +}
> +
>  /**
>Register a boot option using a file GUID in the FV.
>
> @@ -109,15 +176,12 @@ PlatformRegisterFvBootOption (
>EFI_BOOT_MANAGER_LOAD_OPTION   *BootOptions;
>UINTN  BootOptionCount;
>MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  FileNode;
> -  EFI_LOADED_IMAGE_PROTOCOL  *LoadedImage;
>EFI_DEVICE_PATH_PROTOCOL   *DevicePath;
>
> -  Status = 

[edk2-devel][PATCH] UefiPayloadPkg: Fix boot shell issue for universal UEFI payload

2023-05-09 Thread Guo Dong
From: Guo Dong 

After moving BDS driver to a new FV for universal UEFI payload,
the shell boot option path is not correct since it used the BDS
FV instead of DXE FV in its device path.
This patch would find the correct FV by reading shell file.
It also removed PcdShellFile by using gUefiShellFileGuid.

Signed-off-by: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
---
 UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c  | 76 
++--
 UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |  5 
+++--
 UefiPayloadPkg/UefiPayloadPkg.dec|  3 
---
 3 files changed, 73 insertions(+), 11 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index 62637ae6aa..cf72783af1 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -2,7 +2,7 @@
   This file include all platform action which can be customized
   by IBV/OEM.
 
-Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2023, Intel Corporation. All rights reserved.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -11,6 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include "PlatformConsole.h"
 #include 
 #include 
+#include 
 
 /**
   Signal EndOfDxe event and install SMM Ready to lock protocol.
@@ -89,6 +90,72 @@ PlatformFindLoadOption (
   return -1;
 }
 
+
+EFI_DEVICE_PATH_PROTOCOL *
+BdsGetShellFvDevicePath (
+  VOID
+  )
+{
+  UINTN FvHandleCount;
+  EFI_HANDLE*FvHandleBuffer;
+  UINTN Index;
+  EFI_STATUSStatus;
+  EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
+  UINTN Size;
+  UINT32AuthenticationStatus;
+  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
+  VOID  *Buffer;
+
+  Status = EFI_SUCCESS;
+  gBS->LocateHandleBuffer (
+ ByProtocol,
+ ,
+ NULL,
+ ,
+ 
+ );
+
+  for (Index = 0; Index < FvHandleCount; Index++) {
+Buffer = NULL;
+Size   = 0;
+gBS->HandleProtocol (
+   FvHandleBuffer[Index],
+   ,
+   (VOID **) 
+   );
+Status = Fv->ReadSection (
+   Fv,
+   ,
+   EFI_SECTION_PE32,
+   0,
+   ,
+   ,
+   
+   );
+if (!EFI_ERROR (Status)) {
+  //
+  // Found the shell file
+  //
+  break;
+}
+  }
+
+  if (EFI_ERROR (Status)) {
+if (FvHandleCount) {
+  FreePool (FvHandleBuffer);
+}
+return NULL;
+  }
+
+  DevicePath = DevicePathFromHandle (FvHandleBuffer[Index]);
+
+  if (FvHandleCount) {
+FreePool (FvHandleBuffer);
+  }
+
+  return DevicePath;
+}
+
 /**
   Register a boot option using a file GUID in the FV.
 
@@ -109,15 +176,12 @@ PlatformRegisterFvBootOption (
   EFI_BOOT_MANAGER_LOAD_OPTION   *BootOptions;
   UINTN  BootOptionCount;
   MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  FileNode;
-  EFI_LOADED_IMAGE_PROTOCOL  *LoadedImage;
   EFI_DEVICE_PATH_PROTOCOL   *DevicePath;
 
-  Status = gBS->HandleProtocol (gImageHandle, , 
(VOID **));
-  ASSERT_EFI_ERROR (Status);
 
   EfiInitializeFwVolDevicepathNode (, FileGuid);
   DevicePath = AppendDevicePathNode (
- DevicePathFromHandle (LoadedImage->DeviceHandle),
+ BdsGetShellFvDevicePath(),
  (EFI_DEVICE_PATH_PROTOCOL *)
  );
 
@@ -248,7 +312,7 @@ PlatformBootManagerAfterConsole (
   //
   // Register UEFI Shell
   //
-  PlatformRegisterFvBootOption (PcdGetPtr (PcdShellFile), L"UEFI Shell", 
LOAD_OPTION_ACTIVE);
+  PlatformRegisterFvBootOption (, L"UEFI Shell", 
LOAD_OPTION_ACTIVE);
 
   if (FixedPcdGetBool (PcdBootManagerEscape)) {
 Print (
diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index f9626175e2..a3951b7a7e 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -1,7 +1,7 @@
 ## @file
 #  Include all platform action which can be customized by IBV/OEM.
 #
-#  Copyright (c) 2012 - 2021, Intel Corporation. All rights reserved.
+#  Copyright (c) 2012 - 2023, Intel Corporation. All rights reserved.
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -32,6 +32,7 @@
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
   UefiPayloadPkg/UefiPayloadPkg

Re: [edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Remove FP Init from UPL entryfunc

2023-03-02 Thread Guo Dong
Reviewed-by: Guo Dong 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Dhaval Sharma
Sent: Thursday, March 2, 2023 11:12 AM
To: devel@edk2.groups.io
Cc: Guo, Gua 
Subject: [edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Remove FP Init from UPL 
entryfunc

Signed-off-by: Dhaval Sharma 
Cc: Gua Guo 
---
 UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c 
b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
index 46ee27c905e9..07f4c1d29686 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
@@ -470,9 +470,6 @@ _ModuleEntryPoint (
 PrintHob (mHobList);
 );
 
-  // Initialize floating point operating environment to be compliant with UEFI 
spec.
-  InitializeFloatingPointUnits ();
-
   // Build HOB based on information from Bootloader
   Status = BuildHobs (BootloaderParameter, );
   ASSERT_EFI_ERROR (Status);
-- 
2.40.0.rc0.57.g454dfcbddf








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100644): https://edk2.groups.io/g/devel/message/100644
Mute This Topic: https://groups.io/mt/97345074/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 4/5] UefiPayloadPkg: Add CpuPageTableLib required by MpInitLib

2023-02-08 Thread Guo Dong
Reviewed-by: Guo Dong 

-Original Message-
From: Xie, Yuanhao  
Sent: Tuesday, February 7, 2023 6:50 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Rhodes, Sean 
; Lu, James ; Guo, Gua 

Subject: [PATCH 4/5] UefiPayloadPkg: Add CpuPageTableLib required by MpInitLib

Add CpuPageTableLib required by MpInitLib in UefiPayloadPkg.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: Yuanhao Xie 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 2dbd875f37..a1a3c74290 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -340,6 +340,7 @@
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
 !endif
   
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
+  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
   MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
 !if $(PERFORMANCE_MEASUREMENT_ENABLE)
   PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
-- 
2.36.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99798): https://edk2.groups.io/g/devel/message/99798
Mute This Topic: https://groups.io/mt/96807125/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Set RTC dynamic PCD to PeiPCDdatabase

2023-01-17 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Liu, KasimX  
Sent: Tuesday, January 17, 2023 3:41 AM
To: devel@edk2.groups.io
Cc: Liu, KasimX ; Dong, Guo ; Ni, Ray 
; Lu, James ; Guo, Gua 
Subject: [PATCH] UefiPayloadPkg: Set RTC dynamic PCD to PeiPCDdatabase

From: KasimX Liu 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4193

In order to remove RTC_INDEX/RTC_TARGET from the UplBuild macro list,change the 
RTC_INDEX /RTC_TARGET type from PcdsFixedAtBuild to PcdsDynamicEx

Cc: Guo Dong 
Cc: Ray Ni 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: KasimX Liu 
---
 UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.inf | 5 +
 1 file changed, 5 insertions(+)

diff --git a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.inf 
b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.inf
index 73f76064a0..06e83dbadc 100644
--- a/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.inf
+++ b/UefiPayloadPkg/PayloadLoaderPeim/PayloadLoaderPeim.inf
@@ -37,6 +37,7 @@
 [Packages]   MdePkg/MdePkg.dec   MdeModulePkg/MdeModulePkg.dec+  
PcAtChipsetPkg/PcAtChipsetPkg.dec   UefiPayloadPkg/UefiPayloadPkg.dec  
[LibraryClasses]@@ -52,6 +53,10 @@
 [Ppis]   gEfiPeiLoadFilePpiGuid ## PRODUCES +[Pcd]+  
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister+  
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister+ [Guids]   
gUniversalPayloadExtraDataGuid ## PRODUCES -- 
2.32.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#98697): https://edk2.groups.io/g/devel/message/98697
Mute This Topic: https://groups.io/mt/96330756/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Move RTC PCD to dynamic PCD

2023-01-04 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Liu, KasimX  
Sent: Wednesday, December 28, 2022 1:13 AM
To: devel@edk2.groups.io
Cc: Liu, KasimX ; Dong, Guo ; Ni, Ray 
; Lu, James ; Guo, Gua 
Subject: [PATCH] UefiPayloadPkg: Move RTC PCD to dynamic PCD

From: KasimX Liu 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4193

In order to remove RTC_INDEX/RTC_TARGET from the UplBuild macro list,change the 
RTC_INDEX /RTC_TARGET type from PcdsFixedAtBuild to PcdsDynamicEx

Cc: Guo Dong 
Cc: Ray Ni 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: KasimX Liu 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 12e80a9e74..a1a3c74290 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -472,8 +472,6 @@
 !endif  [PcdsPatchableInModule.X64]-  
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)-  
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|$(RTC_TARGET_REGISTER) !if 
$(NETWORK_DRIVER_ENABLE) == TRUE   
gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE !endif@@ -580,6 
+578,9 @@
   gUefiCpuPkgTokenSpaceGuid.PcdSevEsIsEnabled|0   
gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|TRUE +  
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)+  
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|$(RTC_TARGET_REGISTER)+ 

 # # Components Section - list of all EDK II Modules needed by this Platform.-- 
2.32.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97951): https://edk2.groups.io/g/devel/message/97951
Mute This Topic: https://groups.io/mt/95916824/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: remove the change that get platform specific logic

2023-01-04 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Lin, MarsX  
Sent: Tuesday, January 3, 2023 12:45 AM
To: devel@edk2.groups.io
Cc: Lin, MarsX ; Dong, Guo ; Ni, Ray 
; Rhodes, Sean ; Lu, James 
; Guo, Gua 
Subject: [PATCH] UefiPayloadPkg: remove the change that get platform specific 
logic

From: MarsX Lin 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4241

Since UefiPayloadPkg had supported multiple firmware volume, remove the 
platform specific logic via protocol

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 

Signed-off-by: MarsX Lin 
---
 .../Protocol/PlatformBootManagerOverride.h| 84 ---
 .../PlatformBootManager.c | 27 --
 .../PlatformBootManagerLib.inf|  1 -
 UefiPayloadPkg/UefiPayloadPkg.dec |  2 -
 4 files changed, 114 deletions(-)
 delete mode 100644 
UefiPayloadPkg/Include/Protocol/PlatformBootManagerOverride.h

diff --git a/UefiPayloadPkg/Include/Protocol/PlatformBootManagerOverride.h 
b/UefiPayloadPkg/Include/Protocol/PlatformBootManagerOverride.h
deleted file mode 100644
index 878ddc044b..00
--- a/UefiPayloadPkg/Include/Protocol/PlatformBootManagerOverride.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/** @file-  This file defines the Univeral Payload Platform BootManager 
Protocol.--  Copyright (c) 2021, Intel Corporation. All rights reserved.-  
SPDX-License-Identifier: BSD-2-Clause-Patent-**/--#ifndef 
__PLATFORM_BOOT_MANAGER_OVERRIDE_H__-#define 
__PLATFORM_BOOT_MANAGER_OVERRIDE_H__--/**-  Do the platform specific action 
before the console is connected.--  Such as:-Update console variable;-
Register new Driver or Boot;-Signal ReadyToLock event.--  This 
function will override the default behavior in 
PlatformBootManagerLib-**/-typedef-VOID-(EFIAPI 
*UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_BEFORE_CONSOLE)(-  VOID-  
);--/**-  Do the platform specific action after the console is connected.--  
Such as:-Dynamically switch output mode;-Signal console ready platform 
customized event;-Run diagnostics like memory testing;-Connect certain 
devices;-Dispatch aditional option roms.--  This function will override the 
default behavior in PlatformBootManagerLib-**/-typedef-VOID-(EFIAPI 
*UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_AFTER_CONSOLE)(-  VOID-  
);--/**-  This function is called each second during the boot manager waits the 
timeout.-  This function will override the default behavior in 
PlatformBootManagerLib--  @param TimeoutRemain  The remaining 
timeout.-**/-typedef-VOID-(EFIAPI 
*UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_WAIT_CALLBACK)(-  UINT16  
TimeoutRemain-  );--/**-  The function is called when no boot option could 
be launched,-  including platform recovery options and options pointing to 
applications-  built into firmware volumes.--  If this function returns, BDS 
attempts to enter an infinite loop.-  This function will override the default 
behavior in PlatformBootManagerLib-**/-typedef-VOID-(EFIAPI 
*UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_UNABLE_TO_BOOT)(-  VOID-  
);--///-/// Provides an interface to override the default behavior in 
PlatformBootManagerLib,-/// so platform can provide its own platform specific 
logic through this protocol-///-typedef struct {-  
UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_BEFORE_CONSOLE
BeforeConsole;-  UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_AFTER_CONSOLE 
AfterConsole;-  
UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_WAIT_CALLBACK 
WaitCallback;-  UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_UNABLE_TO_BOOT 
   UnableToBoot;-} 
UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_PROTOCOL;--extern GUID  
gUniversalPayloadPlatformBootManagerOverrideProtocolGuid;--#endifdiff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a92a260a6e..62637ae6aa 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
+++ c
@@ -9,12 +9,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
  #include "PlatformBootManager.h" #include "PlatformConsole.h"-#include 
 #include  
#include  
-UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_PROTOCOL  
*mUniversalPayloadPlatformBootManagerOverrideInstance = NULL;- /**   Signal 
EndOfDxe event and install SMM Ready to lock protocol. @@ -167,17 +164,6 @@ 
PlatformBootManagerBeforeConsole (
   EFI_INPUT_KEY CustomKey;   EFI_INPUT_KEY 
Down;   EFI_BOOT_MANAGER_LOAD_OPTION  BootOption;-  EFI_STATUS  
  Status;--  Status = gBS->LocateProtocol 
(, NULL, (VOID 
**));-  if (EFI_ERROR 
(Status)) {-mUniversalPayloadPlatformBootManagerOverrideInstance = NULL;-  
}--  if (mUniversalPayloadPlatformBootManagerO

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Move RTC PCD to dynamic PCD

2023-01-04 Thread Guo Dong


From: Guo Dong 

-Original Message-
From: Liu, KasimX  
Sent: Wednesday, December 28, 2022 1:13 AM
To: devel@edk2.groups.io
Cc: Liu, KasimX ; Dong, Guo ; Ni, Ray 
; Lu, James ; Guo, Gua 
Subject: [PATCH] UefiPayloadPkg: Move RTC PCD to dynamic PCD

From: KasimX Liu 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4193

In order to remove RTC_INDEX/RTC_TARGET from the UplBuild macro list,change the 
RTC_INDEX /RTC_TARGET type from PcdsFixedAtBuild to PcdsDynamicEx

Cc: Guo Dong 
Cc: Ray Ni 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: KasimX Liu 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 12e80a9e74..a1a3c74290 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -472,8 +472,6 @@
 !endif  [PcdsPatchableInModule.X64]-  
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)-  
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|$(RTC_TARGET_REGISTER) !if 
$(NETWORK_DRIVER_ENABLE) == TRUE   
gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE !endif@@ -580,6 
+578,9 @@
   gUefiCpuPkgTokenSpaceGuid.PcdSevEsIsEnabled|0   
gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|TRUE +  
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)+  
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|$(RTC_TARGET_REGISTER)+ 

 # # Components Section - list of all EDK II Modules needed by this Platform.-- 
2.32.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97949): https://edk2.groups.io/g/devel/message/97949
Mute This Topic: https://groups.io/mt/95916824/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel][PATCH] UefiPayloadPkg: Fix boot issue for non-universal payload

2022-12-21 Thread Guo Dong
From: Guo Dong 

BDS module was moved from DXEFV to newly created BDSFV recently.
Non-universal UEFI payload doesn't support multiple FV, so it failed
to boot since BDS module could not be found.
This patch add BDS back to DXEFV when UNIVERSAL_PAYLOAD is not set.

Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: Guo Dong 
---
 UefiPayloadPkg/UefiPayloadPkg.fdf | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf 
b/UefiPayloadPkg/UefiPayloadPkg.fdf
index 94ba922244..ee7d718b3f 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -59,9 +59,6 @@ INF UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
 FILE FV_IMAGE = 4E35FD93-9C72-4c15-8C4B-E77F1DB2D793 {
 SECTION FV_IMAGE = DXEFV
 }
-FILE FV_IMAGE = FBE6C1E3-2F80-4770-88B0-494186E3346F {
-SECTION FV_IMAGE = BDSFV
-}
 
 

 [FV.BDSFV]
@@ -277,6 +274,10 @@ INF  
MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
 INF  
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf
 !endif
 
+!if $(UNIVERSAL_PAYLOAD) == FALSE
+INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
+!endif
+
 #
 # UEFI network modules
 #
-- 
2.35.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97710): https://edk2.groups.io/g/devel/message/97710
Mute This Topic: https://groups.io/mt/95815569/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: The UPL info section is not aligned at 4-byte boundary

2022-11-15 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Hsu, VictorX  
Sent: Tuesday, November 15, 2022 8:08 PM
To: devel@edk2.groups.io
Cc: Hsu, VictorX ; Dong, Guo ; Ni, 
Ray ; Lu, James ; Guo, Gua 

Subject: [PATCH] UefiPayloadPkg: The UPL info section is not aligned at 4-byte 
boundary

From: VictorX Hsu 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4153

1.Upgrade spec revision to 0.9
2.Align .upld_info with 4-byte boundary by spec

Cc: Guo Dong 
Cc: Ray Ni 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: VictorX Hsu 
---
 UefiPayloadPkg/UniversalPayloadBuild.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py 
b/UefiPayloadPkg/UniversalPayloadBuild.py
index 6003de36d1..50a5950e7c 100644
--- a/UefiPayloadPkg/UniversalPayloadBuild.py
+++ b/UefiPayloadPkg/UniversalPayloadBuild.py
@@ -31,7 +31,7 @@ class UPLD_INFO_HEADER(LittleEndianStructure):
 def __init__(self):

 self.Identifier =  b'PLDH'

 self.HeaderLength   = sizeof(UPLD_INFO_HEADER)

-self.SpecRevision   = 0x0007

+self.SpecRevision   = 0x0009

 self.Revision   = 0x010105

 self.ImageId= b'UEFI'

 self.ProducerId = b'INTEL'

@@ -133,7 +133,7 @@ def BuildUniversalPayload(Args, MacroList):
FvOutputDir,

EntryOutputDir

)

-set_section= '"{}" -I {} -O {} --set-section-alignment 
.upld.upld_info=16 --set-section-alignment .upld.uefi_fv=16 {}'.format (

+set_section= '"{}" -I {} -O {} --set-section-alignment .upld_info=4 
--set-section-alignment .upld.uefi_fv=16 {}'.format (

LlvmObjcopyPath,

ObjCopyFlag,

ObjCopyFlag,

-- 
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96420): https://edk2.groups.io/g/devel/message/96420
Mute This Topic: https://groups.io/mt/95059984/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v3 8/9] UefiPayloadPkg: Remove UefiCpuLib from module INFs.

2022-11-03 Thread Guo Dong
Reviewed-by: Guo Dong 

-Original Message-
From: Liu, Zhiguang  
Sent: Tuesday, November 1, 2022 12:59 AM
To: devel@edk2.groups.io
Cc: Yu Pu ; Dong, Guo ; Ni, Ray 
; Maurice Ma ; You, Benjamin 
; Rhodes, Sean 
Subject: [PATCH v3 8/9] UefiPayloadPkg: Remove UefiCpuLib from module INFs.

From: Yu Pu 

Because UefiCpuPkg/UefiCpuLib is merged to MdePkg/CpuLib, remove the dependency 
of UefiCpuLib.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Yu Pu 
Reviewed-by: Ray Ni 
---
 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h| 1 -
 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf  | 1 -
 UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf | 1 -
 UefiPayloadPkg/UefiPayloadPkg.dsc | 1 -
 4 files changed, 4 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h 
b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
index d1c7425b28..ad8a9fd22b 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
@@ -24,7 +24,6 @@
 #include 
 #include   #include  -#include 
  #include   #include 

 #include 
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf 
b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
index 95446dd997..d47e8e76cf 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
@@ -55,7 +55,6 @@
   PeCoffLib
   PlatformSupportLib
   CpuLib
-  UefiCpuLib
 
 [Guids]
   gEfiMemoryTypeInformationGuid
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf 
b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
index 3b4836042a..c4f4f28eaa 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
@@ -53,7 +53,6 @@
   HobLib
   PeCoffLib
   CpuLib
-  UefiCpuLib
 
 [Guids]
   gEfiMemoryTypeInformationGuid
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1150be6acd..b7712d4de1 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -221,7 +221,6 @@
   
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
   DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
   
DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
-  UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf
   SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
 
   #
--
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95893): https://edk2.groups.io/g/devel/message/95893
Mute This Topic: https://groups.io/mt/94704522/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Boot mode in PHIT HOB will not be updated

2022-11-03 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Hsu, VictorX  
Sent: Thursday, November 3, 2022 2:11 AM
To: devel@edk2.groups.io
Cc: Hsu, VictorX ; Dong, Guo ; Ni, 
Ray ; Lu, James ; Guo, Gua 

Subject: [PATCH] UefiPayloadPkg: Boot mode in PHIT HOB will not be updated

From: VictorX Hsu 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4136

System will depend on Boot Mode value to do different behavior Update during 
Capsule Update process. So UPL need to support update boot mode.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: VictorX Hsu 
---
 UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c 
b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
index edb3c20471..2ae6b088ab 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
@@ -309,6 +309,7 @@ BuildHobs (
   EFI_HOB_FIRMWARE_VOLUME   *FvHob;   UNIVERSAL_PAYLOAD_ACPI_TABLE  
*AcpiTable;   ACPI_BOARD_INFO   *AcpiBoardInfo;+  
EFI_HOB_HANDOFF_INFO_TABLE*HobInfo;Hob.Raw   = (UINT8 
*)BootloaderParameter;   MinimalNeededSize = FixedPcdGet32 
(PcdSystemMemoryUefiRegionSize);@@ -368,7 +369,8 @@ BuildHobs (
 MemoryTop= FreeMemoryTop;   } -  HobConstructor ((VOID 
*)(UINTN)MemoryBottom, (VOID *)(UINTN)MemoryTop, (VOID 
*)(UINTN)FreeMemoryBottom, (VOID *)(UINTN)FreeMemoryTop);+  HobInfo = 
HobConstructor ((VOID *)(UINTN)MemoryBottom, (VOID *)(UINTN)MemoryTop, (VOID 
*)(UINTN)FreeMemoryBottom, (VOID *)(UINTN)FreeMemoryTop);+  HobInfo->BootMode = 
Hob.HandoffInformationTable->BootMode;   //   // From now on, mHobList will 
point to the new Hob range.   //-- 
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95892): https://edk2.groups.io/g/devel/message/95892
Mute This Topic: https://groups.io/mt/94752793/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 4/8] UefiPayloadPkg: Use CcExitLib instead of VmgExitLib

2022-11-03 Thread Guo Dong
Reviewed-by: Guo Dong 

-Original Message-
From: Xu, Min M  
Sent: Tuesday, November 1, 2022 10:11 PM
To: devel@edk2.groups.io
Cc: Xu, Min M ; Dong, Guo ; Ni, Ray 
; Rhodes, Sean ; Lu, James 
; Guo, Gua 
Subject: [PATCH 4/8] UefiPayloadPkg: Use CcExitLib instead of VmgExitLib

From: Min M Xu 

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4123

VmgExitLib is renamed as CcExitLib. So UefiPayloadPkg.dsc should be updated as 
well.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: Min Xu 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1150be6acd0e..723a50a42284 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -301,7 +301,7 @@
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
   
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
   
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
-  VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
+  CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf
   
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
 
 [LibraryClasses.common]
--
2.29.2.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95891): https://edk2.groups.io/g/devel/message/95891
Mute This Topic: https://groups.io/mt/94728439/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Provide a wrapper for UniversalPayloadBuild.py

2022-09-20 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Hsu, VictorX  
Sent: Tuesday, September 20, 2022 7:19 PM
To: devel@edk2.groups.io
Cc: Hsu, VictorX ; Dong, Guo ; Lu, 
James 
Subject: [PATCH] UefiPayloadPkg: Provide a wrapper for UniversalPayloadBuild.py

From: VictorX Hsu 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4071

Provide a wrapper to wrap UniversalPayloadBuild.py

Cc: Guo Dong 
Cc: James Lu 
Signed-off-by: VictorX Hsu 
---
 UefiPayloadPkg/UniversalPayloadBuild | 14 ++
 1 file changed, 14 insertions(+)
 create mode 100644 UefiPayloadPkg/UniversalPayloadBuild

diff --git a/UefiPayloadPkg/UniversalPayloadBuild 
b/UefiPayloadPkg/UniversalPayloadBuild
new file mode 100644
index 00..fc3c2aadc9
--- /dev/null
+++ b/UefiPayloadPkg/UniversalPayloadBuild
@@ -0,0 +1,14 @@
+#!/bin/bash

+#

+# Copyright (c) 2022, Intel Corporation. All rights reserved.

+#

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+

+if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then

+echo python_exe=${PYTHON_COMMAND}

+fi

+

+upl_bldfile_path=${BASH_SOURCE:-$0}

+echo "upl_bldfile_path=$upl_bldfile_path"

+exec "${python_exe:-python}" "$upl_bldfile_path.py" "$@"

-- 
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94039): https://edk2.groups.io/g/devel/message/94039
Mute This Topic: https://groups.io/mt/93800833/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v6 2/2] UefiPayloadPkg: Allow DxeMain.inf to consume the new SerialPortLib

2022-09-01 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Sravanthi, K KavyaX  
Sent: Thursday, September 1, 2022 3:13 AM
To: devel@edk2.groups.io
Cc: Sravanthi, K KavyaX ; Dong, Guo 
; Ni, Ray ; Rhodes, Sean 
; Lu, James ; Guo, Gua 

Subject: [PATCH v6 2/2] UefiPayloadPkg: Allow DxeMain.inf to consume the new 
SerialPortLib

Let DxeMain.inf consume new SerialPortLib to support multiple channel debug 
message on early DXE if the macro MULTIPLE_DEBUG_PORT_SUPPORT is TRUE.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1b23ff3dbc..70828ea633 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -132,6 +132,8 @@
   # Note: for emulation platform such as QEMU, this may not work and should 
set it as FALSE
   DEFINE CPU_TIMER_LIB_ENABLE  = TRUE
 
+  DEFINE MULTIPLE_DEBUG_PORT_SUPPORT = FALSE
+
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
 !if $(USE_CBMEM_FOR_CONSOLE) == FALSE
@@ -615,6 +617,10 @@
   #
   MdeModulePkg/Core/Dxe/DxeMain.inf {
 
+  !if $(MULTIPLE_DEBUG_PORT_SUPPORT) == TRUE
+
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+
SerialPortLib|UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf
+  !endif
   
NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
   }
 
--
2.30.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93062): https://edk2.groups.io/g/devel/message/93062
Mute This Topic: https://groups.io/mt/93391293/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v5 2/2] UefiPayloadPkg: Allow DxeMain.inf to consume the new SerialPortLib

2022-08-30 Thread Guo Dong


The usage is not clear from the MACRO name DEBUG_REAL_INSTANCE_SUPPORT
Not sure if we could have a better name (e.g., MULTIPLE_DEBUG_PORT_SUPPORT?)

Thanks,
Guo
-Original Message-
From: Sravanthi, K KavyaX  
Sent: Monday, August 29, 2022 10:29 PM
To: devel@edk2.groups.io
Cc: Sravanthi, K KavyaX ; Dong, Guo 
; Ni, Ray ; Rhodes, Sean 
; Guo, Gua 
Subject: [PATCH v5 2/2] UefiPayloadPkg: Allow DxeMain.inf to consume the new 
SerialPortLib

Let DxeMain.inf consume new SerialPortLib to support multiple channel debug 
message on early DXE if DEBUG_REAL_INSTANCE_SUPPORT is true.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1b23ff3dbc..24aa66006f 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -132,6 +132,8 @@
   # Note: for emulation platform such as QEMU, this may not work and should 
set it as FALSE
   DEFINE CPU_TIMER_LIB_ENABLE  = TRUE
 
+  DEFINE DEBUG_REAL_INSTANCE_SUPPORT = FALSE
+
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
 !if $(USE_CBMEM_FOR_CONSOLE) == FALSE
@@ -615,6 +617,10 @@
   #
   MdeModulePkg/Core/Dxe/DxeMain.inf {
 
+  !if $(DEBUG_REAL_INSTANCE_SUPPORT) == TRUE
+
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
+
SerialPortLib|UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf
+  !endif
   
NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
   }
 
--
2.30.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93002): https://edk2.groups.io/g/devel/message/93002
Mute This Topic: https://groups.io/mt/93343477/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v5 1/2] UefiPayloadPkg: Implement a new SerialPortLib instance

2022-08-30 Thread Guo Dong


Had better read the register first and write register to have a short line and 
make it more readable.
+SerialPortWriteRegister (SerialRegisterBase, R_UART_LCR, 
(UINT8)(SerialPortReadRegister (SerialRegisterBase, R_UART_LCR, MmioEnable, 
RegisterStride) | B_UART_LCR_DLAB), MmioEnable, RegisterStride);

+SerialPortWriteRegister (SerialRegisterBase, R_UART_LCR, 
(UINT8)(SerialPortReadRegister (SerialRegisterBase, R_UART_LCR, MmioEnable, 
RegisterStride) & ~B_UART_LCR_DLAB), MmioEnable, RegisterStride);

The other change looks good to me.
Reviewed-by: Guo Dong 

-Original Message-
From: Sravanthi, K KavyaX  
Sent: Monday, August 29, 2022 10:29 PM
To: devel@edk2.groups.io
Cc: Sravanthi, K KavyaX ; Dong, Guo 
; Ni, Ray ; Rhodes, Sean 
; Guo, Gua 
Subject: [PATCH v5 1/2] UefiPayloadPkg: Implement a new SerialPortLib instance

Add new Serial port library instance that consumes the HOB defined in 
MdeModulePkg/Include/UniversalPayload/SerialPortInfo.h to support multiple 
UART's.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c   | 805 
+
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf |  39 
+++
 2 files changed, 844 insertions(+)

diff --git a/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c 
b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
new file mode 100644
index 00..875f4307f7
--- /dev/null
+++ b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
@@ -0,0 +1,805 @@
+/** @file
+  UART Serial Port library functions.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+//
+// 16550 UART register offsets and bitfields //
+#define R_UART_RXBUF 0// LCR_DLAB = 0
+#define R_UART_TXBUF 0// LCR_DLAB = 0
+#define R_UART_BAUD_LOW  0// LCR_DLAB = 1
+#define R_UART_BAUD_HIGH 1// LCR_DLAB = 1
+#define R_UART_IER   1// LCR_DLAB = 0
+#define R_UART_FCR   2
+#define   B_UART_FCR_FIFOE   BIT0
+#define   B_UART_FCR_FIFO64  BIT5
+#define R_UART_LCR   3
+#define   B_UART_LCR_DLABBIT7
+#define R_UART_MCR   4
+#define   B_UART_MCR_DTRCBIT0
+#define   B_UART_MCR_RTS BIT1
+#define R_UART_LSR   5
+#define   B_UART_LSR_RXRDY   BIT0
+#define   B_UART_LSR_TXRDY   BIT5
+#define   B_UART_LSR_TEMTBIT6
+#define R_UART_MSR   6
+#define   B_UART_MSR_CTS BIT4
+#define   B_UART_MSR_DSR BIT5
+#define   B_UART_MSR_RI  BIT6
+#define   B_UART_MSR_DCD BIT7
+
+#define MAX_SIZE 16
+
+typedef struct {
+  UINTNBaseAddress;
+  BOOLEAN  UseMmio;
+  UINT32   BaudRate;
+  UINT8RegisterStride;
+} UART_INFO;
+
+UART_INFO   mUartInfo[MAX_SIZE];
+UINT8   mUartCount = 0;
+
+/**
+  Reads an 8-bit register. If UseMmio is TRUE, then the value is read 
+from
+  MMIO space. If UseMmio is FALSE, then the value is read from I/O 
+space. The
+  parameter Offset is added to the base address of the register.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to read.
+  @param  UseMmio  Check if value has to be read from MMIO space or IO 
space.
+  @param  RegisterStride   Number of bytes between registers in serial device.
+
+  @return The value read from the register.
+
+**/
+UINT8
+SerialPortReadRegister (
+  UINTNBase,
+  UINTNOffset,
+  BOOLEAN  UseMmio,
+  UINT8RegisterStride
+  )
+{
+  if (UseMmio) {
+return MmioRead8 (Base + Offset * RegisterStride);
+  } else {
+return IoRead8 (Base + Offset * RegisterStride);
+  }
+}
+
+/**
+  Writes an 8-bit register.. If UseMmio is TRUE, then the value is 
+written to
+  MMIO space. If UseMmio is FALSE, then the value is written to I/O 
+space. The
+  parameter Offset is added to the base address of the regis

[edk2-devel][PATCH] Maintainers.txt: Update Maintainers/reviewers for universal payload

2022-08-22 Thread Guo Dong
From: Guo Dong 

Add James Lu as UefiPayloadPkg maintainer.
Add Gua Guo as universal payload reviewer.

Signed-off-by: Guo Dong 
Cc: Ray Ni 
Cc: Michael D Kinney 
Cc: Sean Rhodes 
Cc: James Lu 
Cc: Gua Guo 
Cc: Zhiguang Liu 
---
 Maintainers.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index a0d8b69685..5f639bffab 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -407,6 +407,7 @@ MdeModulePkg: Universal Payload definitions
 F: MdeModulePkg/Include/UniversalPayload/
 R: Zhiguang Liu  [LiuZhiguang001]
 R: Ray Ni  [niruiyu]
+R: Gua Guo  [gguo11837463]
 
 MdePkg
 F: MdePkg/
@@ -604,6 +605,8 @@ W: 
https://github.com/tianocore/tianocore.github.io/wiki/UefiPayloadPkg
 M: Guo Dong  [gdong1]
 M: Ray Ni  [niruiyu]
 M: Sean Rhodes  [Sean-StarLabs]
+M: James Lu  [jameslu8]
+R: Gua Guo  [gguo11837463]
 S: Maintained
 
 UnitTestFrameworkPkg
-- 
2.35.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92627): https://edk2.groups.io/g/devel/message/92627
Mute This Topic: https://groups.io/mt/93194677/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v4 1/2] UefiPayloadPkg: Implement a new SerialPortLib instance

2022-08-22 Thread Guo Dong


In SerialPortInitialize(), these code could be removed.

+  Count = 0;
+
+  GuidHob = GetFirstGuidHob ();
+  while (GuidHob != NULL) {
+Count++;
+GuidHob = GET_NEXT_HOB (GuidHob);
+GuidHob = GetNextGuidHob (, GuidHob);
+  }
+
+  mUartCount = Count;
+
+  Index = 0;

And change Index to mUartCount in below code.
Since multiple serial port support and SerialRegisterBase check, one serial 
port failure should not impact others.
So SerialRegisterBase check failure should continue checking other serial port. 
And move this check before setting mUartInfo.

+  GuidHob = GetFirstGuidHob ();
+  while (GuidHob != NULL) {
+SerialPortInfo = (UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO *)GET_GUID_HOB_DATA 
(GuidHob);
+SerialRegisterBase = SerialPortInfo->RegisterBase;
+MmioEnable = SerialPortInfo->UseMmio;
+BaudRate   = SerialPortInfo->BaudRate;
+RegisterStride = SerialPortInfo->RegisterStride;
+
+mUartInfo[Index].BaseAddress= SerialRegisterBase;
+mUartInfo[Index].UseMmio= MmioEnable;
+mUartInfo[Index].BaudRate   = BaudRate;
+mUartInfo[Index].RegisterStride = RegisterStride;
+Index++;
+
+if (SerialRegisterBase == 0) {
+  return RETURN_DEVICE_ERROR;
+}

Thanks,
Guo

-Original Message-
From: Sravanthi, K KavyaX  
Sent: Monday, July 25, 2022 11:34 PM
To: devel@edk2.groups.io
Cc: Sravanthi, K KavyaX ; Dong, Guo 
; Ni, Ray ; Rhodes, Sean 
; Guo, Gua 
Subject: [PATCH v4 1/2] UefiPayloadPkg: Implement a new SerialPortLib instance

Add new Serial port library instance that consumes the HOB defined in 
MdeModulePkg/Include/UniversalPayload/SerialPortInfo.h to support multiple 
UART's.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c   | 808 

 UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.inf |  39 
+++
 2 files changed, 847 insertions(+)

diff --git a/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c 
b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
new file mode 100644
index 00..140ecf5f4d
--- /dev/null
+++ b/UefiPayloadPkg/Library/BaseSerialPortLibHob/BaseSerialPortLibHob.c
@@ -0,0 +1,808 @@
+/** @file
+  UART Serial Port library functions.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+//
+// 16550 UART register offsets and bitfields //
+#define R_UART_RXBUF 0// LCR_DLAB = 0
+#define R_UART_TXBUF 0// LCR_DLAB = 0
+#define R_UART_BAUD_LOW  0// LCR_DLAB = 1
+#define R_UART_BAUD_HIGH 1// LCR_DLAB = 1
+#define R_UART_IER   1// LCR_DLAB = 0
+#define R_UART_FCR   2
+#define   B_UART_FCR_FIFOE   BIT0
+#define   B_UART_FCR_FIFO64  BIT5
+#define R_UART_LCR   3
+#define   B_UART_LCR_DLABBIT7
+#define R_UART_MCR   4
+#define   B_UART_MCR_DTRCBIT0
+#define   B_UART_MCR_RTS BIT1
+#define R_UART_LSR   5
+#define   B_UART_LSR_RXRDY   BIT0
+#define   B_UART_LSR_TXRDY   BIT5
+#define   B_UART_LSR_TEMTBIT6
+#define R_UART_MSR   6
+#define   B_UART_MSR_CTS BIT4
+#define   B_UART_MSR_DSR BIT5
+#define   B_UART_MSR_RI  BIT6
+#define   B_UART_MSR_DCD BIT7
+
+#define MAX_SIZE 16
+
+typedef struct {
+  UINTNBaseAddress;
+  BOOLEAN  UseMmio;
+  UINT32   BaudRate;
+  UINT8RegisterStride;
+} UART_INFO;
+
+UART_INFO   mUartInfo[MAX_SIZE];
+UINT8   mUartCount = 0;
+
+/**
+  Reads an 8-bit register. If UseMmio is TRUE, then the value is read 
+from
+  MMIO space. If UseMmio is FALSE, then the value is read from I/O 
+space. The
+  parameter Offset is added to the base address of the register.
+
+  @param  Base The base address register of UART device.
+  @param  Offset   The offset of the register to read.
+  @param  UseMmio  Check 

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Return PciRootBridges instead of NULL

2022-08-12 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of kavya
Sent: Thursday, August 11, 2022 12:08 AM
To: devel@edk2.groups.io
Cc: Sravanthi, K KavyaX ; Dong, Guo 
; Ni, Ray ; Rhodes, Sean 
; Guo, Gua 
Subject: [edk2-devel] [PATCH] UefiPayloadPkg: Return PciRootBridges instead of 
NULL

Return PciRootBridges instead of NULL and set PcdPciDisableBusEnumeration to 
FALSE when root bridge count is zero.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c 
b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
index e1faa24ae7..fb76853072 100644
--- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
+++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
@@ -549,6 +549,7 @@ RetrieveRootBridgeInfoFromHob (
   }
 
   if (PciRootBridgeInfo->Count == 0) {
+PcdSetBoolS (PcdPciDisableBusEnumeration, FALSE);
 return NULL;
   }
 
@@ -589,9 +590,8 @@ RetrieveRootBridgeInfoFromHob (
   if (PciRootBridgeInfo->ResourceAssigned) {
 PcdSetBoolS (PcdPciDisableBusEnumeration, TRUE);
   } else {
-DEBUG ((DEBUG_ERROR, "There is root bridge whose ResourceAssigned is 
FALSE\n"));
+DEBUG ((DEBUG_INFO, "There is root bridge whose ResourceAssigned is 
+ FALSE\n"));
 PcdSetBoolS (PcdPciDisableBusEnumeration, FALSE);
-return NULL;
   }
 
   return PciRootBridges;
--
2.30.2.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92403): https://edk2.groups.io/g/devel/message/92403
Mute This Topic: https://groups.io/mt/92953686/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v4 21/28] UefiPayloadPkg: Add ProtectedVariable reference

2022-08-12 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Vang, Judah  
Sent: Wednesday, August 10, 2022 11:54 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J ; Dong, Guo ; Ni, 
Ray ; Maurice Ma ; You, Benjamin 
; Rhodes, Sean ; Mistry, Nishant 
C 
Subject: [PATCH v4 21/28] UefiPayloadPkg: Add ProtectedVariable reference

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2594

Add reference for ProtectedVariableLib so build is successful.

Cc: Jian J Wang 
Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Cc: Nishant C Mistry 
Signed-off-by: Jian J Wang 
Signed-off-by: Nishant C Mistry 
Signed-off-by: Judah Vang 
Reviewed-by: Ray Ni 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 91cd78dbf109..591fae635b23 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -287,9 +287,11 @@ [LibraryClasses]
   
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
 !if $(VARIABLE_SUPPORT) == "EMU"
   
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
+  
ProtectedVariableLib|MdeModulePkg/Library/ProtectedVariableLibNull/ProtectedVariableLibNull.inf
 !elseif $(VARIABLE_SUPPORT) == "SPI"
   
PlatformSecureLib|SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf
   
TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
+  
ProtectedVariableLib|SecurityPkg/Library/ProtectedVariableLib/DxeProtectedVariableLib.inf
   
S3BootScriptLib|MdePkg/Library/BaseS3BootScriptLibNull/BaseS3BootScriptLibNull.inf
   
MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf
 !endif
-- 
2.35.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92402): https://edk2.groups.io/g/devel/message/92402
Mute This Topic: https://groups.io/mt/92953547/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix Coverity report defect

2022-08-12 Thread Guo Dong
Reviewed-by: Guo Dong 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of GregX Yeh
Sent: Wednesday, August 10, 2022 11:46 PM
To: devel@edk2.groups.io
Cc: Yeh, GregX ; Dong, Guo ; Ni, Ray 

Subject: [edk2-devel] [PATCH] UefiPayloadPkg: Fix Coverity report defect

From: Gregx Yeh 

https://bugzilla.tianocore.org/show_bug.cgi?id=4018
Coverity report FORWARD_NULL and OVERFLOW_BEFORE_WIDEN potential defect in 
UefiPayloadPkg.

Signed-off-by: Gregx Yeh 
Cc: Guo Dong 
Cc: Ray Ni 
---
 UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 4 ++--
 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c   | 2 +-
 UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c| 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c 
b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
index 9847063d3d..790e6109c0 100644
--- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
+++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
@@ -232,11 +232,11 @@ PciHostBridgeFreeRootBridges (
   UINTNCount   ) {-  if ((Bridges == NULL) && (Count == 0)) {+  if 
((Bridges == NULL) || (Count == 0)) { return;   } -  ASSERT (Bridges != 
NULL && Count > 0);+  ASSERT (Bridges != NULL || Count > 0);do { 
--Count;diff --git a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c 
b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c
index 2a6305c67b..a9bf6f3223 100644
--- a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c
+++ b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c
@@ -149,7 +149,7 @@ CalculateElfFileSize (
 FileSize2 = Elf32Hdr->e_shoff + Elf32Hdr->e_shentsize * Elf32Hdr->e_shnum; 
  } else if (ElfCt->EiClass == ELFCLASS64) { Elf64Hdr  = (Elf64_Ehdr 
*)ElfCt->FileBase;-FileSize2 = (UINTN)(Elf64Hdr->e_shoff + 
Elf64Hdr->e_shentsize * Elf64Hdr->e_shnum);+FileSize2 = 
((UINTN)Elf64Hdr->e_shoff + (UINTN)(Elf64Hdr->e_shentsize * 
Elf64Hdr->e_shnum));   }*FileSize = MAX (FileSize1, FileSize2);diff --git 
a/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c 
b/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
index 74b667a62a..8d8a9d0ca8 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
@@ -783,9 +783,9 @@ CreateIdentityMappingPageTables (
   // Pre-allocate big pages to avoid later allocations.   //   if 
(!Page1GSupport) {-TotalPagesNum = ((NumberOfPdpEntriesNeeded + 1) * 
NumberOfPml4EntriesNeeded + 1) * NumberOfPml5EntriesNeeded + 1;+
TotalPagesNum = (UINTN)((NumberOfPdpEntriesNeeded + 1) * 
NumberOfPml4EntriesNeeded + 1) * NumberOfPml5EntriesNeeded + 1;   } else {-
TotalPagesNum = (NumberOfPml4EntriesNeeded + 1) * NumberOfPml5EntriesNeeded + 
1;+TotalPagesNum = (UINTN)(NumberOfPml4EntriesNeeded + 1) * 
NumberOfPml5EntriesNeeded + 1;   }//-- 
2.26.2.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92343): https://edk2.groups.io/g/devel/message/92343
Mute This Topic: https://groups.io/mt/92953360/1781375
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.d...@intel.com] 
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92401): https://edk2.groups.io/g/devel/message/92401
Mute This Topic: https://groups.io/mt/92953360/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to control NvmExpressDxe

2022-08-12 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Sravanthi, K KavyaX  
Sent: Wednesday, August 10, 2022 1:37 AM
To: devel@edk2.groups.io
Cc: Sravanthi, K KavyaX ; Dong, Guo 
; Ni, Ray ; Rhodes, Sean 
; Guo, Gua 
Subject: [PATCH] UefiPayloadPkg: Add macro to control NvmExpressDxe

Add NVME_ENABLE macro to control NvmExpressDxe driver.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Sean Rhodes 
Cc: Gua Guo 
Signed-off-by: Kavya 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 3 +++  UefiPayloadPkg/UefiPayloadPkg.fdf | 
2 ++
 2 files changed, 5 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 91cd78dbf1..1b23ff3dbc 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -43,6 +43,7 @@
   DEFINE SD_MMC_TIMEOUT   = 100
   DEFINE USE_CBMEM_FOR_CONSOLE= FALSE
   DEFINE BOOTSPLASH_IMAGE = FALSE
+  DEFINE NVME_ENABLE  = TRUE
 
   #
   # NULL:NullMemoryTestDxe
@@ -713,7 +714,9 @@
   MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
   MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
   MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
+!if $(NVME_ENABLE) == TRUE
   MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+!endif
 
 !if $(RAM_DISK_ENABLE) == TRUE
   MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
diff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf 
b/UefiPayloadPkg/UefiPayloadPkg.fdf
index 27534f445d..9c9e2f2741 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -215,7 +215,9 @@ INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
 INF MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
 INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
 INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
+!if $(NVME_ENABLE) == TRUE
 INF MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+!endif
 !if $(RAM_DISK_ENABLE) == TRUE
 INF MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
 !endif
--
2.30.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92400): https://edk2.groups.io/g/devel/message/92400
Mute This Topic: https://groups.io/mt/92932576/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch V2 2/2] UefiPayloadPkg: Remove clearing CR0.WP when protecting pagetable

2022-08-12 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Tan, Dun  
Sent: Tuesday, August 9, 2022 10:34 PM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Maurice Ma 
; You, Benjamin ; Rhodes, Sean 

Subject: [Patch V2 2/2] UefiPayloadPkg: Remove clearing CR0.WP when protecting 
pagetable

Remove clearing CR0.WP when marking the memory used for page table as read-only 
in the page table itself created by UefiPayloadEntry.
This page table address is written to Cr3 after these protection steps. Till 
this, the memory used for page table is always RW.

Signed-off-by: Dun Tan 
Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
---
 UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c 
b/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
index 74b667a62a..a586941352 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
@@ -622,12 +622,7 @@ EnablePageTableProtection (
   }
 
   //
-  // Disable write protection, because we need to mark page table to be write
-  // protected.
-  //
-  AsmWriteCr0 (AsmReadCr0 () & ~CR0_WP);
-
-  //
+  // No need to clear CR0.WP since PageTableBase has't been written to CR3 yet.
   // SetPageTablePoolReadOnly might update mPageTablePool. It's safer to
   // remember original one in advance.
   //
--
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92399): https://edk2.groups.io/g/devel/message/92399
Mute This Topic: https://groups.io/mt/92931316/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel][edk2-platforms][PATCH V1 3/3] PlatformPayloadFeaturePkg: Update contents to match feature conventions

2022-08-12 Thread Guo Dong
Reviewed-by: Guo Dong 

-Original Message-
From: Oram, Isaac W  
Sent: Wednesday, August 10, 2022 3:47 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Chaganty, Rangasai V 
; Desimone, Nathaniel L 
; Gao, Liming ; Ni, 
Ray ; Dong, Guo 
Subject: [edk2-devel][edk2-platforms][PATCH V1 3/3] PlatformPayloadFeaturePkg: 
Update contents to match feature conventions

Rename gPlatformPayloadPkgTokenSpaceGuid to 
gPlatformPayloadFeaturePkgTokenSpaceGuid

Rename PcdPayloadPackageFeatureEnable to PcdPlatformPayloadFeatureEnable

Update Readme including format improvements

Cc: Sai Chaganty 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Ray Ni 
Cc: Guo Dong 
Signed-off-by: Isaac Oram 
---
 .../AdvancedFeaturePkg/AdvancedFeaturePkg.dsc |  2 +-
 .../Include/AdvancedFeatures.dsc  |  2 +-
 .../Include/AdvancedFeaturesPcd.dsc   |  2 +-
 .../AdvancedFeaturePkg/Include/PostMemory.fdf |  2 +-  
.../AdvancedFeaturePkg/Include/PreMemory.fdf  |  2 +-  
.../PlatformPayloadFeaturePkg/Fvb/FvbSmm.inf  |  2 +-
 .../PlatformPayloadFeaturePkg.dec |  6 +-
 .../Intel/PlatformPayloadFeaturePkg/Readme.md | 73 ++-
 8 files changed, 48 insertions(+), 43 deletions(-)

diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc 
b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
index df8e678ae8..236c5570ca 100644
--- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
@@ -84,7 +84,7 @@
   #
   # Individual features
   #
-  gPlatformPayloadPkgTokenSpaceGuid.PcdPayloadPackageFeatureEnable  
|TRUE
+  
+ gPlatformPayloadFeaturePkgTokenSpaceGuid.PcdPlatformPayloadFeatureEnab
+ le  |TRUE
 
 #
 # PCD that are required to be set by the build target should be configured 
here for test purposes diff --git 
a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc 
b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc
index 6a80546592..804aab89bc 100644
--- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc
@@ -79,6 +79,6 @@
 #
 # Individual features
 #
-!if gPlatformPayloadPkgTokenSpaceGuid.PcdPayloadPackageFeatureEnable == TRUE
+!if 
+gPlatformPayloadFeaturePkgTokenSpaceGuid.PcdPlatformPayloadFeatureEnabl
+e == TRUE
   !include PlatformPayloadFeaturePkg/Include/PlatformPayloadFeature.dsc
 !endif
diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc 
b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
index 08f258a48c..0af5a8bfbc 100644
--- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
+++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc
@@ -82,7 +82,7 @@
   gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable  
|FALSE
   gVirtualKeyboardFeaturePkgTokenSpaceGuid.PcdVirtualKeyboardFeatureEnable  
|FALSE
 
-  gPlatformPayloadPkgTokenSpaceGuid.PcdPayloadPackageFeatureEnable  
|FALSE
+  
+ gPlatformPayloadFeaturePkgTokenSpaceGuid.PcdPlatformPayloadFeatureEnab
+ le  |FALSE
 
 #
 # There seems to be some build parsing odd behavior that requires this PCD to 
be specified even though diff --git 
a/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf 
b/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf
index 66032ba117..349bdcc491 100644
--- a/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf
+++ b/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf
@@ -80,6 +80,6 @@
 #
 # Individual features
 #
-!if gPlatformPayloadPkgTokenSpaceGuid.PcdPayloadPackageFeatureEnable == TRUE
+!if 
+gPlatformPayloadFeaturePkgTokenSpaceGuid.PcdPlatformPayloadFeatureEnabl
+e == TRUE
   !include PlatformPayloadFeaturePkg/Include/PostMemory.fdf
 !endif
diff --git a/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf 
b/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf
index 9cd6de833b..b991a5aabf 100644
--- a/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf
+++ b/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf
@@ -80,6 +80,6 @@
 #
 # Individual features
 #
-!if gPlatformPayloadPkgTokenSpaceGuid.PcdPayloadPackageFeatureEnable == TRUE
+!if 
+gPlatformPayloadFeaturePkgTokenSpaceGuid.PcdPlatformPayloadFeatureEnabl
+e == TRUE
   !include PlatformPayloadFeaturePkg/Include/PreMemory.fdf
 !endif
diff --git a/Features/Intel/PlatformPayloadFeaturePkg/Fvb/FvbSmm.inf 
b/Features/Intel/PlatformPayloadFeaturePkg/Fvb/FvbSmm.inf
index f973465cba..a692d9bf41 100644
--- a/Features/Intel/PlatformPayloadFeaturePkg/Fvb/FvbSmm.inf
+++ b/Features/Intel/PlatformPayloadFeaturePkg/Fvb/FvbSmm.inf
@@ -60,7 +60,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
-  gPlatformPayloadPkgTokenSpaceGuid.PcdNvsDataFile
+  gPlatformPayloadFeaturePkgTokenSpaceGuid.PcdNvsDataFile

Re: [edk2-devel][edk2-platforms][PATCH V1 1/3] PlatformPayloadPkg: Fix AdvancedFeaturePkg build issue

2022-08-12 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Oram, Isaac W  
Sent: Wednesday, August 10, 2022 3:47 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Chaganty, Rangasai V 
; Desimone, Nathaniel L 
; Gao, Liming ; Ni, 
Ray ; Dong, Guo 
Subject: [edk2-devel][edk2-platforms][PATCH V1 1/3] PlatformPayloadPkg: Fix 
AdvancedFeaturePkg build issue

Feature packages should build with -a IA32 -a X64.
The commonly board selected libraries were moved to the PlatformPayloadPkg 
build so as not to conflict with other advanced features.

Cc: Sai Chaganty 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Ray Ni 
Cc: Guo Dong 
Signed-off-by: Isaac Oram 
---
 .../Include/PlatformPayloadFeature.dsc| 42 +--
 .../PlatformPayloadPkg/PlatformPayloadPkg.dsc | 26 +++-
 2 files changed, 46 insertions(+), 22 deletions(-)

diff --git 
a/Features/Intel/PlatformPayloadPkg/Include/PlatformPayloadFeature.dsc 
b/Features/Intel/PlatformPayloadPkg/Include/PlatformPayloadFeature.dsc
index 3003c563c9..bc776659b6 100644
--- a/Features/Intel/PlatformPayloadPkg/Include/PlatformPayloadFeature.dsc
+++ b/Features/Intel/PlatformPayloadPkg/Include/PlatformPayloadFeature.d
+++ sc
@@ -19,7 +19,9 @@
 !error "DXE_ARCH must be specified to build this feature!"
   !endif
 
-  DEFINE SMM_VARIABLE = TRUE
+  !ifndef SMM_VARIABLE
+DEFINE SMM_VARIABLE = TRUE
+  !endif
 
 
 

@@ -28,7 +30,7 @@
 #
 

 
-[PcdsPatchableInModule.X64]
+[PcdsPatchableInModule]
 !if $(SMM_VARIABLE) == TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0
@@ -45,24 +47,11 @@
 #
 

 
-[LibraryClasses]
-  !if $(SMM_VARIABLE) == TRUE
-PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
-PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf
-# (Optional for variable modules debug output
-PlatformHookLib|UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf
-
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
-PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
-DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
-  !endif
-
 [LibraryClasses.common.DXE_SMM_DRIVER,LibraryClasses.common.DXE_RUNTIME_DRIVER]
   !if $(SMM_VARIABLE) == TRUE
 SpiFlashLib|PlatformPayloadPkg/Library/SpiFlashLib/SpiFlashLib.inf
 FlashDeviceLib|PlatformPayloadPkg/Library/FlashDeviceLib/FlashDeviceLib.inf
 DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLib/DxeHobListLib.inf
-HobLib|UefiPayloadPkg/Library/DxeHobLib/DxeHobLib.inf
-TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf
   !endif
 
 

@@ -90,13 +79,20 @@
   # SMM Variable Support
   #
   !if $(SMM_VARIABLE) == TRUE
-PlatformPayloadPkg/PchSmiDispatchSmm/PchSmiDispatchSmm.inf
-  PlatformPayloadPkg/Fvb/FvbSmm.inf {
-
-  NULL|PlatformPayloadPkg/Library/PcdInitLib/PcdInitLib.inf
-  }
+PlatformPayloadPkg/PchSmiDispatchSmm/PchSmiDispatchSmm.inf {
+  
+
PlatformHookLib|UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf
+}
+
+PlatformPayloadPkg/Fvb/FvbSmm.inf {
+  
+
PlatformHookLib|UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf
+NULL|PlatformPayloadPkg/Library/PcdInitLib/PcdInitLib.inf
+}
+
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf {
   
+
+ PlatformHookLib|UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib
+ .inf
 NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
 NULL|MdeModulePkg/Library/VarCheckHiiLib/VarCheckHiiLib.inf
 NULL|MdeModulePkg/Library/VarCheckPcdLib/VarCheckPcdLib.inf
@@ -106,7 +102,11 @@
 
 MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf {
   
+
+ PlatformHookLib|UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib
+ .inf
 NULL|PlatformPayloadPkg/Library/PcdInitLib/PcdInitLib.inf
 }
-MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf
+MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf {
+  
+
PlatformHookLib|UefiPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf
+}
   !endif
diff --git a/Features/Intel/PlatformPayloadPkg/PlatformPayloadPkg.dsc 
b/Features/Intel/PlatformPayloadPkg/PlatformPayloadPkg.dsc
index adf028c511..702523a73f 100644
--- a/Features/Intel/PlatformPayloadPkg/PlatformPayloadPkg.dsc
+++ b/Features/Intel/PlatformPayloadPkg/PlatformPayloadPkg.dsc
@@ -27,6 +27,10 @@
   PCD_DYNAMIC_AS_DYNAMICEX= TRUE
 

Re: [edk2-devel][edk2-platforms][PATCH V1 2/3] PlatformPayloadPkg: Rename to match other feature conventions

2022-08-12 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Oram, Isaac W  
Sent: Wednesday, August 10, 2022 3:47 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Chaganty, Rangasai V 
; Desimone, Nathaniel L 
; Gao, Liming ; Ni, 
Ray ; Dong, Guo 
Subject: [edk2-devel][edk2-platforms][PATCH V1 2/3] PlatformPayloadPkg: Rename 
to match other feature conventions

Rename PlatformPayloadPkg to PlatformPayloadFeaturePkg.
Rename Package DEC, DSC, FDF and py scripts to match.
Search and replace PlatformPayloadPkg with PlatformPayloadFeaturePkg.

Cc: Sai Chaganty 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Ray Ni 
Cc: Guo Dong 
Signed-off-by: Isaac Oram 
---
 .../Include/AdvancedFeatures.dsc   |  2 +-
 .../Include/AdvancedFeaturesPcd.dsc|  2 +-
 .../AdvancedFeaturePkg/Include/PostMemory.fdf  |  2 +-
 .../Intel/AdvancedFeaturePkg/Include/PreMemory.fdf |  2 +-
 .../Fvb/FvbInfo.c  |  0
 .../Fvb/FvbService.c   |  0
 .../Fvb/FvbService.h   |  0
 .../Fvb/FvbServiceSmm.c|  0
 .../Fvb/FvbSmm.inf |  2 +-
 .../Fvb/FvbSmmCommon.h |  0
 .../Include/Guid/NvVariableInfoGuid.h  |  0
 .../Include/Guid/SpiFlashInfoGuid.h|  0
 .../Include/Library/FlashDeviceLib.h   |  0
 .../Include/Library/SpiFlashLib.h  |  0
 .../Include/PlatformPayloadFeature.dsc | 14 +++---
 .../Include/PostMemory.fdf |  4 ++--
 .../Include/PreMemory.fdf  |  0
 .../Library/FlashDeviceLib/FlashDeviceLib.c|  0
 .../Library/FlashDeviceLib/FlashDeviceLib.inf  |  3 +--
 .../Library/PcdInitLib/PcdInitLib.c|  0
 .../Library/PcdInitLib/PcdInitLib.inf  |  3 +--
 .../Library/SpiFlashLib/PchSpi.c   |  0
 .../Library/SpiFlashLib/RegsSpi.h  |  0
 .../Library/SpiFlashLib/SpiCommon.h|  0
 .../Library/SpiFlashLib/SpiFlashLib.c  |  0
 .../Library/SpiFlashLib/SpiFlashLib.inf|  2 +-
 .../PchSmiDispatchSmm/PchSmiDispatchSmm.c  |  0
 .../PchSmiDispatchSmm/PchSmiDispatchSmm.h  |  0
 .../PchSmiDispatchSmm/PchSmiDispatchSmm.inf|  0
 .../PlatformPayloadFeaturePkg.dec} |  2 +-
 .../PlatformPayloadFeaturePkg.dsc} |  4 ++--
 .../PlatformPayloadFeaturePkg.fdf} |  0
 .../PlatformPayloadFeaturePkg.py}  |  4 ++--
 .../Readme.md  |  9 -
 34 files changed, 26 insertions(+), 29 deletions(-)  rename 
Features/Intel/{PlatformPayloadPkg => PlatformPayloadFeaturePkg}/Fvb/FvbInfo.c 
(100%)  rename Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Fvb/FvbService.c (100%)  rename 
Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Fvb/FvbService.h (100%)  rename 
Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Fvb/FvbServiceSmm.c (100%)  rename 
Features/Intel/{PlatformPayloadPkg => PlatformPayloadFeaturePkg}/Fvb/FvbSmm.inf 
(92%)  rename Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Fvb/FvbSmmCommon.h (100%)  rename 
Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Include/Guid/NvVariableInfoGuid.h (100%)  rename 
Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Include/Guid/SpiFlashInfoGuid.h (100%)  rename 
Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Include/Library/FlashDeviceLib.h (100%)  rename 
Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Include/Library/SpiFlashLib.h (100%)  rename 
Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Include/PlatformPayloadFeature.dsc (87%)  rename 
Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Include/PostMemory.fdf (77%)  rename 
Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Include/PreMemory.fdf (100%)  rename 
Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Library/FlashDeviceLib/FlashDeviceLib.c (100%)  
rename Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Library/FlashDeviceLib/FlashDeviceLib.inf (90%)  
rename Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Library/PcdInitLib/PcdInitLib.c (100%)  rename 
Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Library/PcdInitLib/PcdInitLib.inf (92%)  rename 
Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Library/SpiFlashLib/PchSpi.c (100%)  rename 
Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Library/SpiFlashLib/RegsSpi.h (100%)  rename 
Features/Intel/{PlatformPayloadPkg => 
PlatformPayloadFeaturePkg}/Library/SpiFlashLib/SpiCommon.h (100%)  rename 
Features/Intel/{PlatformP

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Backward support with python 3.6

2022-08-08 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Liu, KasimX  
Sent: Thursday, June 23, 2022 8:44 PM
To: devel@edk2.groups.io
Cc: Liu, KasimX ; Dong, Guo ; Ni, Ray 
; Lu, James ; Guo, Gua 
Subject: [PATCH] UefiPayloadPkg: Backward support with python 3.6

From: KasimX Liu 

REF: ttps://bugzilla.tianocore.org/show_bug.cgi?id=3960

Currently, UniversalPayloadBuild.py don't have support python3.6, we use 
python3.6 will encounter f"" failure use the change to fix it to support 
python3.6/3.7/3.8.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: James Lu 
Reviewed-by: Gua Guo 
Signed-off-by: KasimX Liu 
---
 UefiPayloadPkg/UniversalPayloadBuild.py | 33 +++--
 1 file changed, 25 insertions(+), 8 deletions(-)

diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py 
b/UefiPayloadPkg/UniversalPayloadBuild.py
index c71526e0a6..ab4c977ba5 100644
--- a/UefiPayloadPkg/UniversalPayloadBuild.py
+++ b/UefiPayloadPkg/UniversalPayloadBuild.py
@@ -59,15 +59,15 @@ def BuildUniversalPayload(Args, MacroList):
 if Args.Arch == 'X64': BuildArch  = "X64" ObjCopyFlag  
  = "elf64-x86-64"-EntryOutputDir = os.path.join(BuildDir, 
f"{BuildTarget}_{ElfToolChain}", 
os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll"))+
EntryOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, 
ElfToolChain), 
os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll"))
 else: BuildArch  = "IA32 -a X64" ObjCopyFlag= 
"elf32-i386"-EntryOutputDir = os.path.join(BuildDir, 
f"{BuildTarget}_{ElfToolChain}", 
os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll"))+
EntryOutputDir = os.path.join(BuildDir, "{}_{}".format (BuildTarget, 
ElfToolChain), 
os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll"))
  EntryModuleInf = 
os.path.normpath("UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf")   
  DscPath = os.path.normpath("UefiPayloadPkg/UefiPayloadPkg.dsc")-
FvOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ToolChain}", 
os.path.normpath("FV/DXEFV.Fv"))+FvOutputDir = os.path.join(BuildDir, 
"{}_{}".format (BuildTarget, ToolChain), os.path.normpath("FV/DXEFV.Fv")) 
PayloadReportPath = os.path.join(BuildDir, "UefiUniversalPayload.txt") 
ModuleReportPath = os.path.join(BuildDir, "UefiUniversalPayloadEntry.txt") 
UpldInfoFile = os.path.join(BuildDir, "UniversalPayloadInfo.bin")@@ -94,14 
+94,14 @@ def BuildUniversalPayload(Args, MacroList):
 # # Building DXE core and DXE drivers as DXEFV. #-BuildPayload 
= f"build -p {DscPath} -b {BuildTarget} -a X64 -t {ToolChain} -y 
{PayloadReportPath} {Quiet}"+BuildPayload = "build -p {} -b {} -a X64 -t {} 
-y {} {}".format (DscPath, BuildTarget, ToolChain, PayloadReportPath, Quiet)
 BuildPayload += Pcds BuildPayload += Defines RunCommand(BuildPayload)  
   # # Building Universal Payload entry. #-BuildModule = f"build -p 
{DscPath} -b {BuildTarget} -a {BuildArch} -m {EntryModuleInf} -t {ElfToolChain} 
-y {ModuleReportPath} {Quiet}"+BuildModule = "build -p {} -b {} -a {} -m {} 
-t {} -y {} {}".format (DscPath, BuildTarget, BuildArch, EntryModuleInf, 
ElfToolChain, ModuleReportPath, Quiet) BuildModule += Pcds BuildModule 
+= Defines RunCommand(BuildModule)@@ -118,9 +118,26 @@ def 
BuildUniversalPayload(Args, MacroList):
 # # Copy the DXEFV as a section in elf format Universal Payload entry. 
#-remove_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O 
{ObjCopyFlag} --remove-section .upld_info --remove-section .upld.uefi_fv 
{EntryOutputDir}'-add_section= f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} 
-O {ObjCopyFlag} --add-section .upld_info={UpldInfoFile} --add-section 
.upld.uefi_fv={FvOutputDir} {EntryOutputDir}'-set_section= 
f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} --set-section-alignment 
.upld.upld_info=16 --set-section-alignment .upld.uefi_fv=16 {EntryOutputDir}'+  
  remove_section = '"{}" -I {} -O {} --remove-section .upld_info 
--remove-section .upld.uefi_fv {}'.format (+   
LlvmObjcopyPath,+   ObjCopyFlag,+   
ObjCopyFlag,+   EntryOutputDir+   )+
add_section= '"{}" -I {} -O {} --add-section .upld_info={} --add-section 
.upld.uefi_fv={} {}'.format (+   LlvmObjcopyPath,+  
 ObjCopyFlag,

Re: [edk2-devel] [PATCH 3/3] UefiPayloadPkg: Hook up MICROSOFT_RECOMMENDED macro

2022-08-08 Thread Guo Dong


Hi Sean,
How about directly setting the PCD in the build command line instead of adding 
a MACRO?
Prefer not adding new MACRO if we could avoid it.

Thanks,
Guo
-Original Message-
From: Sean Rhodes  
Sent: Friday, August 5, 2022 12:53 AM
To: devel@edk2.groups.io
Cc: Rhodes, Sean ; Dong, Guo ; Ni, 
Ray 
Subject: [PATCH 3/3] UefiPayloadPkg: Hook up MICROSOFT_RECOMMENDED macro

Hook up MICROSOFT_RECOMMENDED macro to PcdFollowMicrosoftRecommended.

Cc: Guo Dong 
Cc: Ray Ni 
Signed-off-by: Sean Rhodes 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 91cd78dbf1..b3ed0f6a2e 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -43,6 +43,7 @@
   DEFINE SD_MMC_TIMEOUT   = 100

   DEFINE USE_CBMEM_FOR_CONSOLE= FALSE

   DEFINE BOOTSPLASH_IMAGE = FALSE

+  DEFINE MICROSOFT_RECOMMENDED= FALSE

 

   #

   # NULL:NullMemoryTestDxe

@@ -440,6 +441,7 @@
 

   
gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(ABOVE_4G_MEMORY)

   gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)

+  
gEfiMdeModulePkgTokenSpaceGuid.PcdFollowMicrosoftRecommended|$(MICROSOFT_RECOMMENDED)

 

   gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|180

 

-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92233): https://edk2.groups.io/g/devel/message/92233
Mute This Topic: https://groups.io/mt/92830996/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 2/2] UefiPayloadPkg: Load Boot Logo into ACPI table

2022-08-03 Thread Guo Dong
Reviewed-by: Guo Dong 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sean Rhodes
Sent: Tuesday, August 2, 2022 1:00 PM
To: devel@edk2.groups.io
Cc: Rhodes, Sean ; Dong, Guo ; Ni, 
Ray 
Subject: [edk2-devel] [PATCH 2/2] UefiPayloadPkg: Load Boot Logo into ACPI table

If the boot logo is enabled, this will allow edk2 to pass the logo to the OS 
via ACPI.

Cc: Guo Dong 
Cc: Ray Ni 
Signed-off-by: Sean Rhodes 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 10 ++  
UefiPayloadPkg/UefiPayloadPkg.fdf |  4 
 2 files changed, 14 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index abe1a42709..91cd78dbf1 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -300,6 +300,12 @@
   VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf   
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
 +[LibraryClasses.common]+!if $(BOOTSPLASH_IMAGE)+  
SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf+  
BmpSupportLib|MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf+!endif+
 [LibraryClasses.common.SEC]   
HobLib|UefiPayloadPkg/Library/PayloadEntryHobLib/HobLib.inf   
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf@@ -679,6 +685,10 @@
   # ACPI Support   #   
MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf+!if 
$(BOOTSPLASH_IMAGE)+  
MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf+  
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf+!endif
#   # PCI Supportdiff --git a/UefiPayloadPkg/UefiPayloadPkg.fdf 
b/UefiPayloadPkg/UefiPayloadPkg.fdf
index d7c9db191c..27534f445d 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -245,6 +245,10 @@ INF MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
 # ACPI Support # INF  
MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf+!if 
$(BOOTSPLASH_IMAGE)+INF  
MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf+INF  
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf+!endif
  # # UEFI network modules--
2.34.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92060): https://edk2.groups.io/g/devel/message/92060
Mute This Topic: https://groups.io/mt/92779007/1781375
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.d...@intel.com]
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92092): https://edk2.groups.io/g/devel/message/92092
Mute This Topic: https://groups.io/mt/92779007/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add a Macro to enable Boot Logo

2022-08-03 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sean Rhodes
Sent: Tuesday, August 2, 2022 1:00 PM
To: devel@edk2.groups.io
Cc: Rhodes, Sean ; Dong, Guo ; Ni, 
Ray 
Subject: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add a Macro to enable Boot 
Logo

Add a macro called BOOTSPLASH_IMAGE, which when enabled, will display a logo at 
boot time.

Cc: Guo Dong 
Cc: Ray Ni 
Signed-off-by: Sean Rhodes 
---
 .../Library/PlatformBootManagerLib/PlatformBootManager.c | 9 +
 .../PlatformBootManagerLib/PlatformBootManagerLib.inf| 1 +
 UefiPayloadPkg/UefiPayloadPkg.dsc| 6 ++
 UefiPayloadPkg/UefiPayloadPkg.fdf| 4 
 4 files changed, 20 insertions(+)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index b360e29dfe..a3b98f713d 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
+++ c
@@ -243,6 +243,8 @@ PlatformBootManagerAfterConsole (
 {   EFI_GRAPHICS_OUTPUT_BLT_PIXEL  Black;   EFI_GRAPHICS_OUTPUT_BLT_PIXEL  
White;+  EDKII_PLATFORM_LOGO_PROTOCOL   *PlatformLogo;+  EFI_STATUS 
Status;if (mUniversalPayloadPlatformBootManagerOverrideInstance != 
NULL) { mUniversalPayloadPlatformBootManagerOverrideInstance->AfterConsole 
();@@ -252,6 +254,13 @@ PlatformBootManagerAfterConsole (
   Black.Blue = Black.Green = Black.Red = Black.Reserved = 0;   White.Blue = 
White.Green = White.Red = White.Reserved = 0xFF; +  Status = 
gBS->LocateProtocol (, NULL, (VOID 
**));++  if (!EFI_ERROR (Status)) {+gST->ConOut->ClearScreen 
(gST->ConOut);+BootLogoEnableLogo ();+  }+   EfiBootManagerConnectAll ();   
EfiBootManagerRefreshAllBootOption (); diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 9f58c460cd..7ec93420f2 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerL
+++ ib.inf
@@ -39,6 +39,7 @@
   UefiRuntimeServicesTableLib   UefiLib   UefiBootManagerLib+  BootLogoLib   
PcdLib   DxeServicesLib   MemoryAllocationLibdiff --git 
a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index e78e959ce4..abe1a42709 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -42,6 +42,7 @@
   DEFINE CRYPTO_PROTOCOL_SUPPORT  = FALSE   DEFINE SD_MMC_TIMEOUT  
 = 100   DEFINE USE_CBMEM_FOR_CONSOLE= FALSE+  DEFINE 
BOOTSPLASH_IMAGE = FALSE#   # NULL:NullMemoryTestDxe@@ 
-229,6 +230,7 @@
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf   
SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
   
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf+
  BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf   
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
   
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf 
@@ -432,6 +434,7 @@

gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(ABOVE_4G_MEMORY) 
  gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)+   
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|180  !if 
$(CRYPTO_PROTOCOL_SUPPORT) == TRUE@@ -616,6 +619,9 @@
 !endif   UefiCpuPkg/CpuDxe/CpuDxe.inf   
MdeModulePkg/Universal/BdsDxe/BdsDxe.inf+!if $(BOOTSPLASH_IMAGE)+  
MdeModulePkg/Logo/LogoDxe.inf+!endif   MdeModulePkg/Application/UiApp/UiApp.inf 
{
NULL|MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.infdiff --git 
a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf
index afdd6447a7..d7c9db191c 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -165,6 +165,10 @@ INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
 INF UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf  INF 
MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf+!if $(BOOTSPLASH_IMAGE)+INF 
MdeModulePkg/Logo/LogoDxe.inf+!endif+ # # PCI Support #--
2.34.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92059): https://edk2.groups.io/g/devel/message/92059
Mute This Topic: https://groups.io/mt/92779006/1781375
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.d...@intel.com]
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92091): https://edk2.groups.io/g/devel/message/92091
Mute This Topic: https://groups.io/mt/92779006/21656
Group Owner: devel+ow...@edk2.groups

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add macro to support selection of CryptoDxe driver

2022-07-25 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Hsieh, PaytonX  
Sent: Friday, July 22, 2022 12:02 AM
To: devel@edk2.groups.io
Cc: Hsieh, PaytonX ; Dong, Guo ; 
Ni, Ray ; Lu, James ; Guo, Gua 

Subject: [PATCH] UefiPayloadPkg: Add macro to support selection of CryptoDxe 
driver

From: PaytonX Hsieh 

REF : https://bugzilla.tianocore.org/show_bug.cgi?id=4006

Add CRYPTO_PROTOCOL_SUPPORT to decide CryptoDxe built into UPL.efi If 
CRYPTO_PROTOCOL_SUPPORT is true, BIOS will use crypto protocol instead of 
building OpensslLib into drivers.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: James Lu 
Cc: Gua Guo 
Signed-off-by: PaytonX Hsieh 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 10 ++  
UefiPayloadPkg/UefiPayloadPkg.fdf |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 5e947526b7..862d440b16 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -39,6 +39,7 @@
   DEFINE ATA_ENABLE   = TRUE   DEFINE SD_ENABLE
= TRUE   DEFINE PS2_MOUSE_ENABLE = TRUE+  DEFINE 
CRYPTO_PROTOCOL_SUPPORT  = FALSE   DEFINE SD_MMC_TIMEOUT   = 
100#@@ -189,8 +190,13 @@
   
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
   SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf   
DxeHobListLib|UefiPayloadPkg/Library/DxeHobListLib/DxeHobListLib.inf+!if 
$(CRYPTO_PROTOCOL_SUPPORT) == TRUE   
BaseCryptLib|CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf   
TlsLib|CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.inf+!else+  
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf+  
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf+!endif   
IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf   
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf   
RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf@@ -421,6 +427,7 @@
   gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)   
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|180 +!if 
$(CRYPTO_PROTOCOL_SUPPORT) == TRUE   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.HmacSha256.Family  
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Md5.Family 
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Pkcs.Family
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY@@ -443,6 +450,7 @@
   gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.Tls.Family  
 | PCD_CRYPTO_SERVICE_ENABLE_FAMILY   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsSet.Family  
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY   
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceFamilyEnable.TlsGet.Family  
  | PCD_CRYPTO_SERVICE_ENABLE_FAMILY+!endif  
[PcdsPatchableInModule.X64]   
gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)@@ 
-764,11 +772,13 @@
   #   # Misc   #+!if $(CRYPTO_PROTOCOL_SUPPORT) == TRUE   
CryptoPkg/Driver/CryptoDxe.inf {
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf   
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf   }+!endif
#--   #  Build the shelldiff --git 
a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf
index 5c055e61b3..afdd6447a7 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -99,7 +99,9 @@ INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
 INF 
MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf
 INF 
MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
 +!if $(CRYPTO_PROTOCOL_SUPPORT) == TRUE INF 
CryptoPkg/Driver/CryptoDxe.inf+!endif !if $(SECURITY_STUB_ENABLE) == TRUE INF 
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf !endif--
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91811): https://edk2.groups.io/g/devel/message/91811
Mute This Topic: https://groups.io/mt/92558123/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix RelaAddress type always mismatch in if condition

2022-07-20 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Lu, James  
Sent: Tuesday, July 19, 2022 11:58 PM
To: devel@edk2.groups.io
Cc: Ni, Ray ; Dong, Guo ; Guo, Gua 

Subject: RE: [PATCH] UefiPayloadPkg: Fix RelaAddress type always mismatch in if 
condition

Hi Ray,

Any comment on this patch?


Thanks,
James

-Original Message-
From: Lu, James  
Sent: Monday, July 11, 2022 1:06 PM
To: devel@edk2.groups.io
Cc: Lu, James ; Ni, Ray ; Dong, Guo 
; Guo, Gua 
Subject: [PATCH] UefiPayloadPkg: Fix RelaAddress type always mismatch in if 
condition

From: James Lu 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3984

Under function RolocateElfDynamic() in Elf32Lib.c if (RelaAddress == 
MAX_UINT64) is always FALSE while RelaAddress is UINT32 Fix is to  modify if 
condition check to "if (RelaAddress == MAX_UINT32)"

Cc: Ray Ni 
Cc: Guo Dong 
Cc: Gua Guo 
Signed-off-by: James Lu 
---
 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c 
b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c
index b002c4b9cf..cb915e7142 100644
--- a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c
+++ b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/Elf32Lib.c
@@ -292,7 +292,7 @@ RelocateElf32Dynamic (
 }   } -  if (RelaAddress == MAX_UINT64) {+  if (RelaAddress == MAX_UINT32) 
{ ASSERT (RelaCount == 0); ASSERT (RelaEntrySize == 0); ASSERT 
(RelaSize  == 0);-- 
2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91608): https://edk2.groups.io/g/devel/message/91608
Mute This Topic: https://groups.io/mt/92303921/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v3] UefiPayloadPkg: Add macro to support selective driver in UPL

2022-07-18 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Lu, James  
Sent: Thursday, July 7, 2022 9:15 AM
To: devel@edk2.groups.io
Cc: Lu, James ; Dong, Guo ; Ni, Ray 
; Guo, Gua 
Subject: [PATCH v3] UefiPayloadPkg: Add macro to support selective driver in UPL

From: James Lu 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3967

Add macros to decide modules built into UPL.elf.

Macro list:
 - GENERIC_MEMORY_TEST_ENABLE: GenericMemoryTestDxe
 - MEMORY_TEST: NullMemoryTestDxe or GenericMemoryDxe
 - ATA_ENABLE: SataControllerDxe, AtaBusDxe
 - SD_ENABLE: SdMmcPciDxe, EmmcDxe, SdDxe
 - PS2_MOUSE_ENABLE: Ps2MouseDxe

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Gua Guo 
Signed-off-by: James Lu 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 21   
UefiPayloadPkg/UefiPayloadPkg.fdf | 14 -
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index cfcf38578d..ec79914f45 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -36,7 +36,16 @@
   DEFINE PLATFORM_BOOT_TIMEOUT= 3   DEFINE ABOVE_4G_MEMORY 
 = TRUE   DEFINE BOOT_MANAGER_ESCAPE  = FALSE+  DEFINE ATA_ENABLE   
= TRUE+  DEFINE SD_ENABLE= TRUE+  DEFINE 
PS2_MOUSE_ENABLE = TRUE   DEFINE SD_MMC_TIMEOUT   = 
100++  #+  # NULL:NullMemoryTestDxe+  # GENERIC: GenericMemoryTestDxe+  
#+  DEFINE MEMORY_TEST  = NULL   #   # SBL:  UEFI payload 
for Slim Bootloader   # COREBOOT: UEFI payload for coreboot@@ -596,7 +605,11 @@
   
MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf
   UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf   
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf+!if $(MEMORY_TEST) == 
"GENERIC"+  
MdeModulePkg/Universal/MemoryTest/GenericMemoryTestDxe/GenericMemoryTestDxe.inf+!elseif
 $(MEMORY_TEST) == "NULL"   
MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf+!endif
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf   
MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf   
MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf@@ -631,8 +644,10 @@
   MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf   
MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf   
FatPkg/EnhancedFatDxe/Fat.inf+!if $(ATA_ENABLE) == TRUE   
MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf   
MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf+!endif   
MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf   
MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf   
MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf@@ -644,9 +659,11 @@
   #   # SD/eMMC Support   #+!if $(SD_ENABLE) == TRUE   
MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf   
MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.inf   
MdeModulePkg/Bus/Sd/SdDxe/SdDxe.inf+!endif#   # Usb Support@@ -671,7 +688,9 
@@
 !if $(PS2_KEYBOARD_ENABLE) == TRUE   
MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf !endif+!if 
$(PS2_MOUSE_ENABLE) == TRUE   
MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf+!endif#   # Console 
Support@@ -742,12 +761,14 @@
   #  This should be FALSE for compiling the dynamic command.   
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE   }+!if 
$(PERFORMANCE_MEASUREMENT_ENABLE) == TRUE   
ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf { 
   ## This flag is used to control initialization of the 
shell library   #  This should be FALSE for compiling the dynamic command.  
 gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE   }+!endif   
ShellPkg/Application/Shell/Shell.inf {## This 
flag is used to control initialization of the shell librarydiff --git 
a/UefiPayloadPkg/UefiPayloadPkg.fdf b/UefiPayloadPkg/UefiPayloadPkg.fdf
index c7b04978ad..35f79be2f0 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.fdf
+++ b/UefiPayloadPkg/UefiPayloadPkg.fdf
@@ -149,7 +149,11 @@ INF 
PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf
  INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf INF 
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf-INF 
MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf+!if 
$(MEMORY_TEST) == "GENERIC"+INF  
MdeModulePkg/Universal/MemoryTest/GenericMemoryTestDxe/GenericMemoryTestDxe.inf+!elseif
 $(MEMORY_TEST) == "NULL"+INF  
MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf+!endif
 INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf INF 
MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf INF 
MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf@@ -176,7 +180,9 @@ 
INF OvmfPkg/SioBusDxe/SioBusDxe.inf  !if $(PS2_KEYBOARD_ENABLE) == TRUE INF 
MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf !endif+!if 
$(PS2_MOUSE_ENABLE) == TRUE INF 
MdeModulePkg/Bu

Re: [edk2-devel] [PATCH 2/3] UefiPayloadPkg/PlatformBootManagerLib: Evenly space boot prompt

2022-07-15 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sean Rhodes
Sent: Monday, July 4, 2022 12:39 PM
To: devel@edk2.groups.io
Cc: Rhodes, Sean ; Dong, Guo ; Ni, 
Ray ; Maurice Ma ; You, Benjamin 

Subject: [edk2-devel] [PATCH 2/3] UefiPayloadPkg/PlatformBootManagerLib: Evenly 
space boot prompt

Add 4 spaces before the boot prompt "F2 or Down..." so that the spacing is 
equadistant from the top, which is spaced with a `\n`, and the left.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 .../Library/PlatformBootManagerLib/PlatformBootManager.c  | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index 0eb577313a..b360e29dfe 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
+++ c
@@ -263,15 +263,15 @@ PlatformBootManagerAfterConsole (
   if (FixedPcdGetBool (PcdBootManagerEscape)) { Print (   L"\n"-  
L"Esc or Down  to enter Boot Manager Menu.\n"-  L"ENTER   to 
boot directly.\n"+  L"Esc or Down  to enter Boot Manager Menu.\n"+  
L"ENTER   to boot directly.\n"   L"\n"   );   } else {  
   Print (   L"\n"-  L"F2 or Down  to enter Boot Manager Menu.\n"-  
L"ENTER   to boot directly.\n"+  L"F2 or Down  to enter 
Boot Manager Menu.\n"+  L"ENTER   to boot directly.\n"   
L"\n"   );   }-- 
2.34.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91044): https://edk2.groups.io/g/devel/message/91044
Mute This Topic: https://groups.io/mt/92172169/1781375
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.d...@intel.com] 
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91424): https://edk2.groups.io/g/devel/message/91424
Mute This Topic: https://groups.io/mt/92172169/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel][PATCH] Maintainers.txt: Add new reviewer for UefiPayloadPkg

2022-07-15 Thread Guo Dong
From: Guo Dong 

Promote Sean Rhodes as UefiPayloadPkg maintainer.
Remove Maurice and Benjamin since their role was changed.

Signed-off-by: Guo Dong 
Cc: Ray Ni 
Cc: Benjamin You 
Cc: Maurice Ma 
Cc: Michael D Kinney 
Cc: Sean Rhodes 
---
 Maintainers.txt | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index bc08ce1f15..a3b62abeee 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -612,9 +612,7 @@ F: UefiPayloadPkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/UefiPayloadPkg
 M: Guo Dong  [gdong1]
 M: Ray Ni  [niruiyu]
-R: Maurice Ma  [mauricema]
-R: Benjamin You  [BenjaminYou]
-R: Sean Rhodes 
+M: Sean Rhodes 
 S: Maintained
 
 UnitTestFrameworkPkg
-- 
2.35.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91423): https://edk2.groups.io/g/devel/message/91423
Mute This Topic: https://groups.io/mt/92413853/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v3] UefiPayloadPkg: Add support for logging to CBMEM console

2022-06-21 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Benjamin Doron  
Sent: Sunday, June 5, 2022 5:55 PM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Maurice Ma 
; You, Benjamin ; Rhodes, Sean 

Subject: [PATCH v3] UefiPayloadPkg: Add support for logging to CBMEM console

Writes TianoCore debug logs into the CBMEM console ringbuffer, from where the 
user can retrieve them with the `cbmem` userspace utility.

The intention is to aid in debugging non-fatal issues even in release builds, 
or simply make TianoCore's logs available to those interested.
Consequently, MDEPKG_NDEBUG must be masked. As an in-memory debug logging 
library, ASSERTs must be non-fatal to be seen, so they neither dead-loop nor 
create a breakpoint. It is assumed that ASSERT() neither enforces fatal 
conditions nor security integrity, as release builds do not call DebugAssert() 
from the ASSERT macro.

More detailed debug logs are produced with the DEBUG_CODE macro, but this 
guards other debug-related code throughout the codebase. To avoid changing 
behaviour on release builds, this is only set for debug builds.

Tested on QEMU, dumping the appropriate memory region in the UEFI shell shows 
the TianoCore log. An improved revision of the debug library used in several 
coreboot-related EDK2 forks, including MrChromebox's.
Previous revisions also tested on an Acer Aspire VN7-572G laptop.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Benjamin Doron 
---
 UefiPayloadPkg/Include/Coreboot.h  |  13 +
 UefiPayloadPkg/Library/CbSerialPortLib/CbSerialPortLib.c   | 264 

 UefiPayloadPkg/Library/CbSerialPortLib/CbSerialPortLib.inf |  30 +++
 UefiPayloadPkg/UefiPayloadPkg.dsc  |  25 +-
 4 files changed, 327 insertions(+), 5 deletions(-)

diff --git a/UefiPayloadPkg/Include/Coreboot.h 
b/UefiPayloadPkg/Include/Coreboot.h
index a3e1109fe84e..5892fae7682b 100644
--- a/UefiPayloadPkg/Include/Coreboot.h
+++ b/UefiPayloadPkg/Include/Coreboot.h
@@ -199,6 +199,13 @@ struct cb_forward {
   UINT64forward; }; +struct cb_cbmem_ref {+  UINT32tag;+  // Field 
contains size of this struct = 0x0010+  UINT32size;+  UINT64
cbmem_addr;+};+ #define CB_TAG_FRAMEBUFFER  0x0012 struct cb_framebuffer {   
UINT32tag;@@ -229,6 +236,12 @@ struct cb_vdat {
  #define CB_TAG_TIMESTAMPS 0x0016 #define CB_TAG_CBMEM_CONSOLE  
0x0017+struct cbmem_console {+  UINT32 size;+  UINT32 cursor;+  UINT8  
body[0];+} __attribute__((packed));+ #define CB_TAG_MRC_CACHE  0x0018 
struct cb_cbmem_tab {   UINT32tag;diff --git 
a/UefiPayloadPkg/Library/CbSerialPortLib/CbSerialPortLib.c 
b/UefiPayloadPkg/Library/CbSerialPortLib/CbSerialPortLib.c
new file mode 100644
index ..863fbcfef2f0
--- /dev/null
+++ b/UefiPayloadPkg/Library/CbSerialPortLib/CbSerialPortLib.c
@@ -0,0 +1,264 @@
+/** @file+  CBMEM console SerialPortLib instance++  Copyright (c) 2022, Baruch 
Binyamin Doron+  SPDX-License-Identifier: BSD-2-Clause-Patent++**/++#include 
+#include ++#include +#include 
+#include ++// Upper nibble 
contains flags+#define CBMC_CURSOR_MASK ((1 << 28) - 1)+#define CBMC_OVERFLOW 
(1 << 31)++STATIC struct cbmem_console  *mCbConsole = NULL;++/**+  Find 
coreboot record with given Tag.+  NOTE: This coreboot-specific function 
definition is absent+ from the common BlParseLib header.++  @param  Tag 
   The tag id to be found++  @retval NULL  The Tag is 
not found.+  @retval OthersThe pointer to the record 
found.++**/+VOID *+FindCbTag (+  IN  UINT32 Tag+  );++/**+  Initialize 
the serial device hardware.++  If no initialization is required, then return 
RETURN_SUCCESS.+  If the serial device was successfully initialized, then 
return RETURN_SUCCESS.+  If the serial device could not be initialized, then 
return RETURN_DEVICE_ERROR.++  @retval RETURN_SUCCESSThe serial device 
was initialized.+  @retval RETURN_DEVICE_ERROR   The serial device could not be 
initialized.++**/+RETURN_STATUS+EFIAPI+SerialPortInitialize (+  VOID+  )+{+  // 
The coreboot table contains large structures as references+  struct 
cb_cbmem_ref *cbref = FindCbTag(CB_TAG_CBMEM_CONSOLE);+  if (!cbref) {+
return RETURN_DEVICE_ERROR;+  }++  mCbConsole = (VOID 
*)(UINTN)cbref->cbmem_addr;  // Support PEI and DXE+  if (mCbConsole == NULL) 
{+return RETURN_DEVICE_ERROR;+  }++  return RETURN_SUCCESS;+}++/**+  Write 
data from buffer to serial device.++  Writes NumberOfBytes data bytes from 
Buffer to the serial device.+  The number of bytes actually written to the 
serial device is returned.+  If the return value is less than NumberOfBytes, 
then the write operation failed.+  If Buffer is NULL, then ASSERT().+  If 
NumberOfBytes is zero, then return 0.++  @param  Buffer   Pointer to 
the data buffer to be written.+  @param  NumberOfBytesNumber of bytes to 
written to the serial devic

Re: [edk2-devel] [PATCH v2] UefiPayloadPkg: Add support for logging to CBMEM console

2022-05-27 Thread Guo Dong

Thanks Benjamin for the explaining. I have no other comments.

Thanks,
Guo

From: Benjamin Doron 
Sent: Friday, May 27, 2022 9:33 AM
To: Dong, Guo ; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH v2] UefiPayloadPkg: Add support for logging to 
CBMEM console

Hi Guo,
Dumping some of the coreboot table shows that some smaller entries/data (such 
as build information) are inserted inline while larger entries use the 
cb_cbmem_ref structure. This may answer why some users of FindCbTag() assign 
the returned pointer directly to their requested structure, while this library 
must first dereference the console's address.

For reasons unclear to me, cb_cbmem_ref->size == 0x0010, the size of the 
cb_cbmem_ref structure. Perhaps the structure of cb_cbmem_ref has been changed 
in the past and the size field informs coreboot payloads? Either way, it 
doesn't look like a useful field at the moment.

I will add comments and submit a v3. Is there anything else that needs some 
comments?

Regards,
Benjamin


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90088): https://edk2.groups.io/g/devel/message/90088
Mute This Topic: https://groups.io/mt/91273919/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 2/3] UefiPayloadPkg: Align Identifier value with UPL spec

2022-05-27 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Guo, Gua  
Sent: Thursday, May 26, 2022 5:14 AM
To: devel@edk2.groups.io
Cc: Guo, Gua ; Ni, Ray ; Dong, Guo 

Subject: [PATCH 2/3] UefiPayloadPkg: Align Identifier value with UPL spec

From: Gua Guo 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3933

URL: https://universalpayload.github.io/documentation/
Currently, Identifier value is "UPLD", it needs to have correct value "PLDH" 
based on Universal Payload Specification spec section 2.12.2

Cc: Ray Ni 
Cc: Guo Dong 
Signed-off-by: Gua Guo 
---
 UefiPayloadPkg/UniversalPayloadBuild.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py 
b/UefiPayloadPkg/UniversalPayloadBuild.py
index 50335d4316..b7fd1505b6 100644
--- a/UefiPayloadPkg/UniversalPayloadBuild.py
+++ b/UefiPayloadPkg/UniversalPayloadBuild.py
@@ -29,7 +29,7 @@ class UPLD_INFO_HEADER(LittleEndianStructure):
 ]  def __init__(self):-self.Identifier =  b'UPLD'+ 
   self.Identifier =  b'PLDH' self.HeaderLength   = 
sizeof(UPLD_INFO_HEADER) self.HeaderRevision = 0x0075 
self.Revision   = 0x010105-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90084): https://edk2.groups.io/g/devel/message/90084
Mute This Topic: https://groups.io/mt/91354493/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 3/3] UefiPayloadPkg: Align SpecRevision value with UPL spec

2022-05-27 Thread Guo Dong
Reviewed-by: Guo Dong 

-Original Message-
From: Guo, Gua  
Sent: Thursday, May 26, 2022 5:14 AM
To: devel@edk2.groups.io
Cc: Guo, Gua ; Ni, Ray ; Dong, Guo 

Subject: [PATCH 3/3] UefiPayloadPkg: Align SpecRevision value with UPL spec

From: Gua Guo 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3933

URL: https://universalpayload.github.io/documentation/

1. Currently, SpecRevision on USF spec is 0.7. Change to align it.
2. SpecRevision is not be patched into UniversalPayloadInfo.bin due to 
different structure item name. Change item name from "HeaderRevision"
 to "SpecRevision" to check the correct value can be patched.

Cc: Ray Ni 
Cc: Guo Dong 
Signed-off-by: Gua Guo 
---
 UefiPayloadPkg/UniversalPayloadBuild.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py 
b/UefiPayloadPkg/UniversalPayloadBuild.py
index b7fd1505b6..089d631b51 100644
--- a/UefiPayloadPkg/UniversalPayloadBuild.py
+++ b/UefiPayloadPkg/UniversalPayloadBuild.py
@@ -31,7 +31,7 @@ class UPLD_INFO_HEADER(LittleEndianStructure):
 def __init__(self): self.Identifier =  b'PLDH' 
self.HeaderLength   = sizeof(UPLD_INFO_HEADER)-self.HeaderRevision = 
0x0075+self.SpecRevision   = 0x0007 self.Revision   = 
0x010105 self.ImageId= b'UEFI' self.ProducerId 
= b'INTEL'-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90083): https://edk2.groups.io/g/devel/message/90083
Mute This Topic: https://groups.io/mt/91354494/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2] UefiPayloadPkg: Add support for logging to CBMEM console

2022-05-26 Thread Guo Dong


It would be great if you could add some comments to the newly added cbmem. It 
looks cb_cbmem_ref size was not used in this patch. Is it expected?
+struct cb_cbmem_ref {
+  UINT32 tag;
+  UINT32 size;
+  UINT64 cbmem_addr;
+};
+
+struct cbmem_console {
+  UINT32 size;
+  UINT32 cursor;
+  UINT8  body[0];
+} __attribute__((packed));
+

Rename gCbConsole to mCbConsole since this global variable is only used in this 
module.
+STATIC struct cbmem_console  *gCbConsole = NULL;

Thanks,
Guo
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Benjamin Doron
Sent: Sunday, May 22, 2022 11:47 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Maurice Ma 
; You, Benjamin ; Rhodes, Sean 

Subject: [edk2-devel] [PATCH v2] UefiPayloadPkg: Add support for logging to 
CBMEM console

Writes TianoCore debug logs into the CBMEM console ringbuffer, from where the 
user can retrieve them with the `cbmem` userspace utility.

The intention is to aid in debugging non-fatal issues even in release builds, 
or simply make TianoCore's logs available to those interested.
Consequently, MDEPKG_NDEBUG must be masked. As an in-memory debug logging 
library, ASSERTs must be non-fatal to be seen, so they neither dead-loop nor 
create a breakpoint. It is assumed that ASSERT() neither enforces fatal 
conditions nor security integrity, as release builds do not call DebugAssert() 
from the ASSERT macro.

More detailed debug logs are produced with the DEBUG_CODE macro, but this 
guards other debug-related code throughout the codebase. To avoid changing 
behaviour on release builds, this is only set for debug builds.

Tested on QEMU, dumping the appropriate memory region in the UEFI shell shows 
the TianoCore log. An improved revision of the debug library used in several 
coreboot-related EDK2 forks, including MrChromebox's.
Previous revisions also tested on an Acer Aspire VN7-572G laptop.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Benjamin Doron 
---
 UefiPayloadPkg/Include/Coreboot.h  |  12 +
 UefiPayloadPkg/Library/CbSerialPortLib/CbSerialPortLib.c   | 258 

 UefiPayloadPkg/Library/CbSerialPortLib/CbSerialPortLib.inf |  30 +++
 UefiPayloadPkg/UefiPayloadPkg.dsc  |  25 +-
 4 files changed, 320 insertions(+), 5 deletions(-)

diff --git a/UefiPayloadPkg/Include/Coreboot.h 
b/UefiPayloadPkg/Include/Coreboot.h
index a3e1109fe84e..4c9cf965519b 100644
--- a/UefiPayloadPkg/Include/Coreboot.h
+++ b/UefiPayloadPkg/Include/Coreboot.h
@@ -199,6 +199,12 @@ struct cb_forward {
   UINT64forward; }; +struct cb_cbmem_ref {+  UINT32 tag;+  UINT32 size;+  
UINT64 cbmem_addr;+};+ #define CB_TAG_FRAMEBUFFER  0x0012 struct cb_framebuffer 
{   UINT32tag;@@ -229,6 +235,12 @@ struct cb_vdat {
  #define CB_TAG_TIMESTAMPS 0x0016 #define CB_TAG_CBMEM_CONSOLE  
0x0017+struct cbmem_console {+  UINT32 size;+  UINT32 cursor;+  UINT8  
body[0];+} __attribute__((packed));+ #define CB_TAG_MRC_CACHE  0x0018 
struct cb_cbmem_tab {   UINT32tag;diff --git 
a/UefiPayloadPkg/Library/CbSerialPortLib/CbSerialPortLib.c 
b/UefiPayloadPkg/Library/CbSerialPortLib/CbSerialPortLib.c
new file mode 100644
index ..f7c06b0f41e9
--- /dev/null
+++ b/UefiPayloadPkg/Library/CbSerialPortLib/CbSerialPortLib.c
@@ -0,0 +1,258 @@
+/** @file+  CBMEM console SerialPortLib instance++  Copyright (c) 2022, Baruch 
Binyamin Doron+  SPDX-License-Identifier: BSD-2-Clause-Patent++**/++#include 
+#include ++#include +#include 
+#include ++// Upper nibble 
contains flags+#define CBMC_CURSOR_MASK ((1 << 28) - 1)+#define CBMC_OVERFLOW 
(1 << 31)++STATIC struct cbmem_console  *gCbConsole = NULL;++/**+  Find 
coreboot record with given Tag.+  NOTE: This coreboot-specific function 
definition is absent+ from the common BlParseLib header.++  @param  Tag 
   The tag id to be found++  @retval NULL  The Tag is 
not found.+  @retval OthersThe pointer to the record 
found.++**/+VOID *+FindCbTag (+  IN  UINT32 Tag+  );++/**+  Initialize 
the serial device hardware.++  If no initialization is required, then return 
RETURN_SUCCESS.+  If the serial device was successfully initialized, then 
return RETURN_SUCCESS.+  If the serial device could not be initialized, then 
return RETURN_DEVICE_ERROR.++  @retval RETURN_SUCCESSThe serial device 
was initialized.+  @retval RETURN_DEVICE_ERROR   The serial device could not be 
initialized.++**/+RETURN_STATUS+EFIAPI+SerialPortInitialize (+  VOID+  )+{+  
struct cb_cbmem_ref *cbref = FindCbTag(CB_TAG_CBMEM_CONSOLE);+  if (!cbref) {+  
  return RETURN_DEVICE_ERROR;+  }++  gCbConsole = (VOID 
*)(UINTN)cbref->cbmem_addr;  // Support PEI and DXE+  if (gCbConsole == NULL) 
{+return RETURN_DEVICE_ERROR;+  }++  return RETURN_SUCCESS;+}++/**+  Write 
data from buffer to serial device.++  Writes NumberOfBytes data bytes from 
Buffer to the serial devic

Re: [edk2-devel] [PATCH v2 3/3] UefiPayloadPkg: Connect all root bridge in PlatformBootManagerBeforeConsole

2022-05-12 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Liu, Zhiguang  
Sent: Thursday, May 12, 2022 3:55 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Maurice Ma 
; You, Benjamin ; Rhodes, Sean 

Subject: [PATCH v2 3/3] UefiPayloadPkg: Connect all root bridge in 
PlatformBootManagerBeforeConsole

Some ConIn or ConOut device may not in the first root bridge, so connect all 
root bridge  before detect ConIn and ConOut device.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Zhiguang Liu 
---
 .../PlatformBootManagerLib.inf|  1 +
 .../PlatformBootManagerLib/PlatformConsole.c  | 49 ++-
 2 files changed, 15 insertions(+), 35 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index acf2880d22..9f58c460cd 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerL
+++ ib.inf
@@ -61,6 +61,7 @@
   gEfiSmmAccess2ProtocolGuid   
gUniversalPayloadPlatformBootManagerOverrideProtocolGuid   
gEfiSerialIoProtocolGuid+  gEfiPciRootBridgeIoProtocolGuid  [Pcd]   
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOutdiff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
index 5aece6636f..e92d12e991 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
@@ -38,9 +38,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 0 \   } -#define gPciRootBridge \-  PNPID_DEVICE_PATH_NODE(0x0A03)- 
#define gPnp16550ComPort \   PNPID_DEVICE_PATH_NODE(0x0501) @@ -64,19 +61,6 @@ 
ACPI_HID_DEVICE_PATH  gPnpPs2KeyboardDeviceNode  = gPnpPs2Keyboard;
 ACPI_HID_DEVICE_PATH  gPnp16550ComPortDeviceNode = gPnp16550ComPort; 
VENDOR_DEVICE_PATHgTerminalTypeDeviceNode= gPcAnsiTerminal; -//-// 
Predefined platform root bridge-//-PLATFORM_ROOT_BRIDGE_DEVICE_PATH  
gPlatformRootBridge0 = {-  gPciRootBridge,-  
gEndEntire-};--EFI_DEVICE_PATH_PROTOCOL  *gPlatformRootBridges[] = {-  
(EFI_DEVICE_PATH_PROTOCOL *),-  NULL-};- BOOLEAN  
mDetectDisplayOnly;  /**@@ -447,32 +431,24 @@ 
DetectAndPreparePlatformPciDevicePaths (
 }  /**-  The function will connect root bridge+  The function will connect one 
root bridge -   @return EFI_SUCCESS  Connect RootBridge successfully.+  
@param[in]  Handle - The root bridge handle+  @param[in]  Instance   - The 
instance of the root bridge++  @return EFI_SUCCESS  Connect RootBridge 
successfully.  **/ EFI_STATUS-ConnectRootBridge (-  
VOID+EFIAPI+ConnectOneRootBridge (+  IN EFI_HANDLE  Handle,+  IN VOID
*Instance   ) {   EFI_STATUS  Status;-  EFI_HANDLE  RootHandle; -  //-  // Make 
all the PCI_IO protocols on PCI Seg 0 show up-  //-  Status = 
gBS->LocateDevicePath (-  ,- 
 [0],- 
   );-  if (EFI_ERROR (Status)) {-return Status;-  }--  Status = 
gBS->ConnectController (RootHandle, NULL, NULL, FALSE);+  Status = 
gBS->ConnectController (Handle, NULL, NULL, FALSE);   if (EFI_ERROR (Status)) { 
return Status;   }@@ -491,7 +467,10 @@ PlatformConsoleInit (
   VOID   ) {-  ConnectRootBridge ();+  VisitAllInstancesOfProtocol (+
,+ConnectOneRootBridge+);//   // Do 
platform specific PCI Device check and add them to ConOut, ConIn, ErrOut-- 
2.32.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#89709): https://edk2.groups.io/g/devel/message/89709
Mute This Topic: https://groups.io/mt/91055224/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 2/3] UefiPayloadPkg: Add Serial IO device path according to related protocol

2022-05-12 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Liu, Zhiguang  
Sent: Thursday, May 12, 2022 3:55 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Maurice Ma 
; You, Benjamin ; Rhodes, Sean 

Subject: [PATCH v2 2/3] UefiPayloadPkg: Add Serial IO device path according to 
related protocol

Current code follow some rules to check if the PCI device connected to a serial 
port device, but some platform or hardware doesn't follow such rule.
By locating gEfiSerialIoProtocolGuid protocol, we can find the related device 
path.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Zhiguang Liu 
---
 .../PlatformBootManagerLib.inf|   1 +
 .../PlatformBootManagerLib/PlatformConsole.c  | 146 +-
 .../PlatformBootManagerLib/PlatformConsole.h  |   1 -
 3 files changed, 41 insertions(+), 107 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 80390e0d98..acf2880d22 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerL
+++ ib.inf
@@ -60,6 +60,7 @@
   gEfiDxeSmmReadyToLockProtocolGuid   gEfiSmmAccess2ProtocolGuid   
gUniversalPayloadPlatformBootManagerOverrideProtocolGuid+  
gEfiSerialIoProtocolGuid  [Pcd]   
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOutdiff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
index 75aafebccd..5aece6636f 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
@@ -47,36 +47,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define gPnpPs2Keyboard \   PNPID_DEVICE_PATH_NODE(0x0303) -#define 
gUartVendor \-  { \-{ \-  HARDWARE_DEVICE_PATH, \-  HW_VENDOR_DP, 
\-  { \-(UINT8) (sizeof (VENDOR_DEVICE_PATH)), \-(UINT8) 
((sizeof (VENDOR_DEVICE_PATH)) >> 8) \-  } \-}, \-
EDKII_SERIAL_PORT_LIB_VENDOR_GUID \-  }--#define gUart \-  { \-{ \-  
MESSAGING_DEVICE_PATH, \-  MSG_UART_DP, \-  { \-(UINT8) (sizeof 
(UART_DEVICE_PATH)), \-(UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8) \-
  } \-}, \-0, \-115200, \-8, \-1, \-1 \-  }- #define 
gPcAnsiTerminal \   { \ { \@@ -92,9 +62,7 @@ SPDX-License-Identifier: 
BSD-2-Clause-Patent
  ACPI_HID_DEVICE_PATH  gPnpPs2KeyboardDeviceNode  = gPnpPs2Keyboard; 
ACPI_HID_DEVICE_PATH  gPnp16550ComPortDeviceNode = 
gPnp16550ComPort;-UART_DEVICE_PATH  gUartDeviceNode= gUart; 
VENDOR_DEVICE_PATHgTerminalTypeDeviceNode= 
gPcAnsiTerminal;-VENDOR_DEVICE_PATHgUartDeviceVendorNode  = 
gUartVendor;  // // Predefined platform root bridge@@ -112,13 +80,11 @@ 
EFI_DEVICE_PATH_PROTOCOL  *gPlatformRootBridges[] = {
 BOOLEAN  mDetectDisplayOnly;  /**-  Add IsaKeyboard to ConIn; add IsaSerial to 
ConOut, ConIn, ErrOut.+  Add IsaKeyboard to ConIn.@param[in] DeviceHandle  
Handle of the LPC Bridge device. -  @retval EFI_SUCCESS  Console devices on the 
LPC bridge have been added to-   ConOut, ConIn, and 
ErrOut.-+  @retval EFI_SUCCESS  IsaKeyboard on the LPC bridge have been added 
to ConIn.   @return  Error codes, due to EFI_DEVICE_PATH_PROTOCOL 
missingfrom DeviceHandle. **/@@ -129,7 +95,6 @@ 
PrepareLpcBridgeDevicePath (
 {   EFI_STATUSStatus;   EFI_DEVICE_PATH_PROTOCOL  
*DevicePath;-  EFI_DEVICE_PATH_PROTOCOL  *TempDevicePath;DevicePath = NULL; 
  Status = gBS->HandleProtocol (@@ -141,26 +106,11 @@ 
PrepareLpcBridgeDevicePath (
 return Status;   } -  TempDevicePath = DevicePath;-   //   // Register 
Keyboard   //   DevicePath = AppendDevicePathNode (DevicePath, 
(EFI_DEVICE_PATH_PROTOCOL *));   
EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL);--  //-  // 
Register COM1-  //-  DevicePath = TempDevicePath;-  DevicePath = 
AppendDevicePathNode ((EFI_DEVICE_PATH_PROTOCOL *)NULL, 
(EFI_DEVICE_PATH_PROTOCOL *));-  DevicePath = 
AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL 
*));-  DevicePath = AppendDevicePathNode (DevicePath, 
(EFI_DEVICE_PATH_PROTOCOL *));--  
EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL);-  
EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL);-  
EfiBootManagerUpdateConsoleVariable (ErrOut, DevicePath, NULL);-   return 
EFI_SUCCESS; } @@ -291,43 +241,6 @@ PreparePciVgaDevicePath (
   return EFI_SUCCESS; } -/**-  Add PCI Serial to ConOut, ConIn, ErrOut.--  
@param[in]  DeviceHandle - Handle of PciIo protocol.--  @retval EFI_SUCCESS  - 
PCI Serial is added to ConOut, ConIn, and ErrOut.-  @retval EFI_STATUS   - No 
PCI Serial device is added.--**/-EFI_STATUS-PreparePciSerialDevicePath (- 

Re: [edk2-devel] [PATCH v2 1/3] UefiPayloadPkg: Simplify code logic

2022-05-12 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Liu, Zhiguang  
Sent: Thursday, May 12, 2022 3:55 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Maurice Ma 
; You, Benjamin ; Rhodes, Sean 

Subject: [PATCH v2 1/3] UefiPayloadPkg: Simplify code logic

A little overdesign about VisitAllPciInstances function, since there are two 
call back functions. Simplify the code logic by combining the two call back 
functions, and unused parameters.
Change the PROTOCOL_INSTANCE_CALLBACK to SIMPLE_PROTOCOL_INSTANCE_CALLBACK 
because the former is also defined in OvmfPkg. Rename it to avoid confusion.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Zhiguang Liu 
---
 .../PlatformBootManagerLib/PlatformConsole.c  | 93 +--  
.../PlatformBootManagerLib/PlatformConsole.h  |  5 +-
 2 files changed, 25 insertions(+), 73 deletions(-)

diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
index bfaf89e74c..75aafebccd 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c
@@ -333,7 +333,6 @@ PreparePciSerialDevicePath (
@param[in]  Id - The protocol GUID for callback   
@param[in]  CallBackFunction   - The callback function-  @param[in]  Context
- The context of the callback@retval EFI_STATUS - Callback function failed. 
@@ -341,9 +340,8 @@ PreparePciSerialDevicePath (
 EFI_STATUS EFIAPI VisitAllInstancesOfProtocol (-  IN EFI_GUID  
  *Id,-  IN PROTOCOL_INSTANCE_CALLBACK  CallBackFunction,-  IN VOID 
   *Context+  IN EFI_GUID   *Id,+  IN 
SIMPLE_PROTOCOL_INSTANCE_CALLBACK  CallBackFunction   ) {   EFI_STATUS  
Status;@@ -376,8 +374,7 @@ VisitAllInstancesOfProtocol (
  Status = (*CallBackFunction)(   HandleBuffer[Index],-  Instance,-  
Context+  Instance   );   } @@ -387,21 +384,21 @@ VisitAllInstancesOfProtocol (
 }  /**-  For every PCI instance execute a callback function.+  Do platform 
specific PCI Device check and add them to+  ConOut, ConIn, ErrOut. -  
@param[in]  Handle - The PCI device handle-  @param[in]  Instance   - The 
instance of the PciIo protocol-  @param[in]  Context- The context of the 
callback+  @param[in]  Handle- Handle of PCI device instance+  @param[in]  
Instance  - The instance of PCI device -  @retval EFI_STATUS - Callback 
function failed.+  @retval EFI_SUCCESS - PCI Device check and Console variable 
update successfully.+  @retval EFI_STATUS - PCI Device check or Console 
variable update fail.  **/ EFI_STATUS EFIAPI-VisitingAPciInstance 
(+DetectAndPreparePlatformPciDevicePath (   IN EFI_HANDLE  Handle,-  IN VOID
*Instance,-  IN VOID*Context+  IN VOID*Instance   ) {   
EFI_STATUS   Status;@@ -424,56 +421,6 @@ VisitingAPciInstance (
 return Status;   } -  return 
(*(VISIT_PCI_INSTANCE_CALLBACK)(UINTN)Context)(-  Handle,-  PciIo,-
);-}--/**-  For every PCI instance execute a callback function.--  @param[in]  
CallBackFunction - Callback function pointer--  @retval EFI_STATUS - Callback 
function failed.--**/-EFI_STATUS-EFIAPI-VisitAllPciInstances (-  IN 
VISIT_PCI_INSTANCE_CALLBACK  CallBackFunction-  )-{-  return 
VisitAllInstancesOfProtocol (-   ,-   
VisitingAPciInstance,-   (VOID *)(UINTN)CallBackFunction-   
);-}--/**-  Do platform specific PCI Device check and add them to-  ConOut, 
ConIn, ErrOut.--  @param[in]  Handle - Handle of PCI device instance-  
@param[in]  PciIo - PCI IO protocol instance-  @param[in]  Pci - PCI Header 
register block--  @retval EFI_SUCCESS - PCI Device check and Console variable 
update successfully.-  @retval EFI_STATUS - PCI Device check or Console 
variable update 
fail.--**/-EFI_STATUS-EFIAPI-DetectAndPreparePlatformPciDevicePath (-  IN 
EFI_HANDLE   Handle,-  IN EFI_PCI_IO_PROTOCOL  *PciIo,-  IN PCI_TYPE00  
 *Pci-  )-{-  EFI_STATUS  Status;-   Status = PciIo->Attributes (   
  PciIo, EfiPciIoAttributeOperationEnable,@@ 
-486,9 +433,9 @@ DetectAndPreparePlatformPciDevicePath (
 // // Here we decide whether it is LPC Bridge //-if 
((IS_PCI_LPC (Pci)) ||-((IS_PCI_ISA_PDECODE (Pci)) &&- 
(Pci->Hdr.VendorId == 0x8086)+if ((IS_PCI_LPC ()) ||+
((IS_PCI_ISA_PDECODE ()) &&+ (Pci.Hdr.VendorId == 0x8086) ) 
) {@@ -504,7 +451,7 @@ DetectAndPreparePlatformPciDevicePath (
 // // Here we decide which Serial device to enable in PCI bus //-  
  if (IS_PCI_16550SERIAL (Pci)) {+if (IS_PCI_16550SERIAL ()) {   // 
  // Add them to ConOut, ConIn, ErrOut.   //@@ -517,7 +464,7 @@ 
DetectAndPreparePlatformPciDevicePath (
   //   // Enable all display devices   //-  i

Re: [edk2-devel] [Patch V2] UefiPayloadPkg: Fix the UPL build failure

2022-05-08 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Tan, Dun  
Sent: Friday, May 6, 2022 8:58 PM
To: devel@edk2.groups.io
Cc: Ni, Ray ; Dong, Guo ; You, Benjamin 
; Rhodes, Sean 
Subject: [Patch V2] UefiPayloadPkg: Fix the UPL build failure

Add double quotes to LlvmObjcopyPath.
Blank space in LlvmObjcopyPath will cause build failure.
This build failure is introduced by 2306555bf908 (
"UefiPayloadPkg: Fix IA32 entry build failure").

Signed-off-by: Dun Tan 
Cc: Ray Ni 
Cc: Guo Dong 
Cc: Benjamin You 
Cc: Sean Rhodes 
---
 UefiPayloadPkg/UniversalPayloadBuild.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py 
b/UefiPayloadPkg/UniversalPayloadBuild.py
index 8af381336d..50335d4316 100644
--- a/UefiPayloadPkg/UniversalPayloadBuild.py
+++ b/UefiPayloadPkg/UniversalPayloadBuild.py
@@ -111,9 +111,9 @@ def BuildUniversalPayload(Args, MacroList):
 #
 # Copy the DXEFV as a section in elf format Universal Payload entry.
 #
-remove_section = f"{LlvmObjcopyPath} -I {ObjCopyFlag} -O {ObjCopyFlag} 
--remove-section .upld_info --remove-section .upld.uefi_fv {EntryOutputDir}"
-add_section= f"{LlvmObjcopyPath} -I {ObjCopyFlag} -O {ObjCopyFlag} 
--add-section .upld_info={UpldInfoFile} --add-section 
.upld.uefi_fv={FvOutputDir} {EntryOutputDir}"
-set_section= f"{LlvmObjcopyPath} -I {ObjCopyFlag} -O {ObjCopyFlag} 
--set-section-alignment .upld.upld_info=16 --set-section-alignment 
.upld.uefi_fv=16 {EntryOutputDir}"
+remove_section = f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} 
--remove-section .upld_info --remove-section .upld.uefi_fv {EntryOutputDir}'
+add_section= f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} 
--add-section .upld_info={UpldInfoFile} --add-section 
.upld.uefi_fv={FvOutputDir} {EntryOutputDir}'
+set_section= f'"{LlvmObjcopyPath}" -I {ObjCopyFlag} -O {ObjCopyFlag} 
--set-section-alignment .upld.upld_info=16 --set-section-alignment 
.upld.uefi_fv=16 {EntryOutputDir}'
 RunCommand(remove_section)
 RunCommand(add_section)
 RunCommand(set_section)
-- 
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#89583): https://edk2.groups.io/g/devel/message/89583
Mute This Topic: https://groups.io/mt/90948162/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel][edk2-platforms][PATCH V2 0/1] Add PlatformPayloadPkg

2022-05-06 Thread Guo Dong
From: Guo Dong 

changes from patch V1:
a) Change package name from PayloadPlatformPkg to PlatformPayloadPkg
b) Put PlatformPayloadPkg to Features/Intel instead of Platform/Intel
c) Reuse DSC/FDF files from MinPlatforms
d) Following Features orgnaizaion updated AdvancedFeaturePkg DSC/FDF
e) Updated PlatformPayloadPkg.py and Readme file

https://github.com/tianocore/edk2-platforms/pull/41

Guo Dong (1):
  Features/Intel/PlatformPayloadPkg: add platform payload FV

 Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc|  
  5 +
 Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc  |  
  7 ++
 Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc   |  
  7 ++
 Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf|  
  7 ++
 Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf |  
  7 ++
 Features/Intel/PlatformPayloadPkg/Fvb/FvbInfo.c |  
 77 +
 Features/Intel/PlatformPayloadPkg/Fvb/FvbService.c  | 
1088 
+++
 Features/Intel/PlatformPayloadPkg/Fvb/FvbService.h  |  
185 

 Features/Intel/PlatformPayloadPkg/Fvb/FvbServiceSmm.c   |  
139 
+
 Features/Intel/PlatformPayloadPkg/Fvb/FvbSmm.inf|  
 66 
 Features/Intel/PlatformPayloadPkg/Fvb/FvbSmmCommon.h|  
 68 ++
 Features/Intel/PlatformPayloadPkg/Include/Guid/NvVariableInfoGuid.h |  
 24 +
 Features/Intel/PlatformPayloadPkg/Include/Guid/SpiFlashInfoGuid.h   |  
 38 
 Features/Intel/PlatformPayloadPkg/Include/Library/FlashDeviceLib.h  |  
104 

 Features/Intel/PlatformPayloadPkg/Include/Library/SpiFlashLib.h |  
213 
+++
 Features/Intel/PlatformPayloadPkg/Include/PlatformPayloadFeature.dsc|  
112 
+++
 Features/Intel/PlatformPayloadPkg/Include/PostMemory.fdf|  
 20 +
 Features/Intel/PlatformPayloadPkg/Include/PreMemory.fdf |  
  8 +++
 Features/Intel/PlatformPayloadPkg/Library/FlashDeviceLib/FlashDeviceLib.c   |  
160 
+++
 Features/Intel/PlatformPayloadPkg/Library/FlashDeviceLib/FlashDeviceLib.inf |  
 38 
 Features/Intel/PlatformPayloadPkg/Library/PcdInitLib/PcdInitLib.c   |  
 89 +++
 Features/Intel/PlatformPayloadPkg/Library/PcdInitLib/PcdInitLib.inf |  
 50 +++
 Features/Intel/PlatformPayloadPkg/Library/SpiFlashLib/PchSpi.c  |  
170 
+++
 Features/Intel/PlatformPayloadPkg/Library/SpiFlashLib/RegsSpi.h |  
120 
+
 Features/Intel/PlatformPayloadPkg/Library/SpiFlashLib/SpiCommon.h   |  
203

Re: [edk2-devel] [Patch v2 21/28] UefiPayloadPkg: Add ProtectedVariable reference

2022-04-29 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Vang, Judah  
Sent: Friday, April 29, 2022 11:04 AM
To: devel@edk2.groups.io
Cc: Wang, Jian J ; Dong, Guo ; Ni, 
Ray ; Maurice Ma ; You, Benjamin 
; Rhodes, Sean ; Mistry, Nishant 
C 
Subject: [Patch v2 21/28] UefiPayloadPkg: Add ProtectedVariable reference

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2594

Add reference for ProtectedVariableLib so build is successful.

Cc: Jian J Wang 
Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Cc: Nishant C Mistry 
Signed-off-by: Jian J Wang 
Signed-off-by: Nishant C Mistry 
Signed-off-by: Judah Vang 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 17b30589e77c..fe835eed1bc7 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -263,9 +263,11 @@ [LibraryClasses]
   
AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf
 !if $(VARIABLE_SUPPORT) == "EMU"
   
TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf
+  
ProtectedVariableLib|MdeModulePkg/Library/ProtectedVariableLibNull/ProtectedVariableLibNull.inf
 !elseif $(VARIABLE_SUPPORT) == "SPI"
   
PlatformSecureLib|SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf
   
TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
+  
ProtectedVariableLib|SecurityPkg/Library/ProtectedVariableLib/DxeProtectedVariableLib.inf
   
S3BootScriptLib|MdePkg/Library/BaseS3BootScriptLibNull/BaseS3BootScriptLibNull.inf
   
MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf
 !endif
-- 
2.35.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#89451): https://edk2.groups.io/g/devel/message/89451
Mute This Topic: https://groups.io/mt/90781909/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch V2] UefiPayloadPkg: Add definition for PayloadCommandLine HOB

2022-04-29 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Tan, Dun  
Sent: Wednesday, April 27, 2022 11:46 PM
To: devel@edk2.groups.io
Cc: Tan, Dun ; Ni, Ray ; Dong, Guo 
; You, Benjamin ; Rhodes, Sean 
; Liu, Zhiguang 
Subject: [Patch V2] UefiPayloadPkg: Add definition for PayloadCommandLine HOB

From: duntan 

Add definition for UNIVERSAL_PAYLOAD_COMMAND_LINE Hob.
This Hob is used to pass command Line to Payload.

Signed-off-by: Dun Tan 
Cc: Ray Ni 
Cc: Guo Dong 
Cc: Benjamin You 
Cc: Sean Rhodes 
Cc: Zhiguang Liu 
Signed-off-by: Dun Tan 
---
 UefiPayloadPkg/Include/Guid/PayloadCommandLine.h | 28 

 UefiPayloadPkg/UefiPayloadPkg.dec|  1 +
 2 files changed, 29 insertions(+)

diff --git a/UefiPayloadPkg/Include/Guid/PayloadCommandLine.h 
b/UefiPayloadPkg/Include/Guid/PayloadCommandLine.h
new file mode 100644
index 00..845a30efe1
--- /dev/null
+++ b/UefiPayloadPkg/Include/Guid/PayloadCommandLine.h
@@ -0,0 +1,28 @@
+/** @file
+  Define the structure for the Payload command line Hob.
+
+Copyright (c) 2022, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef PAYLOAD_COMMAND_LINE_H_
+#define PAYLOAD_COMMAND_LINE_H_
+
+#include 
+#include 
+
+#pragma pack (1)
+
+typedef struct {
+  UNIVERSAL_PAYLOAD_GENERIC_HEADERHeader;
+  UINT32  Count;
+  CHAR8   CommandLine[0];
+} UNIVERSAL_PAYLOAD_COMMAND_LINE;
+
+#pragma pack()
+
+#define UNIVERSAL_PAYLOAD_COMMAND_LINE_REVISION  1
+
+extern GUID  gEdkiiPayloadCommandLineGuid; #endif
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dec 
b/UefiPayloadPkg/UefiPayloadPkg.dec
index 5c1aeb8235..1ccfc32548 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -35,6 +35,7 @@
   gUefiAcpiBoardInfoGuid   = {0xad3d31b, 0xb3d8, 0x4506, {0xae, 0x71, 0x2e, 
0xf1, 0x10, 0x6, 0xd9, 0xf}}
   gUefiSerialPortInfoGuid  = { 0x6c6872fe, 0x56a9, 0x4403, { 0xbb, 0x98, 0x95, 
0x8d, 0x62, 0xde, 0x87, 0xf1 } }
   gLoaderMemoryMapInfoGuid = { 0xa1ff7424, 0x7a1a, 0x478e, { 0xa9, 0xe4, 0x92, 
0xf3, 0x57, 0xd1, 0x28, 0x32 } }
+  gEdkiiPayloadCommandLineGuid = {0xb5aeb34f, 0x3047, 0x4955, {0xb8, 
+ 0x80, 0xad, 0xd3, 0x6d, 0x86, 0xdc, 0x0f}}
 
   # SMM variable support
   gNvVariableInfoGuid  = { 0x7a345dca, 0xc26, 0x4f2a,  { 0xa8, 0x9a, 0x57, 
0xc0, 0x8d, 0xdd, 0x22, 0xee } }
--
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#89416): https://edk2.groups.io/g/devel/message/89416
Mute This Topic: https://groups.io/mt/90748159/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add definition for LinuxCommandLine HOB

2022-04-26 Thread Guo Dong


Hi Dun,

This patch adds an interface (passing command line HOB) between bootloader and 
UEFI payload.
Do you mean the use case is that  bootloader passes this HOB to UEFI payload, 
then UEFI payload would launch LinuxPayload with this command line?
If so, how the UEFI payload knows it is LinuxPayload so it would pass this 
command line?

Thanks,
Guo

-Original Message-
From: Tan, Dun  
Sent: Thursday, April 21, 2022 11:59 PM
To: Dong, Guo ; devel@edk2.groups.io
Cc: Ni, Ray ; You, Benjamin ; Rhodes, 
Sean ; Liu, Zhiguang 
Subject: RE: [PATCH] UefiPayloadPkg: Add definition for LinuxCommandLine HOB

Hi Guo,

Thanks for the comments! 
This Hob is used to pass Linux command line to LinuxPayload instead of OSes. 
For LinuxPayload, it only needs the Linux Command Line.

Thanks,
Dun
-Original Message-
From: Dong, Guo  
Sent: Friday, April 22, 2022 1:09 PM
To: Tan, Dun ; devel@edk2.groups.io
Cc: Ni, Ray ; You, Benjamin ; Rhodes, 
Sean ; Liu, Zhiguang 
Subject: RE: [PATCH] UefiPayloadPkg: Add definition for LinuxCommandLine HOB


Minor comments:
It would be great if adding some descriptions to the fields to make its usage 
more clear.
Maybe we need give this header file and structure a more generic name by using 
"OS" instead of "LINUX" so that bootloader could pass command line to Android 
and other OSes using same structure.
With current definition it looks bootloader could only pass 1 command line to 
payload. I am not sure if there is a case that bootloader need pass multiple 
command line so that payload could pick up one of them for OS.

+typedef struct {
+  UNIVERSAL_PAYLOAD_GENERIC_HEADERHeader;
+  UINT32  Count;
+  CHAR8   CommandLine[0];
+} UNIVERSAL_PAYLOAD_LINUX_COMMAND_LINE;

Thanks,
Guo

-Original Message-
From: Tan, Dun 
Sent: Thursday, April 21, 2022 8:51 PM
To: devel@edk2.groups.io
Cc: Ni, Ray ; Dong, Guo ; You, Benjamin 
; Rhodes, Sean ; Liu, Zhiguang 

Subject: [PATCH] UefiPayloadPkg: Add definition for LinuxCommandLine HOB

Add definition for UNIVERSAL_PAYLOAD_LINUX_COMMAND_LINE Hob.
This Hob is used to pass Linux Kernel command Line to Payload

Signed-off-by: Dun Tan 
Cc: Ray Ni 
Cc: Guo Dong 
Cc: Benjamin You 
Cc: Sean Rhodes 
Cc: Zhiguang Liu 
Signed-off-by: Dun Tan 
---
 UefiPayloadPkg/Include/Guid/LinuxCommandLine.h | 28 

 UefiPayloadPkg/UefiPayloadPkg.dec  |  1 +
 2 files changed, 29 insertions(+)

diff --git a/UefiPayloadPkg/Include/Guid/LinuxCommandLine.h 
b/UefiPayloadPkg/Include/Guid/LinuxCommandLine.h
new file mode 100644
index 00..0bb75238e7
--- /dev/null
+++ b/UefiPayloadPkg/Include/Guid/LinuxCommandLine.h
@@ -0,0 +1,28 @@
+/** @file
+  Define the structure for the Linux command line Hob.
+
+Copyright (c) 2022, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef LINUX_COMMAND_LINE_GUID_H_
+#define LINUX_COMMAND_LINE_GUID_H_
+
+#include 
+#include 
+
+#pragma pack (1)
+
+typedef struct {
+  UNIVERSAL_PAYLOAD_GENERIC_HEADERHeader;
+  UINT32  Count;
+  CHAR8   CommandLine[0];
+} UNIVERSAL_PAYLOAD_LINUX_COMMAND_LINE;
+
+#pragma pack()
+
+#define UNIVERSAL_PAYLOAD_LINUX_COMMAND_LINE_REVISION  1
+
+extern GUID  gEdkiiLinuxCommandLineGuid; #endif
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dec 
b/UefiPayloadPkg/UefiPayloadPkg.dec
index 5c1aeb8235..494ef94932 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -35,6 +35,7 @@
   gUefiAcpiBoardInfoGuid   = {0xad3d31b, 0xb3d8, 0x4506, {0xae, 0x71, 0x2e, 
0xf1, 0x10, 0x6, 0xd9, 0xf}}
   gUefiSerialPortInfoGuid  = { 0x6c6872fe, 0x56a9, 0x4403, { 0xbb, 0x98, 0x95, 
0x8d, 0x62, 0xde, 0x87, 0xf1 } }
   gLoaderMemoryMapInfoGuid = { 0xa1ff7424, 0x7a1a, 0x478e, { 0xa9, 0xe4, 0x92, 
0xf3, 0x57, 0xd1, 0x28, 0x32 } }
+  gEdkiiLinuxCommandLineGuid = {0xb5aeb34f, 0x3047, 0x4955, {0xb8, 
+ 0x80, 0xad, 0xd3, 0x6d, 0x86, 0xdc, 0x0f}}
 
   # SMM variable support
   gNvVariableInfoGuid  = { 0x7a345dca, 0xc26, 0x4f2a,  { 0xa8, 0x9a, 0x57, 
0xc0, 0x8d, 0xdd, 0x22, 0xee } }
--
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#89335): https://edk2.groups.io/g/devel/message/89335
Mute This Topic: https://groups.io/mt/90621302/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add definition for LinuxCommandLine HOB

2022-04-21 Thread Guo Dong


Minor comments:
It would be great if adding some descriptions to the fields to make its usage 
more clear.
Maybe we need give this header file and structure a more generic name by using 
"OS" instead of "LINUX" so that bootloader could pass command line to Android 
and other OSes using same structure.
With current definition it looks bootloader could only pass 1 command line to 
payload. I am not sure if there is a case that bootloader need pass multiple 
command line so that payload could pick up one of them for OS.

+typedef struct {
+  UNIVERSAL_PAYLOAD_GENERIC_HEADERHeader;
+  UINT32  Count;
+  CHAR8   CommandLine[0];
+} UNIVERSAL_PAYLOAD_LINUX_COMMAND_LINE;

Thanks,
Guo

-Original Message-
From: Tan, Dun  
Sent: Thursday, April 21, 2022 8:51 PM
To: devel@edk2.groups.io
Cc: Ni, Ray ; Dong, Guo ; You, Benjamin 
; Rhodes, Sean ; Liu, Zhiguang 

Subject: [PATCH] UefiPayloadPkg: Add definition for LinuxCommandLine HOB

Add definition for UNIVERSAL_PAYLOAD_LINUX_COMMAND_LINE Hob.
This Hob is used to pass Linux Kernel command Line to Payload

Signed-off-by: Dun Tan 
Cc: Ray Ni 
Cc: Guo Dong 
Cc: Benjamin You 
Cc: Sean Rhodes 
Cc: Zhiguang Liu 
Signed-off-by: Dun Tan 
---
 UefiPayloadPkg/Include/Guid/LinuxCommandLine.h | 28 

 UefiPayloadPkg/UefiPayloadPkg.dec  |  1 +
 2 files changed, 29 insertions(+)

diff --git a/UefiPayloadPkg/Include/Guid/LinuxCommandLine.h 
b/UefiPayloadPkg/Include/Guid/LinuxCommandLine.h
new file mode 100644
index 00..0bb75238e7
--- /dev/null
+++ b/UefiPayloadPkg/Include/Guid/LinuxCommandLine.h
@@ -0,0 +1,28 @@
+/** @file
+  Define the structure for the Linux command line Hob.
+
+Copyright (c) 2022, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef LINUX_COMMAND_LINE_GUID_H_
+#define LINUX_COMMAND_LINE_GUID_H_
+
+#include 
+#include 
+
+#pragma pack (1)
+
+typedef struct {
+  UNIVERSAL_PAYLOAD_GENERIC_HEADERHeader;
+  UINT32  Count;
+  CHAR8   CommandLine[0];
+} UNIVERSAL_PAYLOAD_LINUX_COMMAND_LINE;
+
+#pragma pack()
+
+#define UNIVERSAL_PAYLOAD_LINUX_COMMAND_LINE_REVISION  1
+
+extern GUID  gEdkiiLinuxCommandLineGuid; #endif
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dec 
b/UefiPayloadPkg/UefiPayloadPkg.dec
index 5c1aeb8235..494ef94932 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -35,6 +35,7 @@
   gUefiAcpiBoardInfoGuid   = {0xad3d31b, 0xb3d8, 0x4506, {0xae, 0x71, 0x2e, 
0xf1, 0x10, 0x6, 0xd9, 0xf}}
   gUefiSerialPortInfoGuid  = { 0x6c6872fe, 0x56a9, 0x4403, { 0xbb, 0x98, 0x95, 
0x8d, 0x62, 0xde, 0x87, 0xf1 } }
   gLoaderMemoryMapInfoGuid = { 0xa1ff7424, 0x7a1a, 0x478e, { 0xa9, 0xe4, 0x92, 
0xf3, 0x57, 0xd1, 0x28, 0x32 } }
+  gEdkiiLinuxCommandLineGuid = {0xb5aeb34f, 0x3047, 0x4955, {0xb8, 
+ 0x80, 0xad, 0xd3, 0x6d, 0x86, 0xdc, 0x0f}}
 
   # SMM variable support
   gNvVariableInfoGuid  = { 0x7a345dca, 0xc26, 0x4f2a,  { 0xa8, 0x9a, 0x57, 
0xc0, 0x8d, 0xdd, 0x22, 0xee } }
--
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#89208): https://edk2.groups.io/g/devel/message/89208
Mute This Topic: https://groups.io/mt/90621302/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix IA32 entry build failure

2022-04-21 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Tan, Dun  
Sent: Monday, April 18, 2022 5:51 PM
To: devel@edk2.groups.io
Cc: Ni, Ray ; Dong, Guo ; You, Benjamin 
; Liu, Zhiguang 
Subject: [PATCH] UefiPayloadPkg: Fix IA32 entry build failure

The ObjCopyFlag and EntryOutputDir need to be modified when building IA32 
UniversalPayload Entry

Signed-off-by: Dun Tan 
Cc: Ray Ni 
Cc: Guo Dong 
Cc: Benjamin You 
Cc: Zhiguang Liu 
---
 UefiPayloadPkg/UniversalPayloadBuild.py | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py 
b/UefiPayloadPkg/UniversalPayloadBuild.py
index 99410d244d..8af381336d 100644
--- a/UefiPayloadPkg/UniversalPayloadBuild.py
+++ b/UefiPayloadPkg/UniversalPayloadBuild.py
@@ -54,14 +54,20 @@ def BuildUniversalPayload(Args, MacroList):
 BuildTarget = Args.Target
 ToolChain = Args.ToolChain
 Quiet = "--quiet"  if Args.Quiet else ""
-BuildArch = "X64" if Args.Arch == 'X64' else "IA32 -a X64"
 ElfToolChain = 'CLANGDWARF'
+BuildDir = os.path.join(os.environ['WORKSPACE'], 
os.path.normpath("Build/UefiPayloadPkgX64"))
+if Args.Arch == 'X64':
+BuildArch  = "X64"
+ObjCopyFlag= "elf64-x86-64"
+EntryOutputDir = os.path.join(BuildDir, 
f"{BuildTarget}_{ElfToolChain}", 
os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll"))
+else:
+BuildArch  = "IA32 -a X64"
+ObjCopyFlag= "elf32-i386"
+EntryOutputDir = os.path.join(BuildDir, 
+ f"{BuildTarget}_{ElfToolChain}", 
+ os.path.normpath("IA32/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloa
+ dEntry/DEBUG/UniversalPayloadEntry.dll"))
 
 EntryModuleInf = 
os.path.normpath("UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf")
 DscPath = os.path.normpath("UefiPayloadPkg/UefiPayloadPkg.dsc")
-BuildDir = os.path.join(os.environ['WORKSPACE'], 
os.path.normpath("Build/UefiPayloadPkgX64"))
 FvOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ToolChain}", 
os.path.normpath("FV/DXEFV.Fv"))
-EntryOutputDir = os.path.join(BuildDir, f"{BuildTarget}_{ElfToolChain}", 
os.path.normpath("X64/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry/DEBUG/UniversalPayloadEntry.dll"))
 PayloadReportPath = os.path.join(BuildDir, "UefiUniversalPayload.txt")
 ModuleReportPath = os.path.join(BuildDir, "UefiUniversalPayloadEntry.txt")
 UpldInfoFile = os.path.join(BuildDir, "UniversalPayloadInfo.bin") @@ 
-105,9 +111,9 @@ def BuildUniversalPayload(Args, MacroList):
 #
 # Copy the DXEFV as a section in elf format Universal Payload entry.
 #
-remove_section = '"%s" -I elf64-x86-64 -O elf64-x86-64 --remove-section 
.upld_info --remove-section .upld.uefi_fv %s'%(LlvmObjcopyPath, EntryOutputDir)
-add_section= '"%s" -I elf64-x86-64 -O elf64-x86-64 --add-section 
.upld_info=%s --add-section .upld.uefi_fv=%s %s'%(LlvmObjcopyPath, 
UpldInfoFile, FvOutputDir, EntryOutputDir)
-set_section= '"%s" -I elf64-x86-64 -O elf64-x86-64 
--set-section-alignment .upld.upld_info=16 --set-section-alignment 
.upld.uefi_fv=16 %s'%(LlvmObjcopyPath, EntryOutputDir)
+remove_section = f"{LlvmObjcopyPath} -I {ObjCopyFlag} -O {ObjCopyFlag} 
--remove-section .upld_info --remove-section .upld.uefi_fv {EntryOutputDir}"
+add_section= f"{LlvmObjcopyPath} -I {ObjCopyFlag} -O {ObjCopyFlag} 
--add-section .upld_info={UpldInfoFile} --add-section 
.upld.uefi_fv={FvOutputDir} {EntryOutputDir}"
+set_section= f"{LlvmObjcopyPath} -I {ObjCopyFlag} -O {ObjCopyFlag} 
--set-section-alignment .upld.upld_info=16 --set-section-alignment 
.upld.uefi_fv=16 {EntryOutputDir}"
 RunCommand(remove_section)
 RunCommand(add_section)
 RunCommand(set_section)
--
2.31.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#89205): https://edk2.groups.io/g/devel/message/89205
Mute This Topic: https://groups.io/mt/90553049/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 2/2] UefiPayloadPkg: Keep reserved MMIO at runtime

2022-04-14 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Akihiko Odaki  
Sent: Sunday, April 10, 2022 7:47 PM
Cc: devel@edk2.groups.io; Dong, Guo ; Wang, Jian J 
; Gao, Liming ; Bi, Dandan 
; Kinney, Michael D ; Liu, 
Zhiguang ; Ni, Ray ; Ma, Maurice 
; You, Benjamin ; Akihiko Odaki 

Subject: [PATCH v2 2/2] UefiPayloadPkg: Keep reserved MMIO at runtime

Signed-off-by: Akihiko Odaki 
---
 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c 
b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
index 0fed1e3691..a50f1c0271 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -74,7 +74,8 @@ MemInfoCallbackMmio (
  EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |

  EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |

  EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |

- EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE;

+ EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |

+ EFI_RESOURCE_ATTRIBUTE_RUNTIME;

 

   BuildResourceDescriptorHob (Type, Attribue, (EFI_PHYSICAL_ADDRESS)Base, 
Size);

   DEBUG ((DEBUG_INFO, "buildhob: base = 0x%lx, size = 0x%lx, type = 0x%x\n", 
Base, Size, Type));

-- 
2.35.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88914): https://edk2.groups.io/g/devel/message/88914
Mute This Topic: https://groups.io/mt/90407108/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v4 8/8] UefiPayloadPkg: Add VariableFlashInfoLib

2022-04-13 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Michael Kubacki
Sent: Tuesday, April 12, 2022 9:30 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Ma, Maurice 
; You, Benjamin ; Rhodes, Sean 

Subject: [edk2-devel] [PATCH v4 8/8] UefiPayloadPkg: Add VariableFlashInfoLib

From: Michael Kubacki 

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3479

Adds an instance of VariableFlashInfoLib to the platform build as it is a new 
library class introduced in MdeModulePkg.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Michael Kubacki 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 17b30589e77c..4d9bbc80c866 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -272,6 +272,7 @@ [LibraryClasses]
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
   
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.inf
   
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
+  
+ VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/Bas
+ eVariableFlashInfoLib.inf
   VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
   
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
 
--
2.28.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88795): https://edk2.groups.io/g/devel/message/88795
Mute This Topic: https://groups.io/mt/90421985/1781375
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.d...@intel.com]
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88899): https://edk2.groups.io/g/devel/message/88899
Mute This Topic: https://groups.io/mt/90421985/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel][PATCH] UefiPayloadPkg: Fix the build failure

2022-04-13 Thread Guo Dong
From: Guo Dong 

When Quite parameter is not provided, its default value would
be "None" instead of "". So update its default value not to
impact the build.

Cc: Ray Ni 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Guo Dong 
---
 UefiPayloadPkg/UniversalPayloadBuild.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py 
b/UefiPayloadPkg/UniversalPayloadBuild.py
index 2796c310a7..99410d244d 100644
--- a/UefiPayloadPkg/UniversalPayloadBuild.py
+++ b/UefiPayloadPkg/UniversalPayloadBuild.py
@@ -53,7 +53,7 @@ def RunCommand(cmd):
 def BuildUniversalPayload(Args, MacroList):
 BuildTarget = Args.Target
 ToolChain = Args.ToolChain
-Quiet = Args.Quiet
+Quiet = "--quiet"  if Args.Quiet else ""
 BuildArch = "X64" if Args.Arch == 'X64' else "IA32 -a X64"
 ElfToolChain = 'CLANGDWARF'
 
@@ -121,7 +121,7 @@ def main():
 parser.add_argument('-a', '--Arch', choices=['IA32', 'X64'], help='Specify 
the ARCH for payload entry module. Default build X64 image.', default ='X64')
 parser.add_argument("-D", "--Macro", action="append", 
default=["UNIVERSAL_PAYLOAD=TRUE"])
 parser.add_argument('-i', '--ImageId', type=str, help='Specify payload ID 
(16 bytes maximal).', default ='UEFI')
-parser.add_argument('-q', '--Quiet')
+parser.add_argument('-q', '--Quiet', action='store_true', help='Disable 
all build messages except FATAL ERRORS.')
 MacroList = {}
 args = parser.parse_args()
 if args.Macro is not None:
-- 
2.35.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#3): https://edk2.groups.io/g/devel/message/3
Mute This Topic: https://groups.io/mt/90450653/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 1/8] MdeModulePkg: Add Variable Flash Info HOB

2022-04-11 Thread Guo Dong

Thanks for the update. It looks good to me.
Hopefully the variable modules would report errors gracefully if the variable 
HOB doesn't meet the expectation.

Thanks,
Guo

-Original Message-
From: Michael Kubacki  
Sent: Monday, April 11, 2022 10:48 AM
To: devel@edk2.groups.io; Dong, Guo 
Cc: Wang, Jian J ; Wu, Hao A ; Gao, 
Liming 
Subject: Re: [edk2-devel] [PATCH v2 1/8] MdeModulePkg: Add Variable Flash Info 
HOB

I renamed the fields and added comments to the interface file in the v3 patch 
series.

V3: https://edk2.groups.io/g/devel/message/88709
CI PR: https://github.com/tianocore/edk2/pull/2762

That patch series includes all feedback I have received. Maintainers, please 
review that series as soon as possible.

Regards,
Michael

On 4/10/2022 7:22 PM, Guo Dong wrote:
> 
> Does the range (NvStorageBaseAddress, NvStorageLength) includes FTW spare 
> range and FTW working range?
> If not, maybe rename them as  (NvVariableBaseAddress, NvVariableLength) to 
> make it clear.
> 
> For these 3 ranges, are there any other requirements (e.g. base address must 
> be 4KB aligned, or FtwSpaceLength >= NvVariablelength)?
> If yes, had better add to this interface file to make the HOB producer easy 
> to build the HOB.
> 
> Thanks,
> Guo
> 
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Michael 
> Kubacki
> Sent: Friday, April 8, 2022 2:17 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J ; Wu, Hao A 
> ; Gao, Liming 
> Subject: [edk2-devel] [PATCH v2 1/8] MdeModulePkg: Add Variable Flash 
> Info HOB
> 
> From: Michael Kubacki 
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3479
> 
> Adds a new GUID that is used to identify a HOB that passes variable flash 
> information to UEFI variable drivers in HOB consumption phases such as DXE, 
> Traditional MM, and Standalone MM.
> 
> This information was previously passed directly with PCDs such as 
> EfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
> and gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize.
> 
> However, the Standalone MM variable driver instance does not have direct 
> access to the PCD database. Therefore, this HOB will first be considered as 
> the source for variable flash information and if platforms do not produce the 
> HOB, reading the information from the PCDs directly will be a backup to 
> provide backward compatibility.
> 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Liming Gao 
> Signed-off-by: Michael Kubacki 
> ---
>   MdeModulePkg/Include/Guid/VariableFlashInfo.h | 39 
>   MdeModulePkg/MdeModulePkg.dec |  4 ++
>   2 files changed, 43 insertions(+)
> 
> diff --git a/MdeModulePkg/Include/Guid/VariableFlashInfo.h 
> b/MdeModulePkg/Include/Guid/VariableFlashInfo.h
> new file mode 100644
> index ..e526e362aab9
> --- /dev/null
> +++ b/MdeModulePkg/Include/Guid/VariableFlashInfo.h
> @@ -0,0 +1,39 @@
> +/** @file
> +  This file defines the GUID and data structure used to pass 
> +information about
> +  a variable store mapped on flash (i.e. a MMIO firmware volume) to the DXE 
> and MM environment.
> +
> +  Copyright (c) Microsoft Corporation.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef VARIABLE_FLASH_INFO_H_
> +#define VARIABLE_FLASH_INFO_H_
> +
> +#define VARIABLE_FLASH_INFO_HOB_GUID \
> +  { 0x5d11c653, 0x8154, 0x4ac3, { 0xa8, 0xc2, 0xfb, 0xa2, 0x89, 0x20, 
> +0xfc, 0x90 }}
> +
> +#define VARIABLE_FLASH_INFO_HOB_VERSION  1
> +
> +extern EFI_GUID  gVariableFlashInfoHobGuid;
> +
> +#pragma pack (push, 1)
> +
> +///
> +/// This structure can be used to describe UEFI variable /// flash 
> +information.
> +///
> +typedef struct {
> +  UINT32  Version;
> +  EFI_PHYSICAL_ADDRESSNvStorageBaseAddress;
> +  UINT64  NvStorageLength;
> +  EFI_PHYSICAL_ADDRESSFtwSpareBaseAddress;
> +  UINT64  FtwSpareLength;
> +  EFI_PHYSICAL_ADDRESSFtwWorkingBaseAddress;
> +  UINT64  FtwWorkingLength;
> +} VARIABLE_FLASH_INFO;
> +
> +#pragma pack (pop)
> +
> +#endif
> diff --git a/MdeModulePkg/MdeModulePkg.dec 
> b/MdeModulePkg/MdeModulePkg.dec index cf79292ec877..4e82f5836096 
> 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -226,6 +226,10 @@ [Guids]
> #  Include/Guid/SmmVariableCommon.h
> gSmmVariableWriteGuid  = { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 
> 0xa7, 0xe7, 0xdc, 0xaa, 0x3b, 0xbd, 0xf3 }}
>   
> +  ## Guid of the variable flash information HOB.
> +  #  Include/Guid/VariableFlashInfo.h  gVariableFlashInfoHobGuid = { 
> + 0x5d11c653, 0x8154, 0x4ac3, { 0xa8, 0xc2, 

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Keep reserved MMIO at runtime

2022-04-10 Thread Guo Dong


This patch changed both MdeModulePkg and UefiPayloadPkg, had better split them 
into 2 patches?

Thanks,
Guo

-Original Message-
From: Akihiko Odaki  
Sent: Friday, April 8, 2022 7:25 PM
Cc: devel@edk2.groups.io; Wang, Jian J ; Gao, Liming 
; Bi, Dandan ; Kinney, Michael D 
; Liu, Zhiguang ; Dong, Guo 
; Ni, Ray ; Ma, Maurice 
; You, Benjamin ; Akihiko Odaki 

Subject: [PATCH] UefiPayloadPkg: Keep reserved MMIO at runtime

Signed-off-by: Akihiko Odaki 
---
 MdeModulePkg/Core/Dxe/Gcd/Gcd.c| 9 +
 MdePkg/Include/Pi/PiHob.h  | 2 ++
 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 3 ++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c 
index 3763467bdb..623b316c61 100644
--- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
+++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c
@@ -2628,6 +2628,15 @@ CoreInitializeGcdServices (
ResourceHob->ResourceLength,
Capabilities);++if (!EFI_ERROR (Status) &&+ 
   (ResourceHob->ResourceAttribute & EFI_RESOURCE_ATTRIBUTE_RUNTIME) == 
EFI_RESOURCE_ATTRIBUTE_RUNTIME) {+  Status = 
CoreSetMemorySpaceAttributes(+ResourceHob->PhysicalStart,+  
  ResourceHob->ResourceLength,+EFI_MEMORY_RUNTIME+);+   
 }   }if (GcdIoType != EfiGcdIoTypeNonExistent) {diff --git 
a/MdePkg/Include/Pi/PiHob.h b/MdePkg/Include/Pi/PiHob.h
index e9f0ab4309..92bacbe62c 100644
--- a/MdePkg/Include/Pi/PiHob.h
+++ b/MdePkg/Include/Pi/PiHob.h
@@ -296,6 +296,8 @@ typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE;  // #define 
EFI_RESOURCE_ATTRIBUTE_MORE_RELIABLE  0x0200 +#define 
EFI_RESOURCE_ATTRIBUTE_RUNTIME 0x0400+ /// /// Describes the resource 
properties of all fixed, /// nonrelocatable resource ranges found on the 
processordiff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c 
b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
index 0fed1e3691..a50f1c0271 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -74,7 +74,8 @@ MemInfoCallbackMmio (
  EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |  
EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |  
EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |- 
EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE;+ 
EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |+ 
EFI_RESOURCE_ATTRIBUTE_RUNTIME;BuildResourceDescriptorHob (Type, Attribue, 
(EFI_PHYSICAL_ADDRESS)Base, Size);   DEBUG ((DEBUG_INFO, "buildhob: base = 
0x%lx, size = 0x%lx, type = 0x%x\n", Base, Size, Type));-- 
2.35.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88668): https://edk2.groups.io/g/devel/message/88668
Mute This Topic: https://groups.io/mt/90384323/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 1/8] MdeModulePkg: Add Variable Flash Info HOB

2022-04-10 Thread Guo Dong


Does the range (NvStorageBaseAddress, NvStorageLength) includes FTW spare range 
and FTW working range?
If not, maybe rename them as  (NvVariableBaseAddress, NvVariableLength) to make 
it clear.

For these 3 ranges, are there any other requirements (e.g. base address must be 
4KB aligned, or FtwSpaceLength >= NvVariablelength)?
If yes, had better add to this interface file to make the HOB producer easy to 
build the HOB.

Thanks,
Guo

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Michael Kubacki
Sent: Friday, April 8, 2022 2:17 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J ; Wu, Hao A ; Gao, 
Liming 
Subject: [edk2-devel] [PATCH v2 1/8] MdeModulePkg: Add Variable Flash Info HOB

From: Michael Kubacki 

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3479

Adds a new GUID that is used to identify a HOB that passes variable flash 
information to UEFI variable drivers in HOB consumption phases such as DXE, 
Traditional MM, and Standalone MM.

This information was previously passed directly with PCDs such as 
EfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
and gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize.

However, the Standalone MM variable driver instance does not have direct access 
to the PCD database. Therefore, this HOB will first be considered as the source 
for variable flash information and if platforms do not produce the HOB, reading 
the information from the PCDs directly will be a backup to provide backward 
compatibility.

Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Liming Gao 
Signed-off-by: Michael Kubacki 
---
 MdeModulePkg/Include/Guid/VariableFlashInfo.h | 39 
 MdeModulePkg/MdeModulePkg.dec |  4 ++
 2 files changed, 43 insertions(+)

diff --git a/MdeModulePkg/Include/Guid/VariableFlashInfo.h 
b/MdeModulePkg/Include/Guid/VariableFlashInfo.h
new file mode 100644
index ..e526e362aab9
--- /dev/null
+++ b/MdeModulePkg/Include/Guid/VariableFlashInfo.h
@@ -0,0 +1,39 @@
+/** @file
+  This file defines the GUID and data structure used to pass 
+information about
+  a variable store mapped on flash (i.e. a MMIO firmware volume) to the DXE 
and MM environment.
+
+  Copyright (c) Microsoft Corporation.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef VARIABLE_FLASH_INFO_H_
+#define VARIABLE_FLASH_INFO_H_
+
+#define VARIABLE_FLASH_INFO_HOB_GUID \
+  { 0x5d11c653, 0x8154, 0x4ac3, { 0xa8, 0xc2, 0xfb, 0xa2, 0x89, 0x20, 
+0xfc, 0x90 }}
+
+#define VARIABLE_FLASH_INFO_HOB_VERSION  1
+
+extern EFI_GUID  gVariableFlashInfoHobGuid;
+
+#pragma pack (push, 1)
+
+///
+/// This structure can be used to describe UEFI variable /// flash 
+information.
+///
+typedef struct {
+  UINT32  Version;
+  EFI_PHYSICAL_ADDRESSNvStorageBaseAddress;
+  UINT64  NvStorageLength;
+  EFI_PHYSICAL_ADDRESSFtwSpareBaseAddress;
+  UINT64  FtwSpareLength;
+  EFI_PHYSICAL_ADDRESSFtwWorkingBaseAddress;
+  UINT64  FtwWorkingLength;
+} VARIABLE_FLASH_INFO;
+
+#pragma pack (pop)
+
+#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec 
index cf79292ec877..4e82f5836096 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -226,6 +226,10 @@ [Guids]
   #  Include/Guid/SmmVariableCommon.h
   gSmmVariableWriteGuid  = { 0x93ba1826, 0xdffb, 0x45dd, { 0x82, 0xa7, 0xe7, 
0xdc, 0xaa, 0x3b, 0xbd, 0xf3 }}
 
+  ## Guid of the variable flash information HOB.
+  #  Include/Guid/VariableFlashInfo.h
+  gVariableFlashInfoHobGuid = { 0x5d11c653, 0x8154, 0x4ac3, { 0xa8, 
+ 0xc2, 0xfb, 0xa2, 0x89, 0x20, 0xfc, 0x90 }}
+
   ## Performance protocol guid that also acts as the performance HOB guid and 
performance variable GUID
   #  Include/Guid/Performance.h
   gPerformanceProtocolGuid   = { 0x76B6BDFA, 0x2ACD, 0x4462, { 0x9E, 0x3F, 
0xCB, 0x58, 0xC9, 0x69, 0xD9, 0x37 } }
--
2.28.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88650): https://edk2.groups.io/g/devel/message/88650
Mute This Topic: https://groups.io/mt/90345653/1781375
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.d...@intel.com]
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88667): https://edk2.groups.io/g/devel/message/88667
Mute This Topic: https://groups.io/mt/90345653/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix bug that Elf loader doesn't relocate in some case

2022-04-10 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Liu, Zhiguang  
Sent: Wednesday, April 6, 2022 6:52 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Ma, Maurice 
; You, Benjamin ; Rhodes, Sean 

Subject: [PATCH] UefiPayloadPkg: Fix bug that Elf loader doesn't relocate in 
some case

Current implementation of the Elf loader reuses the same memory range if the 
desired memory range is covered by [file base, file base + file size].
However, there is a potentil bug, for example:
If the first segment is located at 0x1000, and the desired address is 0x2000. 
While the second segment is located at 0x2000, and the desired address is 
0x2000. When we parse and try to load the elf file, current implementation may 
load the first segment at 0x2000, and override second segment.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 

Signed-off-by: Zhiguang Liu 
---
 UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c 
b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c
index 2a6305c67b..c7dfae14af 100644
--- a/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c
+++ b/UefiPayloadPkg/PayloadLoaderPeim/ElfLib/ElfLib.c
@@ -312,6 +312,13 @@ ParseElfImage (
   ElfCt->ReloadRequired = TRUE; } +if (SegInfo.MemAddr != 
((UINTN)ElfCt->FileBase + SegInfo.Offset)) {+  //+  // Need to relocate 
if the desired address is not the current address+  //+  
ElfCt->ReloadRequired = TRUE;+}+ if (Base > (SegInfo.MemAddr & 
~(EFI_PAGE_SIZE - 1))) {   Base = SegInfo.MemAddr & ~(EFI_PAGE_SIZE - 1);   
  }-- 
2.32.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88666): https://edk2.groups.io/g/devel/message/88666
Mute This Topic: https://groups.io/mt/90289885/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 6/6] UefiPayloadPkg: Add CpuLib to module INFs that depend on UefiCpuLib.

2022-04-10 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Pu, Yu  
Sent: Thursday, March 31, 2022 10:22 PM
To: devel@edk2.groups.io
Cc: Pu, Yu ; Dong, Guo ; Ni, Ray 
; Ma, Maurice ; You, Benjamin 
; Rhodes, Sean 
Subject: [PATCH v1 6/6] UefiPayloadPkg: Add CpuLib to module INFs that depend 
on UefiCpuLib.

Step 1 to merge UefiCpuLib to CpuLib.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Yu Pu 
---
 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h| 1 +
 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf  | 1 +
 UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf | 1 +
 3 files changed, 3 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h 
b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
index 56e0a4c639a0..d1c7425b28f2 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.h
@@ -23,6 +23,7 @@
 #include 

 #include 

 #include 

+#include 

 #include 

 #include 

 #include 

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf 
b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
index c4e4339ede4b..95446dd99729 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
@@ -54,6 +54,7 @@
   HobLib

   PeCoffLib

   PlatformSupportLib

+  CpuLib

   UefiCpuLib

 

 [Guids]

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf 
b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
index 80af5afe0a3f..3b4836042a06 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf
@@ -52,6 +52,7 @@
   IoLib

   HobLib

   PeCoffLib

+  CpuLib

   UefiCpuLib

 

 [Guids]

-- 
2.30.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88665): https://edk2.groups.io/g/devel/message/88665
Mute This Topic: https://groups.io/mt/90179542/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 1/1] UefiPayloadPkg: Add dependency of VariableSmm driver.

2022-04-10 Thread Guo Dong

Reviewed-by: Guo Dong 

-Original Message-
From: Li, Zhihao  
Sent: Tuesday, March 29, 2022 12:12 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; You, Benjamin 
; Rhodes, Sean ; Fu, Siyuan 

Subject: [PATCH v1 1/1] UefiPayloadPkg: Add dependency of VariableSmm driver.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3882

UefiCpuPkg define a new Protocol with the new services 
SmmWaitForAllProcessor(), which can be used by SMI handler to optionally wait 
for other APs to complete SMM rendezvous in relaxed AP mode.

VariableSmm driver need use SmmCpuRendezvousLib, So add SmmCpuRendezvousLib 
dependency in UefiPayloadPkg which use VariableSmm driver.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Benjamin You 
Cc: Sean Rhodes 
Cc: Siyuan Fu 

Signed-off-by: Zhihao Li 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 14a8d157a292..a9feba47bbd9 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -3,7 +3,7 @@
 # # Provides drivers and definitions to create uefi payload for bootloaders. 
#-# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.+# 
Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved. # 
Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: 
BSD-2-Clause-Patent #@@ -352,6 +352,7 @@
   SmmCpuFeaturesLib|UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf 
  
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
   
ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf+
  
SmmCpuRendezvousLib|UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf
 !if $(PERFORMANCE_MEASUREMENT_ENABLE)   
PerformanceLib|MdeModulePkg/Library/SmmPerformanceLib/SmmPerformanceLib.inf 
!endif-- 
2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88664): https://edk2.groups.io/g/devel/message/88664
Mute This Topic: https://groups.io/mt/90102732/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Patch V2 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib instance

2022-03-30 Thread Guo Dong


This patch has both UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL and 
UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL.
Please double check this patch if it could pass build.

Thanks,
Guo

-Original Message-
From: Xie, Yuanhao  
Sent: Wednesday, March 30, 2022 2:17 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Maurice Ma 
; You, Benjamin ; Rhodes, Sean 

Subject: [Patch V2 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib 
instance

It consumes the HOB defined in
UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h, and allow bootloader  to 
config DebugPrintErrorLevel.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 

Signed-off-by: Yuanhao Xie 
---
 UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h 
  | 31 +++
 UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c 
  | 77 
+
 
UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.inf
 | 39 +++
 UefiPayloadPkg/UefiPayloadPkg.dec  
  |  2 +-
 4 files changed, 148 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h 
b/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h
new file mode 100644
index 00..5bc84039db
--- /dev/null
+++ b/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h
@@ -0,0 +1,31 @@
+/** @file
+  Define the structure for Debug Print Error Level Guid Hob.
+
+Copyright (c) 2022, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_H_
+#define UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_H_
+
+#include 
+#include 
+
+#pragma pack (1)
+//
+// ErrorLevel: The error level of the debug message.
+// Bits for ErrorLevel is declared in
+// edk2\MdePkg\Include\Library\DebugLib.h
+//
+typedef struct {
+  UNIVERSAL_PAYLOAD_GENERIC_HEADERHeader;
+  UINT32  ErrorLevel;
+} UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL;
+
+#pragma pack()
+
+#define UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION  1
+
+extern GUID  gEdkiiDebugPrintErrorLevelGuid; #endif
diff --git 
a/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c
 
b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c
new file mode 100644
index 00..7f087e5c06
--- /dev/null
+++ b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorL
+++ evelLibHob.c
@@ -0,0 +1,77 @@
+/** @file
+  Debug Print Error Level library instance that retrieves
+  the DebugPrintErrorLevel from bootloader.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+STATIC UINT32  gDebugPrintErrorLevel;
+STATIC BOOLEAN gDebugPrintErrorLevelInitialized = FALSE;
+/**
+  Returns the debug print error level mask for the current module.
+
+  @return  Debug print error level mask for the current module.
+
+**/
+UINT32
+EFIAPI
+GetDebugPrintErrorLevel (
+  VOID
+  )
+{
+  VOID*GuidHob;
+  UNIVERSAL_PAYLOAD_GENERIC_HEADER*GenericHeader;
+  UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL   *DebugPrintErrorLevel;
+
+  if (!gDebugPrintErrorLevelInitialized) {
+gDebugPrintErrorLevelInitialized = TRUE;
+gDebugPrintErrorLevel = PcdGet32(PcdDebugPrintErrorLevel);
+GuidHob = GetFirstGuidHob ();
+if (GuidHob != NULL) {
+  GenericHeader = (UNIVERSAL_PAYLOAD_GENERIC_HEADER *)GET_GUID_HOB_DATA 
(GuidHob);
+  if ((sizeof (UNIVERSAL_PAYLOAD_GENERIC_HEADER) < GET_GUID_HOB_DATA_SIZE 
(GuidHob)) 
+  && (GenericHeader->Length <= GET_GUID_HOB_DATA_SIZE (GuidHob))) {
+if (GenericHeader->Revision == 
UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION) {
+  DebugPrintErrorLevel =  (UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL 
*)GET_GUID_HOB_DATA (GuidHob);
+  if (DebugPrintErrorLevel->Header.Length > 
UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD (UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL, 
ErrorLevel)) {
+gDebugPrintErrorLevel = DebugPrintErrorLevel->ErrorLevel;  
+  }
+}
+  } 
+}
+  }
+  return gDebugPrintErrorLevel;
+}
+
+/**
+  Sets the global debug print error level mask fpr the entire platform.
+
+  @param   ErrorLevel Global debug print error level.
+
+  @retval  TRUE   The debug print error level mask was sucessfully set.
+  @retval  FALSE  The debug print error level mask could not be set.
+
+**/
+BOOLEAN
+EFIAPI
+SetDebugPrintErrorLevel (
+  UINT32  ErrorLevel
+  )
+{
+  //
+  // This library uinstance does not support setting the global debug 
+print error
+  // level mask.
+  //
+  return FALSE;
+}
diff --

Re: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Fix PciHostBridgeLib

2022-03-30 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Sean Rhodes  
Sent: Wednesday, March 30, 2022 11:29 AM
To: devel@edk2.groups.io
Cc: Tan, Lean Sheng ; Dong, Guo ; 
Ni, Ray ; Ma, Maurice ; You, Benjamin 
; Rhodes, Sean ; Patrick Rudolph 

Subject: [PATCH 1/2] UefiPayloadPkg: Fix PciHostBridgeLib

From: Lean Sheng Tan 

Don't assume a 64bit register always holds an address greater than 4GB.
Check the value in the register and decide which Aperature it should be 
assigned to.

Fixes assertion
"ASSERT [PciHostBridgeDxe] Bridge->MemAbove4G.Base >= 0x0001ULL".

Tested with coreboot as bootloader on platforms that have PCI resource above 
4GiB and on platforms that don't have resource above 4GiB.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Patrick Rudolph 
---
 .../Library/PciHostBridgeLib/PciHostBridgeSupport.c | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c 
b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
index 8a890b6b53..e1faa24ae7 100644
--- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
+++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c
@@ -354,14 +354,19 @@ ScanForRootBridges (
   Base  = ((UINT32)Pci.Bridge.PrefetchableMemoryBase & 0xfff0) << 16;  
 Limit = (((UINT32)Pci.Bridge.PrefetchableMemoryLimit & 0xfff0) 
   << 16) | 0xf;-  MemAperture = +   if (Value 
== BIT0) {-Base   |= LShiftU64 
(Pci.Bridge.PrefetchableBaseUpper32, 32);-Limit  |= LShiftU64 
(Pci.Bridge.PrefetchableLimitUpper32, 32);-MemAperture = 
+Base  |= LShiftU64 
(Pci.Bridge.PrefetchableBaseUpper32, 32);+Limit |= LShiftU64 
(Pci.Bridge.PrefetchableLimitUpper32, 32);   }if ((Base > 
0) && (Base < Limit)) {+if (Base < BASE_4GB) {+  
MemAperture = +} else {+  MemAperture = 
+}+ if (MemAperture->Base > Base) { 
  MemAperture->Base = Base; }-- 
2.32.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88274): https://edk2.groups.io/g/devel/message/88274
Mute This Topic: https://groups.io/mt/90138164/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 15/18] UefiPayloadPkg/Library/PlatformBootManagerLib: Remove broken VGA detection

2022-03-29 Thread Guo Dong

It was merged.

From: Sean Rhodes 
Sent: Tuesday, March 29, 2022 11:05 AM
To: Dong, Guo 
Cc: devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH 15/18] 
UefiPayloadPkg/Library/PlatformBootManagerLib: Remove broken VGA detection

Hi Guo

Merge conflict is resolved

Thanks

Sean


On Tue, 29 Mar 2022 at 19:01, Dong, Guo 
mailto:guo.d...@intel.com>> wrote:

Hi Sean,

I would help solve merge conflict and then merge 
https://github.com/tianocore/edk2/pull/2654.
For another patch, please contact MdeModulePkg maintainer to help merge it.

Thanks,
Guo

From: Sean Rhodes mailto:sean@starlabs.systems>>
Sent: Tuesday, March 29, 2022 10:35 AM
To: Dong, Guo mailto:guo.d...@intel.com>>
Cc: devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH 15/18] 
UefiPayloadPkg/Library/PlatformBootManagerLib: Remove broken VGA detection

Hey

No problem and thank you.

That have been reviewed, it's just these two:
https://github.com/tianocore/edk2/pull/2654
https://github.com/tianocore/edk2/pull/2485

Thanks

Sean


On Tue, 29 Mar 2022 at 18:32, Dong, Guo 
mailto:guo.d...@intel.com>> wrote:

Hi Sean,

Sorry for late response. I merged several UEFI payload packages yesterday 
including this one.
Please let me know if you have other patches pending to merge (The patches 
passed code review).

Thanks,
Guo

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Sean Rhodes
Sent: Monday, March 21, 2022 2:49 AM
To: Dong, Guo mailto:guo.d...@intel.com>>; 
devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH 15/18] 
UefiPayloadPkg/Library/PlatformBootManagerLib: Remove broken VGA detection

Hey Guo

Can I chase when this patch will be merged?

Many thanks

Sean



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88186): https://edk2.groups.io/g/devel/message/88186
Mute This Topic: https://groups.io/mt/89056153/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 15/18] UefiPayloadPkg/Library/PlatformBootManagerLib: Remove broken VGA detection

2022-03-29 Thread Guo Dong

Hi Sean,

I would help solve merge conflict and then merge 
https://github.com/tianocore/edk2/pull/2654.
For another patch, please contact MdeModulePkg maintainer to help merge it.

Thanks,
Guo

From: Sean Rhodes 
Sent: Tuesday, March 29, 2022 10:35 AM
To: Dong, Guo 
Cc: devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH 15/18] 
UefiPayloadPkg/Library/PlatformBootManagerLib: Remove broken VGA detection

Hey

No problem and thank you.

That have been reviewed, it's just these two:
https://github.com/tianocore/edk2/pull/2654
https://github.com/tianocore/edk2/pull/2485

Thanks

Sean


On Tue, 29 Mar 2022 at 18:32, Dong, Guo 
mailto:guo.d...@intel.com>> wrote:

Hi Sean,

Sorry for late response. I merged several UEFI payload packages yesterday 
including this one.
Please let me know if you have other patches pending to merge (The patches 
passed code review).

Thanks,
Guo

From: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>> On Behalf Of Sean Rhodes
Sent: Monday, March 21, 2022 2:49 AM
To: Dong, Guo mailto:guo.d...@intel.com>>; 
devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH 15/18] 
UefiPayloadPkg/Library/PlatformBootManagerLib: Remove broken VGA detection

Hey Guo

Can I chase when this patch will be merged?

Many thanks

Sean



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88183): https://edk2.groups.io/g/devel/message/88183
Mute This Topic: https://groups.io/mt/89056153/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel][PATCH] UefiPayloadPkg: Support IA32 Build

2022-03-29 Thread Guo Dong
From: Guo Dong 

The payload entry module should support to build as IA32 image
beside X64 image so that it could work with 32bit bootloaders.

This patch adds a option build parameter for arch selection.

Cc: Ray Ni 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Guo Dong 
---
 UefiPayloadPkg/UniversalPayloadBuild.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UniversalPayloadBuild.py 
b/UefiPayloadPkg/UniversalPayloadBuild.py
index e624ec5874..ac965766c7 100644
--- a/UefiPayloadPkg/UniversalPayloadBuild.py
+++ b/UefiPayloadPkg/UniversalPayloadBuild.py
@@ -53,6 +53,7 @@ def RunCommand(cmd):
 def BuildUniversalPayload(Args, MacroList):
 BuildTarget = Args.Target
 ToolChain = Args.ToolChain
+BuildArch = "X64" if Args.Arch == 'X64' else "IA32 -a X64"
 ElfToolChain = 'CLANGDWARF'
 
 EntryModuleInf = 
os.path.normpath("UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf")
@@ -87,7 +88,7 @@ def BuildUniversalPayload(Args, MacroList):
 #
 # Building Universal Payload entry.
 #
-BuildModule = f"build -p {DscPath} -b {BuildTarget} -a X64 -m 
{EntryModuleInf} -t {ElfToolChain} -y {ModuleReportPath}"
+BuildModule = f"build -p {DscPath} -b {BuildTarget} -a {BuildArch} -m 
{EntryModuleInf} -t {ElfToolChain} -y {ModuleReportPath}"
 BuildModule += Defines
 RunCommand(BuildModule)
 
@@ -116,6 +117,7 @@ def main():
 parser = argparse.ArgumentParser(description='For building Universal 
Payload')
 parser.add_argument('-t', '--ToolChain')
 parser.add_argument('-b', '--Target', default='DEBUG')
+parser.add_argument('-a', '--Arch', choices=['IA32', 'X64'], help='Specify 
the ARCH for payload entry module. Default build X64 image.', default ='X64')
 parser.add_argument("-D", "--Macro", action="append", 
default=["UNIVERSAL_PAYLOAD=TRUE"])
 parser.add_argument('-i', '--ImageId', type=str, help='Specify payload ID 
(16 bytes maximal).', default ='UEFI')
 MacroList = {}
-- 
2.35.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88181): https://edk2.groups.io/g/devel/message/88181
Mute This Topic: https://groups.io/mt/90113865/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 15/18] UefiPayloadPkg/Library/PlatformBootManagerLib: Remove broken VGA detection

2022-03-29 Thread Guo Dong

Hi Sean,

Sorry for late response. I merged several UEFI payload packages yesterday 
including this one.
Please let me know if you have other patches pending to merge (The patches 
passed code review).

Thanks,
Guo

From: devel@edk2.groups.io  On Behalf Of Sean Rhodes
Sent: Monday, March 21, 2022 2:49 AM
To: Dong, Guo ; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH 15/18] 
UefiPayloadPkg/Library/PlatformBootManagerLib: Remove broken VGA detection

Hey Guo

Can I chase when this patch will be merged?

Many thanks

Sean



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88178): https://edk2.groups.io/g/devel/message/88178
Mute This Topic: https://groups.io/mt/89056153/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib instance

2022-03-29 Thread Guo Dong


Hi Yuanhao,

The suggestion looks good to me.

Thanks,
Guo

-Original Message-
From: Xie, Yuanhao  
Sent: Monday, March 28, 2022 11:54 PM
To: Dong, Guo ; Ni, Ray 
Cc: You, Benjamin ; Rhodes, Sean 
; devel@edk2.groups.io
Subject: RE: [PATCH 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib 
instance

Hi Guo,

Sorry for the late response.
Just as we discussed today, and also from the suggestions by Ray, in the new 
patch I will 

1. changed "UNIVERSAL_PAYLOAD_ DEBUG_PRINT_ERROR_LEVEL" to 
"UEFI_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL", and 2. add a comment referencing 
Debuglib.h to declare bits for "ErrorLevel" parameters. The reason why better 
not just declare those common bits is because it can cause confusion if other 
developers still use the rest.

What do you think?

Thanks,
Yuanhao

-Original Message-
From: Dong, Guo 
Sent: Tuesday, March 29, 2022 12:00 PM
To: Xie, Yuanhao ; devel@edk2.groups.io
Cc: Ni, Ray ; You, Benjamin ; Rhodes, 
Sean 
Subject: RE: [PATCH 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib 
instance


I replied in another email. It looks the comments are not addressed in this 
patch, especially on this comment:
In the DebugPrintErrorLevel.h, ErrorLevel is defined as UINT32, but its usage 
is not clear for bootloaders ( so need add more info in the header file)

Thanks,
Guo
-Original Message-
From: Xie, Yuanhao 
Sent: Sunday, March 27, 2022 10:59 PM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Maurice Ma 
; You, Benjamin ; Rhodes, Sean 

Subject: [PATCH 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib instance

It consumes the HOB defined in
UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h, and allow bootloader  to 
config DebugPrintErrorLevel.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 

Signed-off-by: Yuanhao Xie 
---
 UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h 
  | 27 +++
 UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c 
  | 77 
+
 
UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.inf
 | 39 +++
 UefiPayloadPkg/UefiPayloadPkg.dec  
  |  2 +-
 4 files changed, 144 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h 
b/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h
new file mode 100644
index 00..9a3f4eb28e
--- /dev/null
+++ b/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h
@@ -0,0 +1,27 @@
+/** @file
+  Define the structure for Debug Print Error Level Guid Hob.
+
+Copyright (c) 2022, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_H_
+#define UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_H_
+
+#include 
+#include 
+
+#pragma pack (1)
+
+typedef struct {
+  UNIVERSAL_PAYLOAD_GENERIC_HEADERHeader;
+  UINT32  ErrorLevel;
+} UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL;
+
+#pragma pack()
+
+#define UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION  1
+
+extern GUID  gEdkiiDebugPrintErrorLevelGuid; #endif
diff --git 
a/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c
 
b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c
new file mode 100644
index 00..18378249ab
--- /dev/null
+++ b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorL
+++ evelLibHob.c
@@ -0,0 +1,77 @@
+/** @file
+  Debug Print Error Level library instance that retrieves
+  the DebugPrintErrorLevel from bootloader.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+STATIC UINT32  gDebugPrintErrorLevel;
+STATIC BOOLEAN gDebugPrintErrorLevelInitialized = FALSE;
+/**
+  Returns the debug print error level mask for the current module.
+
+  @return  Debug print error level mask for the current module.
+
+**/
+UINT32
+EFIAPI
+GetDebugPrintErrorLevel (
+  VOID
+  )
+{
+  VOID*GuidHob;
+  UNIVERSAL_PAYLOAD_GENERIC_HEADER*GenericHeader;
+  UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL   *DebugPrintErrorLevel;
+
+  if (!gDebugPrintErrorLevelInitialized) {
+gDebugPrintErrorLevelInitialized = TRUE;
+gDebugPrintErrorLevel = PcdGet32(PcdDebugPrintErrorLevel);
+GuidHob = GetFirstGuidHob ();
+if (GuidHob != NULL) {
+  GenericHeader = (UNIVERSAL_PAYLOAD_GENERIC_HEADER *)GET_GUID_HOB_DATA 
(GuidHob);
+  if ((sizeof (UNIVERSAL_PAYLOAD_GENERIC_HEADER) < GET_GUID_HOB_DATA_SIZE 
(GuidHob)) 
+  && (GenericHeader->Length <= GET_GUID_HOB_DATA_SIZE (Gu

Re: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib instance

2022-03-28 Thread Guo Dong


I replied in another email. It looks the comments are not addressed in this 
patch, especially on this comment:
In the DebugPrintErrorLevel.h, ErrorLevel is defined as UINT32, but its usage 
is not clear for bootloaders ( so need add more info in the header file)

Thanks,
Guo
-Original Message-
From: Xie, Yuanhao  
Sent: Sunday, March 27, 2022 10:59 PM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Maurice Ma 
; You, Benjamin ; Rhodes, Sean 

Subject: [PATCH 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib instance

It consumes the HOB defined in
UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h, and allow bootloader  to 
config DebugPrintErrorLevel.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 

Signed-off-by: Yuanhao Xie 
---
 UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h 
  | 27 +++
 UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c 
  | 77 
+
 
UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.inf
 | 39 +++
 UefiPayloadPkg/UefiPayloadPkg.dec  
  |  2 +-
 4 files changed, 144 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h 
b/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h
new file mode 100644
index 00..9a3f4eb28e
--- /dev/null
+++ b/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h
@@ -0,0 +1,27 @@
+/** @file
+  Define the structure for Debug Print Error Level Guid Hob.
+
+Copyright (c) 2022, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_H_
+#define UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_H_
+
+#include 
+#include 
+
+#pragma pack (1)
+
+typedef struct {
+  UNIVERSAL_PAYLOAD_GENERIC_HEADERHeader;
+  UINT32  ErrorLevel;
+} UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL;
+
+#pragma pack()
+
+#define UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION  1
+
+extern GUID  gEdkiiDebugPrintErrorLevelGuid; #endif
diff --git 
a/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c
 
b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorLevelLibHob.c
new file mode 100644
index 00..18378249ab
--- /dev/null
+++ b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibHob/DebugPrintErrorL
+++ evelLibHob.c
@@ -0,0 +1,77 @@
+/** @file
+  Debug Print Error Level library instance that retrieves
+  the DebugPrintErrorLevel from bootloader.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+STATIC UINT32  gDebugPrintErrorLevel;
+STATIC BOOLEAN gDebugPrintErrorLevelInitialized = FALSE;
+/**
+  Returns the debug print error level mask for the current module.
+
+  @return  Debug print error level mask for the current module.
+
+**/
+UINT32
+EFIAPI
+GetDebugPrintErrorLevel (
+  VOID
+  )
+{
+  VOID*GuidHob;
+  UNIVERSAL_PAYLOAD_GENERIC_HEADER*GenericHeader;
+  UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL   *DebugPrintErrorLevel;
+
+  if (!gDebugPrintErrorLevelInitialized) {
+gDebugPrintErrorLevelInitialized = TRUE;
+gDebugPrintErrorLevel = PcdGet32(PcdDebugPrintErrorLevel);
+GuidHob = GetFirstGuidHob ();
+if (GuidHob != NULL) {
+  GenericHeader = (UNIVERSAL_PAYLOAD_GENERIC_HEADER *)GET_GUID_HOB_DATA 
(GuidHob);
+  if ((sizeof (UNIVERSAL_PAYLOAD_GENERIC_HEADER) < GET_GUID_HOB_DATA_SIZE 
(GuidHob)) 
+  && (GenericHeader->Length <= GET_GUID_HOB_DATA_SIZE (GuidHob))) {
+if (GenericHeader->Revision == 
UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION) {
+  DebugPrintErrorLevel =  (UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL 
*)GET_GUID_HOB_DATA (GuidHob);
+  if (DebugPrintErrorLevel->Header.Length > 
UNIVERSAL_PAYLOAD_SIZEOF_THROUGH_FIELD 
(UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL, ErrorLevel)) {
+gDebugPrintErrorLevel = DebugPrintErrorLevel->ErrorLevel;  
+  }
+}
+  } 
+}
+  }
+  return gDebugPrintErrorLevel;
+}
+
+/**
+  Sets the global debug print error level mask fpr the entire platform.
+
+  @param   ErrorLevel Global debug print error level.
+
+  @retval  TRUE   The debug print error level mask was sucessfully set.
+  @retval  FALSE  The debug print error level mask could not be set.
+
+**/
+BOOLEAN
+EFIAPI
+SetDebugPrintErrorLevel (
+  UINT32  ErrorLevel
+  )
+{
+  //
+  // This library uinstance does not support setting the global debug 
+print error
+  // level mask.
+  //
+  return FALSE;
+}
diff --git 
a/UefiPayloadPkg/Libra

Re: [edk2-devel] [PATCH 5/5] UefiPayloadPkg: Add support for Firmware Volume Block Protocol

2022-03-23 Thread Guo Dong

I think these questions could be answered in the attached email which I replied 
to Rudolph for similar questions.

Thanks,
Guo

From: devel@edk2.groups.io  On Behalf Of King Sumo
Sent: Wednesday, March 23, 2022 2:06 PM
To: devel@edk2.groups.io; Rhodes, Sean 
Cc: Dong, Guo 
Subject: Re: [edk2-devel] [PATCH 5/5] UefiPayloadPkg: Add support for Firmware 
Volume Block Protocol

Looks like for Guo's patch SMMSTORE driver is not needed since it implements a 
SpiFlashLib for accessing the SPI Flash controller (via hardware sequencer) of 
Intel CPU targets...
But this is for Universal Payload only right? I guess coreboot supports only 
the non-universal mode.
This stuff was tested only in SBL right?

On Wed, Mar 23, 2022 at 4:52 PM Sean Rhodes 
mailto:sean@starlabs.systems>> wrote:
Hey Guo

To have the parselib and not SMMSTORE support is a bit of a paradox; coreboot 
isn't fully functional without one. I think moving this and any subsequent 
patches into edk2-platforms will inevitably lead to forks, which isn't 
beneficial to anyone.

Is there any method (or ideally exception ;) ) you can suggest for allowing 
bootloader specific patches?

Many thanks

Sean



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87915): https://edk2.groups.io/g/devel/message/87915
Mute This Topic: https://groups.io/mt/89923799/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


--- Begin Message ---

Hi Rudolph,

By my understanding, edk2 repo is mainly for the modules defined by industry 
standards (e.g. UEFI and PI specifications).
For the modules that is specific to a vendor (e.g. Intel PCH), or a bootloader, 
edk2-platform would be a better places.

Currently in the EDK2 UefiPayloadpkg, beside the PCH modules I mentioned 
before, only ParstLib is bootloader specific.
So for PCH modules, I already submitted a patch to move to edk2-platforms repo.
For ParseLib, it is not used in universal UEFI payload. Will keep it as-is to 
be used for non-universal UEFI payload for back-combatable.
Hope this could help.

Thanks,
Guo

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Patrick Rudolph
Sent: Wednesday, March 23, 2022 11:25 AM
To: Dong, Guo 
Cc: Rhodes, Sean ; devel@edk2.groups.io; Ni, Ray 
; Ma, Maurice ; You, Benjamin 

Subject: Re: [edk2-devel] [PATCH 5/5] UefiPayloadPkg: Add support for Firmware 
Volume Block Protocol

Hi Guo,
I don't see where it's written that UefiPayloadPkg is bootloader
independent. Can you point me to that documentation?
Reading the BuildAndIntegrationInstructions.txt I understand that it
is very bootloader specific, as it's  basically designed as a
bootloader payload.
Where do you draw the line between platform code and "generic" payload code?

Regards,
Patrick Rudolph

On Wed, Mar 23, 2022 at 7:12 PM Dong, Guo  wrote:
>
>
> Hi Sean,
> SMMSTORE and this FVB module are specific for coreboot while UefiPayloadPkg 
> in Edk2 is targeting platform/bootloader independent.
> I just submitted an "add UEFI payload platform FV" patch to edk2-platforms 
> repo, in this patch it moves PCH specific modules from
> Edk2 UefiPayloadPkg to edk2-platforms Platform/Intel/PayloadPlatformPkg. 
> Maybe these coreboot specific modules could also target
> to edk2-platforms repo?
>
> Thanks,
> Guo
> -Original Message-
> From: Sean Rhodes 
> Sent: Monday, March 21, 2022 2:10 AM
> To: devel@edk2.groups.io
> Cc: Rhodes, Sean ; Dong, Guo ; Ni, 
> Ray ; Ma, Maurice ; You, Benjamin 
> ; Patrick Rudolph 
> Subject: [PATCH 5/5] UefiPayloadPkg: Add support for Firmware Volume Block 
> Protocol
>
> This adds support for FVB in order to support a platform independent
> and non-volatile variable store on UefiPayloadPkg. The variable store
> makes use the SmmStoreLib to provide an unauthenticed variable store.
>
> Since commit bc744f5893fc4d53275ed26dd8d968011c6a09c1 coreboot supports
> the SMMSTORE v2 feature. It implements a SMI handler that is able to
> write, read and erase pages in the boot media (SPI flash).
> The communication is done using a fixed communication buffer that is
> allocated in CBMEM. The existence of this optional feature is advertised
> by a coreboot table.
> When the SMMSTORE feature is not available the variable emulation is used
> by setting PcdEmuVariableNvModeEnable to TRUE.
>
> The DXE component provides runtime services and takes care of virtual to
> physical mapping the communication buffers between SMM and OS.
>
> The contents of the variable store can be accessed and modified by any
> priviledged application. As authentication is done by runtime services
> only the store shouldn't be used to store authenticated variables.
>
> Tested on Linux and Windows 10 on real hardwar

Re: [edk2-devel] [PATCH 5/5] UefiPayloadPkg: Add support for Firmware Volume Block Protocol

2022-03-23 Thread Guo Dong

Hi Rudolph,

By my understanding, edk2 repo is mainly for the modules defined by industry 
standards (e.g. UEFI and PI specifications).
For the modules that is specific to a vendor (e.g. Intel PCH), or a bootloader, 
edk2-platform would be a better places.

Currently in the EDK2 UefiPayloadpkg, beside the PCH modules I mentioned 
before, only ParstLib is bootloader specific.
So for PCH modules, I already submitted a patch to move to edk2-platforms repo.
For ParseLib, it is not used in universal UEFI payload. Will keep it as-is to 
be used for non-universal UEFI payload for back-combatable. 
Hope this could help.

Thanks,
Guo

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Patrick Rudolph
Sent: Wednesday, March 23, 2022 11:25 AM
To: Dong, Guo 
Cc: Rhodes, Sean ; devel@edk2.groups.io; Ni, Ray 
; Ma, Maurice ; You, Benjamin 

Subject: Re: [edk2-devel] [PATCH 5/5] UefiPayloadPkg: Add support for Firmware 
Volume Block Protocol

Hi Guo,
I don't see where it's written that UefiPayloadPkg is bootloader
independent. Can you point me to that documentation?
Reading the BuildAndIntegrationInstructions.txt I understand that it
is very bootloader specific, as it's  basically designed as a
bootloader payload.
Where do you draw the line between platform code and "generic" payload code?

Regards,
Patrick Rudolph

On Wed, Mar 23, 2022 at 7:12 PM Dong, Guo  wrote:
>
>
> Hi Sean,
> SMMSTORE and this FVB module are specific for coreboot while UefiPayloadPkg 
> in Edk2 is targeting platform/bootloader independent.
> I just submitted an "add UEFI payload platform FV" patch to edk2-platforms 
> repo, in this patch it moves PCH specific modules from
> Edk2 UefiPayloadPkg to edk2-platforms Platform/Intel/PayloadPlatformPkg. 
> Maybe these coreboot specific modules could also target
> to edk2-platforms repo?
>
> Thanks,
> Guo
> -Original Message-
> From: Sean Rhodes 
> Sent: Monday, March 21, 2022 2:10 AM
> To: devel@edk2.groups.io
> Cc: Rhodes, Sean ; Dong, Guo ; Ni, 
> Ray ; Ma, Maurice ; You, Benjamin 
> ; Patrick Rudolph 
> Subject: [PATCH 5/5] UefiPayloadPkg: Add support for Firmware Volume Block 
> Protocol
>
> This adds support for FVB in order to support a platform independent
> and non-volatile variable store on UefiPayloadPkg. The variable store
> makes use the SmmStoreLib to provide an unauthenticed variable store.
>
> Since commit bc744f5893fc4d53275ed26dd8d968011c6a09c1 coreboot supports
> the SMMSTORE v2 feature. It implements a SMI handler that is able to
> write, read and erase pages in the boot media (SPI flash).
> The communication is done using a fixed communication buffer that is
> allocated in CBMEM. The existence of this optional feature is advertised
> by a coreboot table.
> When the SMMSTORE feature is not available the variable emulation is used
> by setting PcdEmuVariableNvModeEnable to TRUE.
>
> The DXE component provides runtime services and takes care of virtual to
> physical mapping the communication buffers between SMM and OS.
>
> The contents of the variable store can be accessed and modified by any
> priviledged application. As authentication is done by runtime services
> only the store shouldn't be used to store authenticated variables.
>
> Tested on Linux and Windows 10 on real hardware.
> Currently this cannot be tested on coreboot and qemu as it doesn't support
> the SMMSTORE on qemu.
>
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> Signed-off-by: Patrick Rudolph 
> Signed-off-by: Sean Rhodes 
> ---
>  .../SmmStoreFvb/SmmStoreFvbRuntime.c  | 282 ++
>  .../SmmStoreFvb/SmmStoreFvbRuntime.h  | 111 +++
>  .../SmmStoreFvb/SmmStoreFvbRuntimeDxe.c   | 849 ++
>  .../SmmStoreFvb/SmmStoreFvbRuntimeDxe.inf |  66 ++
>  UefiPayloadPkg/UefiPayloadPkg.dsc |  24 +-
>  UefiPayloadPkg/UefiPayloadPkg.fdf |   4 +
>  6 files changed, 1330 insertions(+), 6 deletions(-)
>  create mode 100644 UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntime.c
>  create mode 100644 UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntime.h
>  create mode 100644 UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntimeDxe.c
>  create mode 100644 UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntimeDxe.inf
>
> diff --git a/UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntime.c 
> b/UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntime.c
> new file mode 100644
> index 00..08d5c408fb
> --- /dev/null
> +++ b/UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntime.c
> @@ -0,0 +1,282 @@
> +/** @file  SmmStoreFvbRuntime.c
>
> +
>
> +  Copyright (c) 2022, 9elements GmbH
>
> +
>
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
>
> +
>
> +**/
>
> +
>
> +#include 
>
> +#include 

Re: [edk2-devel] [PATCH 5/5] UefiPayloadPkg: Add support for Firmware Volume Block Protocol

2022-03-23 Thread Guo Dong


Hi Sean,
SMMSTORE and this FVB module are specific for coreboot while UefiPayloadPkg in 
Edk2 is targeting platform/bootloader independent.
I just submitted an "add UEFI payload platform FV" patch to edk2-platforms 
repo, in this patch it moves PCH specific modules from
Edk2 UefiPayloadPkg to edk2-platforms Platform/Intel/PayloadPlatformPkg. Maybe 
these coreboot specific modules could also target
to edk2-platforms repo?

Thanks,
Guo
-Original Message-
From: Sean Rhodes  
Sent: Monday, March 21, 2022 2:10 AM
To: devel@edk2.groups.io
Cc: Rhodes, Sean ; Dong, Guo ; Ni, 
Ray ; Ma, Maurice ; You, Benjamin 
; Patrick Rudolph 
Subject: [PATCH 5/5] UefiPayloadPkg: Add support for Firmware Volume Block 
Protocol

This adds support for FVB in order to support a platform independent
and non-volatile variable store on UefiPayloadPkg. The variable store
makes use the SmmStoreLib to provide an unauthenticed variable store.

Since commit bc744f5893fc4d53275ed26dd8d968011c6a09c1 coreboot supports
the SMMSTORE v2 feature. It implements a SMI handler that is able to
write, read and erase pages in the boot media (SPI flash).
The communication is done using a fixed communication buffer that is
allocated in CBMEM. The existence of this optional feature is advertised
by a coreboot table.
When the SMMSTORE feature is not available the variable emulation is used
by setting PcdEmuVariableNvModeEnable to TRUE.

The DXE component provides runtime services and takes care of virtual to
physical mapping the communication buffers between SMM and OS.

The contents of the variable store can be accessed and modified by any
priviledged application. As authentication is done by runtime services
only the store shouldn't be used to store authenticated variables.

Tested on Linux and Windows 10 on real hardware.
Currently this cannot be tested on coreboot and qemu as it doesn't support
the SMMSTORE on qemu.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Patrick Rudolph 
Signed-off-by: Sean Rhodes 
---
 .../SmmStoreFvb/SmmStoreFvbRuntime.c  | 282 ++
 .../SmmStoreFvb/SmmStoreFvbRuntime.h  | 111 +++
 .../SmmStoreFvb/SmmStoreFvbRuntimeDxe.c   | 849 ++
 .../SmmStoreFvb/SmmStoreFvbRuntimeDxe.inf |  66 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  24 +-
 UefiPayloadPkg/UefiPayloadPkg.fdf |   4 +
 6 files changed, 1330 insertions(+), 6 deletions(-)
 create mode 100644 UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntime.c
 create mode 100644 UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntime.h
 create mode 100644 UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntimeDxe.c
 create mode 100644 UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntimeDxe.inf

diff --git a/UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntime.c 
b/UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntime.c
new file mode 100644
index 00..08d5c408fb
--- /dev/null
+++ b/UefiPayloadPkg/SmmStoreFvb/SmmStoreFvbRuntime.c
@@ -0,0 +1,282 @@
+/** @file  SmmStoreFvbRuntime.c

+

+  Copyright (c) 2022, 9elements GmbH

+

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include 

+#include 

+#include 

+#include 

+#include 

+#include 

+#include 

+#include 

+

+#include "SmmStoreFvbRuntime.h"

+

+STATIC EFI_EVENT  mSmmStoreVirtualAddrChangeEvent;

+

+//

+// Global variable declarations

+//

+SMMSTORE_INSTANCE  *mSmmStoreInstance;

+

+SMMSTORE_INSTANCE  mSmmStoreInstanceTemplate = {

+  SMMSTORE_SIGNATURE, // Signature

+  NULL,   // Handle ... NEED TO BE FILLED

+  {

+FvbGetAttributes,  // GetAttributes

+FvbSetAttributes,  // SetAttributes

+FvbGetPhysicalAddress, // GetPhysicalAddress

+FvbGetBlockSize,   // GetBlockSize

+FvbRead,   // Read

+FvbWrite,  // Write

+FvbEraseBlocks,// EraseBlocks

+NULL,  // ParentHandle

+  }, //  FvbProtoccol

+  0, // BlockSize ... NEED TO BE FILLED

+  0, // LastBlock ... NEED TO BE FILLED

+  0, // MmioAddress ... NEED TO BE FILLED

+  {

+{

+  {

+HARDWARE_DEVICE_PATH,

+HW_MEMMAP_DP,

+{

+  (UINT8)(sizeof (MEMMAP_DEVICE_PATH)),

+  (UINT8)(sizeof (MEMMAP_DEVICE_PATH) >> 8)

+}

+  },

+  EfiMemoryMappedIO,

+  (EFI_PHYSICAL_ADDRESS)0, // NEED TO BE FILLED

+  (EFI_PHYSICAL_ADDRESS)0, // NEED TO BE FILLED

+},

+{

+  END_DEVICE_PATH_TYPE,

+  END_ENTIRE_DEVICE_PATH_SUBTYPE,

+  {

+END_DEVICE_PATH_LENGTH,

+0

+  }

+}

+  } // DevicePath

+};

+

+/**

+  Initialize the SmmStore instance.

+

+

+  @param[in]  FvBase The physical MMIO base address of the FV 
containing

+ the variable store.

+

+  @param[in]  NumberofBlocks Number of blocks within the FV.

+  @param[in]  BlockSize  The size in bytes of one block within the FV.

+  @param[in, out] Instance 

Re: [edk2-devel] [PATCH 1/5] UefiPayloadPkg/UefiPayloadPkg.ci.yaml: Remove duplicated entry

2022-03-23 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Sean Rhodes  
Sent: Monday, March 21, 2022 2:10 AM
To: devel@edk2.groups.io
Cc: Patrick Rudolph ; Dong, Guo 
; Ni, Ray ; Ma, Maurice 
; You, Benjamin ; Rhodes, Sean 

Subject: [PATCH 1/5] UefiPayloadPkg/UefiPayloadPkg.ci.yaml: Remove duplicated 
entry

From: Patrick Rudolph 

Remove a duplicated entry to fix a CI error.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 
Signed-off-by: Patrick Rudolph 
---
 UefiPayloadPkg/UefiPayloadPkg.ci.yaml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.ci.yaml 
b/UefiPayloadPkg/UefiPayloadPkg.ci.yaml
index 93f4d3603d..909379eaac 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.ci.yaml
+++ b/UefiPayloadPkg/UefiPayloadPkg.ci.yaml
@@ -20,7 +20,6 @@
 "IgnoreFiles": [

 "Include/Coreboot.h",

 "Library/CbParseLib/CbParseLib.c",

-"Library/CbParseLib/CbParseLib.c",

 "PayloadLoaderPeim/ElfLib/ElfCommon.h",

 "PayloadLoaderPeim/ElfLib/Elf32.h",

 "PayloadLoaderPeim/ElfLib/Elf64.h"

-- 
2.32.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87908): https://edk2.groups.io/g/devel/message/87908
Mute This Topic: https://groups.io/mt/89923797/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix build error

2022-03-23 Thread Guo Dong


As a package reviewer, you just need review it and reply it with “Reviewed-by” 
then the maintainer would merge it.



Thanks,

Guo

From: Sean Rhodes 
Sent: Monday, March 21, 2022 1:52 AM
To: Dong, Guo ; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix build error

The patch looks good to me, and it has been confirmed by several others from 
the coreboot community. However, I don't have the capability to merge.
Thanks
Sean


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87907): https://edk2.groups.io/g/devel/message/87907
Mute This Topic: https://groups.io/mt/89710183/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix architecture in the build instruction

2022-03-23 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Akihiko Odaki  
Sent: Saturday, March 19, 2022 2:07 AM
Cc: devel@edk2.groups.io; Dong, Guo ; Ni, Ray 
; Ma, Maurice ; You, Benjamin 
; Akihiko Odaki 
Subject: [PATCH] UefiPayloadPkg: Fix architecture in the build instruction

Signed-off-by: Akihiko Odaki 
---
 UefiPayloadPkg/BuildAndIntegrationInstructions.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/BuildAndIntegrationInstructions.txt 
b/UefiPayloadPkg/BuildAndIntegrationInstructions.txt
index 61d31f1020..01b3d7f992 100644
--- a/UefiPayloadPkg/BuildAndIntegrationInstructions.txt
+++ b/UefiPayloadPkg/BuildAndIntegrationInstructions.txt
@@ -38,7 +38,7 @@ B. HOW TO BUILD
> edksetup.bat

 

For pure X64 build:

-   > build -a x64 -p UefiPayloadPkg\UefiPayloadPkg.dsc -b  -t 


+   > build -a X64 -p UefiPayloadPkg\UefiPayloadPkg.dsc -b  -t 


  -D BOOTLOADER=

 

For X64 build with IA32 entry point:

-- 
2.35.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87906): https://edk2.groups.io/g/devel/message/87906
Mute This Topic: https://groups.io/mt/89930528/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Timeout configurable

2022-03-23 Thread Guo Dong
Reviewed-by: Guo Dong 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sean Rhodes
Sent: Friday, March 18, 2022 7:17 AM
To: devel@edk2.groups.io
Cc: Rhodes, Sean 
Subject: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Timeout configurable

Signed-off-by: Sean Rhodes 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 14a8d157a2..3f172c5912 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -35,6 +35,7 @@
   DEFINE SMM_SUPPORT  = FALSE   DEFINE ABOVE_4G_MEMORY 
 = TRUE   DEFINE BOOT_MANAGER_ESCAPE  = FALSE+  DEFINE 
PLATFORM_BOOT_TIMEOUT= 3   DEFINE SD_MMC_TIMEOUT   = 
100   #   # SBL:  UEFI payload for Slim Bootloader@@ -475,7 +476,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0   
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0   
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0-  
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3+  
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|$(PLATFORM_BOOT_TIMEOUT) !if 
$(VARIABLE_SUPPORT) == "SPI"   
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize  |0   
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize|0-- 
2.32.0



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87748): https://edk2.groups.io/g/devel/message/87748
Mute This Topic: https://groups.io/mt/89868842/1781375
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.d...@intel.com] 
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87905): https://edk2.groups.io/g/devel/message/87905
Mute This Topic: https://groups.io/mt/89868842/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add a new DebugPrintErrorLevelLib instance.

2022-03-23 Thread Guo Dong


Why adding "Cmos" in the module name?
In the DebugPrintErrorLevel.h, ErrorLevel is defined as UINT32, but its usage 
is not clear for bootloaders ( so need add more info in the header file)
And it used "UNIVERSAL_PAYLOAD" in the interface, do you think this interface 
would be added into universal payload specification?

Thanks,
Guo

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Yuanhao Xie
Sent: Wednesday, March 23, 2022 3:01 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Maurice Ma 
; You, Benjamin ; Rhodes, Sean 

Subject: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add a new 
DebugPrintErrorLevelLib instance.

It consumes the HOB defined in
UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h, and allow bootloader  to 
config DebugPrintErrorLevel

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Cc: Sean Rhodes 

Signed-off-by: Yuanhao Xie 
---
 UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h 
| 27 +++
 
UefiPayloadPkg/Library/DebugPrintErrorLevelLibCmos/DebugPrintErrorLevelLibCmos.c
   | 84 

 
UefiPayloadPkg/Library/DebugPrintErrorLevelLibCmos/DebugPrintErrorLevelLibCmos.inf
 | 39 +++
 UefiPayloadPkg/UefiPayloadPkg.dec  
|  2 +-
 4 files changed, 151 insertions(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h 
b/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h
new file mode 100644
index 00..9a3f4eb28e
--- /dev/null
+++ b/UefiPayloadPkg/Include/Guid/DebugPrintErrorLevel.h
@@ -0,0 +1,27 @@
+/** @file
+  Define the structure for Debug Print Error Level Guid Hob.
+
+Copyright (c) 2022, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_H_
+#define UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_H_
+
+#include 
+#include 
+
+#pragma pack (1)
+
+typedef struct {
+  UNIVERSAL_PAYLOAD_GENERIC_HEADERHeader;
+  UINT32  ErrorLevel;
+} UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL;
+
+#pragma pack()
+
+#define UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION  1
+
+extern GUID  gEdkiiDebugPrintErrorLevelGuid; #endif
diff --git 
a/UefiPayloadPkg/Library/DebugPrintErrorLevelLibCmos/DebugPrintErrorLevelLibCmos.c
 
b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibCmos/DebugPrintErrorLevelLibCmos.c
new file mode 100644
index 00..e3057620d9
--- /dev/null
+++ b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibCmos/DebugPrintError
+++ LevelLibCmos.c
@@ -0,0 +1,84 @@
+/** @file
+  Debug Print Error Level library instance that retrieves
+  the DebugPrintErrorLevel from bootloader.
+
+  Copyright (c) 2022, Intel Corporation. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+  Returns the debug print error level mask for the current module.
+
+  @return  Debug print error level mask for the current module.
+
+**/
+UINT32
+EFIAPI
+GetDebugPrintErrorLevel (
+  VOID
+  )
+{
+  VOID   *GuidHob;
+  UNIVERSAL_PAYLOAD_GENERIC_HEADER   *GenericHeader;
+  UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL  *DebugPrintErrorLevel;
+
+  GuidHob = GetFirstGuidHob ();
+
+  if (GuidHob == NULL) {
+//
+// If the HOB is not create, the default value of PcdDebugPrintErrorLevel 
will be used.
+//
+return PcdGet32(PcdDebugPrintErrorLevel);
+  }
+
+  GenericHeader = (UNIVERSAL_PAYLOAD_GENERIC_HEADER *)GET_GUID_HOB_DATA 
+ (GuidHob);  if ((sizeof (UNIVERSAL_PAYLOAD_GENERIC_HEADER) > 
+ GET_GUID_HOB_DATA_SIZE (GuidHob)) ||  (GenericHeader->Length > 
GET_GUID_HOB_DATA_SIZE (GuidHob))) {
+return PcdGet32(PcdDebugPrintErrorLevel);
+  }
+
+  if (GenericHeader->Revision == 
UNIVERSAL_PAYLOAD_DEBUG_PRINT_ERROR_LEVEL_REVISION) {
+DebugPrintErrorLevel = GET_GUID_HOB_DATA (GuidHob);
+return DebugPrintErrorLevel->ErrorLevel;  } else {
+return PcdGet32(PcdDebugPrintErrorLevel);
+  }
+
+}
+
+/**
+  Sets the global debug print error level mask fpr the entire platform.
+
+  @param   ErrorLevel Global debug print error level.
+
+  @retval  TRUE   The debug print error level mask was sucessfully set.
+  @retval  FALSE  The debug print error level mask could not be set.
+
+**/
+BOOLEAN
+EFIAPI
+SetDebugPrintErrorLevel (
+  UINT32  ErrorLevel
+  )
+{
+  //
+  // This library uinstance does not support setting the global debug 
+print error
+  // level mask.
+  //
+  return FALSE;
+}
diff --git 
a/UefiPayloadPkg/Library/DebugPrintErrorLevelLibCmos/DebugPrintErrorLevelLibCmos.inf
 
b/UefiPayloadPkg/Library/DebugPrintErrorLevelLibCmos/DebugPrint

Re: [edk2-devel] [PATCH 2/2] UefiPayloadPkg: Hookup SD/MMC timeout

2022-03-17 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Sean Rhodes  
Sent: Thursday, February 24, 2022 12:59 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Rhodes, Sean ; Ni, 
Ray ; Ma, Maurice ; You, Benjamin 

Subject: [PATCH 2/2] UefiPayloadPkg: Hookup SD/MMC timeout

Hook SD_MMC_TIMEOUT build option to SdMmcGenericTimeoutValue PCD.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1ce96a51c1..23c2787a94 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -33,6 +33,7 @@
   DEFINE UNIVERSAL_PAYLOAD= FALSE

   DEFINE SECURITY_STUB_ENABLE = TRUE

   DEFINE SMM_SUPPORT  = FALSE

+  DEFINE SD_MMC_TIMEOUT   = 100

   #

   # SBL:  UEFI payload for Slim Bootloader

   # COREBOOT: UEFI payload for coreboot

@@ -398,6 +399,7 @@
 !if $(PERFORMANCE_MEASUREMENT_ENABLE)

   gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask   | 0x1

 !endif

+  gEfiMdeModulePkgTokenSpaceGuid.PcdSdMmcGenericTimeoutValue|$(SD_MMC_TIMEOUT)

 

 [PcdsPatchableInModule.X64]

   gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)

-- 
2.32.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87668): https://edk2.groups.io/g/devel/message/87668
Mute This Topic: https://groups.io/mt/89361076/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix build error

2022-03-14 Thread Guo Dong


You would understand it when you look at the NetworkPkg/Network.dsc.inc
In that DSC file, network components could be built as X64 or IA32 depending on 
PLATFORMX64_ENABLE.

-Original Message-
From: Ni, Ray  
Sent: Sunday, March 13, 2022 8:13 PM
To: devel@edk2.groups.io; Rhodes, Sean 
Cc: Dong, Guo ; Ma, Maurice ; You, 
Benjamin 
Subject: RE: [edk2-devel] [PATCH] UefiPayloadPkg: Fix build error

I don't understand the need of "+  DEFINE PLATFORMX64_ENABLE = TRUE".

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sean Rhodes
Sent: Friday, March 11, 2022 9:41 PM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Ni, Ray ; Ma, Maurice 
; You, Benjamin 
Subject: [edk2-devel] [PATCH] UefiPayloadPkg: Fix build error

From: Guo Dong 

On windows build, need add -DPLATFORMX64_ENABLE=TRUE in the build command line 
beside -DNETWORK_DRIVER_ENABLE=TRUE in order build network features. So set 
PLATFORMX64_ENABLE to TRUE when need build network feature.
On Linux build, DSC file should not have PcdAllowHttpConnections when network 
feature is not built, else would cause build error.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Guo Dong 
---
 UefiPayloadPkg/UefiPayloadPkg.dsc | 4 
 1 file changed, 4 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 558513baf1..f3806a8ebc 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -407,7 +407,9 @@
 [PcdsPatchableInModule.X64]

   gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)

   gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|$(RTC_TARGET_REGISTER)

+!if $(NETWORK_DRIVER_ENABLE) == TRUE

   gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE

+!endif

 

 [PcdsPatchableInModule.common]

   gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 
0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 }

@@ -530,6 +532,8 @@
 # UEFI network modules

 #

 !if $(NETWORK_DRIVER_ENABLE) == TRUE

+[Defines]

+  DEFINE PLATFORMX64_ENABLE = TRUE

   !include NetworkPkg/Network.dsc.inc

 !endif

 

--
2.32.0



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87463): https://edk2.groups.io/g/devel/message/87463
Mute This Topic: https://groups.io/mt/89710183/1712937
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [ray...@intel.com]
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87548): https://edk2.groups.io/g/devel/message/87548
Mute This Topic: https://groups.io/mt/89710183/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Provide option to use Boot Splash

2022-03-10 Thread Guo Dong
Yes, if you do it only when you could locate gEdkiiPlatformLogoProtocolGuid. 
This way you don’t need a PCD and the build option is only used for logo module 
built-in or not.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87423): https://edk2.groups.io/g/devel/message/87423
Mute This Topic: https://groups.io/mt/89281295/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] BlSupportSmm: fix definition of SetSmrr()

2022-03-07 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sean Rhodes
Sent: Wednesday, February 23, 2022 3:55 PM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Rhodes, Sean ; Ni, 
Ray ; Ma, Maurice ; You, Benjamin 
; Matt DeVillier 
Subject: [edk2-devel] [PATCH] BlSupportSmm: fix definition of SetSmrr()

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Matt DeVillier 
Signed-off-by: Sean Rhodes 
---
 UefiPayloadPkg/BlSupportSmm/BlSupportSmm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/UefiPayloadPkg/BlSupportSmm/BlSupportSmm.c 
b/UefiPayloadPkg/BlSupportSmm/BlSupportSmm.c
index dcc4d60bb2..0d16aec8ef 100644
--- a/UefiPayloadPkg/BlSupportSmm/BlSupportSmm.c
+++ b/UefiPayloadPkg/BlSupportSmm/BlSupportSmm.c
@@ -191,6 +191,7 @@ SmmFeatureLockOnS3 (
   @param[in] ProcedureArgument  Pointer to SMRR_BASE_MASK structure. **/ 
VOID+EFIAPI SetSmrr (   IN VOID  *ProcedureArgument   )-- 
2.32.0



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#86928): https://edk2.groups.io/g/devel/message/86928
Mute This Topic: https://groups.io/mt/89277119/1781375
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.d...@intel.com] 
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87319): https://edk2.groups.io/g/devel/message/87319
Mute This Topic: https://groups.io/mt/89277119/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-03-07 Thread Guo Dong


It was merged @https://github.com/tianocore/edk2/pull/2596
https://github.com/tianocore/edk2/commit/af74efe494c5920c7992b543fada1af2b186bd8c

Thanks,
Guo

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Guo Dong
Sent: Monday, March 7, 2022 1:23 PM
To: Rhodes, Sean ; devel@edk2.groups.io
Cc: Rhodes, Sean ; Ni, Ray ; Ma, 
Maurice ; You, Benjamin 
Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key 
configurable


Reviewed-by: Guo Dong 

-Original Message-
From: Sean Rhodes  
Sent: Saturday, March 5, 2022 3:15 AM
To: devel@edk2.groups.io
Cc: Rhodes, Sean ; Dong, Guo ; Ni, 
Ray ; Ma, Maurice ; You, Benjamin 

Subject: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

Provide a build option to use [Esc] instead of [F2] for devices such as 
Chromebooks that don't have F-keys.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  2 +
 4 files changed, 37 insertions(+), 13 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
+++ c
@@ -164,7 +164,7 @@ PlatformBootManagerBeforeConsole (
   ) {   EFI_INPUT_KEY Enter;-  EFI_INPUT_KEY 
F2;+  EFI_INPUT_KEY CustomKey;   EFI_INPUT_KEY 
Down;   EFI_BOOT_MANAGER_LOAD_OPTION  BootOption;   EFI_STATUS  
  Status;@@ -186,13 +186,22 @@ PlatformBootManagerBeforeConsole (
   Enter.UnicodeChar = CHAR_CARRIAGE_RETURN;   
EfiBootManagerRegisterContinueKeyOption (0, , NULL); -  //-  // Map F2 to 
Boot Manager Menu-  //-  F2.ScanCode= SCAN_F2;-  F2.UnicodeChar = 
CHAR_NULL;+  if (FixedPcdGetBool (PcdBootManagerEscape)) {+//+// Map 
Esc to Boot Manager Menu+//+CustomKey.ScanCode= SCAN_ESC;+
CustomKey.UnicodeChar = CHAR_NULL;+  } else {+//+// Map Esc to Boot 
Manager Menu+//+CustomKey.ScanCode= SCAN_F2;+
CustomKey.UnicodeChar = CHAR_NULL;+  }+   EfiBootManagerGetBootManagerMenu 
();-  EfiBootManagerAddKeyOptionVariable (NULL, 
(UINT16)BootOption.OptionNumber, 0, , NULL);+  
EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumber, 0, 
, NULL);//   // Also add Down key to Boot Manager Menu since some 
serial terminals don't support F2 key.@@ -251,12 +260,21 @@ 
PlatformBootManagerAfterConsole (
   //   PlatformRegisterFvBootOption (PcdGetPtr (PcdShellFile), L"UEFI Shell", 
LOAD_OPTION_ACTIVE); -  Print (-L"\n"-L"F2 or Down  to enter Boot 
Manager Menu.\n"-L"ENTER   to boot directly.\n"-L"\n"-);+  
if (FixedPcdGetBool (PcdBootManagerEscape)) {+Print (+  L"\n"+  
L"Esc or Down  to enter Boot Manager Menu.\n"+  L"ENTER   to 
boot directly.\n"+  L"\n"+  );+  } else {+Print (+  L"\n"+  
L"F2 or Down  to enter Boot Manager Menu.\n"+  L"ENTER   to 
boot directly.\n"+  L"\n"+  );+  } }  /**diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 9c4a9da943..80390e0d98 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerL
+++ ib.inf
@@ -73,3 +73,4 @@
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity   
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits   
gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile+  
gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscapediff --git 
a/UefiPayloadPkg/UefiPayloadPkg.dec b/UefiPayloadPkg/UefiPayloadPkg.dec
index e9204d1168..4051172caf 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -86,6 +86,9 @@ gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 
0xcf, 0x80, 0xab, 0  # Above 4G Memory 
gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|TRUE|BOOLEAN|0x0019
 +# Boot Manager 
Key+gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x0020+
 ## FFS filename to find the default variable initial data file. # @Prompt FFS 
Name of variable initial data file  
gUefiPayloadPkgTokenSpaceGuid.PcdNvsDataFile |{ 0x1a, 0xf1, 0xb1, 0xae, 0x42, 
0xcc, 0xcf, 0x4e, 0xac, 0x60, 0xdb, 0xab, 0xf6, 0xca, 0x69, 0xe6 
}|VOID*|0x0025diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-03-07 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Sean Rhodes  
Sent: Saturday, March 5, 2022 3:15 AM
To: devel@edk2.groups.io
Cc: Rhodes, Sean ; Dong, Guo ; Ni, 
Ray ; Ma, Maurice ; You, Benjamin 

Subject: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

Provide a build option to use [Esc] instead of [F2] for devices such as 
Chromebooks that don't have F-keys.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  2 +
 4 files changed, 37 insertions(+), 13 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
+++ c
@@ -164,7 +164,7 @@ PlatformBootManagerBeforeConsole (
   ) {   EFI_INPUT_KEY Enter;-  EFI_INPUT_KEY 
F2;+  EFI_INPUT_KEY CustomKey;   EFI_INPUT_KEY 
Down;   EFI_BOOT_MANAGER_LOAD_OPTION  BootOption;   EFI_STATUS  
  Status;@@ -186,13 +186,22 @@ PlatformBootManagerBeforeConsole (
   Enter.UnicodeChar = CHAR_CARRIAGE_RETURN;   
EfiBootManagerRegisterContinueKeyOption (0, , NULL); -  //-  // Map F2 to 
Boot Manager Menu-  //-  F2.ScanCode= SCAN_F2;-  F2.UnicodeChar = 
CHAR_NULL;+  if (FixedPcdGetBool (PcdBootManagerEscape)) {+//+// Map 
Esc to Boot Manager Menu+//+CustomKey.ScanCode= SCAN_ESC;+
CustomKey.UnicodeChar = CHAR_NULL;+  } else {+//+// Map Esc to Boot 
Manager Menu+//+CustomKey.ScanCode= SCAN_F2;+
CustomKey.UnicodeChar = CHAR_NULL;+  }+   EfiBootManagerGetBootManagerMenu 
();-  EfiBootManagerAddKeyOptionVariable (NULL, 
(UINT16)BootOption.OptionNumber, 0, , NULL);+  
EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumber, 0, 
, NULL);//   // Also add Down key to Boot Manager Menu since some 
serial terminals don't support F2 key.@@ -251,12 +260,21 @@ 
PlatformBootManagerAfterConsole (
   //   PlatformRegisterFvBootOption (PcdGetPtr (PcdShellFile), L"UEFI Shell", 
LOAD_OPTION_ACTIVE); -  Print (-L"\n"-L"F2 or Down  to enter Boot 
Manager Menu.\n"-L"ENTER   to boot directly.\n"-L"\n"-);+  
if (FixedPcdGetBool (PcdBootManagerEscape)) {+Print (+  L"\n"+  
L"Esc or Down  to enter Boot Manager Menu.\n"+  L"ENTER   to 
boot directly.\n"+  L"\n"+  );+  } else {+Print (+  L"\n"+  
L"F2 or Down  to enter Boot Manager Menu.\n"+  L"ENTER   to 
boot directly.\n"+  L"\n"+  );+  } }  /**diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 9c4a9da943..80390e0d98 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerL
+++ ib.inf
@@ -73,3 +73,4 @@
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity   
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits   
gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile+  
gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscapediff --git 
a/UefiPayloadPkg/UefiPayloadPkg.dec b/UefiPayloadPkg/UefiPayloadPkg.dec
index e9204d1168..4051172caf 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -86,6 +86,9 @@ gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 
0xcf, 0x80, 0xab, 0  # Above 4G Memory 
gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|TRUE|BOOLEAN|0x0019
 +# Boot Manager 
Key+gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x0020+
 ## FFS filename to find the default variable initial data file. # @Prompt FFS 
Name of variable initial data file  
gUefiPayloadPkgTokenSpaceGuid.PcdNvsDataFile |{ 0x1a, 0xf1, 0xb1, 0xae, 0x42, 
0xcc, 0xcf, 0x4e, 0xac, 0x60, 0xdb, 0xab, 0xf6, 0xca, 0x69, 0xe6 
}|VOID*|0x0025diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 4fe81a61d6..558513baf1 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -34,6 +34,7 @@
   DEFINE SECURITY_STUB_ENABLE = TRUE   DEFINE SMM_SUPPORT  
= FALSE   DEFINE ABOVE_4G_MEMORY  = TRUE+  DEFINE 
BOOT_MANAGER_ESCAPE  = FALSE   #   # SBL:  UEFI payload for Slim 
Bootloader   # COREBOOT: UEFI 

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-03-04 Thread Guo Dong

Could you re-send the patch without  
.../Library/BrotliCustomDecompressLib/brotli?

Thanks,
Guo

From: Ni, Ray 
Sent: Monday, February 28, 2022 6:28 PM
To: Rhodes, Sean 
Cc: devel@edk2.groups.io; Dong, Guo ; Ma, Maurice 
; You, Benjamin 
Subject: RE: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

Reviewed-by: Ray Ni mailto:ray...@intel.com>>

From: Sean Rhodes mailto:sean@starlabs.systems>>
Sent: Wednesday, February 23, 2022 3:22 AM
To: Ni, Ray mailto:ray...@intel.com>>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Dong, Guo 
mailto:guo.d...@intel.com>>; Ma, Maurice 
mailto:maurice...@intel.com>>; You, Benjamin 
mailto:benjamin@intel.com>>
Subject: Re: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

True - but the experience is better with F2 (on "normal" 
computers/non-Chromebooks).

We've got a lot of feedback, and for most, people turn on their computers and 
start tapping Escape when they want Grub. If it's mapped, this gets intercepted 
by UiApp. Even if they exit, with BGRT in the equation, it requires fairly 
precise timing to access Grub.

On Tue, 22 Feb 2022 at 04:59, Ni, Ray 
mailto:ray...@intel.com>> wrote:
Grub runs later. Then what does “conflict” mean?

From: Sean Rhodes mailto:sean@starlabs.systems>>
Sent: Monday, February 21, 2022 3:48 PM
To: Ni, Ray mailto:ray...@intel.com>>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Dong, Guo 
mailto:guo.d...@intel.com>>; Ma, Maurice 
mailto:maurice...@intel.com>>; You, Benjamin 
mailto:benjamin@intel.com>>
Subject: Re: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

We would prefer to keep PCD, as Esc can conflict with Grub on normal (not 
Chromebook) devices

Thank you

On Mon, 21 Feb 2022 at 05:26, Ni, Ray 
mailto:ray...@intel.com>> wrote:
Can you just map both ESC and F2 to the UI? So that PCD is not needed.

Thanks,
Ray

-Original Message-
From: Sean Rhodes mailto:sean@starlabs.systems>>
Sent: Monday, February 21, 2022 5:39 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Dong, Guo mailto:guo.d...@intel.com>>; Rhodes, Sean 
mailto:sean@starlabs.systems>>; Ni, Ray 
mailto:ray...@intel.com>>; Ma, Maurice 
mailto:maurice...@intel.com>>; You, Benjamin 
mailto:benjamin@intel.com>>
Subject: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

Provide a build option to use [Esc] instead of [F2] for devices
such as Chromebooks that don't have F-keys.

Cc: Guo Dong mailto:guo.d...@intel.com>>
Cc: Ray Ni mailto:ray...@intel.com>>
Cc: Maurice Ma mailto:maurice...@intel.com>>
Cc: Benjamin You mailto:benjamin@intel.com>>
Signed-off-by: Sean Rhodes mailto:sean@starlabs.systems>>
---
 .../Library/BrotliCustomDecompressLib/brotli  |  2 +-
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  3 ++
 5 files changed, 39 insertions(+), 14 deletions(-)

diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
index f4153a09f8..666c3280cc 16
--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
+++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
@@ -1 +1 @@
-Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea
+Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -164,7 +164,7 @@ PlatformBootManagerBeforeConsole (
   )

 {

   EFI_INPUT_KEY Enter;

-  EFI_INPUT_KEY F2;

+  EFI_INPUT_KEY CustomKey;

   EFI_INPUT_KEY Down;

   EFI_BOOT_MANAGER_LOAD_OPTION  BootOption;

   EFI_STATUSStatus;

@@ -186,13 +186,22 @@ PlatformBootManagerBeforeConsole (
   Enter.UnicodeChar = CHAR_CARRIAGE_RETURN;

   EfiBootManagerRegisterContinueKeyOption (0, , NULL);



-  //

-  // Map F2 to Boot Manager Menu

-  //

-  F2.ScanCode= SCAN_F2;

-  F2.UnicodeChar = CHAR_NULL;

+  if (FixedPcdGetBool (PcdBootManagerEscape)) {

+//

+// Map Esc to Boot Manager Menu

+//

+CustomKey.ScanCode= SCAN_ESC;

+CustomKey.UnicodeChar = CHAR_NULL;

+  } else {

+//

+// Map Esc to Boot Manager Menu

+//

+CustomKey.ScanCode= SCAN_F2;

+CustomKey.UnicodeChar = CHAR_NULL;

+  }

+

   EfiBootManagerGetBootManagerMenu ();

-  EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumber, 
0, ,

Re: [edk2-devel] [PATCH v1 7/7] UefiPayloadPkg: Invoke GetPhysicalAddressBits() and remove the duplicated code

2022-03-04 Thread Guo Dong


Please double check, the commit message doesn't pass patch check.
And it looks GetPhysicalAddressBits() is not an API from UefiCpuLib.h since the 
build failed.

Thanks,
Guo

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Guo Dong
Sent: Friday, March 4, 2022 11:10 AM
To: Pu, Yu ; devel@edk2.groups.io
Cc: Ni, Ray 
Subject: Re: [edk2-devel] [PATCH v1 7/7] UefiPayloadPkg: Invoke 
GetPhysicalAddressBits() and remove the duplicated code


Reviewed-by: Guo Dong 

-Original Message-
From: Pu, Yu  
Sent: Wednesday, March 2, 2022 2:19 AM
To: devel@edk2.groups.io
Cc: Pu, Yu ; Dong, Guo ; Ni, Ray 

Subject: [PATCH v1 7/7] UefiPayloadPkg: Invoke GetPhysicalAddressBits() and 
remove the duplicated code

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3394

Invoke GetPhysicalAddressBits() defined in UefiCpuPkg for CPU physical address 
mask calculation and remove the duplicated code in 
UefiPayloadPkg\UefiPayloadEntry

Cc: Guo Dong 
Cc: Ray Ni 

Signed-off-by: Yu Pu 
---
 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c  | 10 ++  
UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c |  9 ++---
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c 
b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
index 0fed1e36918a..4378aa4f1d97 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -4,6 +4,7 @@
   SPDX-License-Identifier: BSD-2-Clause-Patent  **/+#include 
  #include "UefiPayloadEntry.h" @@ -341,7 +342,6 @@ 
BuildGenericHob (
   VOID   ) {-  UINT32   RegEax;   UINT8
PhysicalAddressBits;   EFI_RESOURCE_ATTRIBUTE_TYPE  ResourceAttribute; @@ 
-351,13 +351,7 @@ BuildGenericHob (
   //   // Build CPU memory space and IO space hob   //-  AsmCpuid (0x8000, 
, NULL, NULL, NULL);-  if (RegEax >= 0x8008) {-AsmCpuid 
(0x8008, , NULL, NULL, NULL);-PhysicalAddressBits = 
(UINT8)RegEax;-  } else {-PhysicalAddressBits = 36;-  }+  
PhysicalAddressBits = GetPhysicalAddressBits(NULL, NULL);BuildCpuHob 
(PhysicalAddressBits, 16); diff --git 
a/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c 
b/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
index ac0d58e685c8..c61aeeda7f2e 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
@@ -25,6 +25,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  #include 
 #include  #include +#include 
 #include  #include 
 #include @@ -738,13 +739,7 @@ 
CreateIdentityMappingPageTables (
   if (Hob != NULL) { PhysicalAddressBits = ((EFI_HOB_CPU 
*)Hob)->SizeOfMemorySpace;   } else {-AsmCpuid (0x8000, , NULL, 
NULL, NULL);-if (RegEax >= 0x8008) {-  AsmCpuid (0x8008, 
, NULL, NULL, NULL);-  PhysicalAddressBits = (UINT8)RegEax;-} 
else {-  PhysicalAddressBits = 36;-}+PhysicalAddressBits = 
GetPhysicalAddressBits (NULL, NULL);   }//-- 
2.30.0.windows.2








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87296): https://edk2.groups.io/g/devel/message/87296
Mute This Topic: https://groups.io/mt/89503330/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Add build option for Above 4G Memory

2022-03-04 Thread Guo Dong


It was merged
https://github.com/tianocore/edk2/commit/091b6a11970a447106aadb6538046a85d3f29df5

-Original Message-
From: Ni, Ray  
Sent: Monday, February 28, 2022 11:53 PM
To: Rhodes, Sean ; devel@edk2.groups.io
Cc: Dong, Guo ; Rhodes, Sean ; Ma, 
Maurice ; You, Benjamin 
Subject: RE: [PATCH] UefiPayloadPkg: Add build option for Above 4G Memory

Reviewed-by: Ray Ni 

-Original Message-
From: Sean Rhodes 
Sent: Thursday, February 24, 2022 7:00 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Rhodes, Sean ; Ni, 
Ray ; Ma, Maurice ; You, Benjamin 

Subject: [PATCH] UefiPayloadPkg: Add build option for Above 4G Memory

When build option ABOVE_4G_MEMORY is set to true, nothing will change and EDKII 
will use all available memory.

Setting it to false will create memory type information HOB in payload entry, 
so that EDKII will reserve enough memory below 4G for EDKII modules. This 
option is useful for bootloaders that are not fully 64-bit aware such as Qubes 
R4.0.4 bootloader, Zorin and Proxmox.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 .../UefiPayloadEntry/UefiPayloadEntry.c   | 39 +++
 .../UefiPayloadEntry/UefiPayloadEntry.inf |  7 
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  3 ++
 4 files changed, 52 insertions(+)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c 
b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
index 0fed1e3691..780348eadf 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -5,10 +5,44 @@
 

 **/

 

+#include 

 #include "UefiPayloadEntry.h"

 

 STATIC UINT32  mTopOfLowerUsableDram = 0;

 

+EFI_MEMORY_TYPE_INFORMATION  mDefaultMemoryTypeInformation[] = {

+  { EfiACPIReclaimMemory,   FixedPcdGet32 (PcdMemoryTypeEfiACPIReclaimMemory)  
 },

+  { EfiACPIMemoryNVS,   FixedPcdGet32 (PcdMemoryTypeEfiACPIMemoryNVS)  
 },

+  { EfiReservedMemoryType,  FixedPcdGet32 
+ (PcdMemoryTypeEfiReservedMemoryType)  },

+  { EfiRuntimeServicesData, FixedPcdGet32 
+ (PcdMemoryTypeEfiRuntimeServicesData) },

+  { EfiRuntimeServicesCode, FixedPcdGet32 
+ (PcdMemoryTypeEfiRuntimeServicesCode) },

+  { EfiMaxMemoryType,   0  
 }

+};

+

+/**

+   Function to reserve memory below 4GB for EDKII Modules.

+

+   This causes the DXE to dispatch everything under 4GB and allows 
+ Operating

+   System's that require EFI_LOADED_IMAGE to be under 4GB to start.

+   e.g. Xen hypervisor used in Qubes.

+**/

+VOID

+ForceModulesBelow4G (

+  VOID

+  )

+{

+  DEBUG ((DEBUG_INFO, "Building hob to restrict memory resorces to 
+ below 4G.\n"));

+

+  //

+  // Create Memory Type Information HOB

+  //

+  BuildGuidDataHob (

+,

+mDefaultMemoryTypeInformation,

+sizeof (mDefaultMemoryTypeInformation)

+);

+}

+

 /**

Callback function to build resource descriptor HOB

 

@@ -438,6 +472,11 @@ _ModuleEntryPoint (
   // Build other HOBs required by DXE

   BuildGenericHob ();

 

+  // Create a HOB to make resources for EDKII modules below 4G

+  if (!FixedPcdGetBool (PcdDispatchModuleAbove4GMemory)) {

+ForceModulesBelow4G ();

+  }

+

   // Load the DXE Core

   Status = LoadDxeCore ();

   ASSERT_EFI_ERROR (Status);

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf 
b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
index 1847d6481a..c4e4339ede 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.inf
@@ -86,8 +86,15 @@
   gUefiPayloadPkgTokenSpaceGuid.PcdPayloadFdMemSize

   gUefiPayloadPkgTokenSpaceGuid.PcdBootloaderParameter

   gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize

+  gUefiPayloadPkgTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS

+  gUefiPayloadPkgTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory

+  gUefiPayloadPkgTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType

+  gUefiPayloadPkgTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData

+  gUefiPayloadPkgTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode

 

   gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack   ## 
SOMETIMES_CONSUMES

   gEfiMdeModulePkgTokenSpaceGuid.PcdDxeNxMemoryProtectionPolicy ## 
SOMETIMES_CONSUMES

   gEfiMdeModulePkgTokenSpaceGuid.PcdImageProtectionPolicy   ## 
SOMETIMES_CONSUMES

 

+  gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory

+

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dec 
b/UefiPayloadPkg/UefiPayloadPkg.dec
index 551f0a4915..e9204d1168 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -83,6 +83,9 @@ 
gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x0400|UINT32|0x
 

 gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 0xab, 
0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Fix case of protocol

2022-03-04 Thread Guo Dong


It was merged https://github.com/tianocore/edk2/pull/2591

-Original Message-
From: Sean Rhodes  
Sent: Friday, March 4, 2022 4:05 PM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Rhodes, Sean ; Ni, 
Ray ; Ma, Maurice ; You, Benjamin 

Subject: [PATCH] UefiPayloadPkg: Fix case of protocol

Fix case match in  to avoid build failure on Linux.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 UefiPayloadPkg/BlSupportSmm/BlSupportSmm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiPayloadPkg/BlSupportSmm/BlSupportSmm.h 
b/UefiPayloadPkg/BlSupportSmm/BlSupportSmm.h
index 15e604d514..b82f632556 100644
--- a/UefiPayloadPkg/BlSupportSmm/BlSupportSmm.h
+++ b/UefiPayloadPkg/BlSupportSmm/BlSupportSmm.h
@@ -22,7 +22,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  #include 
 #include  #include 
-#include +#include 
 #include  #include 
 #include --
2.32.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87294): https://edk2.groups.io/g/devel/message/87294
Mute This Topic: https://groups.io/mt/89561171/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Provide option to use Boot Splash

2022-03-04 Thread Guo Dong


Maybe the build option is required if there is a case that Bootloader has its 
own logo and doesn't want it be overridden by UEFI payload.

Thanks,
Guo
-Original Message-
From: Ni, Ray  
Sent: Sunday, February 20, 2022 10:25 PM
To: devel@edk2.groups.io; Rhodes, Sean 
Cc: Dong, Guo ; Ma, Maurice ; You, 
Benjamin 
Subject: RE: [edk2-devel] [PATCH] UefiPayloadPkg: Provide option to use Boot 
Splash

Can you avoid introducing the PCD by always including BootLogo driver?

By the way, you changed brotli version. Is that expected?

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sean Rhodes
Sent: Monday, February 21, 2022 5:34 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Rhodes, Sean ; Ni, 
Ray ; Ma, Maurice ; You, Benjamin 

Subject: [edk2-devel] [PATCH] UefiPayloadPkg: Provide option to use Boot Splash

Provide a build option to use a Boot Splash logo.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 MdeModulePkg/Library/BrotliCustomDecompressLib/brotli  | 2 +-
 .../Library/PlatformBootManagerLib/PlatformBootManager.c   | 5 +
 .../PlatformBootManagerLib/PlatformBootManagerLib.inf  | 2 ++
 UefiPayloadPkg/UefiPayloadPkg.dec  | 3 +++
 UefiPayloadPkg/UefiPayloadPkg.dsc  | 7 +++
 UefiPayloadPkg/UefiPayloadPkg.fdf  | 3 +++
 6 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
index f4153a09f8..666c3280cc 16
--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
+++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
@@ -1 +1 @@
-Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea
+Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..3bded489ef 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -243,6 +243,11 @@ PlatformBootManagerAfterConsole (
   Black.Blue = Black.Green = Black.Red = Black.Reserved = 0;

   White.Blue = White.Green = White.Red = White.Reserved = 0xFF;

 

+  if (FixedPcdGetBool (PcdBootSplashImage)) {

+gST->ConOut->ClearScreen (gST->ConOut);

+BootLogoEnableLogo ();

+  }

+

   EfiBootManagerConnectAll ();

   EfiBootManagerRefreshAllBootOption ();

 

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 9c4a9da943..306bd33b7a 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -39,6 +39,7 @@
   UefiRuntimeServicesTableLib

   UefiLib

   UefiBootManagerLib

+  BootLogoLib

   PcdLib

   DxeServicesLib

   MemoryAllocationLib

@@ -73,3 +74,4 @@
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity

   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits

   gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile

+  gUefiPayloadPkgTokenSpaceGuid.PcdBootSplashImage

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dec 
b/UefiPayloadPkg/UefiPayloadPkg.dec
index 551f0a4915..4f5756d575 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -83,6 +83,9 @@ 
gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x0400|UINT32|0x
 

 gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 0xab, 
0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x76, 0xd8, 0x95, 0x41 
}|VOID*|0x0018

 

+# BootSplash Image

+gUefiPayloadPkgTokenSpaceGuid.PcdBootSplashImage|TRUE|BOOLEAN|0x0021

+

 ## FFS filename to find the default variable initial data file.

 # @Prompt FFS Name of variable initial data file

  gUefiPayloadPkgTokenSpaceGuid.PcdNvsDataFile |{ 0x1a, 0xf1, 0xb1, 0xae, 0x42, 
0xcc, 0xcf, 0x4e, 0xac, 0x60, 0xdb, 0xab, 0xf6, 0xca, 0x69, 0xe6 
}|VOID*|0x0025

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1ce96a51c1..64e9e67d62 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -33,6 +33,7 @@
   DEFINE UNIVERSAL_PAYLOAD= FALSE

   DEFINE SECURITY_STUB_ENABLE = TRUE

   DEFINE SMM_SUPPORT  = FALSE

+  DEFINE BOOTSPLASH_IMAGE = FALSE

   #

   # SBL:  UEFI payload for Slim Bootloader

   # COREBOOT: UEFI payload for coreboot

@@ -209,6 +210,7 @@
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf

   
SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf

   
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf

+  Bo

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Provide option to use Boot Splash

2022-03-04 Thread Guo Dong


Please update this patch not to change 
MdeModulePkg/Library/BrotliCustomDecompressLib/brotli

Thanks,
Guo

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sean Rhodes
Sent: Sunday, February 20, 2022 2:34 PM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Rhodes, Sean ; Ni, 
Ray ; Ma, Maurice ; You, Benjamin 

Subject: [edk2-devel] [PATCH] UefiPayloadPkg: Provide option to use Boot Splash

Provide a build option to use a Boot Splash logo.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 MdeModulePkg/Library/BrotliCustomDecompressLib/brotli  | 2 +-
 .../Library/PlatformBootManagerLib/PlatformBootManager.c   | 5 +
 .../PlatformBootManagerLib/PlatformBootManagerLib.inf  | 2 ++
 UefiPayloadPkg/UefiPayloadPkg.dec  | 3 +++
 UefiPayloadPkg/UefiPayloadPkg.dsc  | 7 +++
 UefiPayloadPkg/UefiPayloadPkg.fdf  | 3 +++
 6 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
index f4153a09f8..666c3280cc 16
--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
+++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
@@ -1 +1 @@
-Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea
+Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..3bded489ef 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -243,6 +243,11 @@ PlatformBootManagerAfterConsole (
   Black.Blue = Black.Green = Black.Red = Black.Reserved = 0;

   White.Blue = White.Green = White.Red = White.Reserved = 0xFF;

 

+  if (FixedPcdGetBool (PcdBootSplashImage)) {

+gST->ConOut->ClearScreen (gST->ConOut);

+BootLogoEnableLogo ();

+  }

+

   EfiBootManagerConnectAll ();

   EfiBootManagerRefreshAllBootOption ();

 

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 9c4a9da943..306bd33b7a 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -39,6 +39,7 @@
   UefiRuntimeServicesTableLib

   UefiLib

   UefiBootManagerLib

+  BootLogoLib

   PcdLib

   DxeServicesLib

   MemoryAllocationLib

@@ -73,3 +74,4 @@
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity

   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits

   gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile

+  gUefiPayloadPkgTokenSpaceGuid.PcdBootSplashImage

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dec 
b/UefiPayloadPkg/UefiPayloadPkg.dec
index 551f0a4915..4f5756d575 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -83,6 +83,9 @@ 
gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x0400|UINT32|0x
 

 gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 0xab, 
0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x76, 0xd8, 0x95, 0x41 
}|VOID*|0x0018

 

+# BootSplash Image

+gUefiPayloadPkgTokenSpaceGuid.PcdBootSplashImage|TRUE|BOOLEAN|0x0021

+

 ## FFS filename to find the default variable initial data file.

 # @Prompt FFS Name of variable initial data file

  gUefiPayloadPkgTokenSpaceGuid.PcdNvsDataFile |{ 0x1a, 0xf1, 0xb1, 0xae, 0x42, 
0xcc, 0xcf, 0x4e, 0xac, 0x60, 0xdb, 0xab, 0xf6, 0xca, 0x69, 0xe6 
}|VOID*|0x0025

diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1ce96a51c1..64e9e67d62 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -33,6 +33,7 @@
   DEFINE UNIVERSAL_PAYLOAD= FALSE

   DEFINE SECURITY_STUB_ENABLE = TRUE

   DEFINE SMM_SUPPORT  = FALSE

+  DEFINE BOOTSPLASH_IMAGE = FALSE

   #

   # SBL:  UEFI payload for Slim Bootloader

   # COREBOOT: UEFI payload for coreboot

@@ -209,6 +210,7 @@
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf

   
SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf

   
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf

+  BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf

   
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf

   
FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf

 

@@ -399,6 +401,8 @@
   gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask   | 0x1

 !endif

 

+  gUefiPayloadPkgTokenSpaceGuid.PcdBootSplashImage|$(BOOTSPL

Re: [edk2-devel] [PATCH v1 7/7] UefiPayloadPkg: Invoke GetPhysicalAddressBits() and remove the duplicated code

2022-03-04 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Pu, Yu  
Sent: Wednesday, March 2, 2022 2:19 AM
To: devel@edk2.groups.io
Cc: Pu, Yu ; Dong, Guo ; Ni, Ray 

Subject: [PATCH v1 7/7] UefiPayloadPkg: Invoke GetPhysicalAddressBits() and 
remove the duplicated code

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3394

Invoke GetPhysicalAddressBits() defined in UefiCpuPkg for CPU physical address 
mask calculation and remove the duplicated code in 
UefiPayloadPkg\UefiPayloadEntry

Cc: Guo Dong 
Cc: Ray Ni 

Signed-off-by: Yu Pu 
---
 UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c  | 10 ++  
UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c |  9 ++---
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c 
b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
index 0fed1e36918a..4378aa4f1d97 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c
@@ -4,6 +4,7 @@
   SPDX-License-Identifier: BSD-2-Clause-Patent  **/+#include 
  #include "UefiPayloadEntry.h" @@ -341,7 +342,6 @@ 
BuildGenericHob (
   VOID   ) {-  UINT32   RegEax;   UINT8
PhysicalAddressBits;   EFI_RESOURCE_ATTRIBUTE_TYPE  ResourceAttribute; @@ 
-351,13 +351,7 @@ BuildGenericHob (
   //   // Build CPU memory space and IO space hob   //-  AsmCpuid (0x8000, 
, NULL, NULL, NULL);-  if (RegEax >= 0x8008) {-AsmCpuid 
(0x8008, , NULL, NULL, NULL);-PhysicalAddressBits = 
(UINT8)RegEax;-  } else {-PhysicalAddressBits = 36;-  }+  
PhysicalAddressBits = GetPhysicalAddressBits(NULL, NULL);BuildCpuHob 
(PhysicalAddressBits, 16); diff --git 
a/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c 
b/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
index ac0d58e685c8..c61aeeda7f2e 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/X64/VirtualMemory.c
@@ -25,6 +25,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  #include 
 #include  #include +#include 
 #include  #include 
 #include @@ -738,13 +739,7 @@ 
CreateIdentityMappingPageTables (
   if (Hob != NULL) { PhysicalAddressBits = ((EFI_HOB_CPU 
*)Hob)->SizeOfMemorySpace;   } else {-AsmCpuid (0x8000, , NULL, 
NULL, NULL);-if (RegEax >= 0x8008) {-  AsmCpuid (0x8008, 
, NULL, NULL, NULL);-  PhysicalAddressBits = (UINT8)RegEax;-} 
else {-  PhysicalAddressBits = 36;-}+PhysicalAddressBits = 
GetPhysicalAddressBits (NULL, NULL);   }//-- 
2.30.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87282): https://edk2.groups.io/g/devel/message/87282
Mute This Topic: https://groups.io/mt/89503330/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add i801 SMBus controller DXE

2022-02-24 Thread Guo Dong

Hi Patrick,

You could refer this page https://github.com/tianocore/edk2-platforms on how to 
build platform with EDK2 and edk2-platform repo.

I had thought you added a SMbus driver that could only work on a particular 
device.  I agree with Maurice to put this kind of modules to Edk2-platform repo.
For SpiFlashLib it is library specific for Intel PCH SPI, we ever discussed to 
put to edk2-platform before.  But we temporarily put to EDK2 with other SMM 
modules for convenience since there is only few this kind of modules.
Let me explore a solution to move PCH specific modules to edk2-platform. Maybe 
create PayloadPlatformPkg under edk2-platforms\Platform\Intel to build 
universal UEFI payload from Edk2 repo, and build a separate FV to include PCH 
specific modules from edk2-platform repo. The build script could add the FV 
into the universal payload as a section of universal payload defined by the 
universal payload specification. This way the UEFI payload in EDK2 could be 
generic enough without platform specific modules.

Thanks,
Guo

-Original Message-
From: Dong, Guo 
Sent: Thursday, February 24, 2022 8:54 AM
To: devel@edk2.groups.io; patrick.rudo...@9elements.com; Ma, Maurice 

Cc: Rhodes, Sean ; Ni, Ray ; You, 
Benjamin 
Subject: RE: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add i801 SMBus controller 
DXE


Hi Patrick,

UefiPayloadPkg/Library/SpiFlashLib/SpiFlashLib.inf is a common module as the 
commit message mentioned as below:

* UefiPayloadPkg: Add SpiFlashLib

This is a common SPI Flash library used for the Intel platform that supports 
SPI hardware sequence. This library provides actual SPI flash operation via 
Intel PCH SPI controller.

Thanks,
Guo

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Patrick Rudolph
Sent: Thursday, February 24, 2022 3:46 AM
To: devel@edk2.groups.io; Ma, Maurice 
Cc: Rhodes, Sean ; Dong, Guo ; Ni, 
Ray ; You, Benjamin 
Subject: Re: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add i801 SMBus controller 
DXE

Hi Maurice,
I agree that edk2-platforms is the right place.
How should it be used to build UefiPlayloadPkg? Should it be hooked up as git 
submodule?

Just wondering why you added vendor (or platform) specific code in 
UefiPayloadPkg/Library/SpiFlashLib/SpiFlashLib.inf ?
Please clarify.

Regards,
Patrick Rudolph

On Thu, Feb 17, 2022 at 7:24 PM Ma, Maurice  wrote:
>
> This vendor specific device driver implementation does not seem to fit into 
> UEFI payload package scope well.
>
> Do you think https://github.com/tianocore/edk2-platforms/tree/master/Silicon 
> could be a better location ?
>
> Thanks
> Maurice
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Sean 
> > Rhodes
> > Sent: Thursday, February 17, 2022 9:51
> > To: devel@edk2.groups.io
> > Cc: Dong, Guo ; Patrick Rudolph 
> > ; Ni, Ray ; Ma, 
> > Maurice ; You, Benjamin 
> > 
> > Subject: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add i801 SMBus 
> > controller DXE
> >
> > From: Patrick Rudolph 
> >
> > Implement a subset of the gEfiSmbusHcProtocolGuid using a generic 
> > PCI i801 SMBus controller.
> >
> > Cc: Guo Dong 
> > Cc: Ray Ni 
> > Cc: Maurice Ma 
> > Cc: Benjamin You 
> > Signed-off-by: Patrick Rudolph 
> > ---
> >  .../Library/BrotliCustomDecompressLib/brotli  |   2 +-
> >  UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c| 556
> > ++
> >  UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.h|  17 +
> >  UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.inf  |  45 ++
> >  UefiPayloadPkg/UefiPayloadPkg.dsc |   7 +
> >  UefiPayloadPkg/UefiPayloadPkg.fdf |   5 +
> >  6 files changed, 631 insertions(+), 1 deletion(-)  create mode
> > 100644 UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c
> >  create mode 100644 UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.h
> >  create mode 100644 UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.inf
> >
> > diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> > b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> > index f4153a09f8..666c3280cc 16
> > --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> > +++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> > @@ -1 +1 @@
> > -Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea
> > +Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
> > diff --git a/UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c
> > b/UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c
> > new file mode 100644
> > index 00..7bf7b893ad
> > --- /dev/null
> > +++ b/UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c
> > @@ -0,0 +1,556 @@
> > +/** @file+  Implementation for a generic i801 SMBus 
> > +driver.++Copyright (c)
> > 2016, Intel

Re: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add i801 SMBus controller DXE

2022-02-24 Thread Guo Dong

Hi Patrick,

UefiPayloadPkg/Library/SpiFlashLib/SpiFlashLib.inf is a common module as the 
commit message mentioned as below:

* UefiPayloadPkg: Add SpiFlashLib

This is a common SPI Flash library used for the Intel platform that
supports SPI hardware sequence. This library provides actual SPI flash
operation via Intel PCH SPI controller.

Thanks,
Guo

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Patrick Rudolph
Sent: Thursday, February 24, 2022 3:46 AM
To: devel@edk2.groups.io; Ma, Maurice 
Cc: Rhodes, Sean ; Dong, Guo ; Ni, 
Ray ; You, Benjamin 
Subject: Re: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add i801 SMBus controller 
DXE

Hi Maurice,
I agree that edk2-platforms is the right place.
How should it be used to build UefiPlayloadPkg? Should it be hooked up as git 
submodule?

Just wondering why you added vendor (or platform) specific code in 
UefiPayloadPkg/Library/SpiFlashLib/SpiFlashLib.inf ?
Please clarify.

Regards,
Patrick Rudolph

On Thu, Feb 17, 2022 at 7:24 PM Ma, Maurice  wrote:
>
> This vendor specific device driver implementation does not seem to fit into 
> UEFI payload package scope well.
>
> Do you think https://github.com/tianocore/edk2-platforms/tree/master/Silicon 
> could be a better location ?
>
> Thanks
> Maurice
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Sean 
> > Rhodes
> > Sent: Thursday, February 17, 2022 9:51
> > To: devel@edk2.groups.io
> > Cc: Dong, Guo ; Patrick Rudolph 
> > ; Ni, Ray ; Ma, 
> > Maurice ; You, Benjamin 
> > 
> > Subject: [edk2-devel] [PATCH 1/2] UefiPayloadPkg: Add i801 SMBus 
> > controller DXE
> >
> > From: Patrick Rudolph 
> >
> > Implement a subset of the gEfiSmbusHcProtocolGuid using a generic 
> > PCI i801 SMBus controller.
> >
> > Cc: Guo Dong 
> > Cc: Ray Ni 
> > Cc: Maurice Ma 
> > Cc: Benjamin You 
> > Signed-off-by: Patrick Rudolph 
> > ---
> >  .../Library/BrotliCustomDecompressLib/brotli  |   2 +-
> >  UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c| 556
> > ++
> >  UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.h|  17 +
> >  UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.inf  |  45 ++
> >  UefiPayloadPkg/UefiPayloadPkg.dsc |   7 +
> >  UefiPayloadPkg/UefiPayloadPkg.fdf |   5 +
> >  6 files changed, 631 insertions(+), 1 deletion(-)  create mode 
> > 100644 UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c
> >  create mode 100644 UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.h
> >  create mode 100644 UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.inf
> >
> > diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> > b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> > index f4153a09f8..666c3280cc 16
> > --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> > +++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> > @@ -1 +1 @@
> > -Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea
> > +Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
> > diff --git a/UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c
> > b/UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c
> > new file mode 100644
> > index 00..7bf7b893ad
> > --- /dev/null
> > +++ b/UefiPayloadPkg/SmbusDxe/SMBusi801Dxe.c
> > @@ -0,0 +1,556 @@
> > +/** @file+  Implementation for a generic i801 SMBus 
> > +driver.++Copyright (c)
> > 2016, Intel Corporation. All rights reserved.+SPDX-License-Identifier:
> > BSD-2-Clause-Patent+++**/++#include "SMBusi801Dxe.h"+#include
> > +#include +#include 
> > +#include +#include 
> > +#include
> > ++EFI_HANDLE  mDriverHandle =
> > NULL;+UINT32  PciDevice = 0;++/* SMBus register offsets. */+#define
> > SMBHSTSTAT  0x0+#define SMBHSTCTL   0x2+#define SMBHSTCMD
> > 0x3+#define SMBXMITADD  0x4+#define SMBHSTDAT0  0x5+#define
> > SMBHSTDAT1  0x6+#define SMBBLKDAT   0x7+#define SMBTRNSADD
> > 0x9+#define SMBSLVDATA  0xa+#define SMLINK_PIN_CTL  0xe+#define
> > SMBUS_PIN_CTL   0xf+#define SMBSLVCMD   0x11++/* I801 command
> > constants */+#define I801_QUICK   (0 << 2)+#define I801_BYTE
> > (1
> > << 2)+#define I801_BYTE_DATA   (2 << 2)+#define I801_WORD_DATA   (3
> > << 2)+#define I801_PROCESS_CALL(4 << 2)+#define I801_BLOCK_DATA
> > (5 << 2)+#define I801_I2C_BLOCK_DATA  (6 << 2) /* ICH5 and later */++/*
> > I801 Host Control register bits */+#define SMBHSTCNT_INTREN (1 <<
> > 0)+#define SMBHSTCNT_KILL   (1 << 1)+#define SMBHSTCNT_LAST_BYTE
> > (1 << 5)+#define SMBHSTCN

[edk2-devel][PATCH] Maintainers.txt: Add new reviewer for UefiPayloadPkg

2022-02-23 Thread Guo Dong
From: Guo Dong 

Add Sean Rhodes as UefiPayload reviewer mainly focus on
UEFI payload for coreboot support.

Signed-off-by: Guo Dong 
Cc: Ray Ni 
Cc: Benjamin You 
Cc: Maurice Ma 
Cc: Michael D Kinney 
Cc: Sean Rhodes 
---
 Maintainers.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index 924069187e..d26f91c02e 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -601,6 +601,7 @@ M: Guo Dong  [gdong1]
 M: Ray Ni  [niruiyu]
 R: Maurice Ma  [mauricema]
 R: Benjamin You  [BenjaminYou]
+R: Sean Rhodes 
 S: Maintained
 
 UnitTestFrameworkPkg
-- 
2.35.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#86935): https://edk2.groups.io/g/devel/message/86935
Mute This Topic: https://groups.io/mt/89353894/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




  1   2   3   4   >