From patchwork Fri Jan 6 06:52:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 90117 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp9321511qgi; Thu, 5 Jan 2017 22:52:45 -0800 (PST) X-Received: by 10.99.167.76 with SMTP id w12mr5517046pgo.142.1483685565014; Thu, 05 Jan 2017 22:52:45 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id z16si78654738pfi.113.2017.01.05.22.52.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jan 2017 22:52:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9CA21819EE; Thu, 5 Jan 2017 22:52:44 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org 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 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: [edk2] [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: , Cc: Haojian Zhuang MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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; }; ///