public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] UpXtreme: Enable USB DCI debug
@ 2020-11-20  5:23 Heng Luo
  2020-12-09 10:30 ` Nate DeSimone
  0 siblings, 1 reply; 3+ messages in thread
From: Heng Luo @ 2020-11-20  5:23 UTC (permalink / raw)
  To: devel; +Cc: Chasel Chiu, Nate DeSimone

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

Allow to debug BIOS via DCI cable.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPchPolicyUpdatePreMem.c                    | 1 -
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiCpuPolicyBoardConfig.c              | 5 +++++
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiPchPolicyBoardConfigPreMem.c        | 7 +++++++
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiPolicyBoardConfigLib.inf            | 1 +
 Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/PeiPolicyBoardConfigLib/PeiPchPolicyBoardConfigPreMem.c | 6 ++++++
 Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/PeiPolicyBoardConfigLib/PeiPolicyBoardConfigLib.inf     | 1 +
 6 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPchPolicyUpdatePreMem.c b/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPchPolicyUpdatePreMem.c
index 2d48b09175..ac5b583f89 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPchPolicyUpdatePreMem.c
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPchPolicyUpdatePreMem.c
@@ -83,7 +83,6 @@ UpdatePeiPchPolicyPreMem (
   Status = GetConfigBlock ((VOID *) SiPreMemPolicy, &gIshPreMemConfigGuid, (VOID *) &IshPreMemConfig);
   ASSERT_EFI_ERROR (Status);
 
-  DciPreMemConfig->DciUsb3TypecUfpDbg = 2;
   PchTraceHubPreMemConfig->MemReg0Size = 3;
   PchTraceHubPreMemConfig->MemReg1Size = 3;
   //
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiCpuPolicyBoardConfig.c b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiCpuPolicyBoardConfig.c
index d1d1920823..d4c5136c0a 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiCpuPolicyBoardConfig.c
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiCpuPolicyBoardConfig.c
@@ -44,6 +44,11 @@ UpdatePeiCpuPolicyBoardConfig (
   Status = GetConfigBlock ((VOID *) SiPolicyPpi, &gCpuConfigGuid, (VOID *) &CpuConfig);
   ASSERT_EFI_ERROR (Status);
 
+  //
+  //Enable processor debug features
+  //
+  CpuConfig->DebugInterfaceEnable = 1;
+
   return Status;
 }
 
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiPchPolicyBoardConfigPreMem.c b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiPchPolicyBoardConfigPreMem.c
index 01bb75525b..c79718f4ee 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiPchPolicyBoardConfigPreMem.c
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiPchPolicyBoardConfigPreMem.c
@@ -25,12 +25,19 @@ UpdatePeiPchPolicyBoardConfigPreMem (
 {
   EFI_STATUS                         Status;
   PCH_GENERAL_PREMEM_CONFIG          *PchGeneralPreMemConfig;
+  PCH_DCI_PREMEM_CONFIG              *DciPreMemConfig;
 
   DEBUG((DEBUG_INFO, "Updating PCH Policy by board config in Pre Mem\n"));
 
   Status = GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gPchGeneralPreMemConfigGuid, (VOID *) &PchGeneralPreMemConfig);
   ASSERT_EFI_ERROR (Status);
 
+  Status = GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gDciPreMemConfigGuid, (VOID *) &DciPreMemConfig);
+  ASSERT_EFI_ERROR (Status);
+
+  DciPreMemConfig->PlatformDebugConsent = 3;
+  DciPreMemConfig->DciUsb3TypecUfpDbg = 1;
+
   return Status;
 }
 
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiPolicyBoardConfigLib.inf b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiPolicyBoardConfigLib.inf
index aaf0abbf04..affb322c59 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiPolicyBoardConfigLib.inf
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoardConfigLib/PeiPolicyBoardConfigLib.inf
@@ -54,6 +54,7 @@
   gPchGeneralConfigGuid                         ## CONSUMES
   gEfiTpmDeviceInstanceTpm20DtpmGuid
   gEfiTpmDeviceInstanceTpm12Guid
+  gDciPreMemConfigGuid
 
 [Ppis]
   gEfiPeiReadOnlyVariable2PpiGuid               ## CONSUMES
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/PeiPolicyBoardConfigLib/PeiPchPolicyBoardConfigPreMem.c b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/PeiPolicyBoardConfigLib/PeiPchPolicyBoardConfigPreMem.c
index 00cf73dfd9..5d75bc5e1c 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/PeiPolicyBoardConfigLib/PeiPchPolicyBoardConfigPreMem.c
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/PeiPolicyBoardConfigLib/PeiPchPolicyBoardConfigPreMem.c
@@ -25,12 +25,18 @@ UpdatePeiPchPolicyBoardConfigPreMem (
 {
   EFI_STATUS                         Status;
   PCH_GENERAL_PREMEM_CONFIG          *PchGeneralPreMemConfig;
+  PCH_DCI_PREMEM_CONFIG              *DciPreMemConfig;
 
   DEBUG((DEBUG_INFO, "Updating PCH Policy by board config in Pre Mem\n"));
 
   Status = GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gPchGeneralPreMemConfigGuid, (VOID *) &PchGeneralPreMemConfig);
   ASSERT_EFI_ERROR (Status);
 
+  Status = GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gDciPreMemConfigGuid, (VOID *) &DciPreMemConfig);
+  ASSERT_EFI_ERROR (Status);
+
+  DciPreMemConfig->DciUsb3TypecUfpDbg = 2;
+
   return Status;
 }
 
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/PeiPolicyBoardConfigLib/PeiPolicyBoardConfigLib.inf b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/PeiPolicyBoardConfigLib/PeiPolicyBoardConfigLib.inf
index 15ef223050..5de11d62e4 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/PeiPolicyBoardConfigLib/PeiPolicyBoardConfigLib.inf
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/PeiPolicyBoardConfigLib/PeiPolicyBoardConfigLib.inf
@@ -54,6 +54,7 @@
   gPchGeneralConfigGuid                         ## CONSUMES
   gEfiTpmDeviceInstanceTpm20DtpmGuid
   gEfiTpmDeviceInstanceTpm12Guid
+  gDciPreMemConfigGuid
 
 [Ppis]
   gEfiPeiReadOnlyVariable2PpiGuid               ## CONSUMES
-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-14  1:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-20  5:23 [PATCH] UpXtreme: Enable USB DCI debug Heng Luo
2020-12-09 10:30 ` Nate DeSimone
2020-12-14  1:31   ` Heng Luo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox