public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Nate DeSimone" <nathaniel.l.desimone@intel.com>
To: "Luo, Heng" <heng.luo@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Chiu, Chasel" <chasel.chiu@intel.com>
Subject: Re: [PATCH] UpXtreme: Enable USB DCI debug
Date: Wed, 9 Dec 2020 10:30:05 +0000	[thread overview]
Message-ID: <MWHPR1101MB2160DB9A43830EC1F4D9AA9FCDCC0@MWHPR1101MB2160.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20201120052316.3707-1-heng.luo@intel.com>

Hi Heng,

Please add a DynamicEx PCD to control the enable/disable of DCI to WhiskeyLakeOpenBoardPkg. It is probably not a good idea from a security standpoint to have the default configuration leave JTAG enabled and open. Other than that, look's good!

Thanks,
Nate

> -----Original Message-----
> From: Luo, Heng <heng.luo@intel.com>
> Sent: Thursday, November 19, 2020 9:23 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [PATCH] UpXtreme: Enable USB DCI debug
> 
> 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/PeiPolicyUpdateLi
> b/PeiPchPolicyUpdatePreMem.c                    | 1 -
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoar
> dConfigLib/PeiCpuPolicyBoardConfig.c              | 5 +++++
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoar
> dConfigLib/PeiPchPolicyBoardConfigPreMem.c        | 7 +++++++
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBoar
> dConfigLib/PeiPolicyBoardConfigLib.inf            | 1 +
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/PeiPol
> icyBoardConfigLib/PeiPchPolicyBoardConfigPreMem.c | 6 ++++++
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/PeiPol
> icyBoardConfigLib/PeiPolicyBoardConfigLib.inf     | 1 +
>  6 files changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdate
> Lib/PeiPchPolicyUpdatePreMem.c
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdate
> Lib/PeiPchPolicyUpdatePreMem.c
> index 2d48b09175..ac5b583f89 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdate
> Lib/PeiPchPolicyUpdatePreMem.c
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdate
> Lib/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/PeiPolicyBo
> ardConfigLib/PeiCpuPolicyBoardConfig.c
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBo
> ardConfigLib/PeiCpuPolicyBoardConfig.c
> index d1d1920823..d4c5136c0a 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBo
> ardConfigLib/PeiCpuPolicyBoardConfig.c
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBo
> ardConfigLib/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/PeiPolicyBo
> ardConfigLib/PeiPchPolicyBoardConfigPreMem.c
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBo
> ardConfigLib/PeiPchPolicyBoardConfigPreMem.c
> index 01bb75525b..c79718f4ee 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBo
> ardConfigLib/PeiPchPolicyBoardConfigPreMem.c
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBo
> ardConfigLib/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/PeiPolicyBo
> ardConfigLib/PeiPolicyBoardConfigLib.inf
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBo
> ardConfigLib/PeiPolicyBoardConfigLib.inf
> index aaf0abbf04..affb322c59 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBo
> ardConfigLib/PeiPolicyBoardConfigLib.inf
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/PeiPolicyBo
> ardConfigLib/PeiPolicyBoardConfigLib.inf
> @@ -54,6 +54,7 @@
>    gPchGeneralConfigGuid                         ## CONSUMES
> 
>    gEfiTpmDeviceInstanceTpm20DtpmGuid
> 
>    gEfiTpmDeviceInstanceTpm12Guid
> 
> +  gDciPreMemConfigGuid
> 
> 
> 
>  [Ppis]
> 
>    gEfiPeiReadOnlyVariable2PpiGuid               ## CONSUMES
> 
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/Pei
> PolicyBoardConfigLib/PeiPchPolicyBoardConfigPreMem.c
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/Pei
> PolicyBoardConfigLib/PeiPchPolicyBoardConfigPreMem.c
> index 00cf73dfd9..5d75bc5e1c 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/Pei
> PolicyBoardConfigLib/PeiPchPolicyBoardConfigPreMem.c
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/Pei
> PolicyBoardConfigLib/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/Pei
> PolicyBoardConfigLib/PeiPolicyBoardConfigLib.inf
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/Pei
> PolicyBoardConfigLib/PeiPolicyBoardConfigLib.inf
> index 15ef223050..5de11d62e4 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/Pei
> PolicyBoardConfigLib/PeiPolicyBoardConfigLib.inf
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/Pei
> PolicyBoardConfigLib/PeiPolicyBoardConfigLib.inf
> @@ -54,6 +54,7 @@
>    gPchGeneralConfigGuid                         ## CONSUMES
> 
>    gEfiTpmDeviceInstanceTpm20DtpmGuid
> 
>    gEfiTpmDeviceInstanceTpm12Guid
> 
> +  gDciPreMemConfigGuid
> 
> 
> 
>  [Ppis]
> 
>    gEfiPeiReadOnlyVariable2PpiGuid               ## CONSUMES
> 
> --
> 2.24.0.windows.2


  reply	other threads:[~2020-12-09 10:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20  5:23 [PATCH] UpXtreme: Enable USB DCI debug Heng Luo
2020-12-09 10:30 ` Nate DeSimone [this message]
2020-12-14  1:31   ` Heng Luo

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=MWHPR1101MB2160DB9A43830EC1F4D9AA9FCDCC0@MWHPR1101MB2160.namprd11.prod.outlook.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