public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] IntelFsp2WrapperPkg: Support FSP Dispatch mode
@ 2018-11-06  9:20 Chasel, Chiu
  2018-11-06 11:37 ` Yao, Jiewen
  0 siblings, 1 reply; 3+ messages in thread
From: Chasel, Chiu @ 2018-11-06  9:20 UTC (permalink / raw)
  To: edk2-devel; +Cc: Jiewen Yao, Desimone Nathaniel L, Chasel Chiu

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

Provides PCD selection for FSP Wrapper to support Dispatch
mode. Also PcdFspmBaseAddress should support Dynamic for
recovery scenario (multiple FSP-M binary in flash)

Test: Verified on internal platform and both API and
      DISPATCH modes booted successfully.

Cc: Jiewen Yao <Jiewen.yao@intel.com>
Cc: Desimone Nathaniel L <nathaniel.l.desimone@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
---
 IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c   | 16 ++++++++++++++--
 IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c   | 14 ++++++++++++--
 IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf |  3 ++-
 IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf |  3 ++-
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec             | 13 +++++++++++--
 5 files changed, 41 insertions(+), 8 deletions(-)

diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
index 7b7c5f5d86..8128a26873 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
@@ -3,7 +3,7 @@
   register TemporaryRamDonePpi to call TempRamExit API, and register MemoryDiscoveredPpi
   notify to call FspSiliconInit API.
 
-  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2014 - 2018, 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
   which accompanies this distribution.  The full text of the license may be found at
@@ -65,7 +65,7 @@ PeiFspMemoryInit (
   FspHobListPtr = NULL;
   FspmUpdDataPtr = NULL;
 
-  FspmHeaderPtr = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 (PcdFspmBaseAddress));
+  FspmHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 (PcdFspmBaseAddress));
   DEBUG ((DEBUG_INFO, "FspmHeaderPtr - 0x%x\n", FspmHeaderPtr));
   if (FspmHeaderPtr == NULL) {
     return EFI_DEVICE_ERROR;
@@ -155,8 +155,20 @@ FspmWrapperInit (
 {
   EFI_STATUS           Status;
 
+  Status = EFI_SUCCESS;
+
+#if FixedPcdGet8 (PcdFspModeSelection) == 1
   Status = PeiFspMemoryInit ();
   ASSERT_EFI_ERROR (Status);
+#else
+  PeiServicesInstallFvInfoPpi (
+    NULL,
+    (VOID *)(UINTN) PcdGet32 (PcdFspmBaseAddress),
+    (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspmBaseAddress))->FvLength,
+    NULL,
+    NULL
+    );
+#endif
 
   return Status;
 }
diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
index 70dac7a414..d11655df89 100644
--- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
@@ -3,7 +3,7 @@
   register TemporaryRamDonePpi to call TempRamExit API, and register MemoryDiscoveredPpi
   notify to call FspSiliconInit API.
 
-  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2014 - 2018, 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
   which accompanies this distribution.  The full text of the license may be found at
@@ -349,7 +349,17 @@ FspsWrapperPeimEntryPoint (
 {
   DEBUG ((DEBUG_INFO, "FspsWrapperPeimEntryPoint\n"));
 
-  FspsWrapperInit ();
+#if FixedPcdGet8 (PcdFspModeSelection) == 1
+    FspsWrapperInit ();
+#else
+    PeiServicesInstallFvInfoPpi (
+      NULL,
+      (VOID *)(UINTN) PcdGet32 (PcdFspsBaseAddress),
+      (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspsBaseAddress))->FvLength,
+      NULL,
+      NULL
+      );
+#endif
 
   return EFI_SUCCESS;
 }
diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
index 542356b582..b3776a80f3 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
@@ -6,7 +6,7 @@
 # register TemporaryRamDonePpi to call TempRamExit API, and register MemoryDiscoveredPpi
 # notify to call FspSiliconInit API.
 #
-#  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2014 - 2018, 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
@@ -61,6 +61,7 @@
 [Pcd]
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress     ## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress  ## CONSUMES
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection    ## CONSUMES
 
 [Sources]
   FspmWrapperPeim.c
diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
index cd87a99c40..910286982b 100644
--- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
+++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
@@ -6,7 +6,7 @@
 # register TemporaryRamDonePpi to call TempRamExit API, and register MemoryDiscoveredPpi
 # notify to call FspSiliconInit API.
 #
-#  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2014 - 2018, 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
@@ -68,6 +68,7 @@
 [Pcd]
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress     ## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress  ## CONSUMES
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection    ## CONSUMES
 
 [Guids]
   gFspHobGuid                           ## CONSUMES ## HOB
diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
index 69df16452d..96f2858fb4 100644
--- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
+++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
@@ -71,9 +71,8 @@
   ## Indicate the PEI memory size platform want to report
   gIntelFsp2WrapperTokenSpaceGuid.PcdPeiRecoveryMinMemSize|0x3000000|UINT32|0x40000005
 
-  ## This is the base address of FSP-T/M/S
+  ## This is the base address of FSP-T
   gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress|0x00000000|UINT32|0x00000300
-  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0x00000000|UINT32|0x00000301
 
   ## This PCD indicates if FSP APIs are skipped from FSP wrapper.<BR><BR>
   #  If a bit is set, that means this FSP API is skipped.<BR>
@@ -93,7 +92,17 @@
   # @Prompt Skip FSP API from FSP wrapper.
   gIntelFsp2WrapperTokenSpaceGuid.PcdSkipFspApi|0x00000000|UINT32|0x40000009
 
+  ## This PCD decides how Wrapper code utilizes FSP
+  # 0: DISPATCH mode (FSP Wrapper will load PeiCore from FSP without calling FSP API)
+  # 1: API mode (FSP Wrapper will call FSP API)
+  #
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection|0x00000001|UINT8|0x4000000A
+
 [PcdsFixedAtBuild, PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]
+  #
+  ## These are the base address of FSP-M/S
+  #
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0x00000000|UINT32|0x00001000
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress|0x00000000|UINT32|0x00001001
   #
   # To provide flexibility for platform to pre-allocate FSP UPD buffer
-- 
2.13.3.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] IntelFsp2WrapperPkg: Support FSP Dispatch mode
  2018-11-06  9:20 [PATCH] IntelFsp2WrapperPkg: Support FSP Dispatch mode Chasel, Chiu
@ 2018-11-06 11:37 ` Yao, Jiewen
  2018-11-07  0:44   ` Chiu, Chasel
  0 siblings, 1 reply; 3+ messages in thread
From: Yao, Jiewen @ 2018-11-06 11:37 UTC (permalink / raw)
  To: Chiu, Chasel; +Cc: edk2-devel@lists.01.org, Desimone, Nathaniel L

hi chasel
I think our guide is not to use #if, but use if()

Is there any special reason in this patch?


thank you!
Yao, Jiewen


> 在 2018年11月6日,下午5:22,Chiu, Chasel <chasel.chiu@intel.com> 写道:
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1300
> 
> Provides PCD selection for FSP Wrapper to support Dispatch
> mode. Also PcdFspmBaseAddress should support Dynamic for
> recovery scenario (multiple FSP-M binary in flash)
> 
> Test: Verified on internal platform and both API and
>      DISPATCH modes booted successfully.
> 
> Cc: Jiewen Yao <Jiewen.yao@intel.com>
> Cc: Desimone Nathaniel L <nathaniel.l.desimone@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> ---
> IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c   | 16 ++++++++++++++--
> IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c   | 14 ++++++++++++--
> IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf |  3 ++-
> IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf |  3 ++-
> IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec             | 13 +++++++++++--
> 5 files changed, 41 insertions(+), 8 deletions(-)
> 
> diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> index 7b7c5f5d86..8128a26873 100644
> --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> @@ -3,7 +3,7 @@
>   register TemporaryRamDonePpi to call TempRamExit API, and register MemoryDiscoveredPpi
>   notify to call FspSiliconInit API.
> 
> -  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2014 - 2018, 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
>   which accompanies this distribution.  The full text of the license may be found at
> @@ -65,7 +65,7 @@ PeiFspMemoryInit (
>   FspHobListPtr = NULL;
>   FspmUpdDataPtr = NULL;
> 
> -  FspmHeaderPtr = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 (PcdFspmBaseAddress));
> +  FspmHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 (PcdFspmBaseAddress));
>   DEBUG ((DEBUG_INFO, "FspmHeaderPtr - 0x%x\n", FspmHeaderPtr));
>   if (FspmHeaderPtr == NULL) {
>     return EFI_DEVICE_ERROR;
> @@ -155,8 +155,20 @@ FspmWrapperInit (
> {
>   EFI_STATUS           Status;
> 
> +  Status = EFI_SUCCESS;
> +
> +#if FixedPcdGet8 (PcdFspModeSelection) == 1
>   Status = PeiFspMemoryInit ();
>   ASSERT_EFI_ERROR (Status);
> +#else
> +  PeiServicesInstallFvInfoPpi (
> +    NULL,
> +    (VOID *)(UINTN) PcdGet32 (PcdFspmBaseAddress),
> +    (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspmBaseAddress))->FvLength,
> +    NULL,
> +    NULL
> +    );
> +#endif
> 
>   return Status;
> }
> diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> index 70dac7a414..d11655df89 100644
> --- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> @@ -3,7 +3,7 @@
>   register TemporaryRamDonePpi to call TempRamExit API, and register MemoryDiscoveredPpi
>   notify to call FspSiliconInit API.
> 
> -  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2014 - 2018, 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
>   which accompanies this distribution.  The full text of the license may be found at
> @@ -349,7 +349,17 @@ FspsWrapperPeimEntryPoint (
> {
>   DEBUG ((DEBUG_INFO, "FspsWrapperPeimEntryPoint\n"));
> 
> -  FspsWrapperInit ();
> +#if FixedPcdGet8 (PcdFspModeSelection) == 1
> +    FspsWrapperInit ();
> +#else
> +    PeiServicesInstallFvInfoPpi (
> +      NULL,
> +      (VOID *)(UINTN) PcdGet32 (PcdFspsBaseAddress),
> +      (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspsBaseAddress))->FvLength,
> +      NULL,
> +      NULL
> +      );
> +#endif
> 
>   return EFI_SUCCESS;
> }
> diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
> index 542356b582..b3776a80f3 100644
> --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
> +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
> @@ -6,7 +6,7 @@
> # register TemporaryRamDonePpi to call TempRamExit API, and register MemoryDiscoveredPpi
> # notify to call FspSiliconInit API.
> #
> -#  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
> +#  Copyright (c) 2014 - 2018, 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
> @@ -61,6 +61,7 @@
> [Pcd]
>   gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress     ## CONSUMES
>   gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress  ## CONSUMES
> +  gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection    ## CONSUMES
> 
> [Sources]
>   FspmWrapperPeim.c
> diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
> index cd87a99c40..910286982b 100644
> --- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
> +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
> @@ -6,7 +6,7 @@
> # register TemporaryRamDonePpi to call TempRamExit API, and register MemoryDiscoveredPpi
> # notify to call FspSiliconInit API.
> #
> -#  Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>
> +#  Copyright (c) 2014 - 2018, 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
> @@ -68,6 +68,7 @@
> [Pcd]
>   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress     ## CONSUMES
>   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress  ## CONSUMES
> +  gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection    ## CONSUMES
> 
> [Guids]
>   gFspHobGuid                           ## CONSUMES ## HOB
> diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> index 69df16452d..96f2858fb4 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> @@ -71,9 +71,8 @@
>   ## Indicate the PEI memory size platform want to report
>   gIntelFsp2WrapperTokenSpaceGuid.PcdPeiRecoveryMinMemSize|0x3000000|UINT32|0x40000005
> 
> -  ## This is the base address of FSP-T/M/S
> +  ## This is the base address of FSP-T
>   gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress|0x00000000|UINT32|0x00000300
> -  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0x00000000|UINT32|0x00000301
> 
>   ## This PCD indicates if FSP APIs are skipped from FSP wrapper.<BR><BR>
>   #  If a bit is set, that means this FSP API is skipped.<BR>
> @@ -93,7 +92,17 @@
>   # @Prompt Skip FSP API from FSP wrapper.
>   gIntelFsp2WrapperTokenSpaceGuid.PcdSkipFspApi|0x00000000|UINT32|0x40000009
> 
> +  ## This PCD decides how Wrapper code utilizes FSP
> +  # 0: DISPATCH mode (FSP Wrapper will load PeiCore from FSP without calling FSP API)
> +  # 1: API mode (FSP Wrapper will call FSP API)
> +  #
> +  gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection|0x00000001|UINT8|0x4000000A
> +
> [PcdsFixedAtBuild, PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]
> +  #
> +  ## These are the base address of FSP-M/S
> +  #
> +  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0x00000000|UINT32|0x00001000
>   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress|0x00000000|UINT32|0x00001001
>   #
>   # To provide flexibility for platform to pre-allocate FSP UPD buffer
> -- 
> 2.13.3.windows.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] IntelFsp2WrapperPkg: Support FSP Dispatch mode
  2018-11-06 11:37 ` Yao, Jiewen
@ 2018-11-07  0:44   ` Chiu, Chasel
  0 siblings, 0 replies; 3+ messages in thread
From: Chiu, Chasel @ 2018-11-07  0:44 UTC (permalink / raw)
  To: Yao, Jiewen; +Cc: edk2-devel@lists.01.org, Desimone, Nathaniel L

Hi Jiewen,

No special reason in this patch. I'm verifying the change for switching to "if" instead of "#if", and will re-send a new patch later.

Thanks!
Chasel


-----Original Message-----
From: Yao, Jiewen 
Sent: Tuesday, November 6, 2018 7:38 PM
To: Chiu, Chasel <chasel.chiu@intel.com>
Cc: edk2-devel@lists.01.org; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: Re: [PATCH] IntelFsp2WrapperPkg: Support FSP Dispatch mode

hi chasel
I think our guide is not to use #if, but use if()

Is there any special reason in this patch?


thank you!
Yao, Jiewen


> 在 2018年11月6日,下午5:22,Chiu, Chasel <chasel.chiu@intel.com> 写道:
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1300
> 
> Provides PCD selection for FSP Wrapper to support Dispatch mode. Also 
> PcdFspmBaseAddress should support Dynamic for recovery scenario 
> (multiple FSP-M binary in flash)
> 
> Test: Verified on internal platform and both API and
>      DISPATCH modes booted successfully.
> 
> Cc: Jiewen Yao <Jiewen.yao@intel.com>
> Cc: Desimone Nathaniel L <nathaniel.l.desimone@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> ---
> IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c   | 16 ++++++++++++++--
> IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c   | 14 ++++++++++++--
> IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf |  3 ++- 
> IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf |  3 ++-
> IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec             | 13 +++++++++++--
> 5 files changed, 41 insertions(+), 8 deletions(-)
> 
> diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c 
> b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> index 7b7c5f5d86..8128a26873 100644
> --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> @@ -3,7 +3,7 @@
>   register TemporaryRamDonePpi to call TempRamExit API, and register MemoryDiscoveredPpi
>   notify to call FspSiliconInit API.
> 
> -  Copyright (c) 2014 - 2017, Intel Corporation. All rights 
> reserved.<BR>
> +  Copyright (c) 2014 - 2018, 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
>   which accompanies this distribution.  The full text of the license 
> may be found at @@ -65,7 +65,7 @@ PeiFspMemoryInit (
>   FspHobListPtr = NULL;
>   FspmUpdDataPtr = NULL;
> 
> -  FspmHeaderPtr = (FSP_INFO_HEADER *)FspFindFspHeader (PcdGet32 
> (PcdFspmBaseAddress));
> +  FspmHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 
> + (PcdFspmBaseAddress));
>   DEBUG ((DEBUG_INFO, "FspmHeaderPtr - 0x%x\n", FspmHeaderPtr));
>   if (FspmHeaderPtr == NULL) {
>     return EFI_DEVICE_ERROR;
> @@ -155,8 +155,20 @@ FspmWrapperInit ( {
>   EFI_STATUS           Status;
> 
> +  Status = EFI_SUCCESS;
> +
> +#if FixedPcdGet8 (PcdFspModeSelection) == 1
>   Status = PeiFspMemoryInit ();
>   ASSERT_EFI_ERROR (Status);
> +#else
> +  PeiServicesInstallFvInfoPpi (
> +    NULL,
> +    (VOID *)(UINTN) PcdGet32 (PcdFspmBaseAddress),
> +    (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspmBaseAddress))->FvLength,
> +    NULL,
> +    NULL
> +    );
> +#endif
> 
>   return Status;
> }
> diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c 
> b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> index 70dac7a414..d11655df89 100644
> --- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> @@ -3,7 +3,7 @@
>   register TemporaryRamDonePpi to call TempRamExit API, and register MemoryDiscoveredPpi
>   notify to call FspSiliconInit API.
> 
> -  Copyright (c) 2014 - 2017, Intel Corporation. All rights 
> reserved.<BR>
> +  Copyright (c) 2014 - 2018, 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
>   which accompanies this distribution.  The full text of the license 
> may be found at @@ -349,7 +349,17 @@ FspsWrapperPeimEntryPoint ( {
>   DEBUG ((DEBUG_INFO, "FspsWrapperPeimEntryPoint\n"));
> 
> -  FspsWrapperInit ();
> +#if FixedPcdGet8 (PcdFspModeSelection) == 1
> +    FspsWrapperInit ();
> +#else
> +    PeiServicesInstallFvInfoPpi (
> +      NULL,
> +      (VOID *)(UINTN) PcdGet32 (PcdFspsBaseAddress),
> +      (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFspsBaseAddress))->FvLength,
> +      NULL,
> +      NULL
> +      );
> +#endif
> 
>   return EFI_SUCCESS;
> }
> diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf 
> b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
> index 542356b582..b3776a80f3 100644
> --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
> +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
> @@ -6,7 +6,7 @@
> # register TemporaryRamDonePpi to call TempRamExit API, and register 
> MemoryDiscoveredPpi # notify to call FspSiliconInit API.
> #
> -#  Copyright (c) 2014 - 2017, Intel Corporation. All rights 
> reserved.<BR>
> +#  Copyright (c) 2014 - 2018, 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 @@ 
> -61,6 +61,7 @@ [Pcd]
>   gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress     ## CONSUMES
>   gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress  ## CONSUMES
> +  gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection    ## CONSUMES
> 
> [Sources]
>   FspmWrapperPeim.c
> diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf 
> b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
> index cd87a99c40..910286982b 100644
> --- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
> +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
> @@ -6,7 +6,7 @@
> # register TemporaryRamDonePpi to call TempRamExit API, and register 
> MemoryDiscoveredPpi # notify to call FspSiliconInit API.
> #
> -#  Copyright (c) 2014 - 2017, Intel Corporation. All rights 
> reserved.<BR>
> +#  Copyright (c) 2014 - 2018, 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 @@ 
> -68,6 +68,7 @@ [Pcd]
>   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress     ## CONSUMES
>   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress  ## CONSUMES
> +  gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection    ## CONSUMES
> 
> [Guids]
>   gFspHobGuid                           ## CONSUMES ## HOB
> diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec 
> b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> index 69df16452d..96f2858fb4 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> @@ -71,9 +71,8 @@
>   ## Indicate the PEI memory size platform want to report
>   
> gIntelFsp2WrapperTokenSpaceGuid.PcdPeiRecoveryMinMemSize|0x3000000|UIN
> T32|0x40000005
> 
> -  ## This is the base address of FSP-T/M/S
> +  ## This is the base address of FSP-T
>   
> gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress|0x00000000|UINT32|0
> x00000300
> -  
> gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0x00000000|UINT32|0
> x00000301
> 
>   ## This PCD indicates if FSP APIs are skipped from FSP wrapper.<BR><BR>
>   #  If a bit is set, that means this FSP API is skipped.<BR> @@ -93,7 
> +92,17 @@
>   # @Prompt Skip FSP API from FSP wrapper.
>   
> gIntelFsp2WrapperTokenSpaceGuid.PcdSkipFspApi|0x00000000|UINT32|0x4000
> 0009
> 
> +  ## This PCD decides how Wrapper code utilizes FSP  # 0: DISPATCH 
> + mode (FSP Wrapper will load PeiCore from FSP without calling FSP 
> + API)  # 1: API mode (FSP Wrapper will call FSP API)  #  
> + gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection|0x00000001|UINT8
> + |0x4000000A
> +
> [PcdsFixedAtBuild, PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]
> +  #
> +  ## These are the base address of FSP-M/S  #
> +  
> + gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0x00000000|UINT32
> + |0x00001000
>   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress|0x00000000|UINT32|0x00001001
>   #
>   # To provide flexibility for platform to pre-allocate FSP UPD buffer
> --
> 2.13.3.windows.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-07  0:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-06  9:20 [PATCH] IntelFsp2WrapperPkg: Support FSP Dispatch mode Chasel, Chiu
2018-11-06 11:37 ` Yao, Jiewen
2018-11-07  0:44   ` Chiu, Chasel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox