summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@linaro.org>2016-12-01 19:16:38 +0800
committerHaojian Zhuang <haojian.zhuang@linaro.org>2017-01-13 18:14:33 +0800
commitcfa2a08e99a79f3a57c5da0d53d5b66a382e7a1d (patch)
tree3fa94348d7b96f1630c66803528c699f586b3b80
parent807df4ae2324a50398118e861ac22d46b8a0c3a5 (diff)
downloadedk2-cfa2a08e99a79f3a57c5da0d53d5b66a382e7a1d.tar.gz
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>
-rw-r--r--MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c2
-rw-r--r--MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c8
-rw-r--r--MdeModulePkg/Include/Protocol/UfsHostController.h7
3 files changed, 17 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
index 7c831e92d..761dc8ee1 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 9432c633a..72475dedc 100644
--- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
+++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
@@ -2081,6 +2081,7 @@ UfsControllerInit (
)
{
EFI_STATUS Status;
+ EDKII_UFS_HOST_CONTROLLER_PROTOCOL *UfsHc;
Status = UfsEnableHostController (Private);
if (EFI_ERROR (Status)) {
@@ -2088,6 +2089,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 909c98172..1f3605fa9 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;
};
///