public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Tian, Feng" <feng.tian@intel.com>
To: Haojian Zhuang <haojian.zhuang@linaro.org>
Cc: "leif.lindholm@linaro.org" <leif.lindholm@linaro.org>,
	"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"Tian, Feng" <feng.tian@intel.com>
Subject: Re: [PATCH 6/9] Ufs: add PhyInit
Date: Fri, 6 Jan 2017 08:44:41 +0000	[thread overview]
Message-ID: <7F1BAD85ADEA444D97065A60D2E97EE5699A60F3@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <CAD6h2NT6xiaRsn4gGf7Bp9_LaFH9VJAupHKSLw6WJH2xpfubeA@mail.gmail.com>

Yes, I am thinking moving UFS HC enable to lower layer, this way should be able to eliminate interface change...

Thanks
Feng

-----Original Message-----
From: Haojian Zhuang [mailto:haojian.zhuang@linaro.org] 
Sent: Friday, January 6, 2017 4:22 PM
To: Tian, Feng <feng.tian@intel.com>
Cc: leif.lindholm@linaro.org; ard.biesheuvel@linaro.org; edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH 6/9] Ufs: add PhyInit

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 <feng.tian@intel.com> 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 <feng.tian@intel.com>; leif.lindholm@linaro.org; 
> ard.biesheuvel@linaro.org; edk2-devel@lists.01.org
> Cc: Haojian Zhuang <haojian.zhuang@linaro.org>
> 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 <haojian.zhuang@linaro.org>
> ---
>  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

  reply	other threads:[~2017-01-06  8:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-06  6:52 [PATCH 0/9] enhance UFS Haojian Zhuang
2017-01-06  6:52 ` [PATCH 1/9] Ufs: fix data direction checking Haojian Zhuang
2017-01-06  7:08   ` Tian, Feng
2017-01-06  8:33     ` Haojian Zhuang
2017-01-06  6:52 ` [PATCH 2/9] Ufs: fix to identify 32 bits address mode Haojian Zhuang
2017-01-06  7:10   ` Tian, Feng
2017-01-06  6:52 ` [PATCH 3/9] Ufs: fix the bit in UFS_HC_UTRLDBR_OFFSET register Haojian Zhuang
2017-01-06  7:18   ` Tian, Feng
2017-01-06  6:52 ` [PATCH 4/9] Ufs: fix to set UTRLBA and UTRLBAU register Haojian Zhuang
2017-01-06  8:36   ` Tian, Feng
2017-01-06  9:05     ` Haojian Zhuang
2017-01-09  1:25       ` Tian, Feng
2017-01-06  6:52 ` [PATCH 5/9] Ufs: fix to set PRDT length Haojian Zhuang
2017-01-06  6:52 ` [PATCH 6/9] Ufs: add PhyInit Haojian Zhuang
2017-01-06  7:27   ` Tian, Feng
2017-01-06  8:21     ` Haojian Zhuang
2017-01-06  8:44       ` Tian, Feng [this message]
2017-01-06  6:52 ` [PATCH 7/9] Ufs: fix initialize OCS value to 0x0F Haojian Zhuang
2017-01-06  7:26   ` Tian, Feng
2017-01-06  8:18     ` Haojian Zhuang
2017-01-06  6:52 ` [PATCH 8/9] Ufs: fix to add cache operation Haojian Zhuang
2017-01-06  8:42   ` Tian, Feng
2017-01-06  6:52 ` [PATCH 9/9] ScsiDisk: retry if device detected power failure Haojian Zhuang
2017-01-06  8:22   ` Tian, Feng
2017-01-06  8:31     ` Haojian Zhuang

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=7F1BAD85ADEA444D97065A60D2E97EE5699A60F3@SHSMSX101.ccr.corp.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