summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@linaro.org>2018-04-18 11:36:13 +0800
committerHaojian Zhuang <haojian.zhuang@linaro.org>2018-04-18 13:07:43 +0800
commit76f0d9ab5b9b162d91a69bcd143a7f3f476b058f (patch)
treed693857e535192a9054dc4828ad1a4407364b09b
parentad746d3044f67cb87359371efb5fdb64965c2815 (diff)
downloadedk2-76f0d9ab5b9b162d91a69bcd143a7f3f476b058f.tar.gz
MdeModulePkg/UfsPassThruDxe: use loop to polling UTRLRSR
In Hi3660 SoC, need to poll UTRLRSR by loop. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
-rw-r--r--MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
index 335bd99c8..fbb31edf6 100644
--- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
+++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
@@ -811,12 +811,14 @@ UfsStartExecCmd (
UINT32 Data;
EFI_STATUS Status;
- Status = UfsMmioRead32 (Private, UFS_HC_UTRLRSR_OFFSET, &Data);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- if ((Data & UFS_HC_UTRLRSR) != UFS_HC_UTRLRSR) {
+ for (;;) {
+ Status = UfsMmioRead32 (Private, UFS_HC_UTRLRSR_OFFSET, &Data);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ if ((Data & UFS_HC_UTRLRSR) == UFS_HC_UTRLRSR) {
+ break;
+ }
Status = UfsMmioWrite32 (Private, UFS_HC_UTRLRSR_OFFSET, UFS_HC_UTRLRSR);
if (EFI_ERROR (Status)) {
return Status;
@@ -1195,7 +1197,6 @@ UfsRwFlags (
ASSERT (QueryResp != NULL);
CmdDescSize = Trd->RuO * sizeof (UINT32) + Trd->RuL * sizeof (UINT32);
- MicroSecondDelay (100000);
//
// Start to execute the transfer request.
//
@@ -1363,7 +1364,6 @@ UfsExecNopCmds (
ASSERT (NopInUpiu != NULL);
CmdDescSize = Trd->RuO * sizeof (UINT32) + Trd->RuL * sizeof (UINT32);
- MicroSecondDelay (100000);
//
// Start to execute the transfer request.
//