Re: [edk2] [PATCH v3] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete.

2016-10-25 Thread Dong, Guo
Hi Jiewen,

Thank you catch this issue. I have sent an updated patch for it.
Could you help check it in if there is no other comments? Since I don't have 
write access.

Thanks,
Guo

-Original Message-
From: Yao, Jiewen 
Sent: Tuesday, October 25, 2016 4:32 PM
To: Dong, Guo <guo.d...@intel.com>; edk2-devel@lists.01.org
Cc: Mudusuru, Giri P <giri.p.mudus...@intel.com>; Ma, Maurice 
<maurice...@intel.com>
Subject: RE: [edk2] [PATCH v3] IntelFsp2WrapperPkg: Add a PCD to control if 
signaling PciEnumerationComplete.

I found the comment section has unreadable char. I think it should be "-".

We need update it to be readable asci char.
With that change, reviewed-by: jiewen@intel.com

> -Original Message-
> From: Dong, Guo
> Sent: Tuesday, October 25, 2016 11:33 PM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen <jiewen@intel.com>; Mudusuru, Giri P 
> <giri.p.mudus...@intel.com>; Ma, Maurice <maurice...@intel.com>; Dong, 
> Guo <guo.d...@intel.com>
> Subject: [edk2] [PATCH v3] 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.d...@intel.com>
> Reviewed-by: Maurice Ma <maurice...@intel.com>
> Reviewed-by: Jiewen Yao <jiewen@intel.com>
> Reviewed-by: Giri P Mudusuru <giri.p.mudus...@intel.com>
> ---
>  .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.c  | 22
> ++
>  .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf|  1 +
>  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec| 18
> ++
>  3 files changed, 33 insertions(+), 8 deletions(-)
> 
> diff --git
> a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> index 0797f44..d09e20e 100644
> --- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> +++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
> @@ -26,6 +26,8 @@
>  #include 
>  #include 
> 
> +#define   FSP_API_NOTIFY_PHASE_AFTER_PCI_ENUMERATION
> 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 (
> -
> ,
> -  TPL_CALLBACK,
> -  OnPciEnumerationComplete,
> -  NULL,
> -  
> -  );
> -  ASSERT (ProtocolNotifyEvent != NULL);
> +  FspApiMask = PcdGet32 (PcdSkipFspApi);  if ((FspApiMask & 
> + FSP_API_NOTIFY_PHASE_AFTER_PCI_ENUMERATION)
> == 0) {
> +ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (
> +
> ,
> +TPL_CALLBACK,
> +OnPciEnumerationComplete,
> +NULL,
> +
> +);
> +ASSERT (ProtocolNotifyEvent != NULL);  }
> 
>Status = EfiCreateEventReadyToBootEx (
>   TPL_CALLBACK,
> diff --git
> a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> index f851f68..54c2cbf 100644
> --- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> +++
> b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
> @@ -62,6 +62,7 @@
> 
>  [Pcd]
>gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress  ## CONSUMES
> +  gIntelFsp2WrapperTokenSpaceGuid.PcdSkipFspApi   ## CONSUMES
> 
>  [Depex]
>TRUE
> diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> index d9d2d80..ea3bc70 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> @@ -75,6 +75,24 @@
> 
> gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress|0x|UINT3
> 2|0x0300
> 
> gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0x|UINT
> 32|0x0301
> 
> +  ## This PCD indicates if FSP APIs are skipped from FSP 
> + wrapper.  #  If a bit is set, that means this F

Re: [edk2] [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete.

2016-10-25 Thread Dong, Guo

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.mudus...@intel.com>; Dong, Guo 
<guo.d...@intel.com>; edk2-devel@lists.01.org
Cc: Ma, Maurice <maurice...@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@intel.com<mailto:jiewen....@intel.com>>; Dong, Guo 
<guo.d...@intel.com<mailto:guo.d...@intel.com>>; 
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Ma, Maurice <maurice...@intel.com<mailto:maurice...@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.d...@intel.com<mailto:guo.d...@intel.com>>; 
> edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Cc: Mudusuru, Giri P 
> <giri.p.mudus...@intel.com<mailto:giri.p.mudus...@intel.com>>; Ma, Maurice
> <maurice...@intel.com<mailto:maurice...@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@intel.com<mailto:jiewen@intel.com>>; 
> > Mudusuru, Giri P
> > <giri.p.mudus...@intel.com<mailto:giri.p.mudus...@intel.com>>; Ma, Maurice 
> > <maurice...@intel.com<mailto:maurice...@intel.com>>; Dong,
> > Guo <guo.d...@intel.com<mailto:guo.d...@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.d...@intel.com<mailto:guo.d...@intel.com>>
> > Reviewed-by: Maurice Ma <maurice...@intel.com<mailto:maurice...@intel.com>>
> > Reviewed-by: Jiewen Yao <jiewen@intel.com<mailto:jiewen@intel.com>>
> > Reviewed-by: Giri P Mudusuru 
> > <giri.p.mudus...@intel.com<mailto:giri.p.mudus...@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 
> >  #include 
> >
> > +#define   PCI_ENUMERATION_COMPLETE_API BIT16
> > +
> >  typedef
> >  EFI_STATUS
> >  (EFIAPI * ADD_PERFORMANCE_RECORDS)(
> > @@ -237,6 +239,7 @@ FspWrapperNotifyDxeEntryPoint (
> >EFI_

Re: [edk2] [PATCH] IntelFsp2WrapperPkg: Add a PCD to control if signaling first event.

2016-10-21 Thread Dong, Guo

I am OK with bit mask PCD.
Now only 3 APIs in this driver. Do we really need UINT64?

Thanks,
Guo

From: Yao, Jiewen
Sent: Friday, October 21, 2016 4:23 PM
To: Dong, Guo <guo.d...@intel.com>; Mudusuru, Giri P 
<giri.p.mudus...@intel.com>; edk2-devel@lists.01.org
Cc: Ma, Maurice <maurice...@intel.com>; Yarlagadda, Satya P 
<satya.p.yarlaga...@intel.com>
Subject: RE: [edk2] [PATCH] IntelFsp2WrapperPkg: Add a PCD to control if 
signaling first event.

Understood. I agree that is a valid usage model.

So how about we define a bit mask for every function? Such as 
"PcdFspApiSkipMask|UINT64" - I am open on any naming proposal.

In the future we may need skip some other functions such as InitTempRam or 
TempRamExit.

Thank you
Yao Jiewen

From: Dong, Guo
Sent: Tuesday, October 18, 2016 1:11 PM
To: Yao, Jiewen <jiewen@intel.com<mailto:jiewen@intel.com>>; Mudusuru, 
Giri P <giri.p.mudus...@intel.com<mailto:giri.p.mudus...@intel.com>>; 
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Ma, Maurice <maurice...@intel.com<mailto:maurice...@intel.com>>; 
Yarlagadda, Satya P 
<satya.p.yarlaga...@intel.com<mailto:satya.p.yarlaga...@intel.com>>
Subject: RE: [edk2] [PATCH] IntelFsp2WrapperPkg: Add a PCD to control if 
signaling first event.


Hi Jiewen,

For Coreboot boot loader, PCI device enumeration is done in coreboot, so it is 
nature Coreboot sends PciEnumerationComplete to FSP. UEFI payload would send 
FSP ReadyToBoot and EndOfFirmware notification.

If there is other boot loader that sends ReadyToBoot and EndOfFirmware in 
different firmware component, we may add PCDs for them later.

Thanks,
Guo

From: Yao, Jiewen
Sent: Monday, October 17, 2016 9:10 PM
To: Dong, Guo <guo.d...@intel.com<mailto:guo.d...@intel.com>>; Mudusuru, Giri P 
<giri.p.mudus...@intel.com<mailto:giri.p.mudus...@intel.com>>; 
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Ma, Maurice <maurice...@intel.com<mailto:maurice...@intel.com>>; 
Yarlagadda, Satya P 
<satya.p.yarlaga...@intel.com<mailto:satya.p.yarlaga...@intel.com>>; Yao, 
Jiewen <jiewen@intel.com<mailto:jiewen@intel.com>>
Subject: RE: [edk2] [PATCH] IntelFsp2WrapperPkg: Add a PCD to control if 
signaling first event.

Hi
I am a little concern on this as well.

If today, there is a POC require skipping PciEnumerationComplete.
There might be the other POC tomorrow to skip ReadyToBoot
Then another POC to skip EventExitBootServices.

We will be exhausted to add POC to skip each separately.

Can this POC handle all 3 event together? Or not handle 3 event completely?


Thank you
Yao Jiewen

From: Dong, Guo
Sent: Tuesday, October 18, 2016 12:04 PM
To: Mudusuru, Giri P 
<giri.p.mudus...@intel.com<mailto:giri.p.mudus...@intel.com>>; 
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Yao, Jiewen <jiewen@intel.com<mailto:jiewen@intel.com>>; Ma, 
Maurice <maurice...@intel.com<mailto:maurice...@intel.com>>; Yarlagadda, Satya 
P <satya.p.yarlaga...@intel.com<mailto:satya.p.yarlaga...@intel.com>>
Subject: RE: [edk2] [PATCH] IntelFsp2WrapperPkg: Add a PCD to control if 
signaling first event.


Hi Giri,

Thank you for the comment.

In our POC implementation, Coreboot will notify FSP EnumerationComplete.  And 
in UEFI payload, the other 2 FSP notifications will be called from 
FspWrapperNotifyDxe.

Thanks,
Guo

-Original Message-
From: Mudusuru, Giri P
Sent: Monday, October 17, 2016 8:32 PM
To: Dong, Guo <guo.d...@intel.com<mailto:guo.d...@intel.com>>; 
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Yao, Jiewen <jiewen@intel.com<mailto:jiewen@intel.com>>; Ma, 
Maurice <maurice...@intel.com<mailto:maurice...@intel.com>>; Yarlagadda, Satya 
P <satya.p.yarlaga...@intel.com<mailto:satya.p.yarlaga...@intel.com>>
Subject: RE: [edk2] [PATCH] IntelFsp2WrapperPkg: Add a PCD to control if 
signaling first event.

Hello Guo,
FSP wrapper and Coreboot are bootloaders consuming FSP binary.

FSP must get called Post PCI bus enumeration to do the required silicon 
initialization. Why do we need a PCD to skip it?

Thanks,
-Giri

> -Original Message-
> From: Dong, Guo
> Sent: Monday, October 17, 2016 3:53 PM
> To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Cc: Yao, Jiewen <jiewen@intel.com<mailto:jiewen@intel.com>>; 
> Mudusuru, Giri P
> <giri.p.mudus...@intel.com<mailto:giri.p.mudus...@intel.com>>; Dong, Guo 
> <guo.d...@intel.com<mailto:guo.d...@intel.com>>
> Subject: [edk2] [PATCH] IntelFsp2WrapperPkg: Add a PCD to control if
> signaling first event.
>
> PciEnumerationComplete might be signaled to FSP in Coreboot. Add a PCD
> PcdNotifyPciEnumerationComplete so

Re: [edk2] [PATCH] IntelFsp2WrapperPkg: Add a PCD to control if signaling first event.

2016-10-24 Thread Dong, Guo

Thanks all for these comments. I have sent an updated patch, please help review.

Thanks,
Guo

From: Mudusuru, Giri P
Sent: Sunday, October 23, 2016 6:53 AM
To: Yao, Jiewen <jiewen@intel.com>; Dong, Guo <guo.d...@intel.com>; 
edk2-devel@lists.01.org
Cc: Ma, Maurice <maurice...@intel.com>; Yarlagadda, Satya P 
<satya.p.yarlaga...@intel.com>
Subject: RE: [edk2] [PATCH] IntelFsp2WrapperPkg: Add a PCD to control if 
signaling first event.

Agree with Jiewen's solution. Default should be 0 in IntelFsp2WrapperPkg and 
CorebootPayloadPkg can set BIT16 to skip the API.

Thanks,
-Giri

From: Yao, Jiewen
Sent: Friday, October 21, 2016 10:15 PM
To: Dong, Guo <guo.d...@intel.com<mailto:guo.d...@intel.com>>; Mudusuru, Giri P 
<giri.p.mudus...@intel.com<mailto:giri.p.mudus...@intel.com>>; 
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Ma, Maurice <maurice...@intel.com<mailto:maurice...@intel.com>>; 
Yarlagadda, Satya P 
<satya.p.yarlaga...@intel.com<mailto:satya.p.yarlaga...@intel.com>>
Subject: RE: [edk2] [PATCH] IntelFsp2WrapperPkg: Add a PCD to control if 
signaling first event.

My thinking is to define mask for ALL APIs, not 3.

We have 5 APIs, and 3 sub API for notify phase. How about this :
# 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
PcdFspApiSkipMask|UINT32

You can use BIT16 now. We may use BIT0+BIT2 later. And any other combination in 
the future.

From: Dong, Guo
Sent: Saturday, October 22, 2016 7:52 AM
To: Yao, Jiewen <jiewen@intel.com<mailto:jiewen@intel.com>>; Mudusuru, 
Giri P <giri.p.mudus...@intel.com<mailto:giri.p.mudus...@intel.com>>; 
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Ma, Maurice <maurice...@intel.com<mailto:maurice...@intel.com>>; 
Yarlagadda, Satya P 
<satya.p.yarlaga...@intel.com<mailto:satya.p.yarlaga...@intel.com>>
Subject: RE: [edk2] [PATCH] IntelFsp2WrapperPkg: Add a PCD to control if 
signaling first event.


I am OK with bit mask PCD.
Now only 3 APIs in this driver. Do we really need UINT64?

Thanks,
Guo

From: Yao, Jiewen
Sent: Friday, October 21, 2016 4:23 PM
To: Dong, Guo <guo.d...@intel.com<mailto:guo.d...@intel.com>>; Mudusuru, Giri P 
<giri.p.mudus...@intel.com<mailto:giri.p.mudus...@intel.com>>; 
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Ma, Maurice <maurice...@intel.com<mailto:maurice...@intel.com>>; 
Yarlagadda, Satya P 
<satya.p.yarlaga...@intel.com<mailto:satya.p.yarlaga...@intel.com>>
Subject: RE: [edk2] [PATCH] IntelFsp2WrapperPkg: Add a PCD to control if 
signaling first event.

Understood. I agree that is a valid usage model.

So how about we define a bit mask for every function? Such as 
"PcdFspApiSkipMask|UINT64" - I am open on any naming proposal.

In the future we may need skip some other functions such as InitTempRam or 
TempRamExit.

Thank you
Yao Jiewen

From: Dong, Guo
Sent: Tuesday, October 18, 2016 1:11 PM
To: Yao, Jiewen <jiewen@intel.com<mailto:jiewen@intel.com>>; Mudusuru, 
Giri P <giri.p.mudus...@intel.com<mailto:giri.p.mudus...@intel.com>>; 
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Ma, Maurice <maurice...@intel.com<mailto:maurice...@intel.com>>; 
Yarlagadda, Satya P 
<satya.p.yarlaga...@intel.com<mailto:satya.p.yarlaga...@intel.com>>
Subject: RE: [edk2] [PATCH] IntelFsp2WrapperPkg: Add a PCD to control if 
signaling first event.


Hi Jiewen,

For Coreboot boot loader, PCI device enumeration is done in coreboot, so it is 
nature Coreboot sends PciEnumerationComplete to FSP. UEFI payload would send 
FSP ReadyToBoot and EndOfFirmware notification.

If there is other boot loader that sends ReadyToBoot and EndOfFirmware in 
different firmware component, we may add PCDs for them later.

Thanks,
Guo

From: Yao, Jiewen
Sent: Monday, October 17, 2016 9:10 PM
To: Dong, Guo <guo.d...@intel.com<mailto:guo.d...@intel.com>>; Mudusuru, Giri P 
<giri.p.mudus...@intel.com<mailto:giri.p.mudus...@intel.com>>; 
edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
Cc: Ma, Maurice <maurice...@intel.com<mailto:maurice...@intel.com>>; 
Yarlagadda, Satya P 
<satya.p.yarlaga...@intel.com<mailto:satya.p.yarlaga...@intel.com>>; Yao, 
Jiewen <jiewen@intel.com<mailto:jiewen@intel.com>>
Subject: RE: [edk2] [PATCH] IntelFsp2WrapperPkg: Add a PCD to control if 
signaling first event.

Hi
I am a little concern on this as well.

If today, the

Re: [edk2] [PATCH] CorebootModulePkgPkg: Expose FindCbTag API from CbParseLib

2016-10-27 Thread Dong, Guo

Hi Maurice,

Thank you for the comments.
I have updated patch to add EFIAPI to all the APIs in CbParseLib.

Thanks,
Guo

-Original Message-
From: Ma, Maurice 
Sent: Wednesday, October 26, 2016 8:02 PM
To: Dong, Guo <guo.d...@intel.com>
Cc: Agyeman, Prince <prince.agye...@intel.com>; edk2-devel@lists.01.org
Subject: RE: [edk2] [PATCH] CorebootModulePkgPkg: Expose FindCbTag API from 
CbParseLib

Guo,

I think it is better to add  "EFIAPI" to force the calling convention.

Thanks
Maurice

-Original Message-
From: Dong, Guo
Sent: Wednesday, October 26, 2016 5:35 PM
To: edk2-devel@lists.01.org
Cc: Ma, Maurice; Agyeman, Prince; Dong, Guo
Subject: [edk2] [PATCH] CorebootModulePkgPkg: Expose FindCbTag API from 
CbParseLib

CbPlatformSupportLib might use FindCbTag() API to parse platform specific 
information.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Dong <guo.d...@intel.com>
Reviewed-by: Maurice Ma <maurice...@intel.com>
---
 CorebootModulePkg/Include/Library/CbParseLib.h | 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/CorebootModulePkg/Include/Library/CbParseLib.h 
b/CorebootModulePkg/Include/Library/CbParseLib.h
index 064baf3..e1fda7e 100644
--- a/CorebootModulePkg/Include/Library/CbParseLib.h
+++ b/CorebootModulePkg/Include/Library/CbParseLib.h
@@ -2,7 +2,7 @@
   This library will parse the coreboot table in memory and extract those 
required
   information.
 
-  Copyright (c) 2014, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2016, Intel Corporation. All rights 
+ reserved.
   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 @@ -18,6 +18,23 @@ typedef RETURN_STATUS \
 (*CB_MEM_INFO_CALLBACK) (UINT64 Base, UINT64 Size, UINT32 Type, VOID 
*Param);
 
 /**
+  Find coreboot record with given Tag from the memory Start in 4096 
+ bytes range.
+
+  @param  Start  The start memory to be searched in
+  @param  TagThe tag id to be found
+
+  @retval NULL  The Tag is not found.
+  @retval OthersThe poiter to the record found.
+
+**/
+VOID *
+FindCbTag (
+  IN  VOID *Start,
+  IN  UINT32   Tag
+  );
+
+/**
   Acquire the memory information from the coreboot table in memory.
 
   @param  MemInfoCallback The callback routine
--
2.7.0.windows.1

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


Re: [edk2] [PATCH v2] CorebootModulePkgPkg: Expose FindCbTag API from CbParseLib

2016-10-27 Thread Dong, Guo

Hi Maurice,

Thank you capture this typo. Updated patch has been sent.

Thanks,
Guo

-Original Message-
From: Ma, Maurice 
Sent: Thursday, October 27, 2016 9:38 AM
To: Dong, Guo <guo.d...@intel.com>
Cc: edk2-devel@lists.01.org; Agyeman, Prince <prince.agye...@intel.com>
Subject: RE: [edk2] [PATCH v2] CorebootModulePkgPkg: Expose FindCbTag API from 
CbParseLib

Hi, Guo,

I think the following code will have issue on compiling.  Can you check ?

+EFIAPI
+FindCbTag
+(IN VOID * Start, IN UINT32 Tag) (
+  IN  VOID *Start,
+  IN  UINT32   Tag
+  );
+

Thanks
Maurice
-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Ma, 
Maurice
Sent: Thursday, October 27, 2016 9:32 AM
To: Dong, Guo
Cc: edk2-devel@lists.01.org; Agyeman, Prince
Subject: Re: [edk2] [PATCH v2] CorebootModulePkgPkg: Expose FindCbTag API from 
CbParseLib

Reviewed-by: Maurice Ma <maurice...@intel.com>

-Original Message-----
From: Dong, Guo
Sent: Thursday, October 27, 2016 7:59 AM
To: edk2-devel@lists.01.org
Cc: Ma, Maurice; Agyeman, Prince; Dong, Guo
Subject: [edk2] [PATCH v2] CorebootModulePkgPkg: Expose FindCbTag API from 
CbParseLib

CbPlatformSupportLib might use FindCbTag() API to parse platform specific 
information. So expose this API.
And add EFIAPI to all functions in CbParseLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Dong <guo.d...@intel.com>
---
 CorebootModulePkg/Include/Library/CbParseLib.h| 29 ++-
 CorebootModulePkg/Library/CbParseLib/CbParseLib.c | 10 
 2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/CorebootModulePkg/Include/Library/CbParseLib.h 
b/CorebootModulePkg/Include/Library/CbParseLib.h
index 064baf3..18e3d1e 100644
--- a/CorebootModulePkg/Include/Library/CbParseLib.h
+++ b/CorebootModulePkg/Include/Library/CbParseLib.h
@@ -2,7 +2,7 @@
   This library will parse the coreboot table in memory and extract those 
required
   information.
 
-  Copyright (c) 2014, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2016, Intel Corporation. All rights 
+ reserved.
   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 @@ -18,6 +18,25 @@ typedef RETURN_STATUS \
 (*CB_MEM_INFO_CALLBACK) (UINT64 Base, UINT64 Size, UINT32 Type, VOID 
*Param);
 
 /**
+  Find coreboot record with given Tag from the memory Start in 4096 
+ bytes range.
+
+  @param  Start  The start memory to be searched in
+  @param  TagThe tag id to be found
+
+  @retval NULL  The Tag is not found.
+  @retval OthersThe poiter to the record found.
+
+**/
+VOID *
+EFIAPI
+FindCbTag
+(IN VOID * Start, IN UINT32 Tag) (
+  IN  VOID *Start,
+  IN  UINT32   Tag
+  );
+
+/**
   Acquire the memory information from the coreboot table in memory.
 
   @param  MemInfoCallback The callback routine
@@ -28,6 +47,7 @@ typedef RETURN_STATUS \
 
 **/
 RETURN_STATUS
+EFIAPI
 CbParseMemoryInfo (
   IN  CB_MEM_INFO_CALLBACK  MemInfoCallback,
   IN  VOID  *pParam
@@ -46,6 +66,7 @@ CbParseMemoryInfo (
 
 **/
 RETURN_STATUS
+EFIAPI
 CbParseCbMemTable (
   IN UINT32 TableId,
   IN VOID** pMemTable,
@@ -64,6 +85,7 @@ CbParseCbMemTable (
 
 **/
 RETURN_STATUS
+EFIAPI
 CbParseAcpiTable (
   IN VOID** pMemTable,
   IN UINT32*pMemTableSize
@@ -81,6 +103,7 @@ CbParseAcpiTable (
 
 **/
 RETURN_STATUS
+EFIAPI
 CbParseSmbiosTable (
   IN VOID** pMemTable,
   IN UINT32*pMemTableSize
@@ -101,6 +124,7 @@ CbParseSmbiosTable (
 
 **/
 RETURN_STATUS
+EFIAPI
 CbParseFadtInfo (
   IN UINTN* pPmCtrlReg,
   IN UINTN* pPmTimerReg,
@@ -125,6 +149,7 @@ CbParseFadtInfo (
 
 **/
 RETURN_STATUS
+EFIAPI
 CbParseSerialInfo (
   OUT UINT32 *pRegBase,
   OUT UINT32 *pRegAccessType,
@@ -145,6 +170,7 @@ CbParseSerialInfo (
 
 **/
 RETURN_STATUS
+EFIAPI
 CbParseGetCbHeader (
   IN UINTN  Level,
   IN VOID** HeaderPtr
@@ -160,6 +186,7 @@ CbParseGetCbHeader (
 
 **/
 RETURN_STATUS
+EFIAPI
 CbParseFbInfo (
   IN FRAME_BUFFER_INFO* pFbInfo
   );
diff --git a/CorebootModulePkg/Library/CbParseLib/CbParseLib.c 
b/CorebootModulePkg/Library/CbParseLib/CbParseLib.c
index 305e38f..0909b0f 100644
--- a/CorebootModulePkg/Library/CbParseLib/CbParseLib.c
+++ b/CorebootModulePkg/Library/CbParseLib/CbParseLib.c
@@ -94,6 +94,7 @@ CbCheckSum16 (
 
 **/
 VOID *
+EFIAPI
 FindCbTag (
   IN  VOID *Start,
   IN  UINT32   Tag
@@ -175,6 +176,7 @@ FindCbTag (
 
 **/
 RETURN_STATUS
+EFIAPI
 FindCbMemTable (
   IN  struct cbmem_root  *Root,
   IN  UINT32 TableId,
@@ -237,6 +239,7 @@ FindCbMemTable (
 
 **/
 RETURN_STATUS
+EFIAPI
 CbParseMemoryInfo (
   IN  CB_MEM_INFO_CALLBACK  MemInfoCallback,
   IN  VOID  *pParam
@@ -287,6 +290,7 @@ CbParseMemoryInfo

Re: [edk2] [PATCH] UefiPayloadPkg: Enhance UEFI payload for coreboot and Slim Bootloader

2019-03-29 Thread Dong, Guo


Hi Ray,

Yes, the new UefiPayload will not require legacy 8254 timer.
And we could remove Coreboot packages after UefiPayloadPkg check in.

Thanks,
Guo

> -Original Message-
> From: Ni, Ray
> Sent: Thursday, March 28, 2019 10:15 PM
> To: Dong, Guo ; edk2-devel@lists.01.org; Laszlo Ersek
> 
> Cc: Wu, Hao A ; Kinney, Michael D
> ; Ma, Maurice 
> Subject: RE: [edk2] [PATCH] UefiPayloadPkg: Enhance UEFI payload for
> coreboot and Slim Bootloader
> 
> 
> Guo,
> Just to double confirm: UefiPayloadPkg will not require Legacy8254 timer
> support.
> The old packages Coreboot*Pkgs will be removed.
> Which means now only QEMU/OVMF needs the Legacy8254 support.
> 
> Laszlo,
> Now since QEMU/OVMF is the only consumer of the Legacy8254 driver, do
> you agree that the Legacy8254 is moved to OvmfPkg?
> Note: We agreed that Legacy8259 will be moved to OvmfPkg/Csm directory
> and that decision is not going to be changed by this new situation.
> 
> Thanks,
> Ray
> 
> > -Original Message-
> > From: edk2-devel  On Behalf Of Guo
> > Dong
> > Sent: Friday, March 29, 2019 8:34 AM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] [PATCH] UefiPayloadPkg: Enhance UEFI payload for
> > coreboot and Slim Bootloader
> >
> > CorebootModulePkg and CorebootPayloadPkg originally supports coreboot
> > only.
> > In order to support other bootloaders, such as Slim Bootloader, they
> > need be updated to be more generic.
> > UEFI Payload (UefiPayloadPkg) a converged package from
> > CorebootModulePkg and CorebootPayloadPkg with following updates:
> > a. Support both coreboot and Slim Bootloader b. Removed
> > SataControllerDxe and BaseSerialPortLib16550 to use EDK2 modules c.
> > Support passing bootloader parameter to UEFI payload, e.g. coreboot
> >table from coreboot or HOB list from Slim Bootloader d. Using
> > GraphicsOutputDxe from EDK2 with minor change instead of FbGop e.
> > Remove the dependency to IntelFrameworkPkg and
> IntelFrameworkModulePkg
> >and QuarkSocPkg
> > f. Use BaseDebugLibSerialPort library as DebugLib g. Use HPET timer,
> > drop legacy 8254 timer support h. Use BaseXApicX2ApicLib instead of
> > BaseXApicLib i. Other clean ups
> >
> > On how UefiPayloadPkg could work with coreboot/Slim Bootloader, please
> > refer UefiPayloadPkg/BuildAndIntegrationInstructions.txt
> >
> > Once UefiPayloadPkg is checked-in, CorebootModulePkg and
> > CorebootPayloadPkg could be retired.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Guo Dong 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel