From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-x232.google.com (mail-pg0-x232.google.com [IPv6:2607:f8b0:400e:c05::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 1C7AC819EE for ; Thu, 5 Jan 2017 22:52:44 -0800 (PST) Received: by mail-pg0-x232.google.com with SMTP id g1so210005602pgn.0 for ; Thu, 05 Jan 2017 22:52:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wxN7SRcTKgFI/yVf69VuVpnpT5tC606Gpfgrt7EnYok=; b=VJkZF81maIwQTm11Z/7AjgcbFxoRKrFc1qLJ7wRDhMlzivEAEk7Lxa+9AVjtHo71Yy vLIAQ0Zrle/38JXAoX2fwCHlHuHu88J4PYWjWVbNQmXNRGHu/qQUfVkAeSoSuecnaLr9 19LifZ9BAKzOxFPvoc+/Gz4rsIUG5QdbD4c6Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wxN7SRcTKgFI/yVf69VuVpnpT5tC606Gpfgrt7EnYok=; b=h2V8yb+6Jr2L+FDisPEA7lnNZuEmEDyDtajHR78yItff4+Vjwb0goYBCi0NzRsTo8e 4hi5UFaBO3Xd3Wx9NsTnCeoEoP31cxzml5hnyTLFp+x7QJP/Vh7Zmackn1MCJzzIFsig pNfs40iWHr5MVGGeLW2SG2BxaPHMdIB8Qgi/dPurDLoYqw0A5qYQWRVhvOjWdYL843nA HJB6WFUaL0QN6KbDDcYFkzLcPGf+ASA7t9Za1AvEm1V9fwkStiBpmr2deGsdGXfmXgyN Cr1lz4n/uo2QqWaacmMOSP3mXXvCcIhEVdYIFBUAky0k1bMO5sQ69NHZHJ4WvSCYMPEz OV4Q== X-Gm-Message-State: AIkVDXI9mTujR2/P9Xzq8c8CZjD5KNXGwLTbrNASbvPA8HzVPGyzktNxqvz+YSYHPi33nq0j X-Received: by 10.99.45.134 with SMTP id t128mr139599156pgt.86.1483685563814; Thu, 05 Jan 2017 22:52:43 -0800 (PST) Received: from localhost.localdomain ([45.56.159.83]) by smtp.gmail.com with ESMTPSA id p13sm159096976pgf.47.2017.01.05.22.52.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jan 2017 22:52:43 -0800 (PST) From: Haojian Zhuang To: feng.tian@intel.com, leif.lindholm@linaro.org, ard.biesheuvel@linaro.org, edk2-devel@lists.01.org Cc: Haojian Zhuang Date: Fri, 6 Jan 2017 14:52:15 +0800 Message-Id: <1483685538-11058-7-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483685538-11058-1-git-send-email-haojian.zhuang@linaro.org> References: <1483685538-11058-1-git-send-email-haojian.zhuang@linaro.org> Subject: [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 06:52:44 -0000 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