public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Heng Luo" <heng.luo@intel.com>
To: devel@edk2.groups.io
Cc: Chasel Chiu <chasel.chiu@intel.com>,
	Nate DeSimone <nathaniel.l.desimone@intel.com>
Subject: [Patch V2] WhiskeylakeOpenBoardPkg: Add USB DCI debug suport
Date: Mon, 14 Dec 2020 09:43:52 +0800	[thread overview]
Message-ID: <20201214014352.1087-1-heng.luo@intel.com> (raw)

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

Add gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDciEnable for
USB DCI debug feature, feature is enabled if PcdDciEnable is TRUE,
it allows 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/OpenBoardPkg.dec                                             | 1 +
 Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPchPolicyUpdatePreMem.c | 8 +++++++-
 Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPolicyUpdateLib.inf     | 4 ++++
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc                                 | 2 ++
 Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc                          | 2 ++
 5 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec b/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
index fbb9549e44..196460e170 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/OpenBoardPkg.dec
@@ -554,6 +554,7 @@ gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdNCT6776FHWMON                        |
 [PcdsDynamicEx]
 
 [PcdsDynamic, PcdsDynamicEx]
+gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDciEnable           |FALSE|BOOLEAN|0x20000001
 
 [PcdsPatchableInModule]
 
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPchPolicyUpdatePreMem.c b/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPchPolicyUpdatePreMem.c
index 2d48b09175..bb34f89fb5 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPchPolicyUpdatePreMem.c
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPchPolicyUpdatePreMem.c
@@ -83,7 +83,13 @@ UpdatePeiPchPolicyPreMem (
   Status = GetConfigBlock ((VOID *) SiPreMemPolicy, &gIshPreMemConfigGuid, (VOID *) &IshPreMemConfig);
   ASSERT_EFI_ERROR (Status);
 
-  DciPreMemConfig->DciUsb3TypecUfpDbg = 2;
+  if (PcdGetBool (PcdDciEnable)) {
+    DciPreMemConfig->PlatformDebugConsent = 3;
+    DciPreMemConfig->DciUsb3TypecUfpDbg = 1;
+  } else {
+    DciPreMemConfig->DciUsb3TypecUfpDbg = 2;
+  }
+
   PchTraceHubPreMemConfig->MemReg0Size = 3;
   PchTraceHubPreMemConfig->MemReg1Size = 3;
   //
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPolicyUpdateLib.inf b/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPolicyUpdateLib.inf
index 478e2d0512..252f92f487 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPolicyUpdateLib.inf
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/PeiPolicyUpdateLib.inf
@@ -230,6 +230,9 @@
 
   gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdEcPresent
 
+  # Enable/Disable USB DCI Debug
+  gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDciEnable                      ## CONSUMES
+
   gIntelSiliconPkgTokenSpaceGuid.PcdIntelGraphicsVbtFileGuid               ## CONSUMES
   gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdSmbusAlertEnable               ## CONSUMES
   gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdSataLedEnable                  ## CONSUMES
@@ -243,6 +246,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdSystemFmpCapsuleImageTypeIdGuid   ## CONSUMES
   gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber           ## CONSUMES
 
+
 [FixedPcd]
   gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiAcpiReclaimMemorySize  ## CONSUMES
   gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiAcpiNvsMemorySize      ## CONSUMES
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc
index e161bf06f4..84d4ec1331 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkgPcd.dsc
@@ -399,6 +399,8 @@
   gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdRtd3Tbt|0x1
   gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdRtd3TbtClkReq|0x1
 
+  gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDciEnable|FALSE
+
 [PcdsDynamicHii.X64.DEFAULT]
   ######################################
   # Edk2 Configuration
diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc
index 83ada3c95c..4a7ba4d5f0 100644
--- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc
@@ -389,6 +389,8 @@
   gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdRtd3Tbt|0x1
   gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdRtd3TbtClkReq|0x1
 
+  gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdDciEnable|FALSE
+
 [PcdsDynamicHii.X64.DEFAULT]
   ######################################
   # Edk2 Configuration
-- 
2.24.0.windows.2


             reply	other threads:[~2020-12-14  1:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14  1:43 Heng Luo [this message]
2020-12-15  0:49 ` [Patch V2] WhiskeylakeOpenBoardPkg: Add USB DCI debug suport Nate DeSimone
2020-12-19  1:18 ` 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=20201214014352.1087-1-heng.luo@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