X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=EmbeddedPkg%2FUniversal%2FMmcDxe%2FMmcIdentification.c;h=0b0a0445404add550c1193d632de576a6b514839;hb=3201075377f80af632465361155f7498c177bad1;hp=2d8038ffe02f14ff66e0fb0d2958279eda2ca2ff;hpb=bab82372a9e6ce066fa725a792e71d07191046ca;p=mirror_edk2.git diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c index 2d8038ffe0..0b0a044540 100644 --- a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c +++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c @@ -222,14 +222,19 @@ MmcIdentificationMode ( // Send CMD1 to get OCR (MMC) // This command only valid for MMC and eMMC - Status = MmcHost->SendCommand (MmcHost, MMC_CMD1, EMMC_CMD1_CAPACITY_GREATER_THAN_2GB); - if (Status == EFI_SUCCESS) { + Timeout = MAX_RETRY_COUNT; + do { + Status = MmcHost->SendCommand (MmcHost, MMC_CMD1, EMMC_CMD1_CAPACITY_GREATER_THAN_2GB); + if (EFI_ERROR (Status)) + break; Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, (UINT32 *)&OcrResponse); if (EFI_ERROR (Status)) { DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive OCR, Status=%r.\n", Status)); return Status; } - + Timeout--; + } while (!OcrResponse.Ocr.PowerUp && (Timeout > 0)); + if (Status == EFI_SUCCESS) { if (!OcrResponse.Ocr.PowerUp) { DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD1): Card initialisation failure, Status=%r.\n", Status)); return EFI_DEVICE_ERROR;