From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.1501.1574907532401861037 for ; Wed, 27 Nov 2019 18:18:52 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: michael.a.kubacki@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Nov 2019 18:18:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,251,1571727600"; d="scan'208";a="221174206" Received: from makuback-desk1.amr.corp.intel.com ([10.7.159.162]) by orsmga002.jf.intel.com with ESMTP; 27 Nov 2019 18:18:51 -0800 From: "Kubacki, Michael A" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Liming Gao Subject: [edk2-platforms][PATCH V2 39/47] MinPlatformPkg: Install advanced feature FVs by stage enabled Date: Wed, 27 Nov 2019 18:18:30 -0800 Message-Id: <20191128021838.42640-1-michael.a.kubacki@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 This change updates the FvReportLib instance in MinPlatformPkg to only install advanced feature firmware volumes if the advanced feature stage should be active. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec | 1 + Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf | 1 + Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c | 50 +++++++++++--------- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec index 21013cc87c..7f74ac9380 100644 --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec @@ -272,6 +272,7 @@ SetCacheMtrrLib|Include/Library/SetCacheMtrrLib.h # Stage 3 - boot to shell only # Stage 4 - boot to OS # Stage 5 - boot to OS with security boot enabled + # Stage 6 - boot with advanced features enabled # gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4|UINT8|0xF00000A0 diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf index 1ce3034fcc..ef03e110bd 100644 --- a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf @@ -30,6 +30,7 @@ PeiReportFvLib.c [Pcd] + gMinPlatformPkgTokenSpaceGuid.PcdBootStage ## CONSUMES gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode ## CONSUMES gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress ## CONSUMES gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize ## CONSUMES diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c index b61587f6e3..0d805d6fe7 100644 --- a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c @@ -40,20 +40,22 @@ ReportPreMemFv ( NULL, 0 ); - DEBUG (( - DEBUG_INFO, - "Install FlashFvAdvancedPreMemory - 0x%x, 0x%x\n", - PcdGet32 (PcdFlashFvAdvancedPreMemoryBase), - PcdGet32 (PcdFlashFvAdvancedPreMemorySize) - )); - PeiServicesInstallFvInfo2Ppi ( - &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvAdvancedPreMemoryBase))->FileSystemGuid), - (VOID *) (UINTN) PcdGet32 (PcdFlashFvAdvancedPreMemoryBase), - PcdGet32 (PcdFlashFvAdvancedPreMemorySize), - NULL, - NULL, - 0 - ); + if (PcdGet8 (PcdBootStage) >= 6) { + DEBUG (( + DEBUG_INFO, + "Install FlashFvAdvancedPreMemory - 0x%x, 0x%x\n", + PcdGet32 (PcdFlashFvAdvancedPreMemoryBase), + PcdGet32 (PcdFlashFvAdvancedPreMemorySize) + )); + PeiServicesInstallFvInfo2Ppi ( + &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvAdvancedPreMemoryBase))->FileSystemGuid), + (VOID *) (UINTN) PcdGet32 (PcdFlashFvAdvancedPreMemoryBase), + PcdGet32 (PcdFlashFvAdvancedPreMemorySize), + NULL, + NULL, + 0 + ); + } } VOID @@ -122,15 +124,17 @@ ReportPostMemFv ( NULL, 0 ); - DEBUG ((DEBUG_INFO, "Install FlashFvAdvanced - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvAdvancedBase), PcdGet32 (PcdFlashFvAdvancedSize))); - PeiServicesInstallFvInfo2Ppi ( - &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvAdvancedBase))->FileSystemGuid), - (VOID *) (UINTN) PcdGet32 (PcdFlashFvAdvancedBase), - PcdGet32 (PcdFlashFvAdvancedSize), - NULL, - NULL, - 0 - ); + if (PcdGet8 (PcdBootStage) >= 6) { + DEBUG ((DEBUG_INFO, "Install FlashFvAdvanced - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvAdvancedBase), PcdGet32 (PcdFlashFvAdvancedSize))); + PeiServicesInstallFvInfo2Ppi ( + &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvAdvancedBase))->FileSystemGuid), + (VOID *) (UINTN) PcdGet32 (PcdFlashFvAdvancedBase), + PcdGet32 (PcdFlashFvAdvancedSize), + NULL, + NULL, + 0 + ); + } } // -- 2.16.2.windows.1