* [PATCH] IntelFsp2WrapperPkg: Perform post FSP-S process.
@ 2019-04-12 15:02 Chiu, Chasel
2019-04-13 1:05 ` Nate DeSimone
2019-04-14 10:15 ` Zeng, Star
0 siblings, 2 replies; 3+ messages in thread
From: Chiu, Chasel @ 2019-04-12 15:02 UTC (permalink / raw)
To: devel; +Cc: Chasel, Chiu, Nate DeSimone, Star Zeng
From: "Chasel, Chiu" <chasel.chiu@intel.com>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1716
In API mode FSP wrapper will perform some post
FSP-S process but such process was skipped in Dispatch
mode which may impact some of boot loaders.
To align behavior between API and Dispatch, an
End-of-Pei callback is introduced to perform same process
in Dispatch mode.
Test: Verified on internal platform and both
FSP API and Dispatch modes booted successfully.
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
---
IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)
diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
index bb126797ae..c1823656ed 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 - 2018, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -179,6 +179,46 @@ FspSiliconInitDoneGetFspHobList (
}
/**
+ This function is for FSP dispatch mode to perform post FSP-S process.
+
+ @param[in] PeiServices Pointer to PEI Services Table.
+ @param[in] NotifyDesc Pointer to the descriptor for the Notification event that
+ caused this function to execute.
+ @param[in] Ppi Pointer to the PPI data associated with this function.
+
+ @retval EFI_STATUS Status returned by PeiServicesInstallPpi ()
+**/
+EFI_STATUS
+EFIAPI
+FspsWrapperEndOfPeiNotify (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+ IN VOID *Ppi
+ )
+{
+ EFI_STATUS Status;
+
+ //
+ // In Dispatch mode no FspHobList so passing NULL
+ //
+ PostFspsHobProcess (NULL);
+
+ //
+ // Install FspSiliconInitDonePpi so that any other driver can consume this info.
+ //
+ Status = PeiServicesInstallPpi (&mPeiFspSiliconInitDonePpi);
+ ASSERT_EFI_ERROR(Status);
+
+ return Status;
+}
+
+EFI_PEI_NOTIFY_DESCRIPTOR mFspsWrapperEndOfPeiNotifyDesc = {
+ (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+ &gEfiEndOfPeiSignalPpiGuid,
+ FspsWrapperEndOfPeiNotify
+};
+
+/**
This function is called after PEI core discover memory and finish migration.
@param[in] PeiServices Pointer to PEI Services Table.
@@ -341,6 +381,8 @@ FspsWrapperPeimEntryPoint (
IN CONST EFI_PEI_SERVICES **PeiServices
)
{
+ EFI_STATUS Status;
+
DEBUG ((DEBUG_INFO, "FspsWrapperPeimEntryPoint\n"));
if (PcdGet8 (PcdFspModeSelection) == 1) {
@@ -353,6 +395,12 @@ FspsWrapperPeimEntryPoint (
NULL,
NULL
);
+
+ //
+ // Register EndOfPei Nofity to run post FSP-S process.
+ //
+ Status = PeiServicesNotifyPpi (&mFspsWrapperEndOfPeiNotifyDesc);
+ ASSERT_EFI_ERROR (Status);
}
return EFI_SUCCESS;
--
2.13.3.windows.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] IntelFsp2WrapperPkg: Perform post FSP-S process.
2019-04-12 15:02 [PATCH] IntelFsp2WrapperPkg: Perform post FSP-S process Chiu, Chasel
@ 2019-04-13 1:05 ` Nate DeSimone
2019-04-14 10:15 ` Zeng, Star
1 sibling, 0 replies; 3+ messages in thread
From: Nate DeSimone @ 2019-04-13 1:05 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io; +Cc: Zeng, Star
Hi Chasel,
Looks good! This is mildly unrelated to your change, but could you put a comment on the following line that informs the reader that 1 == API Mode?
if (PcdGet8 (PcdFspModeSelection) == 1) {
Once that is done... Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
-----Original Message-----
From: Chiu, Chasel
Sent: Friday, April 12, 2019 8:02 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>
Subject: [PATCH] IntelFsp2WrapperPkg: Perform post FSP-S process.
From: "Chasel, Chiu" <chasel.chiu@intel.com>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1716
In API mode FSP wrapper will perform some post FSP-S process but such process was skipped in Dispatch mode which may impact some of boot loaders.
To align behavior between API and Dispatch, an End-of-Pei callback is introduced to perform same process in Dispatch mode.
Test: Verified on internal platform and both
FSP API and Dispatch modes booted successfully.
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
---
IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)
diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
index bb126797ae..c1823656ed 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 - 2018, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2014 - 2019, Intel Corporation. All rights
+ reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -179,6 +179,46 @@ FspSiliconInitDoneGetFspHobList ( }
/**
+ This function is for FSP dispatch mode to perform post FSP-S process.
+
+ @param[in] PeiServices Pointer to PEI Services Table.
+ @param[in] NotifyDesc Pointer to the descriptor for the Notification event that
+ caused this function to execute.
+ @param[in] Ppi Pointer to the PPI data associated with this function.
+
+ @retval EFI_STATUS Status returned by PeiServicesInstallPpi ()
+**/
+EFI_STATUS
+EFIAPI
+FspsWrapperEndOfPeiNotify (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+ IN VOID *Ppi
+ )
+{
+ EFI_STATUS Status;
+
+ //
+ // In Dispatch mode no FspHobList so passing NULL //
+ PostFspsHobProcess (NULL);
+
+ //
+ // Install FspSiliconInitDonePpi so that any other driver can consume this info.
+ //
+ Status = PeiServicesInstallPpi (&mPeiFspSiliconInitDonePpi);
+ ASSERT_EFI_ERROR(Status);
+
+ return Status;
+}
+
+EFI_PEI_NOTIFY_DESCRIPTOR mFspsWrapperEndOfPeiNotifyDesc = {
+ (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK |
+EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+ &gEfiEndOfPeiSignalPpiGuid,
+ FspsWrapperEndOfPeiNotify
+};
+
+/**
This function is called after PEI core discover memory and finish migration.
@param[in] PeiServices Pointer to PEI Services Table.
@@ -341,6 +381,8 @@ FspsWrapperPeimEntryPoint (
IN CONST EFI_PEI_SERVICES **PeiServices
)
{
+ EFI_STATUS Status;
+
DEBUG ((DEBUG_INFO, "FspsWrapperPeimEntryPoint\n"));
if (PcdGet8 (PcdFspModeSelection) == 1) { @@ -353,6 +395,12 @@ FspsWrapperPeimEntryPoint (
NULL,
NULL
);
+
+ //
+ // Register EndOfPei Nofity to run post FSP-S process.
+ //
+ Status = PeiServicesNotifyPpi (&mFspsWrapperEndOfPeiNotifyDesc);
+ ASSERT_EFI_ERROR (Status);
}
return EFI_SUCCESS;
--
2.13.3.windows.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] IntelFsp2WrapperPkg: Perform post FSP-S process.
2019-04-12 15:02 [PATCH] IntelFsp2WrapperPkg: Perform post FSP-S process Chiu, Chasel
2019-04-13 1:05 ` Nate DeSimone
@ 2019-04-14 10:15 ` Zeng, Star
1 sibling, 0 replies; 3+ messages in thread
From: Zeng, Star @ 2019-04-14 10:15 UTC (permalink / raw)
To: Chiu, Chasel, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L, Zeng, Star
Minor comment inline.
> -----Original Message-----
> From: Chiu, Chasel
> Sent: Friday, April 12, 2019 11:02 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [PATCH] IntelFsp2WrapperPkg: Perform post FSP-S process.
>
> From: "Chasel, Chiu" <chasel.chiu@intel.com>
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1716
>
> In API mode FSP wrapper will perform some post FSP-S process but such
> process was skipped in Dispatch mode which may impact some of boot
> loaders.
> To align behavior between API and Dispatch, an End-of-Pei callback is
> introduced to perform same process in Dispatch mode.
>
> Test: Verified on internal platform and both
> FSP API and Dispatch modes booted successfully.
>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
This line should be not needed for new license.
> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
> ---
> IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c | 50
> +++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 49 insertions(+), 1 deletion(-)
>
> diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> index bb126797ae..c1823656ed 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 - 2018, Intel Corporation. All rights reserved.<BR>
> + Copyright (c) 2014 - 2019, Intel Corporation. All rights
> + reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
> @@ -179,6 +179,46 @@ FspSiliconInitDoneGetFspHobList ( }
>
> /**
> + This function is for FSP dispatch mode to perform post FSP-S process.
> +
> + @param[in] PeiServices Pointer to PEI Services Table.
> + @param[in] NotifyDesc Pointer to the descriptor for the Notification
> event that
> + caused this function to execute.
> + @param[in] Ppi Pointer to the PPI data associated with this
> function.
> +
> + @retval EFI_STATUS Status returned by PeiServicesInstallPpi ()
> +**/
> +EFI_STATUS
> +EFIAPI
> +FspsWrapperEndOfPeiNotify (
> + IN EFI_PEI_SERVICES **PeiServices,
> + IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
> + IN VOID *Ppi
> + )
> +{
> + EFI_STATUS Status;
> +
> + //
> + // In Dispatch mode no FspHobList so passing NULL //
> + PostFspsHobProcess (NULL);
Why this calling is needed?
> +
> + //
> + // Install FspSiliconInitDonePpi so that any other driver can consume this
> info.
> + //
> + Status = PeiServicesInstallPpi (&mPeiFspSiliconInitDonePpi);
There is a typo "FReturn" in FspSiliconInitDoneGetFspHobList, up to you to fix it or not in this patch.
Thanks,
Star
> + ASSERT_EFI_ERROR(Status);
> +
> + return Status;
> +}
> +
> +EFI_PEI_NOTIFY_DESCRIPTOR mFspsWrapperEndOfPeiNotifyDesc = {
> + (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK |
> +EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
> + &gEfiEndOfPeiSignalPpiGuid,
> + FspsWrapperEndOfPeiNotify
> +};
> +
> +/**
> This function is called after PEI core discover memory and finish migration.
>
> @param[in] PeiServices Pointer to PEI Services Table.
> @@ -341,6 +381,8 @@ FspsWrapperPeimEntryPoint (
> IN CONST EFI_PEI_SERVICES **PeiServices
> )
> {
> + EFI_STATUS Status;
> +
> DEBUG ((DEBUG_INFO, "FspsWrapperPeimEntryPoint\n"));
>
> if (PcdGet8 (PcdFspModeSelection) == 1) { @@ -353,6 +395,12 @@
> FspsWrapperPeimEntryPoint (
> NULL,
> NULL
> );
> +
> + //
> + // Register EndOfPei Nofity to run post FSP-S process.
> + //
> + Status = PeiServicesNotifyPpi (&mFspsWrapperEndOfPeiNotifyDesc);
> + ASSERT_EFI_ERROR (Status);
> }
>
> return EFI_SUCCESS;
> --
> 2.13.3.windows.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-14 10:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-12 15:02 [PATCH] IntelFsp2WrapperPkg: Perform post FSP-S process Chiu, Chasel
2019-04-13 1:05 ` Nate DeSimone
2019-04-14 10:15 ` Zeng, Star
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox