public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: dorax.hsueh@intel.com
To: devel@edk2.groups.io
Cc: DoraX Hsueh <dorax.hsueh@intel.com>,
	Sai Chaganty <rangasai.v.chaganty@intel.com>,
	Rosen Chuang <rosen.chuang@intel.com>,
	Saloni Kasbekar <saloni.kasbekar@intel.com>,
	Haoyu Tang <haoyu.tang@intel.com>,
	Nate DeSimone <nathaniel.l.desimone@intel.com>
Subject: [edk2-devel] [PATCH] AlderlakeOpenBoardPkg: Halt the TCO timer.
Date: Mon, 22 Apr 2024 14:58:57 +0800	[thread overview]
Message-ID: <691cfc8d9c30f304c969bf74b0a3282ad6400442.1713768053.git.dorax.hsueh@intel.com> (raw)

From: DoraX Hsueh <dorax.hsueh@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.chaganty@intel.com>
Cc: Rosen Chuang <rosen.chuang@intel.com>
Cc: Saloni Kasbekar <saloni.kasbekar@intel.com>
Cc: Haoyu Tang <haoyu.tang@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: DoraX Hsueh <dorax.hsueh@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 (#118069): https://edk2.groups.io/g/devel/message/118069
Mute This Topic: https://groups.io/mt/105665490/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



             reply	other threads:[~2024-04-22  6:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22  6:58 dorax.hsueh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-04-22  8:40 [edk2-devel] [PATCH] AlderlakeOpenBoardPkg: Halt the TCO timer dorax.hsueh
2024-04-22 17:45 ` Saloni Kasbekar
2024-05-02 23:45 ` Nate DeSimone
2024-05-02 23:45 ` Nate DeSimone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=691cfc8d9c30f304c969bf74b0a3282ad6400442.1713768053.git.dorax.hsueh@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox