[edk2] [Patch][edk2-platforms/devel-MinnowBoard3] Enable fastboot

Guo, Mang posted 1 patch 7 years, 1 month ago
Failed in applying to current master (apply log)
.../PlatformPostMemPei/PlatformInit.c              | 10 +--------
.../PlatformPreMemPei/FvCallback.c                 | 24 ++++++++++++++--------
.../BroxtonPlatformPkg/PlatformDsc/Components.dsc  | 10 +++++++++
Platform/BroxtonPlatformPkg/PlatformPkg.fdf        |  2 +-
Platform/BroxtonPlatformPkg/PlatformPkgIA32.dsc    |  2 +-
Platform/BroxtonPlatformPkg/PlatformPkgX64.dsc     |  2 +-
6 files changed, 30 insertions(+), 20 deletions(-)
[edk2] [Patch][edk2-platforms/devel-MinnowBoard3] Enable fastboot
Posted by Guo, Mang 7 years, 1 month ago
Please ignore previous patch. Fixed format issue.


1. Unload UNDI if fastboot enable. 2. Optimized the FV decompressing process

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Mang <mang.guo@intel.com>
---
 .../PlatformPostMemPei/PlatformInit.c              | 10 +--------
 .../PlatformPreMemPei/FvCallback.c                 | 24 ++++++++++++++--------
 .../BroxtonPlatformPkg/PlatformDsc/Components.dsc  | 10 +++++++++
 Platform/BroxtonPlatformPkg/PlatformPkg.fdf        |  2 +-
 Platform/BroxtonPlatformPkg/PlatformPkgIA32.dsc    |  2 +-
 Platform/BroxtonPlatformPkg/PlatformPkgX64.dsc     |  2 +-
 6 files changed, 30 insertions(+), 20 deletions(-)

diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c
index 6e8d4ab..0853f8f 100644
--- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c
+++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c
@@ -48,15 +48,7 @@ static EFI_PEI_PPI_DESCRIPTOR       mBoardPostMemInitStartPpi[] = {
 };
 
 static EFI_PEI_PPI_DESCRIPTOR       mPpiList[] = {
-  {
-    //
-    // This PPI is hard coded to be installed as SPI boot (vs. eMMC boot)
-    // to trigger  GetFvNotifyCallback()
-    //
-    EFI_PEI_PPI_DESCRIPTOR_PPI,
-    &gCseSpiSelectPpiGuid,
-    NULL
-  },
+
   {
     EFI_PEI_PPI_DESCRIPTOR_PPI,
     &gEfiPeiMasterBootModePpiGuid,
diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/FvCallback.c b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/FvCallback.c
index 6dcdc75..91ac6f5 100644
--- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/FvCallback.c
+++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/FvCallback.c
@@ -1,7 +1,7 @@
 /** @file
   Locate and install Firmware Volume Hob's Once there is main memory.
 
-  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -277,6 +277,7 @@ ParseObbPayload (
   EFI_GUID                         *FvName;
   FSP_INFO_HEADER                  *FspHeader;
   UINT32                           FspSImageBase;
+  VOID                             *Memory;
 
   DEBUG ((EFI_D_INFO, "Parsing and checking OBB Payload\n"));
 
@@ -370,13 +371,20 @@ ParseObbPayload (
       PlatformInfo->FvMain3Base = (UINTN) FvHeader;
       PlatformInfo->FvMain3Length = (UINT32) (FvHeader->FvLength);
     } else if (!CompareGuid(FvName, &gFspSFirmwareFileSystemFvGuid)) {
-      PeiServicesInstallFvInfoPpi (
-        NULL,
-        FvHeader,
-        (UINT32) (FvHeader->FvLength),
-        NULL,
-        NULL
-        );
+      Memory = AllocatePages (EFI_SIZE_TO_PAGES ((UINT32) (FvHeader->FvLength)));
+      if(Memory !=NULL) {
+        CopyMem (Memory, FvHeader, (UINT32) (FvHeader->FvLength));
+        PeiServicesInstallFvInfoPpi (
+          NULL,
+          (VOID *) Memory,
+          (UINT32) (FvHeader->FvLength),
+          NULL,
+          NULL
+          );
+      } else  {
+        ASSERT (FALSE);
+      }
+
     }//if/else S3
 
     FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) ((UINTN) FvHeader + (UINTN) FvHeader->FvLength);
diff --git a/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc b/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc
index d3be2da..d39ec6d 100644
--- a/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc
+++ b/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc
@@ -213,6 +213,16 @@
   $(PLATFORM_PACKAGE_COMMON)/SampleCode/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf
 !endif
 
+
+  PerformancePkg/Dp_App/Dp.inf {
+  <LibraryClasses>
+  !if $(PERFORMANCE_ENABLE) == TRUE
+    PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
+    TimerLib|$(PLATFORM_PACKAGE_COMMON)/Library/PlatformTscTimerLib/DxeTscTimerLib.inf
+  !endif
+  }
+
+
 !if $(TPM12_ENABLE) == TRUE
   SecurityPkg/Tcg/TcgDxe/TcgDxe.inf
   SecurityPkg/Tcg/TcgSmm/TcgSmm.inf
diff --git a/Platform/BroxtonPlatformPkg/PlatformPkg.fdf b/Platform/BroxtonPlatformPkg/PlatformPkg.fdf
index 2476407..c117245 100644
--- a/Platform/BroxtonPlatformPkg/PlatformPkg.fdf
+++ b/Platform/BroxtonPlatformPkg/PlatformPkg.fdf
@@ -670,7 +670,7 @@ APRIORI DXE {
   # LAN/Network
   #
 !if $(NETWORK_ENABLE) == TRUE
-  FILE DRIVER = 22DE1691-D65D-456a-993E-A253DD1F308C {
+  FILE DRIVER = 2E561D56-4863-44F7-960D-EF2D7F2D35BB {
     SECTION PE32 = BroxtonPlatformPkg/Common/Binaries/UNDI/I210PcieUndiDxe/E7320X3.EFI
     SECTION UI = "UNDI"
   }
diff --git a/Platform/BroxtonPlatformPkg/PlatformPkgIA32.dsc b/Platform/BroxtonPlatformPkg/PlatformPkgIA32.dsc
index 083e32b..6109a76 100644
--- a/Platform/BroxtonPlatformPkg/PlatformPkgIA32.dsc
+++ b/Platform/BroxtonPlatformPkg/PlatformPkgIA32.dsc
@@ -99,7 +99,7 @@
   !else
     PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
   !endif
-  TimerLib|$(PLATFORM_PACKAGE_COMMON)/Library/PlatformTscTimerLib/DxeTscTimerLib.inf
+  TimerLib|$(PLATFORM_PACKAGE_COMMON)/Library/PlatformTscTimerLib/PeiTscTimerLib.inf
 !endif
 
 [LibraryClasses.IA32.DXE_DRIVER]
diff --git a/Platform/BroxtonPlatformPkg/PlatformPkgX64.dsc b/Platform/BroxtonPlatformPkg/PlatformPkgX64.dsc
index 19b8f34..cdd91b3 100644
--- a/Platform/BroxtonPlatformPkg/PlatformPkgX64.dsc
+++ b/Platform/BroxtonPlatformPkg/PlatformPkgX64.dsc
@@ -99,7 +99,7 @@
   !else
     PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
   !endif
-  TimerLib|$(PLATFORM_PACKAGE_COMMON)/Library/PlatformTscTimerLib/DxeTscTimerLib.inf
+  TimerLib|$(PLATFORM_PACKAGE_COMMON)/Library/PlatformTscTimerLib/PeiTscTimerLib.inf
 !endif
 
 [LibraryClasses.IA32.DXE_DRIVER]
-- 
2.10.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch][edk2-platforms/devel-MinnowBoard3] Enable fastboot
Posted by Wei, David 7 years, 1 month ago
Reviewed-by: zwei4 <david.wei@intel.com>


Thanks,
David  Wei                                 


-----Original Message-----
From: Guo, Mang 
Sent: Thursday, March 02, 2017 3:55 PM
To: edk2-devel@lists.01.org
Cc: Wei, David <david.wei@intel.com>; Lu, ShifeiX A <shifeix.a.lu@intel.com>
Subject: [Patch][edk2-platforms/devel-MinnowBoard3] Enable fastboot

Please ignore previous patch. Fixed format issue.


1. Unload UNDI if fastboot enable. 2. Optimized the FV decompressing process

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Mang <mang.guo@intel.com>
---
 .../PlatformPostMemPei/PlatformInit.c              | 10 +--------
 .../PlatformPreMemPei/FvCallback.c                 | 24 ++++++++++++++--------
 .../BroxtonPlatformPkg/PlatformDsc/Components.dsc  | 10 +++++++++
 Platform/BroxtonPlatformPkg/PlatformPkg.fdf        |  2 +-
 Platform/BroxtonPlatformPkg/PlatformPkgIA32.dsc    |  2 +-
 Platform/BroxtonPlatformPkg/PlatformPkgX64.dsc     |  2 +-
 6 files changed, 30 insertions(+), 20 deletions(-)

diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c
index 6e8d4ab..0853f8f 100644
--- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c
+++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPostMemPei/PlatformInit.c
@@ -48,15 +48,7 @@ static EFI_PEI_PPI_DESCRIPTOR       mBoardPostMemInitStartPpi[] = {
 };
 
 static EFI_PEI_PPI_DESCRIPTOR       mPpiList[] = {
-  {
-    //
-    // This PPI is hard coded to be installed as SPI boot (vs. eMMC boot)
-    // to trigger  GetFvNotifyCallback()
-    //
-    EFI_PEI_PPI_DESCRIPTOR_PPI,
-    &gCseSpiSelectPpiGuid,
-    NULL
-  },
+
   {
     EFI_PEI_PPI_DESCRIPTOR_PPI,
     &gEfiPeiMasterBootModePpiGuid,
diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/FvCallback.c b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/FvCallback.c
index 6dcdc75..91ac6f5 100644
--- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/FvCallback.c
+++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/FvCallback.c
@@ -1,7 +1,7 @@
 /** @file
   Locate and install Firmware Volume Hob's Once there is main memory.
 
-  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -277,6 +277,7 @@ ParseObbPayload (
   EFI_GUID                         *FvName;
   FSP_INFO_HEADER                  *FspHeader;
   UINT32                           FspSImageBase;
+  VOID                             *Memory;
 
   DEBUG ((EFI_D_INFO, "Parsing and checking OBB Payload\n"));
 
@@ -370,13 +371,20 @@ ParseObbPayload (
       PlatformInfo->FvMain3Base = (UINTN) FvHeader;
       PlatformInfo->FvMain3Length = (UINT32) (FvHeader->FvLength);
     } else if (!CompareGuid(FvName, &gFspSFirmwareFileSystemFvGuid)) {
-      PeiServicesInstallFvInfoPpi (
-        NULL,
-        FvHeader,
-        (UINT32) (FvHeader->FvLength),
-        NULL,
-        NULL
-        );
+      Memory = AllocatePages (EFI_SIZE_TO_PAGES ((UINT32) (FvHeader->FvLength)));
+      if(Memory !=NULL) {
+        CopyMem (Memory, FvHeader, (UINT32) (FvHeader->FvLength));
+        PeiServicesInstallFvInfoPpi (
+          NULL,
+          (VOID *) Memory,
+          (UINT32) (FvHeader->FvLength),
+          NULL,
+          NULL
+          );
+      } else  {
+        ASSERT (FALSE);
+      }
+
     }//if/else S3
 
     FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) ((UINTN) FvHeader + (UINTN) FvHeader->FvLength);
diff --git a/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc b/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc
index d3be2da..d39ec6d 100644
--- a/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc
+++ b/Platform/BroxtonPlatformPkg/PlatformDsc/Components.dsc
@@ -213,6 +213,16 @@
   $(PLATFORM_PACKAGE_COMMON)/SampleCode/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf
 !endif
 
+
+  PerformancePkg/Dp_App/Dp.inf {
+  <LibraryClasses>
+  !if $(PERFORMANCE_ENABLE) == TRUE
+    PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
+    TimerLib|$(PLATFORM_PACKAGE_COMMON)/Library/PlatformTscTimerLib/DxeTscTimerLib.inf
+  !endif
+  }
+
+
 !if $(TPM12_ENABLE) == TRUE
   SecurityPkg/Tcg/TcgDxe/TcgDxe.inf
   SecurityPkg/Tcg/TcgSmm/TcgSmm.inf
diff --git a/Platform/BroxtonPlatformPkg/PlatformPkg.fdf b/Platform/BroxtonPlatformPkg/PlatformPkg.fdf
index 2476407..c117245 100644
--- a/Platform/BroxtonPlatformPkg/PlatformPkg.fdf
+++ b/Platform/BroxtonPlatformPkg/PlatformPkg.fdf
@@ -670,7 +670,7 @@ APRIORI DXE {
   # LAN/Network
   #
 !if $(NETWORK_ENABLE) == TRUE
-  FILE DRIVER = 22DE1691-D65D-456a-993E-A253DD1F308C {
+  FILE DRIVER = 2E561D56-4863-44F7-960D-EF2D7F2D35BB {
     SECTION PE32 = BroxtonPlatformPkg/Common/Binaries/UNDI/I210PcieUndiDxe/E7320X3.EFI
     SECTION UI = "UNDI"
   }
diff --git a/Platform/BroxtonPlatformPkg/PlatformPkgIA32.dsc b/Platform/BroxtonPlatformPkg/PlatformPkgIA32.dsc
index 083e32b..6109a76 100644
--- a/Platform/BroxtonPlatformPkg/PlatformPkgIA32.dsc
+++ b/Platform/BroxtonPlatformPkg/PlatformPkgIA32.dsc
@@ -99,7 +99,7 @@
   !else
     PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
   !endif
-  TimerLib|$(PLATFORM_PACKAGE_COMMON)/Library/PlatformTscTimerLib/DxeTscTimerLib.inf
+  TimerLib|$(PLATFORM_PACKAGE_COMMON)/Library/PlatformTscTimerLib/PeiTscTimerLib.inf
 !endif
 
 [LibraryClasses.IA32.DXE_DRIVER]
diff --git a/Platform/BroxtonPlatformPkg/PlatformPkgX64.dsc b/Platform/BroxtonPlatformPkg/PlatformPkgX64.dsc
index 19b8f34..cdd91b3 100644
--- a/Platform/BroxtonPlatformPkg/PlatformPkgX64.dsc
+++ b/Platform/BroxtonPlatformPkg/PlatformPkgX64.dsc
@@ -99,7 +99,7 @@
   !else
     PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
   !endif
-  TimerLib|$(PLATFORM_PACKAGE_COMMON)/Library/PlatformTscTimerLib/DxeTscTimerLib.inf
+  TimerLib|$(PLATFORM_PACKAGE_COMMON)/Library/PlatformTscTimerLib/PeiTscTimerLib.inf
 !endif
 
 [LibraryClasses.IA32.DXE_DRIVER]
-- 
2.10.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel