public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete.
@ 2016-10-24 17:02 gdong1
  2016-10-24 23:17 ` Yao, Jiewen
  0 siblings, 1 reply; 5+ messages in thread
From: gdong1 @ 2016-10-24 17:02 UTC (permalink / raw)
  To: edk2-devel; +Cc: jiewen.yao, giri.p.mudusuru, maurice.ma, guo.dong

 PciEnumerationComplete might be signaled to FSP in Coreboot. So FSP
 wrapper driver don't need send it again. Add a PCD to control if a
 FSP API could be skipped from FspWrapperNotifyDxe driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Dong <guo.dong@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
---
 .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.c      | 22 ++++++++++++++--------
 .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf    |  1 +
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec        |  8 ++++++++
 3 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
index 0797f44..969debc 100644
--- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
+++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
@@ -26,6 +26,8 @@
 #include <Library/PerformanceLib.h>
 #include <Library/HobLib.h>
 
+#define   PCI_ENUMERATION_COMPLETE_API     BIT16
+
 typedef
 EFI_STATUS
 (EFIAPI * ADD_PERFORMANCE_RECORDS)(
@@ -237,6 +239,7 @@ FspWrapperNotifyDxeEntryPoint (
   EFI_EVENT  ReadyToBootEvent;
   VOID       *Registration;
   EFI_EVENT  ProtocolNotifyEvent;
+  UINT32       FspApiMask;
 
   //
   // Load this driver's image to memory
@@ -246,14 +249,17 @@ FspWrapperNotifyDxeEntryPoint (
     return EFI_SUCCESS;
   }
 
-  ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (
-                          &gEfiPciEnumerationCompleteProtocolGuid,
-                          TPL_CALLBACK,
-                          OnPciEnumerationComplete,
-                          NULL,
-                          &Registration
-                          );
-  ASSERT (ProtocolNotifyEvent != NULL);
+  FspApiMask = PcdGet32 (PcdFspApiSkipMask);
+  if ((FspApiMask & PCI_ENUMERATION_COMPLETE_API) == 0) {
+    ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (
+                            &gEfiPciEnumerationCompleteProtocolGuid,
+                            TPL_CALLBACK,
+                            OnPciEnumerationComplete,
+                            NULL,
+                            &Registration
+                            );
+    ASSERT (ProtocolNotifyEvent != NULL);
+  }
 
   Status = EfiCreateEventReadyToBootEx (
              TPL_CALLBACK,
diff --git a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
index f851f68..9ef81ff 100644
--- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
+++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
@@ -62,6 +62,7 @@
 
 [Pcd]
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress  ## CONSUMES
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspApiSkipMask   ## CONSUMES
 
 [Depex]
   TRUE
diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
index d9d2d80..534f482 100644
--- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
+++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
@@ -75,6 +75,14 @@
   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>
+  #  If a bit is clear, that means this FSP API is NOT skipped.<BR>
+  #    BIT16   - Mask NotifyPhase (AfterPciEnumeration).<BR>
+  #    Any undefined BITs are reserved for future use.<BR>
+  # @Prompt FSP API skip mask from FSP wrapper.
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspApiSkipMask|0x00000000|UINT32|0x40000009
+
 [PcdsFixedAtBuild, PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress|0x00000000|UINT32|0x00001001
   
\ No newline at end of file
-- 
2.7.0.windows.1



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

* Re: [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete.
  2016-10-24 17:02 [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete gdong1
@ 2016-10-24 23:17 ` Yao, Jiewen
  2016-10-25  3:43   ` Mudusuru, Giri P
  0 siblings, 1 reply; 5+ messages in thread
From: Yao, Jiewen @ 2016-10-24 23:17 UTC (permalink / raw)
  To: Dong, Guo, edk2-devel@lists.01.org

Thanks Guo. Can we add full description for the PCD?

# BIT0~15 is for function:
#   BIT0 - Mask TempRamInit
#   BIT1 - Mask MemoryInit
#   BIT2 - Mask TempRamExit
#   BIT3 - Mask SiliconInit
#   BIT4 - Mask NotifyPhase
# BIT16~32 is for sub-function:
#   BIT16 - Mask NotifyPhase (AfterPciEnumeration)
#   BIT17 - Mask NotifyPhase (ReadyToBoot)
#   BIT18 - Mask NotifyPhase (EndOfFirmware)
# Any undefined BITs are reserved for future use


Thank you
Yao Jiewen

> -----Original Message-----
> From: Dong, Guo
> Sent: Tuesday, October 25, 2016 1:03 AM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Mudusuru, Giri P
> <giri.p.mudusuru@intel.com>; Ma, Maurice <maurice.ma@intel.com>; Dong,
> Guo <guo.dong@intel.com>
> Subject: [edk2] [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if
> signaling PciEnumerationComplete.
> 
>  PciEnumerationComplete might be signaled to FSP in Coreboot. So FSP
>  wrapper driver don't need send it again. Add a PCD to control if a
>  FSP API could be skipped from FspWrapperNotifyDxe driver.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Guo Dong <guo.dong@intel.com>
> Reviewed-by: Maurice Ma <maurice.ma@intel.com>
> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
> Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
> ---
>  .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.c      | 22
> ++++++++++++++--------
>  .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf    |  1 +
>  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec        |  8 ++++++++
>  3 files changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git
> a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> index 0797f44..969debc 100644
> --- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> +++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> @@ -26,6 +26,8 @@
>  #include <Library/PerformanceLib.h>
>  #include <Library/HobLib.h>
> 
> +#define   PCI_ENUMERATION_COMPLETE_API     BIT16
> +
>  typedef
>  EFI_STATUS
>  (EFIAPI * ADD_PERFORMANCE_RECORDS)(
> @@ -237,6 +239,7 @@ FspWrapperNotifyDxeEntryPoint (
>    EFI_EVENT  ReadyToBootEvent;
>    VOID       *Registration;
>    EFI_EVENT  ProtocolNotifyEvent;
> +  UINT32       FspApiMask;
> 
>    //
>    // Load this driver's image to memory
> @@ -246,14 +249,17 @@ FspWrapperNotifyDxeEntryPoint (
>      return EFI_SUCCESS;
>    }
> 
> -  ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (
> -
> &gEfiPciEnumerationCompleteProtocolGuid,
> -                          TPL_CALLBACK,
> -                          OnPciEnumerationComplete,
> -                          NULL,
> -                          &Registration
> -                          );
> -  ASSERT (ProtocolNotifyEvent != NULL);
> +  FspApiMask = PcdGet32 (PcdFspApiSkipMask);
> +  if ((FspApiMask & PCI_ENUMERATION_COMPLETE_API) == 0) {
> +    ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (
> +
> &gEfiPciEnumerationCompleteProtocolGuid,
> +                            TPL_CALLBACK,
> +                            OnPciEnumerationComplete,
> +                            NULL,
> +                            &Registration
> +                            );
> +    ASSERT (ProtocolNotifyEvent != NULL);
> +  }
> 
>    Status = EfiCreateEventReadyToBootEx (
>               TPL_CALLBACK,
> diff --git
> a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> index f851f68..9ef81ff 100644
> --- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> +++
> b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> @@ -62,6 +62,7 @@
> 
>  [Pcd]
>    gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress  ##
> CONSUMES
> +  gIntelFsp2WrapperTokenSpaceGuid.PcdFspApiSkipMask   ##
> CONSUMES
> 
>  [Depex]
>    TRUE
> diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> index d9d2d80..534f482 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> @@ -75,6 +75,14 @@
> 
> gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress|0x00000000|UINT3
> 2|0x00000300
> 
> gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0x00000000|UINT
> 32|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>
> +  #  If a bit is clear, that means this FSP API is NOT skipped.<BR>
> +  #    BIT16   - Mask NotifyPhase (AfterPciEnumeration).<BR>
> +  #    Any undefined BITs are reserved for future use.<BR>
> +  # @Prompt FSP API skip mask from FSP wrapper.
> +
> gIntelFsp2WrapperTokenSpaceGuid.PcdFspApiSkipMask|0x00000000|UINT3
> 2|0x40000009
> +
>  [PcdsFixedAtBuild, PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]
> 
> gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress|0x00000000|UINT
> 32|0x00001001
> 
> \ No newline at end of file
> --
> 2.7.0.windows.1



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

* Re: [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete.
  2016-10-24 23:17 ` Yao, Jiewen
@ 2016-10-25  3:43   ` Mudusuru, Giri P
  2016-10-25  4:54     ` Yao, Jiewen
  0 siblings, 1 reply; 5+ messages in thread
From: Mudusuru, Giri P @ 2016-10-25  3:43 UTC (permalink / raw)
  To: Yao, Jiewen, Dong, Guo, edk2-devel@lists.01.org

We can add full description with note that only skip NotifyPhase Post PCI enumeration is implemented.

1) Change "BIT0~15 is for function:" to "BIT[15:0] is for function:" and "BIT16~32 is for sub-function:" to "BIT[32:16] is for sub-function:" for consistency
2)  Suggest to rename fix below define FSP_API_NOTIFY_PHASE_AFTER_PCI_ENUMERATION to be consistent with other usage
+#define   PCI_ENUMERATION_COMPLETE_API     BIT16
3) Also for PCD naming suggest to change PcdSkipFspApi 

Thanks,
-Giri

> -----Original Message-----
> From: Yao, Jiewen
> Sent: Monday, October 24, 2016 4:18 PM
> To: Dong, Guo <guo.dong@intel.com>; edk2-devel@lists.01.org
> Cc: Mudusuru, Giri P <giri.p.mudusuru@intel.com>; Ma, Maurice
> <maurice.ma@intel.com>
> Subject: RE: [edk2] [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if
> signaling PciEnumerationComplete.
> 
> Thanks Guo. Can we add full description for the PCD?
> 
> # BIT0~15 is for function:
> #   BIT0 - Mask TempRamInit
> #   BIT1 - Mask MemoryInit
> #   BIT2 - Mask TempRamExit
> #   BIT3 - Mask SiliconInit
> #   BIT4 - Mask NotifyPhase
> # BIT16~32 is for sub-function:
> #   BIT16 - Mask NotifyPhase (AfterPciEnumeration)
> #   BIT17 - Mask NotifyPhase (ReadyToBoot)
> #   BIT18 - Mask NotifyPhase (EndOfFirmware)
> # Any undefined BITs are reserved for future use
> 
> 
> Thank you
> Yao Jiewen
> 
> > -----Original Message-----
> > From: Dong, Guo
> > Sent: Tuesday, October 25, 2016 1:03 AM
> > To: edk2-devel@lists.01.org
> > Cc: Yao, Jiewen <jiewen.yao@intel.com>; Mudusuru, Giri P
> > <giri.p.mudusuru@intel.com>; Ma, Maurice <maurice.ma@intel.com>; Dong,
> > Guo <guo.dong@intel.com>
> > Subject: [edk2] [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if
> > signaling PciEnumerationComplete.
> >
> >  PciEnumerationComplete might be signaled to FSP in Coreboot. So FSP
> >  wrapper driver don't need send it again. Add a PCD to control if a
> >  FSP API could be skipped from FspWrapperNotifyDxe driver.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Guo Dong <guo.dong@intel.com>
> > Reviewed-by: Maurice Ma <maurice.ma@intel.com>
> > Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
> > Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
> > ---
> >  .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.c      | 22
> > ++++++++++++++--------
> >  .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf    |  1 +
> >  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec        |  8 ++++++++
> >  3 files changed, 23 insertions(+), 8 deletions(-)
> >
> > diff --git
> > a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> > b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> > index 0797f44..969debc 100644
> > --- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> > +++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> > @@ -26,6 +26,8 @@
> >  #include <Library/PerformanceLib.h>
> >  #include <Library/HobLib.h>
> >
> > +#define   PCI_ENUMERATION_COMPLETE_API     BIT16
> > +
> >  typedef
> >  EFI_STATUS
> >  (EFIAPI * ADD_PERFORMANCE_RECORDS)(
> > @@ -237,6 +239,7 @@ FspWrapperNotifyDxeEntryPoint (
> >    EFI_EVENT  ReadyToBootEvent;
> >    VOID       *Registration;
> >    EFI_EVENT  ProtocolNotifyEvent;
> > +  UINT32       FspApiMask;
> >
> >    //
> >    // Load this driver's image to memory
> > @@ -246,14 +249,17 @@ FspWrapperNotifyDxeEntryPoint (
> >      return EFI_SUCCESS;
> >    }
> >
> > -  ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (
> > -
> > &gEfiPciEnumerationCompleteProtocolGuid,
> > -                          TPL_CALLBACK,
> > -                          OnPciEnumerationComplete,
> > -                          NULL,
> > -                          &Registration
> > -                          );
> > -  ASSERT (ProtocolNotifyEvent != NULL);
> > +  FspApiMask = PcdGet32 (PcdFspApiSkipMask);
> > +  if ((FspApiMask & PCI_ENUMERATION_COMPLETE_API) == 0) {
> > +    ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (
> > +
> > &gEfiPciEnumerationCompleteProtocolGuid,
> > +                            TPL_CALLBACK,
> > +                            OnPciEnumerationComplete,
> > +                            NULL,
> > +                            &Registration
> > +                            );
> > +    ASSERT (ProtocolNotifyEvent != NULL);
> > +  }
> >
> >    Status = EfiCreateEventReadyToBootEx (
> >               TPL_CALLBACK,
> > diff --git
> > a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> > b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> > index f851f68..9ef81ff 100644
> > --- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> > +++
> > b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> > @@ -62,6 +62,7 @@
> >
> >  [Pcd]
> >    gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress  ##
> > CONSUMES
> > +  gIntelFsp2WrapperTokenSpaceGuid.PcdFspApiSkipMask   ##
> > CONSUMES
> >
> >  [Depex]
> >    TRUE
> > diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> > b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> > index d9d2d80..534f482 100644
> > --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> > +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> > @@ -75,6 +75,14 @@
> >
> > gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress|0x00000000|UINT3
> > 2|0x00000300
> >
> > gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0x00000000|UINT
> > 32|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>
> > +  #  If a bit is clear, that means this FSP API is NOT skipped.<BR>
> > +  #    BIT16   - Mask NotifyPhase (AfterPciEnumeration).<BR>
> > +  #    Any undefined BITs are reserved for future use.<BR>
> > +  # @Prompt FSP API skip mask from FSP wrapper.
> > +
> > gIntelFsp2WrapperTokenSpaceGuid.PcdFspApiSkipMask|0x00000000|UINT3
> > 2|0x40000009
> > +
> >  [PcdsFixedAtBuild, PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]
> >
> > gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress|0x00000000|UINT
> > 32|0x00001001
> >
> > \ No newline at end of file
> > --
> > 2.7.0.windows.1



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

* Re: [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete.
  2016-10-25  3:43   ` Mudusuru, Giri P
@ 2016-10-25  4:54     ` Yao, Jiewen
  2016-10-25 15:38       ` Dong, Guo
  0 siblings, 1 reply; 5+ messages in thread
From: Yao, Jiewen @ 2016-10-25  4:54 UTC (permalink / raw)
  To: Mudusuru, Giri P, Dong, Guo, edk2-devel@lists.01.org

Agree all.

From: Mudusuru, Giri P
Sent: Tuesday, October 25, 2016 11:43 AM
To: Yao, Jiewen <jiewen.yao@intel.com>; Dong, Guo <guo.dong@intel.com>; edk2-devel@lists.01.org
Cc: Ma, Maurice <maurice.ma@intel.com>
Subject: RE: [edk2] [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete.

We can add full description with note that only skip NotifyPhase Post PCI enumeration is implemented.

1) Change "BIT0~15 is for function:" to "BIT[15:0] is for function:" and "BIT16~32 is for sub-function:" to "BIT[32:16] is for sub-function:" for consistency
2)  Suggest to rename fix below define FSP_API_NOTIFY_PHASE_AFTER_PCI_ENUMERATION to be consistent with other usage
+#define   PCI_ENUMERATION_COMPLETE_API     BIT16
3) Also for PCD naming suggest to change PcdSkipFspApi

Thanks,
-Giri

> -----Original Message-----
> From: Yao, Jiewen
> Sent: Monday, October 24, 2016 4:18 PM
> To: Dong, Guo <guo.dong@intel.com<mailto:guo.dong@intel.com>>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Cc: Mudusuru, Giri P <giri.p.mudusuru@intel.com<mailto:giri.p.mudusuru@intel.com>>; Ma, Maurice
> <maurice.ma@intel.com<mailto:maurice.ma@intel.com>>
> Subject: RE: [edk2] [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if
> signaling PciEnumerationComplete.
>
> Thanks Guo. Can we add full description for the PCD?
>
> # BIT0~15 is for function:
> #   BIT0 - Mask TempRamInit
> #   BIT1 - Mask MemoryInit
> #   BIT2 - Mask TempRamExit
> #   BIT3 - Mask SiliconInit
> #   BIT4 - Mask NotifyPhase
> # BIT16~32 is for sub-function:
> #   BIT16 - Mask NotifyPhase (AfterPciEnumeration)
> #   BIT17 - Mask NotifyPhase (ReadyToBoot)
> #   BIT18 - Mask NotifyPhase (EndOfFirmware)
> # Any undefined BITs are reserved for future use
>
>
> Thank you
> Yao Jiewen
>
> > -----Original Message-----
> > From: Dong, Guo
> > Sent: Tuesday, October 25, 2016 1:03 AM
> > To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> > Cc: Yao, Jiewen <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>; Mudusuru, Giri P
> > <giri.p.mudusuru@intel.com<mailto:giri.p.mudusuru@intel.com>>; Ma, Maurice <maurice.ma@intel.com<mailto:maurice.ma@intel.com>>; Dong,
> > Guo <guo.dong@intel.com<mailto:guo.dong@intel.com>>
> > Subject: [edk2] [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if
> > signaling PciEnumerationComplete.
> >
> >  PciEnumerationComplete might be signaled to FSP in Coreboot. So FSP
> >  wrapper driver don't need send it again. Add a PCD to control if a
> >  FSP API could be skipped from FspWrapperNotifyDxe driver.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Guo Dong <guo.dong@intel.com<mailto:guo.dong@intel.com>>
> > Reviewed-by: Maurice Ma <maurice.ma@intel.com<mailto:maurice.ma@intel.com>>
> > Reviewed-by: Jiewen Yao <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>
> > Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com<mailto:giri.p.mudusuru@intel.com>>
> > ---
> >  .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.c      | 22
> > ++++++++++++++--------
> >  .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf    |  1 +
> >  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec        |  8 ++++++++
> >  3 files changed, 23 insertions(+), 8 deletions(-)
> >
> > diff --git
> > a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> > b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> > index 0797f44..969debc 100644
> > --- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> > +++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> > @@ -26,6 +26,8 @@
> >  #include <Library/PerformanceLib.h>
> >  #include <Library/HobLib.h>
> >
> > +#define   PCI_ENUMERATION_COMPLETE_API     BIT16
> > +
> >  typedef
> >  EFI_STATUS
> >  (EFIAPI * ADD_PERFORMANCE_RECORDS)(
> > @@ -237,6 +239,7 @@ FspWrapperNotifyDxeEntryPoint (
> >    EFI_EVENT  ReadyToBootEvent;
> >    VOID       *Registration;
> >    EFI_EVENT  ProtocolNotifyEvent;
> > +  UINT32       FspApiMask;
> >
> >    //
> >    // Load this driver's image to memory
> > @@ -246,14 +249,17 @@ FspWrapperNotifyDxeEntryPoint (
> >      return EFI_SUCCESS;
> >    }
> >
> > -  ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (
> > -
> > &gEfiPciEnumerationCompleteProtocolGuid,
> > -                          TPL_CALLBACK,
> > -                          OnPciEnumerationComplete,
> > -                          NULL,
> > -                          &Registration
> > -                          );
> > -  ASSERT (ProtocolNotifyEvent != NULL);
> > +  FspApiMask = PcdGet32 (PcdFspApiSkipMask);
> > +  if ((FspApiMask & PCI_ENUMERATION_COMPLETE_API) == 0) {
> > +    ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (
> > +
> > &gEfiPciEnumerationCompleteProtocolGuid,
> > +                            TPL_CALLBACK,
> > +                            OnPciEnumerationComplete,
> > +                            NULL,
> > +                            &Registration
> > +                            );
> > +    ASSERT (ProtocolNotifyEvent != NULL);
> > +  }
> >
> >    Status = EfiCreateEventReadyToBootEx (
> >               TPL_CALLBACK,
> > diff --git
> > a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> > b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> > index f851f68..9ef81ff 100644
> > --- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> > +++
> > b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> > @@ -62,6 +62,7 @@
> >
> >  [Pcd]
> >    gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress  ##
> > CONSUMES
> > +  gIntelFsp2WrapperTokenSpaceGuid.PcdFspApiSkipMask   ##
> > CONSUMES
> >
> >  [Depex]
> >    TRUE
> > diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> > b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> > index d9d2d80..534f482 100644
> > --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> > +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> > @@ -75,6 +75,14 @@
> >
> > gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress|0x00000000|UINT3
> > 2|0x00000300
> >
> > gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0x00000000|UINT
> > 32|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>
> > +  #  If a bit is clear, that means this FSP API is NOT skipped.<BR>
> > +  #    BIT16   - Mask NotifyPhase (AfterPciEnumeration).<BR>
> > +  #    Any undefined BITs are reserved for future use.<BR>
> > +  # @Prompt FSP API skip mask from FSP wrapper.
> > +
> > gIntelFsp2WrapperTokenSpaceGuid.PcdFspApiSkipMask|0x00000000|UINT3
> > 2|0x40000009
> > +
> >  [PcdsFixedAtBuild, PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]
> >
> > gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress|0x00000000|UINT
> > 32|0x00001001
> >
> > \ No newline at end of file
> > --
> > 2.7.0.windows.1


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

* Re: [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete.
  2016-10-25  4:54     ` Yao, Jiewen
@ 2016-10-25 15:38       ` Dong, Guo
  0 siblings, 0 replies; 5+ messages in thread
From: Dong, Guo @ 2016-10-25 15:38 UTC (permalink / raw)
  To: Yao, Jiewen, Mudusuru, Giri P, edk2-devel@lists.01.org


Thanks Jiewen and Giri!
The patch has been updated by all the comments.

Thanks,
Guo

From: Yao, Jiewen
Sent: Monday, October 24, 2016 9:55 PM
To: Mudusuru, Giri P <giri.p.mudusuru@intel.com>; Dong, Guo <guo.dong@intel.com>; edk2-devel@lists.01.org
Cc: Ma, Maurice <maurice.ma@intel.com>
Subject: RE: [edk2] [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete.

Agree all.

From: Mudusuru, Giri P
Sent: Tuesday, October 25, 2016 11:43 AM
To: Yao, Jiewen <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>; Dong, Guo <guo.dong@intel.com<mailto:guo.dong@intel.com>>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Ma, Maurice <maurice.ma@intel.com<mailto:maurice.ma@intel.com>>
Subject: RE: [edk2] [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete.

We can add full description with note that only skip NotifyPhase Post PCI enumeration is implemented.

1) Change "BIT0~15 is for function:" to "BIT[15:0] is for function:" and "BIT16~32 is for sub-function:" to "BIT[32:16] is for sub-function:" for consistency
2)  Suggest to rename fix below define FSP_API_NOTIFY_PHASE_AFTER_PCI_ENUMERATION to be consistent with other usage
+#define   PCI_ENUMERATION_COMPLETE_API     BIT16
3) Also for PCD naming suggest to change PcdSkipFspApi

Thanks,
-Giri

> -----Original Message-----
> From: Yao, Jiewen
> Sent: Monday, October 24, 2016 4:18 PM
> To: Dong, Guo <guo.dong@intel.com<mailto:guo.dong@intel.com>>; edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Cc: Mudusuru, Giri P <giri.p.mudusuru@intel.com<mailto:giri.p.mudusuru@intel.com>>; Ma, Maurice
> <maurice.ma@intel.com<mailto:maurice.ma@intel.com>>
> Subject: RE: [edk2] [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if
> signaling PciEnumerationComplete.
>
> Thanks Guo. Can we add full description for the PCD?
>
> # BIT0~15 is for function:
> #   BIT0 - Mask TempRamInit
> #   BIT1 - Mask MemoryInit
> #   BIT2 - Mask TempRamExit
> #   BIT3 - Mask SiliconInit
> #   BIT4 - Mask NotifyPhase
> # BIT16~32 is for sub-function:
> #   BIT16 - Mask NotifyPhase (AfterPciEnumeration)
> #   BIT17 - Mask NotifyPhase (ReadyToBoot)
> #   BIT18 - Mask NotifyPhase (EndOfFirmware)
> # Any undefined BITs are reserved for future use
>
>
> Thank you
> Yao Jiewen
>
> > -----Original Message-----
> > From: Dong, Guo
> > Sent: Tuesday, October 25, 2016 1:03 AM
> > To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> > Cc: Yao, Jiewen <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>; Mudusuru, Giri P
> > <giri.p.mudusuru@intel.com<mailto:giri.p.mudusuru@intel.com>>; Ma, Maurice <maurice.ma@intel.com<mailto:maurice.ma@intel.com>>; Dong,
> > Guo <guo.dong@intel.com<mailto:guo.dong@intel.com>>
> > Subject: [edk2] [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if
> > signaling PciEnumerationComplete.
> >
> >  PciEnumerationComplete might be signaled to FSP in Coreboot. So FSP
> >  wrapper driver don't need send it again. Add a PCD to control if a
> >  FSP API could be skipped from FspWrapperNotifyDxe driver.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Guo Dong <guo.dong@intel.com<mailto:guo.dong@intel.com>>
> > Reviewed-by: Maurice Ma <maurice.ma@intel.com<mailto:maurice.ma@intel.com>>
> > Reviewed-by: Jiewen Yao <jiewen.yao@intel.com<mailto:jiewen.yao@intel.com>>
> > Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com<mailto:giri.p.mudusuru@intel.com>>
> > ---
> >  .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.c      | 22
> > ++++++++++++++--------
> >  .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf    |  1 +
> >  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec        |  8 ++++++++
> >  3 files changed, 23 insertions(+), 8 deletions(-)
> >
> > diff --git
> > a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> > b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> > index 0797f44..969debc 100644
> > --- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> > +++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> > @@ -26,6 +26,8 @@
> >  #include <Library/PerformanceLib.h>
> >  #include <Library/HobLib.h>
> >
> > +#define   PCI_ENUMERATION_COMPLETE_API     BIT16
> > +
> >  typedef
> >  EFI_STATUS
> >  (EFIAPI * ADD_PERFORMANCE_RECORDS)(
> > @@ -237,6 +239,7 @@ FspWrapperNotifyDxeEntryPoint (
> >    EFI_EVENT  ReadyToBootEvent;
> >    VOID       *Registration;
> >    EFI_EVENT  ProtocolNotifyEvent;
> > +  UINT32       FspApiMask;
> >
> >    //
> >    // Load this driver's image to memory
> > @@ -246,14 +249,17 @@ FspWrapperNotifyDxeEntryPoint (
> >      return EFI_SUCCESS;
> >    }
> >
> > -  ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (
> > -
> > &gEfiPciEnumerationCompleteProtocolGuid,
> > -                          TPL_CALLBACK,
> > -                          OnPciEnumerationComplete,
> > -                          NULL,
> > -                          &Registration
> > -                          );
> > -  ASSERT (ProtocolNotifyEvent != NULL);
> > +  FspApiMask = PcdGet32 (PcdFspApiSkipMask);
> > +  if ((FspApiMask & PCI_ENUMERATION_COMPLETE_API) == 0) {
> > +    ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (
> > +
> > &gEfiPciEnumerationCompleteProtocolGuid,
> > +                            TPL_CALLBACK,
> > +                            OnPciEnumerationComplete,
> > +                            NULL,
> > +                            &Registration
> > +                            );
> > +    ASSERT (ProtocolNotifyEvent != NULL);
> > +  }
> >
> >    Status = EfiCreateEventReadyToBootEx (
> >               TPL_CALLBACK,
> > diff --git
> > a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> > b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> > index f851f68..9ef81ff 100644
> > --- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> > +++
> > b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> > @@ -62,6 +62,7 @@
> >
> >  [Pcd]
> >    gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress  ##
> > CONSUMES
> > +  gIntelFsp2WrapperTokenSpaceGuid.PcdFspApiSkipMask   ##
> > CONSUMES
> >
> >  [Depex]
> >    TRUE
> > diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> > b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> > index d9d2d80..534f482 100644
> > --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> > +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> > @@ -75,6 +75,14 @@
> >
> > gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress|0x00000000|UINT3
> > 2|0x00000300
> >
> > gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0x00000000|UINT
> > 32|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>
> > +  #  If a bit is clear, that means this FSP API is NOT skipped.<BR>
> > +  #    BIT16   - Mask NotifyPhase (AfterPciEnumeration).<BR>
> > +  #    Any undefined BITs are reserved for future use.<BR>
> > +  # @Prompt FSP API skip mask from FSP wrapper.
> > +
> > gIntelFsp2WrapperTokenSpaceGuid.PcdFspApiSkipMask|0x00000000|UINT3
> > 2|0x40000009
> > +
> >  [PcdsFixedAtBuild, PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]
> >
> > gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress|0x00000000|UINT
> > 32|0x00001001
> >
> > \ No newline at end of file
> > --
> > 2.7.0.windows.1


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

end of thread, other threads:[~2016-10-25 15:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-24 17:02 [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete gdong1
2016-10-24 23:17 ` Yao, Jiewen
2016-10-25  3:43   ` Mudusuru, Giri P
2016-10-25  4:54     ` Yao, Jiewen
2016-10-25 15:38       ` Dong, Guo

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