From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.groups.io (mail04.groups.io [45.79.224.9]) by spool.mail.gandi.net (Postfix) with ESMTPS id 178F7AC0B90 for ; Mon, 15 Apr 2024 06:36:11 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=TYdJvvHhLO8S5aJyYz5cs3MC8lN3gS7zQk4vOK6yWnY=; c=relaxed/simple; d=groups.io; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Thread-Index:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding:Content-Language; s=20240206; t=1713162970; v=1; b=Hv66n7VzSW9DS2XzuewVTveiNuYhIAp3U+Fk3vrlGKWJVXIzH3HcO4moVHV1EW7Lp60LUnm8 SYJ6Dwuv75rSyvrZugfgB5FzS9Tt0bbeNukRCdLghHIVe/B+ivkpOiHo4i3TEyxcTPA1KYki8iJ sjsfLqk/fGfnfUb0dvdum4xqNvB2FdAyrY0PReL91BLW0dn0ryHZFTVSzkp5e82Bldyxosj2hPc +99uKMY5R1/D2+TOsOamT/FcQKaSjA7x6JW2K1iayWtCN8cqR89UCn8btHGv3JcyUa7HCkyahN8 dHGA1I/vio/OCYSO+wwtZgfe4AQanKIYsMORmNpXwYg/g== X-Received: by 127.0.0.2 with SMTP id FtxpYY7687511x0NiTsYKkeE; Sun, 14 Apr 2024 23:36:10 -0700 X-Received: from zrleap.intel-email.com (zrleap.intel-email.com [114.80.218.36]) by mx.groups.io with SMTP id smtpd.web11.15008.1713162969789114017 for ; Sun, 14 Apr 2024 23:36:10 -0700 X-Received: from zrleap.intel-email.com (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 4E368A32E198 for ; Mon, 15 Apr 2024 14:36:07 +0800 (CST) X-Received: from localhost (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 5902EA32DFD3 for ; Mon, 15 Apr 2024 14:36:06 +0800 (CST) X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by zrleap.intel-email.com (Postfix) with SMTP id 4D3F0A32E176 for ; Mon, 15 Apr 2024 14:36:02 +0800 (CST) X-Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP(SSL) for ; Mon, 15 Apr 2024 14:36:00 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming via groups.io" To: "'Xianglei Cai'" , Cc: "'Ray Ni'" , "'Krzysztof Lewandowski'" , "'Jenny Huang'" , "'More Shih'" , "'Ian Chiu'" References: <6ccbc5f73881bc59b8260f947ca092a6a3d6c60c.1713162827.git.xianglei.cai@intel.com> In-Reply-To: <6ccbc5f73881bc59b8260f947ca092a6a3d6c60c.1713162827.git.xianglei.cai@intel.com> Subject: =?UTF-8?B?W2VkazItZGV2ZWxdIOWbnuWkjTogW1BBVENIIFYzIDEvMV0gTWRlTW9kdWxlUGtnL1hoY2lEeGU6IEFkZCBQQ0QgZm9yIHRoZSBkZWxheSBvZiBIQ1JTVA==?= Date: Mon, 15 Apr 2024 14:36:02 +0800 Message-ID: <013c01da8eff$2f8ceb20$8ea6c160$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQHs+II+NeK5wHABtw9F1K5vOIRXkAHJwnEdsTW/RMA= Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Sun, 14 Apr 2024 23:36:10 -0700 Resent-From: gaoliming@byosoft.com.cn Reply-To: devel@edk2.groups.io,gaoliming@byosoft.com.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: x83txQ0W8r0IQjsFz4tzwqU2x7686176AA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=Hv66n7Vz; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.9 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed-by: Liming Gao > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: Xianglei Cai > =B7=A2=CB=CD=CA=B1=BC=E4: 2024=C4=EA4=D4=C215=C8=D5 14:34 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Xianglei Cai ; Ray Ni ; > Liming Gao ; Krzysztof Lewandowski > ; Jenny Huang ; > More Shih ; Ian Chiu > =D6=F7=CC=E2: [PATCH V3 1/1] MdeModulePkg/XhciDxe: Add PCD for the delay = of > HCRST >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D4727 >=20 > Recently some of XHCI host controllers require to have > extra 1ms delay before accessing any MMIO register > during reset. PHY transition from P3 to P0 can take > around 1.3ms and the xHCI reset can take around 1.5ms. > Add PCD to control the delay, the default is 2 ms. >=20 > Cc: Ray Ni > Cc: Liming Gao > Cc: Krzysztof Lewandowski > Cc: Jenny Huang > Cc: More Shih > Cc: Ian Chiu > Signed-off-by: Xianglei Cai > Reviewed-by: Krzysztof Lewandowski > --- > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h | 1 + > MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf | 4 ++++ > MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c | 2 +- > MdeModulePkg/MdeModulePkg.dec | 5 +++++ > 4 files changed, 11 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h > b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h > index 44016758724c..c9a12095c29e 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.h > @@ -28,6 +28,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > #include > #include > #include > +#include >=20 > #include >=20 > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf > index 18ef87916ae4..e6c1ac8a6346 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf > @@ -56,6 +56,7 @@ > DebugLib > ReportStatusCodeLib > TimerLib > + PcdLib >=20 > [Guids] > gEfiEventExitBootServicesGuid ## > SOMETIMES_CONSUMES ## Event > @@ -64,6 +65,9 @@ > gEfiPciIoProtocolGuid ## TO_START > gEfiUsb2HcProtocolGuid ## BY_START >=20 > +[Pcd] > + gEfiMdeModulePkgTokenSpaceGuid.PcdDelayXhciHCReset ## > CONSUMES > + > # [Event] > # EVENT_TYPE_PERIODIC_TIMER ## CONSUMES > # > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c > index 40f2f1f22766..525942a167b0 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c > @@ -864,7 +864,7 @@ XhcResetHC ( > // Otherwise there may have the timeout case happened. > // The below is a workaround to solve such problem. > // > - gBS->Stall (XHC_1_MILLISECOND); > + gBS->Stall (PcdGet16 (PcdDelayXhciHCReset)); > Status =3D XhcWaitOpRegBit (Xhc, XHC_USBCMD_OFFSET, > XHC_USBCMD_RESET, FALSE, Timeout); >=20 > if (!EFI_ERROR (Status)) { > diff --git a/MdeModulePkg/MdeModulePkg.dec > b/MdeModulePkg/MdeModulePkg.dec > index a91058e5b5df..d9e2e724df9e 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -1148,6 +1148,11 @@ > # @Prompt Enable large address image loading. >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdImageLargeAddressLoad|TRUE|BOO > LEAN|0x30001059 >=20 > + ## Indicates time delay for XHCI registers access after it issues HCRST. > + # Default is 2000, it represent delay is 2 ms. > + # @Prompt Delay access XHCI register after it issues HCRST (us) > + > gEfiMdeModulePkgTokenSpaceGuid.PcdDelayXhciHCReset|2000|UINT16|0x3 > 0001060 > + > [PcdsFixedAtBuild, PcdsPatchableInModule] > ## Dynamic type PCD can be registered callback function for Pcd settin= g > action. > # PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum > number of callback function > -- > 2.42.0.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117760): https://edk2.groups.io/g/devel/message/117760 Mute This Topic: https://groups.io/mt/105531090/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-