Re: [edk2-devel] [PATCH v2] IntelFsp2WrapperPkg: Remove microcode related PCDs

2021-05-30 Thread Chiu, Chasel


Patch pushed: fe5da0927aad98f3c005088197fa30c1b8f9d3e8


> -Original Message-
> From: Lou, Yun 
> Sent: Thursday, April 15, 2021 2:49 PM
> To: devel@edk2.groups.io
> Cc: Lou, Yun ; Chiu, Chasel ;
> Desimone, Nathaniel L ; Zeng, Star
> ; Ni, Ray 
> Subject: [PATCH v2] IntelFsp2WrapperPkg: Remove microcode related PCDs
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3334
> 
> IntelFsp2WrapperPkg defines following PCDs:
>   PcdCpuMicrocodePatchAddress
>   PcdCpuMicrocodePatchRegionSize
>   PcdFlashMicrocodeOffset
> 
> But the PCD name caused confusion because UefiCpuPkg defines:
>   PcdCpuMicrocodePatchAddress
>   PcdCpuMicrocodePatchRegionSize
> 
> PcdCpuMicrocodePatchAddress in IntelFsp2WrapperPkg means the base address
> of the FV that holds the microcode.
> PcdCpuMicrocodePatchAddress in UefiCpuPkg means the address of the
> microcode.
> 
> The relationship between the PCDs is:
> IntelFsp2WrapperPkg.PcdCpuMicrocodePatchAddress
>  +  IntelFsp2WrapperPkg.PcdFlashMicrocodeOffset
>  == UefiCpuPkg.PcdCpuMicrocodePatchAddress
> 
> IntelFsp2WrapperPkg.PcdCpuMicrocodePatchRegionSize
>  -  IntelFsp2WrapperPkg.PcdFlashMicrocodeOffset
>  == UefiCpuPkg.PcdCpuMicrocodePatchRegionSize
> 
> To avoid confusion and actually the PCDs in IntelFsp2WrapperPkg are only used
> by a sample FSP-T wrapper, this patch removes the 3 PCDs defined in
> IntelFsp2WrapperPkg.
> 
> The FSP-T wrapper is updated to directly use the ones in UefiCpuPkg.
> 
> Signed-off-by: Jason Lou 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Cc: Ray Ni 
> ---
> 
> IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInit
> Data.c  | 6 +++---
>  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> | 8 +---
> 
> IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspWra
> pperPlatformSecLibSample.inf | 7 +++
>  3 files changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git
> a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamI
> nitData.c
> b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamI
> nitData.c
> index 96b47e23da..e57b5b57be 100644
> ---
> a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamI
> nitData.c
> +++ b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecR
> +++ amInitData.c
> @@ -1,7 +1,7 @@
>  /** @file   Sample to provide TempRamInitParams data. -  Copyright (c) 2014 -
> 2020, Intel Corporation. All rights reserved.+  Copyright (c) 2014 - 2021,
> Intel Corporation. All rights reserved.   SPDX-License-Identifier: BSD-2-
> Clause-Patent  **/@@ -52,8 +52,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED
> CONST FSPT_UPD_CORE_DATA FsptUpdDataPtr = {
>  }   },   {-((UINT32)FixedPcdGet64 (PcdCpuMicrocodePatchAddress) +
> FixedPcdGet32 (PcdFlashMicrocodeOffset)),-((UINT32)FixedPcdGet64
> (PcdCpuMicrocodePatchRegionSize) - FixedPcdGet32
> (PcdFlashMicrocodeOffset)),+FixedPcdGet32
> (PcdCpuMicrocodePatchAddress),+FixedPcdGet32
> (PcdCpuMicrocodePatchRegionSize), FixedPcdGet32
> (PcdFlashCodeCacheAddress), FixedPcdGet32 (PcdFlashCodeCacheSize),   }diff
> --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> index 6852bf1271..a3b9363779 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> @@ -1,7 +1,7 @@
>  ## @file # Provides drivers and definitions to support fsp in EDKII bios. #-#
> Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.+#
> Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved. # SPDX-
> License-Identifier: BSD-2-Clause-Patent # ##@@ -56,12 +56,6 @@
>## Provides the size of the BIOS Flash Device.
> gIntelFsp2WrapperTokenSpaceGuid.PcdFlashCodeCacheSize|0x0020|UINT
> 32|0x1002 -  ## Indicates the base address of the first Microcode Patch in
> the Microcode Region-
> gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchAddress|0x0|UINT6
> 4|0x1005-
> gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize|0x0|UI
> NT64|0x1006-  ## Indicates the offset of the Cpu Microcode.-
> gIntelFsp2WrapperTokenSpaceGuid.PcdFlashMicrocodeOffset|0x90|UINT32|0x
> 1007-   ## Indicate the PEI memory size platform want to report
> gIntelFsp2WrapperTokenSpaceGuid.PcdPeiMinMemSize|0x180|UINT32|0x
> 4004   ## Indicate the PEI memory size platform want to reportdiff --git
> a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspW
> rapperPlatformSecLibSample.inf
> b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspW
> rapperPlatformSecLibSample.inf
> index d7f8301bef..027b127724 100644
> ---
> a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspW
> rapperPlatformSecLibSample.inf
> +++ b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecF
> +++ spWrapperPlatformSecLibSample.inf
> @@ -1,7 +1,7 @@
>  ## @file #  Sample to provide FSP wrapper platform sec 

