From: "Loh, Tien Hock" <[email protected]> Existing implementation checks for error regardless of if DWEMMC_INT_CMD_DONE is set, causing the loop check to errors out even when it shouldn't if the MicroSecondDelay doesn't do long enough delays. This removes MicroSecondDelay and updates the function to check for CMD_DONE before doing any error checking.
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Loh Tien Hock <[email protected]> --- EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c index 0437e30..6d0f472 100644 --- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c +++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c @@ -290,17 +290,15 @@ SendCommand ( ErrMask = DWEMMC_INT_EBE | DWEMMC_INT_HLE | DWEMMC_INT_RTO | DWEMMC_INT_RCRC | DWEMMC_INT_RE; ErrMask |= DWEMMC_INT_DCRC | DWEMMC_INT_DRT | DWEMMC_INT_SBE; + do { - MicroSecondDelay(500); Data = MmioRead32 (DWEMMC_RINTSTS); - - if (Data & ErrMask) { - return EFI_DEVICE_ERROR; - } - if (Data & DWEMMC_INT_DTO) { // Transfer Done - break; - } } while (!(Data & DWEMMC_INT_CMD_DONE)); + + if (Data & ErrMask) { + return EFI_DEVICE_ERROR; + } + return EFI_SUCCESS; } -- 2.2.2 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

