From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mx.groups.io with SMTP id smtpd.web11.12.1662722113511350722 for ; Fri, 09 Sep 2022 04:15:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OV9/nMO+; spf=pass (domain: gmail.com, ip: 209.85.221.52, mailfrom: theojehl76@gmail.com) Received: by mail-wr1-f52.google.com with SMTP id b5so2171080wrr.5 for ; Fri, 09 Sep 2022 04:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=WXu5pn3lc2kDPcBwZYf7zNz9QASlu0/2SxwQYVyd4F8=; b=OV9/nMO+p5iI1dgePhEgVhKrLZgveTQ/4yRig4/naMSq5j0oKs+l41K1FTqz/DckTA F1ORSvzJQgX4TwYJ3rwHL/BGwWTGdkhyXR7HR073+JWxarzMdfwx4fx1S0j/oYcm/DaC aFlDeteDBjtGTeOhq4nJgQY7X8tZV9Wp4q5Ya6iAhe+DOS40Ky8qa3Qol34ueJ5z6fnu bTMAcsI7LtbHGWusCreatlbUpXtppHpueoxLEv+WPbGt+zK12M82E2reDQbJt+GQvEBu 1wvxrdohZTiS3itaOTG0jEpbZ1chduFhd9/QuQERVLhNupObluvZ+qNKy4HF/8uhqr+A HZIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=WXu5pn3lc2kDPcBwZYf7zNz9QASlu0/2SxwQYVyd4F8=; b=vmBQqkn0Cf6OHn0qK84M3PsLgcxihB92jPa9zxIhrgsMwsUB0XjkLvBqF6MRYedL8H PVo2BG7SvfrTqWFttuelOYKSM53RhNOuiymWV9OG02YZVPjre1yuukpBIfcL2rAG909e LDQwKhMOaNYFddB53bzoVZOGt47nFvdxbWEIhj+nm1hkK4a5UUCVDq8Up1HFnXC8sVyy WTeFI+9+9YsZVf+D6RjHj1tVbHQE9RVrHxulzT3hzJUbWbVp5OcgwP5zm8klub9z4GkJ QJmgO7+Q2EPWmXcO5iPdnY+Ie6XhpOX8ZfofF4pju57NTOh5cC8jLUW7vOpByYC9c9pv 2D6w== X-Gm-Message-State: ACgBeo2gckQ4aYSbjrdK91fV8heCALOUD9K10QauiyvkayRU0cNdHeNx eDxoek/owuBPL8ml4ffvAhBq8Wh3zjMEK82r X-Google-Smtp-Source: AA6agR6AFQFIH0l9a0jlVM5sTBhxHuKl+0D3oKfLKgjNIj5H530QFPavmATEgCD8hVhfLKAwLMJwZg== X-Received: by 2002:adf:f8ca:0:b0:226:e456:1896 with SMTP id f10-20020adff8ca000000b00226e4561896mr7869846wrq.177.1662722111527; Fri, 09 Sep 2022 04:15:11 -0700 (PDT) Return-Path: Received: from localhost.localdomain (eth-east-parth2-46-193-66-249.wb.wifirst.net. [46.193.66.249]) by smtp.gmail.com with ESMTPSA id i11-20020adfb64b000000b00228df23bd51sm240537wre.82.2022.09.09.04.15.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 04:15:10 -0700 (PDT) From: =?UTF-8?B?VGjDqW8gSmVobA==?= To: devel@edk2.groups.io Cc: Leif Lindholm , Michael D Kinney , Isaac Oram , Pedro Falcato , Gerd Hoffmann , Stefan Hajnoczi Subject: [[edk2-platforms] Patch V2 2/4] QemuOpenBoardPkg: Enable stage 2 Date: Fri, 9 Sep 2022 13:15:02 +0200 Message-Id: <20220909111504.1661-3-theojehl76@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: <20220909111504.1661-1-theojehl76@gmail.com> References: <20220909111504.1661-1-theojehl76@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Enables MinPlatform stage 2 (memory init) functionality. Cc: Leif Lindholm =0D Cc: Michael D Kinney =0D Cc: Isaac Oram =0D Cc: Pedro Falcato =0D Cc: Gerd Hoffmann =0D Cc: Stefan Hajnoczi =0D Signed-off-by: Th=C3=A9o Jehl --- 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/Pl= atform/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=0D +# Common DSC content to begin Stage 2 enabling=0D +#=0D +# @copyright=0D +# Copyright (C) 2022 Th=C3=A9o Jehl=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +##=0D +=0D +[LibraryClasses.Common]=0D + ResetSystemLib | OvmfPkg/Library/ResetSystemLib/BaseResetSystem= Lib.inf=0D + PciHostBridgeLib | OvmfPkg/Library/PciHostBridgeLib/PciHostBridge= Lib.inf=0D + PciHostBridgeUtilityLib | OvmfPkg/Library/PciHostBridgeUtilityLib/PciHos= tBridgeUtilityLib.inf=0D + DxeHardwareInfoLib | OvmfPkg/Library/HardwareInfoLib/DxeHardwareInf= oLib.inf=0D +=0D +[LibraryClasses.Common.PEIM]=0D + MpInitLib | UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf= =0D + TimerLib | OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.= inf=0D +=0D +[LibraryClasses.Common.DXE_DRIVER, LibraryClasses.Common.DXE_RUNTIME_DRIVE= R, LibraryClasses.Common.DXE_SMM_DRIVER, LibraryClasses.Common.UEFI_DRIVER,= LibraryClasses.Common.UEFI_APPLICATION, LibraryClasses.Common.SMM_CORE]=0D + PciLib | OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI4= 40FxQ35.inf=0D +=0D +[Components.$(PEI_ARCH)]=0D + UefiCpuPkg/CpuMpPei/CpuMpPei.inf=0D + MinPlatformPkg/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPostMem.inf= =0D + MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPostMem.inf=0D + MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf=0D +=0D +[Components.$(DXE_ARCH)]=0D + MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf=0D + MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf=0D 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 =3D Build/$(PLATFORM_NAME)=0D BUILD_TARGETS =3D DEBUG | RELEASE | NOOPT=0D SKUID_IDENTIFIER =3D ALL=0D - SMM_REQUIRED =3D TRUE=0D + SMM_REQUIRED =3D FALSE=0D =0D !ifndef $(PEI_ARCH)=0D !error "PEI_ARCH must be specified to build this feature!"=0D @@ -38,7 +38,7 @@ OvmfPkg/OvmfPkg.dec=0D =0D [PcdsFixedAtBuild]=0D - gMinPlatformPkgTokenSpaceGuid.PcdBootStage | = 1=0D + gMinPlatformPkgTokenSpaceGuid.PcdBootStage | = 2=0D =0D gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel | = 0x802A00C7=0D gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel | = 0x802A00C7=0D @@ -127,6 +127,7 @@ !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc=0D !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc=0D !include QemuOpenBoardPkg/Include/Dsc/Stage1.dsc.inc=0D +!include QemuOpenBoardPkg/Include/Dsc/Stage2.dsc.inc=0D =0D [LibraryClasses.Common]=0D QemuOpenFwCfgLib | QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/Qemu= OpenFwCfgLib.inf=0D 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 = =3D 0x800000 !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf=0D FvNameGuid =3D 5A1D6978-BABE-42F9-A629-F7B3B6A1E1BD=0D =0D + INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf=0D +=0D + INF MinPlatformPkg/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPostMem= .inf=0D + INF MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPostMem.inf= =0D +=0D + INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf=0D +=0D + INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.i= nf=0D + INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf=0D +=0D [FV.FvBsp]=0D !include MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf=0D FvNameGuid =3D FCA0BC4A-994D-4EF9-BD56-A8C45872C2A8=0D diff --git a/Platform/Qemu/QemuOpenBoardPkg/Library/BoardInitLib/BoardInitL= ib.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 ( =0D DEBUG ((DEBUG_INFO, "BoardDetect()\n"));=0D =0D - //Retrieve chipset device ID and vendor ID=0D + //=0D + // Retrieve chipset device ID and vendor ID=0D + //=0D +=0D DeviceID =3D PciCf8Read16 (PCI_CF8_LIB_ADDRESS (0, 0, 0, PCI_DEVICE_ID_O= FFSET));=0D VendorID =3D PciCf8Read16 (PCI_CF8_LIB_ADDRESS (0, 0, 0, PCI_VENDOR_ID_O= FFSET));=0D =0D diff --git a/Platform/Qemu/QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/QemuOp= enFwCfgLib.c b/Platform/Qemu/QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/Qemu= OpenFwCfgLib.c index ec3ca9d5b644..dc7a9241aff3 100644 --- a/Platform/Qemu/QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/QemuOpenFwCfg= Lib.c +++ b/Platform/Qemu/QemuOpenBoardPkg/Library/QemuOpenFwCfgLib/QemuOpenFwCfg= Lib.c @@ -103,14 +103,14 @@ QemuFwCfgIsPresent ( =0D @param String Pointer to an ASCII string to match in the database=0D @param FWConfigFile Buffer for the config file=0D - @retval EFI_STATUS - Entry was found, FWConfigFile is populated=0D - @retval EFI_ERROR - Entry was not found=0D + @retval EFI_STATUS Entry was found, FWConfigFile is populated=0D + @retval EFI_ERROR Entry was not found=0D **/=0D EFI_STATUS=0D EFIAPI=0D QemuFwCfgFindFile (=0D - IN CHAR8 *String,=0D - OUT QEMU_FW_CFG_FILE *FWConfigFile=0D + IN CHAR8 *String,=0D + OUT QEMU_FW_CFG_FILE *FWConfigFile=0D )=0D {=0D QEMU_FW_CFG_FILE FirmwareConfigFile;=0D --=20 2.32.1 (Apple Git-133)