public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Théo Jehl" <theojehl76@gmail.com>
To: devel@edk2.groups.io
Cc: Leif Lindholm <quic_llindhol@quicinc.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Isaac Oram <isaac.w.oram@intel.com>,
	Pedro Falcato <pedro.falcato@gmail.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Stefan Hajnoczi <stefanha@gmail.com>
Subject: [[edk2-platforms] Patch V2 2/4] QemuOpenBoardPkg: Enable stage 2
Date: Fri,  9 Sep 2022 13:15:02 +0200	[thread overview]
Message-ID: <20220909111504.1661-3-theojehl76@gmail.com> (raw)
In-Reply-To: <20220909111504.1661-1-theojehl76@gmail.com>

Enables MinPlatform stage 2 (memory init) functionality.

Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>

Signed-off-by: Théo Jehl <theojehl76@gmail.com>
---
 Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage2.dsc.inc                  | 31 ++++++++++
 Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc                        |  5 +-
 Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf                        | 10 +++
 Platform/Qemu/QemuOpenBoardPkg/Library/BoardInitLib/BoardInitLib.c         |  5 +-
 Platform/Qemu/QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/QemuOpenFwCfgLib.c |  8 +--
 5 files changed, 52 insertions(+), 7 deletions(-)

diff --git a/Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage2.dsc.inc b/Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage2.dsc.inc
new file mode 100644
index 000000000000..9862f1f5f384
--- /dev/null
+++ b/Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage2.dsc.inc
@@ -0,0 +1,31 @@
+## @file
+# Common DSC content to begin Stage 2 enabling
+#
+# @copyright
+# Copyright (C) 2022 Théo Jehl
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[LibraryClasses.Common]
+  ResetSystemLib          | OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf
+  PciHostBridgeLib        | OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf
+  PciHostBridgeUtilityLib | OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf
+  DxeHardwareInfoLib      | OvmfPkg/Library/HardwareInfoLib/DxeHardwareInfoLib.inf
+
+[LibraryClasses.Common.PEIM]
+  MpInitLib               | UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
+  TimerLib                | OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf
+
+[LibraryClasses.Common.DXE_DRIVER, LibraryClasses.Common.DXE_RUNTIME_DRIVER, LibraryClasses.Common.DXE_SMM_DRIVER, LibraryClasses.Common.UEFI_DRIVER, LibraryClasses.Common.UEFI_APPLICATION, LibraryClasses.Common.SMM_CORE]
+  PciLib                  | OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
+
+[Components.$(PEI_ARCH)]
+  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
+  MinPlatformPkg/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPostMem.inf
+  MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPostMem.inf
+  MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
+
+[Components.$(DXE_ARCH)]
+  MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
+  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
diff --git a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc b/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc
index e170f5235340..897ba727cdb2 100644
--- a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc
+++ b/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc
@@ -17,7 +17,7 @@
   OUTPUT_DIRECTORY            = Build/$(PLATFORM_NAME)
   BUILD_TARGETS               = DEBUG | RELEASE | NOOPT
   SKUID_IDENTIFIER            = ALL
-  SMM_REQUIRED                = TRUE
+  SMM_REQUIRED                = FALSE
 
 !ifndef $(PEI_ARCH)
   !error "PEI_ARCH must be specified to build this feature!"
@@ -38,7 +38,7 @@
   OvmfPkg/OvmfPkg.dec
 
 [PcdsFixedAtBuild]
-  gMinPlatformPkgTokenSpaceGuid.PcdBootStage                            | 1
+  gMinPlatformPkgTokenSpaceGuid.PcdBootStage                            | 2
 
   gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel                      | 0x802A00C7
   gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel                 | 0x802A00C7
@@ -127,6 +127,7 @@
 !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
 !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
 !include QemuOpenBoardPkg/Include/Dsc/Stage1.dsc.inc
+!include QemuOpenBoardPkg/Include/Dsc/Stage2.dsc.inc
 
 [LibraryClasses.Common]
   QemuOpenFwCfgLib        | QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/QemuOpenFwCfgLib.inf
diff --git a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf b/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf
index ccd18d559fa9..548397dedb5b 100644
--- a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf
+++ b/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf
@@ -155,6 +155,16 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize             = 0x800000
   !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
   FvNameGuid    = 5A1D6978-BABE-42F9-A629-F7B3B6A1E1BD
 
+  INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf
+
+  INF MinPlatformPkg/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPostMem.inf
+  INF MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPostMem.inf
+
+  INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
+
+  INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
+  INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
+
 [FV.FvBsp]
   !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf
   FvNameGuid    = FCA0BC4A-994D-4EF9-BD56-A8C45872C2A8
diff --git a/Platform/Qemu/QemuOpenBoardPkg/Library/BoardInitLib/BoardInitLib.c b/Platform/Qemu/QemuOpenBoardPkg/Library/BoardInitLib/BoardInitLib.c
index 17b0b703fe59..e85d99403fb1 100644
--- a/Platform/Qemu/QemuOpenBoardPkg/Library/BoardInitLib/BoardInitLib.c
+++ b/Platform/Qemu/QemuOpenBoardPkg/Library/BoardInitLib/BoardInitLib.c
@@ -34,7 +34,10 @@ BoardDetect (
 
   DEBUG ((DEBUG_INFO, "BoardDetect()\n"));
 
-  //Retrieve chipset device ID and vendor ID
+  //
+  // Retrieve chipset device ID and vendor ID
+  //
+
   DeviceID = PciCf8Read16 (PCI_CF8_LIB_ADDRESS (0, 0, 0, PCI_DEVICE_ID_OFFSET));
   VendorID = PciCf8Read16 (PCI_CF8_LIB_ADDRESS (0, 0, 0, PCI_VENDOR_ID_OFFSET));
 
diff --git a/Platform/Qemu/QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/QemuOpenFwCfgLib.c b/Platform/Qemu/QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/QemuOpenFwCfgLib.c
index ec3ca9d5b644..dc7a9241aff3 100644
--- a/Platform/Qemu/QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/QemuOpenFwCfgLib.c
+++ b/Platform/Qemu/QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/QemuOpenFwCfgLib.c
@@ -103,14 +103,14 @@ QemuFwCfgIsPresent (
 
   @param String Pointer to an ASCII string to match in the database
   @param FWConfigFile Buffer for the config file
-  @retval EFI_STATUS - Entry was found, FWConfigFile is populated
-  @retval EFI_ERROR - Entry was not found
+  @retval EFI_STATUS Entry was found, FWConfigFile is populated
+  @retval EFI_ERROR Entry was not found
 **/
 EFI_STATUS
 EFIAPI
 QemuFwCfgFindFile (
-  IN CHAR8              *String,
-  OUT QEMU_FW_CFG_FILE  *FWConfigFile
+  IN  CHAR8              *String,
+  OUT QEMU_FW_CFG_FILE   *FWConfigFile
   )
 {
   QEMU_FW_CFG_FILE  FirmwareConfigFile;
-- 
2.32.1 (Apple Git-133)


  parent reply	other threads:[~2022-09-09 11:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09 11:15 [[edk2-platforms] Patch V2 0/4] QemuOpenBoardPkg: Add QemuOpenBoardPkg Théo Jehl
2022-09-09 11:15 ` [[edk2-platforms] Patch V2 1/4] " Théo Jehl
2022-09-09 11:15 ` Théo Jehl [this message]
2022-09-09 11:15 ` [[edk2-platforms] Patch V2 3/4] QemuOpenBoardPkg: Enable stage 3 Théo Jehl
2022-09-09 11:15 ` [[edk2-platforms] Patch V2 4/4] QemuOpenBoardPkg: Enable stage 4 Théo Jehl
2022-09-09 14:10 ` [[edk2-platforms] Patch V2 0/4] QemuOpenBoardPkg: Add QemuOpenBoardPkg Isaac Oram

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20220909111504.1661-3-theojehl76@gmail.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

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

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