From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9C361818FA for ; Thu, 5 Jan 2017 23:27:34 -0800 (PST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP; 05 Jan 2017 23:27:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,323,1477983600"; d="scan'208";a="49918352" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga005.jf.intel.com with ESMTP; 05 Jan 2017 23:27:33 -0800 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 5 Jan 2017 23:27:33 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 5 Jan 2017 23:27:33 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.177]) by shsmsx102.ccr.corp.intel.com ([169.254.2.88]) with mapi id 14.03.0248.002; Fri, 6 Jan 2017 15:27:29 +0800 From: "Tian, Feng" To: Haojian Zhuang , "leif.lindholm@linaro.org" , "ard.biesheuvel@linaro.org" , "edk2-devel@lists.01.org" CC: "Tian, Feng" Thread-Topic: [edk2] [PATCH 6/9] Ufs: add PhyInit Thread-Index: AQHSZ+mN0Wn33NuGTUufr0F/O7TpnqErDLBQ Date: Fri, 6 Jan 2017 07:27:28 +0000 Message-ID: <7F1BAD85ADEA444D97065A60D2E97EE5699A6014@SHSMSX101.ccr.corp.intel.com> References: <1483685538-11058-1-git-send-email-haojian.zhuang@linaro.org> <1483685538-11058-7-git-send-email-haojian.zhuang@linaro.org> In-Reply-To: <1483685538-11058-7-git-send-email-haojian.zhuang@linaro.org> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 6/9] Ufs: add PhyInit X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2017 07:27:34 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Could this be done at lower layer rather than changing existing interface?= =20 Thanks Feng -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Haoj= ian Zhuang Sent: Friday, January 6, 2017 2:52 PM To: Tian, Feng ; leif.lindholm@linaro.org; ard.biesheu= vel@linaro.org; edk2-devel@lists.01.org Cc: Haojian Zhuang Subject: [edk2] [PATCH 6/9] Ufs: add PhyInit Add PhyInit() to support designware UFS controller. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang --- MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c | 2 ++ MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 8 ++++++++ MdeModulePkg/Include/Protocol/UfsHostController.h | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c b/MdeModuleP= kg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c index 7c831e9..761dc8e 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c @@ -853,6 +853,8 @@ UfsPassThruDriverBindingStart ( goto Error; } =20 + MicroSecondDelay (100000); + // // Get Ufs Device's Lun Info by reading Configuration Descriptor. // diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeModu= lePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c index 218e9f5..7c01d57 100644 --- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c +++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c @@ -2089,6 +2089,7 @@ UfsControllerInit ( ) { EFI_STATUS Status; + EDKII_UFS_HOST_CONTROLLER_PROTOCOL *UfsHc; =20 Status =3D UfsEnableHostController (Private); if (EFI_ERROR (Status)) { @@ -2096,6 +2097,13 @@ UfsControllerInit ( return Status; } =20 + UfsHc =3D Private->UfsHostController; + Status =3D UfsHc->PhyInit (UfsHc); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "UfsControllerInit: Phy Init Fails, Status =3D %r= \n", Status)); + return Status; + } + Status =3D UfsDeviceDetection (Private); if (EFI_ERROR (Status)) { DEBUG ((EFI_D_ERROR, "UfsControllerInit: Device Detection Fails, Statu= s =3D %r\n", Status)); diff --git a/MdeModulePkg/Include/Protocol/UfsHostCo= ntroller.h b/MdeModulePkg/Include/Protocol/UfsHostController.h index 909c981..1f3605f 100644 --- a/MdeModulePkg/Include/Protocol/UfsHostController.h +++ b/MdeModulePkg/Include/Protocol/UfsHostController.h @@ -221,6 +221,12 @@ EFI_STATUS IN OUT VOID *Buffer ); =20 +typedef +EFI_STATUS +(EFIAPI *EDKII_UFS_HC_PHY_INIT)( + IN EDKII_UFS_HOST_CONTROLLER_PROTOCOL *This + ); + /// /// UFS Host Controller Protocol structure. /// @@ -233,6 +239,7 @@ struct _EDKII_UFS_HOST_CONTROLLER_PROTOCOL { EDKII_UFS_HC_FLUSH Flush; EDKII_UFS_HC_MMIO_READ_WRITE Read; EDKII_UFS_HC_MMIO_READ_WRITE Write; + EDKII_UFS_HC_PHY_INIT PhyInit; }; =20 /// -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel