Agree to remove car calculation from MSR.
Reviewed-by: [email protected]


> -----Original Message-----
> From: edk2-devel [mailto:[email protected]] On Behalf Of
> Satya Yarlagadda
> Sent: Wednesday, July 20, 2016 2:49 PM
> To: [email protected]
> Cc: Yao, Jiewen <[email protected]>
> Subject: [edk2] [PATCH] IntelFsp2Pkg: Remove CarBase and CarSize from
> FSP_GLOBAL_DATA
> 
> CarBase and CarSize in Fsp Global data strcture are no longer needed as
> Boot loader doesn't pass them to FSP even incase BL chooses to skip calling
> the FspTempRamInit API. Incase of FspTempramInit is called we can use the
> PCDs to identify the CarBase and Size. Hence removeing the relevent code.
> 
> Cc: Giri P Mudusuru <[email protected]>
> Cc: Jiewen Yao <[email protected]>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Satya Yarlagadda <[email protected]>
> ---
>  IntelFsp2Pkg/FspSecCore/SecFsp.c                   |  4 +--
>  IntelFsp2Pkg/Include/FspGlobalData.h               |  2 --
>  IntelFsp2Pkg/Include/Library/FspCommonLib.h        | 20 -----------
>  .../Library/BaseFspCommonLib/FspCommonLib.c        | 42
> ----------------------
>  4 files changed, 1 insertion(+), 67 deletions(-)
> 
> diff --git a/IntelFsp2Pkg/FspSecCore/SecFsp.c
> b/IntelFsp2Pkg/FspSecCore/SecFsp.c
> index 7259a55..96f8fb7 100644
> --- a/IntelFsp2Pkg/FspSecCore/SecFsp.c
> +++ b/IntelFsp2Pkg/FspSecCore/SecFsp.c
> @@ -76,7 +76,7 @@ SecGetPlatformData (
>    //
>    // Pointer to the size field
>    //
> -  TopOfCar = FspPlatformData->CarBase + FspPlatformData->CarSize;
> +  TopOfCar = PcdGet32(PcdTemporaryRamBase) +
> PcdGet32(PcdTemporaryRamSize);
>    StackPtr = (UINT32 *)(TopOfCar - sizeof (UINT32));
> 
>    if (*(StackPtr - 1) == FSP_MCUD_SIGNATURE) {
> @@ -140,8 +140,6 @@ FspGlobalDataInit (
>    PeiFspData->CoreStack            = BootLoaderStack;
>    PeiFspData->PerfIdx              = 2;
>    PeiFspData->PerfSig              =
> FSP_PERFORMANCE_DATA_SIGNATURE;
> -  PeiFspData->PlatformData.CarBase = AsmReadMsr32 (0x200) & ~(0x6);
> -  PeiFspData->PlatformData.CarSize = ~(AsmReadMsr32(0x201) & ~(0x800))
> + 1;
> 
>    SetFspMeasurePoint (FSP_PERF_ID_API_FSP_MEMORY_INIT_ENTRY);
> 
> diff --git a/IntelFsp2Pkg/Include/FspGlobalData.h
> b/IntelFsp2Pkg/Include/FspGlobalData.h
> index a484d16..8ac3199 100644
> --- a/IntelFsp2Pkg/Include/FspGlobalData.h
> +++ b/IntelFsp2Pkg/Include/FspGlobalData.h
> @@ -34,8 +34,6 @@ typedef struct  {
>     UINT32             MicrocodeRegionSize;
>     UINT32             CodeRegionBase;
>     UINT32             CodeRegionSize;
> -   UINT32             CarBase;
> -   UINT32             CarSize;
>  } FSP_PLAT_DATA;
> 
>  #define FSP_GLOBAL_DATA_SIGNATURE  SIGNATURE_32 ('F', 'S', 'P', 'D')
> diff --git a/IntelFsp2Pkg/Include/Library/FspCommonLib.h
> b/IntelFsp2Pkg/Include/Library/FspCommonLib.h
> index 231f1e4..5f7a14b 100644
> --- a/IntelFsp2Pkg/Include/Library/FspCommonLib.h
> +++ b/IntelFsp2Pkg/Include/Library/FspCommonLib.h
> @@ -290,26 +290,6 @@ SetPhaseStatusCode (
>    );
> 
>  /**
> -  This function gets FSP CAR base.
> -
> -**/
> -UINT32
> -EFIAPI
> -GetFspCarBase (
> -  VOID
> -  );
> -
> -/**
> -  This function gets FSP CAR size.
> -
> -**/
> -UINT32
> -EFIAPI
> -GetFspCarSize (
> -  VOID
> -  );
> -
> -/**
>    This function updates the return status of the FSP API with requested
> reset type and returns to Boot Loader.
> 
>    @param[in] FspResetType     Reset type that needs to returned as API
> return status
> diff --git a/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c
> b/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c
> index 0c5f0b3..660e9fc 100644
> --- a/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c
> +++ b/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c
> @@ -505,48 +505,6 @@ SetPhaseStatusCode (
>  }
> 
>  /**
> -  This function gets FSP CAR base.
> -
> -**/
> -UINT32
> -EFIAPI
> -GetFspCarBase (
> -  VOID
> -  )
> -{
> -  FSP_GLOBAL_DATA  *FspData;
> -  UINT32           CarBase;
> -
> -  FspData  = GetFspGlobalDataPointer ();
> -  CarBase = FspData->PlatformData.CarBase;
> -  if (CarBase == 0) {
> -    CarBase = PcdGet32(PcdTemporaryRamBase);
> -  }
> -  return CarBase;
> -}
> -
> -/**
> -  This function gets FSP CAR size.
> -
> -**/
> -UINT32
> -EFIAPI
> -GetFspCarSize (
> -  VOID
> -  )
> -{
> -  FSP_GLOBAL_DATA  *FspData;
> -  UINT32           CarSize;
> -
> -  FspData  = GetFspGlobalDataPointer ();
> -  CarSize = FspData->PlatformData.CarSize;
> -  if (FspData->PlatformData.CarBase == 0) {
> -    CarSize = PcdGet32(PcdTemporaryRamSize);
> -  }
> -  return CarSize;
> -}
> -
> -/**
>    This function updates the return status of the FSP API with requested
> reset type and returns to Boot Loader.
> 
>    @param[in] FspResetType     Reset type that needs to returned as API
> return status
> --
> 2.9.2.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to