Re: [edk2-devel] [PATCH v2] IntelFsp2WrapperPkg: Remove microcode related PCDs

2021-05-24 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

-Original Message-
From: Lou, Yun  
Sent: Wednesday, April 14, 2021 11:49 PM
To: devel@edk2.groups.io
Cc: Lou, Yun ; Chiu, Chasel ; 
Desimone, Nathaniel L ; Zeng, Star 
; Ni, Ray 
Subject: [PATCH v2] IntelFsp2WrapperPkg: Remove microcode related PCDs

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

IntelFsp2WrapperPkg defines following PCDs:
  PcdCpuMicrocodePatchAddress
  PcdCpuMicrocodePatchRegionSize
  PcdFlashMicrocodeOffset

But the PCD name caused confusion because UefiCpuPkg defines:
  PcdCpuMicrocodePatchAddress
  PcdCpuMicrocodePatchRegionSize

PcdCpuMicrocodePatchAddress in IntelFsp2WrapperPkg means the base address of 
the FV that holds the microcode.
PcdCpuMicrocodePatchAddress in UefiCpuPkg means the address of the microcode.

The relationship between the PCDs is:
IntelFsp2WrapperPkg.PcdCpuMicrocodePatchAddress
 +  IntelFsp2WrapperPkg.PcdFlashMicrocodeOffset
 == UefiCpuPkg.PcdCpuMicrocodePatchAddress

IntelFsp2WrapperPkg.PcdCpuMicrocodePatchRegionSize
 -  IntelFsp2WrapperPkg.PcdFlashMicrocodeOffset
 == UefiCpuPkg.PcdCpuMicrocodePatchRegionSize

To avoid confusion and actually the PCDs in IntelFsp2WrapperPkg are only used 
by a sample FSP-T wrapper, this patch removes the 3 PCDs defined in 
IntelFsp2WrapperPkg.

The FSP-T wrapper is updated to directly use the ones in UefiCpuPkg.

Signed-off-by: Jason Lou 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Cc: Ray Ni 
---
 IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c 
 | 6 +++---
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
 | 8 +---
 
IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspWrapperPlatformSecLibSample.inf
 | 7 +++
 3 files changed, 7 insertions(+), 14 deletions(-)

diff --git 
a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
 
b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
index 96b47e23da..e57b5b57be 100644
--- 
a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
+++ b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecR
+++ amInitData.c
@@ -1,7 +1,7 @@
 /** @file   Sample to provide TempRamInitParams data. -  Copyright (c) 2014 - 
2020, Intel Corporation. All rights reserved.+  Copyright (c) 2014 - 2021, 
Intel Corporation. All rights reserved.   SPDX-License-Identifier: 
BSD-2-Clause-Patent  **/@@ -52,8 +52,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST 
FSPT_UPD_CORE_DATA FsptUpdDataPtr = {
 }   },   {-((UINT32)FixedPcdGet64 (PcdCpuMicrocodePatchAddress) + 
FixedPcdGet32 (PcdFlashMicrocodeOffset)),-((UINT32)FixedPcdGet64 
(PcdCpuMicrocodePatchRegionSize) - FixedPcdGet32 (PcdFlashMicrocodeOffset)),+   
 FixedPcdGet32 (PcdCpuMicrocodePatchAddress),+FixedPcdGet32 
(PcdCpuMicrocodePatchRegionSize), FixedPcdGet32 (PcdFlashCodeCacheAddress), 
FixedPcdGet32 (PcdFlashCodeCacheSize),   }diff --git 
a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec 
b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
index 6852bf1271..a3b9363779 100644
--- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
+++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
@@ -1,7 +1,7 @@
 ## @file # Provides drivers and definitions to support fsp in EDKII bios. #-# 
Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.+# 
Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved. # 
SPDX-License-Identifier: BSD-2-Clause-Patent # ##@@ -56,12 +56,6 @@
   ## Provides the size of the BIOS Flash Device.   
