From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-x232.google.com (mail-qt0-x232.google.com [IPv6:2607:f8b0:400d:c0d::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E0496817B5 for ; Fri, 6 Jan 2017 00:21:39 -0800 (PST) Received: by mail-qt0-x232.google.com with SMTP id k15so302809949qtg.3 for ; Fri, 06 Jan 2017 00:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=qaxOs8HacjgtoObYlmx8uCrCJ4+r290pevQYbXrVxYU=; b=T7pADhNEhYRnBhtq+8nlGzg6pyqqWqoolw/RvPNmFxSJ/TVi8hCs4hhrW/UF1MhCCV 5EV5fC8IxvECgdWTN4PK65dv9wA04Jz+vV7AtAoHLODIlyDfV8+ZB+ZAzjn7tEHuoH4b w/EjUNGbDU04JH2a1zRZvkTUSHqVQQhuAATsA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=qaxOs8HacjgtoObYlmx8uCrCJ4+r290pevQYbXrVxYU=; b=qc3ppdMFmtGOpePf+XOKZlX8Rq07PKa/YtfEmkWd5t4lDbXzIgLa35yDJT57up/BQZ I2c2xndcHQdcT21ysEWUoXgjm1c70HOj/uesDh5f5ihaZpiD6nJ3WaO9Bq8tD79ofGjo Zx9ewEzyHhSReLid6AP92e5x1V5Tq4onDjT8KjOrjR2w23TEa87UjysdXdgIsSa2oyKO wS+rN0pPNA6q/ok0lZr36WpcM7HorOm83lK8epVNeILGeuW5f9Xzh/5C5tKJoJ4IgT5N SWW5qiMMhRTMEatjRmd1WXpbvmfgkp6SW3EpMPFwkJJV4KXR5OV5BhropdCpJcqAFXLI dpdQ== X-Gm-Message-State: AIkVDXK3IxhmQCnUITCh7F/4sZ82gtOLbFRCqZDS69R9r1KbPJdYXfkBHLcjif2aJG59gC8HvpDgifmiCGQnltGk X-Received: by 10.200.50.157 with SMTP id z29mr7907987qta.131.1483690899109; Fri, 06 Jan 2017 00:21:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.41.114 with HTTP; Fri, 6 Jan 2017 00:21:38 -0800 (PST) In-Reply-To: <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> <7F1BAD85ADEA444D97065A60D2E97EE5699A6014@SHSMSX101.ccr.corp.intel.com> From: Haojian Zhuang Date: Fri, 6 Jan 2017 16:21:38 +0800 Message-ID: To: "Tian, Feng" Cc: "leif.lindholm@linaro.org" , "ard.biesheuvel@linaro.org" , "edk2-devel@lists.01.org" 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 08:21:40 -0000 Content-Type: text/plain; charset=UTF-8 It's a bit hard to implement it in lower layer. Since PhyInit () should be executed between UFS controller enabled and UicDmeLinkStartup command. Best Regards Haojian On 6 January 2017 at 15:27, Tian, Feng wrote: > Could this be done at lower layer rather than changing existing interface? > > Thanks > Feng > > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Haojian Zhuang > Sent: Friday, January 6, 2017 2:52 PM > To: Tian, Feng ; leif.lindholm@linaro.org; ard.biesheuvel@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/MdeModulePkg/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; > } > > + MicroSecondDelay (100000); > + > // > // Get Ufs Device's Lun Info by reading Configuration Descriptor. > // > diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeModulePkg/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; > > Status = UfsEnableHostController (Private); > if (EFI_ERROR (Status)) { > @@ -2096,6 +2097,13 @@ UfsControllerInit ( > return Status; > } > > + UfsHc = Private->UfsHostController; > + Status = UfsHc->PhyInit (UfsHc); > + if (EFI_ERROR (Status)) { > + DEBUG ((EFI_D_ERROR, "UfsControllerInit: Phy Init Fails, Status = %r\n", Status)); > + return Status; > + } > + > Status = UfsDeviceDetection (Private); > if (EFI_ERROR (Status)) { > DEBUG ((EFI_D_ERROR, "UfsControllerInit: Device Detection Fails, Status = %r\n", Status)); diff --git a/MdeModulePkg/Include/Protocol/UfsHostController.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 > ); > > +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; > }; > > /// > -- > 2.7.4 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel