Reviewed-by: Nate DeSimone <nathaniel.l.desim...@intel.com>

> -----Original Message-----
> From: Hsueh, DoraX <dorax.hs...@intel.com>
> Sent: Monday, April 22, 2024 1:40 AM
> To: devel@edk2.groups.io
> Cc: Hsueh, DoraX <dorax.hs...@intel.com>; Chaganty, Rangasai V
> <rangasai.v.chaga...@intel.com>; Chuang, Rosen <rosen.chu...@intel.com>;
> Kasbekar, Saloni <saloni.kasbe...@intel.com>; Tang, Haoyu
> <haoyu.t...@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desim...@intel.com>; Chiu, Chasel <chasel.c...@intel.com>
> Subject: [PATCH] AlderlakeOpenBoardPkg: Halt the TCO timer.
> 
> From: DoraX Hsueh <dorax.hs...@intel.com>
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=4761
> 
> Halt the TCO timer to fix release mode hang.
> 
> Cc: Sai Chaganty <rangasai.v.chaga...@intel.com>
> Cc: Rosen Chuang <rosen.chu...@intel.com>
> Cc: Saloni Kasbekar <saloni.kasbe...@intel.com>
> Cc: Haoyu Tang <haoyu.t...@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desim...@intel.com>
> Cc: Chasel Chiu <chasel.c...@intel.com>
> Signed-off-by: DoraX Hsueh <dorax.hs...@intel.com>
> ---
>  .../AlderlakeOpenBoardPkg/AlderlakePRvp/OpenBoardPkg.dsc  | 3 ++-
>  .../Library/SecFspWrapperPlatformSecLib/PlatformInit.c    | 8 ++++++++
>  .../SecFspWrapperPlatformSecLib.inf                       | 1 +
>  3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git 
> a/Platform/Intel/AlderlakeOpenBoardPkg/AlderlakePRvp/OpenBoardPkg.dsc 
> b/Platform/Intel/AlderlakeOpenBoardPkg/AlderlakePRvp/OpenBoardPkg.dsc
> index 59350f06..ea92ec75 100644
> --- a/Platform/Intel/AlderlakeOpenBoardPkg/AlderlakePRvp/OpenBoardPkg.dsc
> +++ b/Platform/Intel/AlderlakeOpenBoardPkg/AlderlakePRvp/OpenBoardPkg.dsc
> @@ -233,8 +233,9 @@
>  
>  [LibraryClasses.X64.DXE_SMM_DRIVER]
>  
> -!if $(TARGET) == DEBUG
>    
> SpiFlashCommonLib|IntelSiliconPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf
> +
> +!if $(TARGET) == DEBUG
>    
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/SmmTestPointCheckLib.inf
>    
> TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
>  !endif
> diff --git 
> a/Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/PlatformInit.c
>  
> b/Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/PlatformInit.c
> index f7ec4f9e..e930c9c7 100644
> --- 
> a/Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/PlatformInit.c
> +++ 
> b/Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/PlatformInit.c
> @@ -12,6 +12,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #include <Library/SerialPortLib.h>
>  #include <Library/SecBoardInitLib.h>
>  #include <Library/TestPointCheckLib.h>
> +#include <Register/TcoRegs.h>
> +#include <Library/IoLib.h>
>  
>  /**
>    Platform initialization.
> @@ -28,6 +30,12 @@ PlatformInit (
>    IN VOID                 *EndOfRange
>    )
>  {
> +
> +  ///
> +  /// Halt the TCO timer as early as possible
> +  ///
> +  IoWrite16 (PcdGet16 (PcdTcoBaseAddress) + R_TCO_IO_TCO1_CNT, 
> B_TCO_IO_TCO1_CNT_TMR_HLT);
> +
>    //
>    // Platform initialization
>    // Enable Serial port here
> diff --git 
> a/Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecFspWrapperPlatformSecLib.inf
>  
> b/Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecFspWrapperPlatformSecLib.inf
> index 3e51cb36..abc84057 100644
> --- 
> a/Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecFspWrapperPlatformSecLib.inf
> +++ 
> b/Platform/Intel/AlderlakeOpenBoardPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecFspWrapperPlatformSecLib.inf
> @@ -89,6 +89,7 @@
>    gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress                  ## 
> CONSUMES
>    gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize                  ## 
> CONSUMES
>    gMinPlatformPkgTokenSpaceGuid.PcdSecSerialPortDebugEnable           ## 
> CONSUMES
> +  gSiPkgTokenSpaceGuid.PcdTcoBaseAddress                              ## 
> CONSUMES
>  
>  [FixedPcd]
>    gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeBase               ## 
> CONSUMES
> -- 
> 2.26.2.windows.1


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


Reply via email to