gIntelFsp2WrapperTokenSpaceGuid.PcdFlashCodeCacheSize|0x0020|UINT32|0x1002
 -  ## Indicates the base address of the first Microcode Patch in the Microcode 
Region-  
gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchAddress|0x0|UINT64|0x1005-
  
gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize|0x0|UINT64|0x1006-
  ## Indicates the offset of the Cpu Microcode.-  
gIntelFsp2WrapperTokenSpaceGuid.PcdFlashMicrocodeOffset|0x90|UINT32|0x1007- 
  ## Indicate the PEI memory size platform want to report   
gIntelFsp2WrapperTokenSpaceGuid.PcdPeiMinMemSize|0x180|UINT32|0x4004   
## Indicate the PEI memory size platform want to reportdiff --git 
a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspWrapperPlatformSecLibSample.inf
 
b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspWrapperPlatformSecLibSample.inf
index d7f8301bef..027b127724 100644
--- 
a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspWrapperPlatformSecLibSample.inf
+++ b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecF
+++ spWrapperPlatformSecLibSample.inf
@@ -1,7 +1,7 @@
 ## @file #  Sample to provide FSP wrapper platform sec related function. #-#  
Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.+#  
Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved. # #  

Re: [edk2-devel] [PATCH v2] IntelFsp2WrapperPkg: Remove microcode related PCDs

2021-05-19 Thread Jason Lou
Hi Chasel & Star,

So far, the PCD usage has been removed from all of these platforms:
1. Server platforms("ServerGen2")
2. Client platforms("ClientMaster")
3. Edk2-platform opensource

Thanks
Jason Lou


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#75352): https://edk2.groups.io/g/devel/message/75352
Mute This Topic: https://groups.io/mt/82111237/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2] IntelFsp2WrapperPkg: Remove microcode related PCDs

2021-04-15 Thread Zeng, Star
Agree with you Chasel.
Deprecating them step by step, it will benefit further code sync for platforms 
consuming the PCDs.


Thanks,
Star
-Original Message-
From: Chiu, Chasel  
Sent: Thursday, April 15, 2021 3:26 PM
To: Lou, Yun ; devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Zeng, Star 
; Ni, Ray 
Subject: RE: [PATCH v2] IntelFsp2WrapperPkg: Remove microcode related PCDs


Hi Yun,

I would recommend that we split this patch and remove PCD from DEC as last step 
after all involved platforms not consuming them, what do you think?

Thanks,
Chasel


> -Original Message-
> From: Lou, Yun 
> Sent: Thursday, April 15, 2021 2:49 PM
> To: devel@edk2.groups.io
> Cc: Lou, Yun ; Chiu, Chasel 
> ; Desimone, Nathaniel L 
> ; Zeng, Star ; 
> Ni, Ray 
> Subject: [PATCH v2] IntelFsp2WrapperPkg: Remove microcode related PCDs
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3334
> 
> IntelFsp2WrapperPkg defines following PCDs:
>   PcdCpuMicrocodePatchAddress
>   PcdCpuMicrocodePatchRegionSize
>   PcdFlashMicrocodeOffset
> 
> But the PCD name caused confusion because UefiCpuPkg defines:
>   PcdCpuMicrocodePatchAddress
>   PcdCpuMicrocodePatchRegionSize
> 
> PcdCpuMicrocodePatchAddress in IntelFsp2WrapperPkg means the base 
> address of the FV that holds the microcode.
> PcdCpuMicrocodePatchAddress in UefiCpuPkg means the address of the 
> microcode.
> 
> The relationship between the PCDs is:
> IntelFsp2WrapperPkg.PcdCpuMicrocodePatchAddress
>  +  IntelFsp2WrapperPkg.PcdFlashMicrocodeOffset
>  == UefiCpuPkg.PcdCpuMicrocodePatchAddress
> 
> IntelFsp2WrapperPkg.PcdCpuMicrocodePatchRegionSize
>  -  IntelFsp2WrapperPkg.PcdFlashMicrocodeOffset
>  == UefiCpuPkg.PcdCpuMicrocodePatchRegionSize
> 
> To avoid confusion and actually the PCDs in IntelFsp2WrapperPkg are 
> only used by a sample FSP-T wrapper, this patch removes the 3 PCDs 
> defined in IntelFsp2WrapperPkg.
> 
> The FSP-T wrapper is updated to directly use the ones in UefiCpuPkg.
> 
> Signed-off-by: Jason Lou 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Cc: Ray Ni 
> ---
> 
> IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInit
> Data.c  | 6 +++---
>  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> | 8 +---
> 
> IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspWr
> a pperPlatformSecLibSample.inf | 7 +++
>  3 files changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git
> a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRam
> I
> nitData.c
> b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRam
> I
> nitData.c
> index 96b47e23da..e57b5b57be 100644
> ---
> a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRam
> I
> nitData.c
> +++ b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/Se
> +++ cR
> +++ amInitData.c
> @@ -1,7 +1,7 @@
>  /** @file   Sample to provide TempRamInitParams data. -  Copyright (c) 2014 -
> 2020, Intel Corporation. All rights reserved.+  Copyright (c) 2014 - 2021,
> Intel Corporation. All rights reserved.   SPDX-License-Identifier: BSD-2-
> Clause-Patent  **/@@ -52,8 +52,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED 
> CONST FSPT_UPD_CORE_DATA FsptUpdDataPtr = {
>  }   },   {-((UINT32)FixedPcdGet64 (PcdCpuMicrocodePatchAddress) +
> FixedPcdGet32 (PcdFlashMicrocodeOffset)),-((UINT32)FixedPcdGet64
> (PcdCpuMicrocodePatchRegionSize) - FixedPcdGet32
> (PcdFlashMicrocodeOffset)),+FixedPcdGet32
> (PcdCpuMicrocodePatchAddress),+FixedPcdGet32
> (PcdCpuMicrocodePatchRegionSize), FixedPcdGet32
> (PcdFlashCodeCacheAddress), FixedPcdGet32 (PcdFlashCodeCacheSize),   }diff
> --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> index 6852bf1271..a3b9363779 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> @@ -1,7 +1,7 @@
>  ## @file # Provides drivers and definitions to support fsp in EDKII 
> bios. #-# Copyright (c) 2014 - 2020, Intel Corporation. All rights 
> reserved.+# Copyright (c) 2014 - 2021, Intel Corporation. All 
> rights reserved. # SPDX-
> License-Identifier: BSD-2-Clause-Patent # ##@@ -56,12 +56,6 @@
>## Provides the size of the BIOS Flash Device.
> gIntelFsp2WrapperTokenSpaceGuid.PcdFlashCodeCacheSize|0x0020|UINT
> 32|0x1002 -  ## Indicates the base address of the first Microcode 
> 32|Patch in
> the Microcode Region-
> gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchAddress|0x0|UINT6
> 4|0x1005-
> gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize|0x0|UI
> NT64|0x1006-  ## Indicates the offset of the Cpu Microcode.-
> gIntelFsp2WrapperTokenSpaceGuid.PcdFlashMicrocodeOffset|0x90|UINT32|0x
> 1007-   ## Indicate the PEI memory size platform want to report
> gIntelFsp2WrapperTokenSpaceGuid.PcdPeiMinMemSize|0x180|UINT32|0x
> 4004   ## Indicate the PEI memory size platform want to reportdiff --git
> 

Re: [edk2-devel] [PATCH v2] IntelFsp2WrapperPkg: Remove microcode related PCDs

2021-04-15 Thread Chiu, Chasel


Hi Yun,

I would recommend that we split this patch and remove PCD from DEC as last step 
after all involved platforms not consuming them, what do you think?

Thanks,
Chasel


