From 139b57737413a7d95bc35edf4a5463a599965edb Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Wed, 5 Feb 2014 12:54:46 +0000 Subject: [PATCH] MmcIdentification: Don't error out for SD cards SD cards don't respond to CMD1 immediately following CMD0. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15210 6f19259b-4bc3-4df7-8a09-765794883524 --- EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c index 32efe19c31..08cc405ed8 100644 --- a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c +++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c @@ -222,7 +222,8 @@ MmcIdentificationMode ( return Status; } - // Send CMD1 to get OCR (SD / MMC) + // 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) { Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, (UINT32 *)&OcrResponse); @@ -242,13 +243,11 @@ MmcIdentificationMode ( else { MmcHostInstance->CardInfo.OCRData.AccessMode = 0x0; } + // Check whether MMC or eMMC if (OcrResponse.Raw == EMMC_CMD1_CAPACITY_GREATER_THAN_2GB || OcrResponse.Raw == EMMC_CMD1_CAPACITY_LESS_THAN_2GB) { return EmmcIdentificationMode (MmcHostInstance, OcrResponse); } - } else { - DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD1) : Failed to send command, Status=%r.\n", Status)); - return Status; } // Are we using SDIO ?