> -Original Message-
> From: Lou, Yun 
> Sent: Thursday, April 15, 2021 2:49 PM
> To: devel@edk2.groups.io
> Cc: Lou, Yun ; Chiu, Chasel ;
> Desimone, Nathaniel L ; Zeng, Star
> ; Ni, Ray 
> Subject: [PATCH v2] IntelFsp2WrapperPkg: Remove microcode related PCDs
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3334
> 
> IntelFsp2WrapperPkg defines following PCDs:
>   PcdCpuMicrocodePatchAddress
>   PcdCpuMicrocodePatchRegionSize
>   PcdFlashMicrocodeOffset
> 
> But the PCD name caused confusion because UefiCpuPkg defines:
>   PcdCpuMicrocodePatchAddress
>   PcdCpuMicrocodePatchRegionSize
> 
> PcdCpuMicrocodePatchAddress in IntelFsp2WrapperPkg means the base address
> of the FV that holds the microcode.
> PcdCpuMicrocodePatchAddress in UefiCpuPkg means the address of the
> microcode.
> 
> The relationship between the PCDs is:
> IntelFsp2WrapperPkg.PcdCpuMicrocodePatchAddress
>  +  IntelFsp2WrapperPkg.PcdFlashMicrocodeOffset
>  == UefiCpuPkg.PcdCpuMicrocodePatchAddress
> 
> IntelFsp2WrapperPkg.PcdCpuMicrocodePatchRegionSize
>  -  IntelFsp2WrapperPkg.PcdFlashMicrocodeOffset
>  == UefiCpuPkg.PcdCpuMicrocodePatchRegionSize
> 
> To avoid confusion and actually the PCDs in IntelFsp2WrapperPkg are only used
> by a sample FSP-T wrapper, this patch removes the 3 PCDs defined in
> IntelFsp2WrapperPkg.
> 
> The FSP-T wrapper is updated to directly use the ones in UefiCpuPkg.
> 
> Signed-off-by: Jason Lou 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Star Zeng 
> Cc: Ray Ni 
> ---
> 
> IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInit
> Data.c  | 6 +++---
>  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> | 8 +---
> 
> IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspWra
> pperPlatformSecLibSample.inf | 7 +++
>  3 files changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git
> a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamI
> nitData.c
> b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamI
> nitData.c
> index 96b47e23da..e57b5b57be 100644
> ---
> a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamI
> nitData.c
> +++ b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecR
> +++ amInitData.c
> @@ -1,7 +1,7 @@
>  /** @file   Sample to provide TempRamInitParams data. -  Copyright (c) 2014 -
> 2020, Intel Corporation. All rights reserved.+  Copyright (c) 2014 - 2021,
> Intel Corporation. All rights reserved.   SPDX-License-Identifier: BSD-2-
> Clause-Patent  **/@@ -52,8 +52,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED
> CONST FSPT_UPD_CORE_DATA FsptUpdDataPtr = {
>  }   },   {-((UINT32)FixedPcdGet64 (PcdCpuMicrocodePatchAddress) +
> FixedPcdGet32 (PcdFlashMicrocodeOffset)),-((UINT32)FixedPcdGet64
> (PcdCpuMicrocodePatchRegionSize) - FixedPcdGet32
> (PcdFlashMicrocodeOffset)),+FixedPcdGet32
> (PcdCpuMicrocodePatchAddress),+FixedPcdGet32
> (PcdCpuMicrocodePatchRegionSize), FixedPcdGet32
> (PcdFlashCodeCacheAddress), FixedPcdGet32 (PcdFlashCodeCacheSize),   }diff
> --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> index 6852bf1271..a3b9363779 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
> @@ -1,7 +1,7 @@
>  ## @file # Provides drivers and definitions to support fsp in EDKII bios. #-#
> Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.+#
> Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved. # SPDX-
> License-Identifier: BSD-2-Clause-Patent # ##@@ -56,12 +56,6 @@
>## Provides the size of the BIOS Flash Device.
> gIntelFsp2WrapperTokenSpaceGuid.PcdFlashCodeCacheSize|0x0020|UINT
> 32|0x1002 -  ## Indicates the base address of the first Microcode Patch in
> the Microcode Region-
> gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchAddress|0x0|UINT6
> 4|0x1005-
> gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize|0x0|UI
> NT64|0x1006-  ## Indicates the offset of the Cpu Microcode.-
> gIntelFsp2WrapperTokenSpaceGuid.PcdFlashMicrocodeOffset|0x90|UINT32|0x
> 1007-   ## Indicate the PEI memory size platform want to report
> gIntelFsp2WrapperTokenSpaceGuid.PcdPeiMinMemSize|0x180|UINT32|0x
> 4004   ## Indicate the PEI memory size platform want to reportdiff --git
> a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspW
> rapperPlatformSecLibSample.inf
> b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspW
> rapperPlatformSecLibSample.inf
> index d7f8301bef..027b127724 100644
> ---
> a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspW
> rapperPlatformSecLibSample.inf
> +++ b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecF
> 

[edk2-devel] [PATCH v2] IntelFsp2WrapperPkg: Remove microcode related PCDs

2021-04-15 Thread Jason Lou
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3334

IntelFsp2WrapperPkg defines following PCDs:
  PcdCpuMicrocodePatchAddress
  PcdCpuMicrocodePatchRegionSize
  PcdFlashMicrocodeOffset

But the PCD name caused confusion because UefiCpuPkg defines:
  PcdCpuMicrocodePatchAddress
  PcdCpuMicrocodePatchRegionSize

PcdCpuMicrocodePatchAddress in IntelFsp2WrapperPkg means the base
address of the FV that holds the microcode.
PcdCpuMicrocodePatchAddress in UefiCpuPkg means the address of the
microcode.

The relationship between the PCDs is:
IntelFsp2WrapperPkg.PcdCpuMicrocodePatchAddress
 +  IntelFsp2WrapperPkg.PcdFlashMicrocodeOffset
 == UefiCpuPkg.PcdCpuMicrocodePatchAddress

IntelFsp2WrapperPkg.PcdCpuMicrocodePatchRegionSize
 -  IntelFsp2WrapperPkg.PcdFlashMicrocodeOffset
 == UefiCpuPkg.PcdCpuMicrocodePatchRegionSize

To avoid confusion and actually the PCDs in IntelFsp2WrapperPkg
are only used by a sample FSP-T wrapper, this patch removes
the 3 PCDs defined in IntelFsp2WrapperPkg.

The FSP-T wrapper is updated to directly use the ones in UefiCpuPkg.

Signed-off-by: Jason Lou 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Star Zeng 
Cc: Ray Ni 
---
 IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c 
 | 6 +++---
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
 | 8 +---
 
IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspWrapperPlatformSecLibSample.inf
 | 7 +++
 3 files changed, 7 insertions(+), 14 deletions(-)

diff --git 
a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
 
b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
index 96b47e23da..e57b5b57be 100644
--- 
a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
+++ 
b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
@@ -1,7 +1,7 @@
 /** @file
   Sample to provide TempRamInitParams data.
 
-  Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -52,8 +52,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST FSPT_UPD_CORE_DATA 
FsptUpdDataPtr = {
 }
   },
   {
-((UINT32)FixedPcdGet64 (PcdCpuMicrocodePatchAddress) + FixedPcdGet32 
(PcdFlashMicrocodeOffset)),
-((UINT32)FixedPcdGet64 (PcdCpuMicrocodePatchRegionSize) - FixedPcdGet32 
(PcdFlashMicrocodeOffset)),
+FixedPcdGet32 (PcdCpuMicrocodePatchAddress),
+FixedPcdGet32 (PcdCpuMicrocodePatchRegionSize),
 FixedPcdGet32 (PcdFlashCodeCacheAddress),
 FixedPcdGet32 (PcdFlashCodeCacheSize),
   }
diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec 
b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
index 6852bf1271..a3b9363779 100644
--- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
+++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
@@ -1,7 +1,7 @@
 ## @file
 # Provides drivers and definitions to support fsp in EDKII bios.
 #
-# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -56,12 +56,6 @@
   ## Provides the size of the BIOS Flash Device.
   
gIntelFsp2WrapperTokenSpaceGuid.PcdFlashCodeCacheSize|0x0020|UINT32|0x1002
 
-  ## Indicates the base address of the first Microcode Patch in the Microcode 
Region
-  
gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchAddress|0x0|UINT64|0x1005
-  
gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize|0x0|UINT64|0x1006
-  ## Indicates the offset of the Cpu Microcode.
-  
gIntelFsp2WrapperTokenSpaceGuid.PcdFlashMicrocodeOffset|0x90|UINT32|0x1007
-
   ## Indicate the PEI memory size platform want to report
   gIntelFsp2WrapperTokenSpaceGuid.PcdPeiMinMemSize|0x180|UINT32|0x4004
   ## Indicate the PEI memory size platform want to report
diff --git 
a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspWrapperPlatformSecLibSample.inf
 
b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspWrapperPlatformSecLibSample.inf
index d7f8301bef..027b127724 100644
--- 
a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspWrapperPlatformSecLibSample.inf
+++ 
b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecFspWrapperPlatformSecLibSample.inf
@@ -1,7 +1,7 @@
 ## @file
 #  Sample to provide FSP wrapper platform sec related function.
 #
-#  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+#  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -76,8 +76,7 @@
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress  ## CONSUMES
 
 [FixedPcd]
-  gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchAddress ## CONSUMES
-