X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EmbeddedPkg%2FUniversal%2FMmcDxe%2FMmcIdentification.c;h=2d8038ffe02f14ff66e0fb0d2958279eda2ca2ff;hp=32efe19c31694e8fd83a3d0cf3c92024b4cf77c7;hb=eff98cf9daf7353274f958bea570f0da419a09a5;hpb=b4fdedc2543c6d193c70ae5339a56824a9729e68 diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c index 32efe19c31..2d8038ffe0 100644 --- a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c +++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c @@ -1,6 +1,6 @@ /** @file * -* Copyright (c) 2011-2014, ARM Limited. All rights reserved. +* Copyright (c) 2011-2015, ARM Limited. All rights reserved. * * This program and the accompanying materials * are licensed and made available under the terms and conditions of the BSD License @@ -12,8 +12,6 @@ * **/ -#include - #include "Mmc.h" typedef union { @@ -222,7 +220,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 +241,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 ? @@ -323,7 +320,7 @@ MmcIdentificationMode ( if (!EFI_ERROR (Status)) { if (!MmcHostInstance->CardInfo.OCRData.PowerUp) { - MicroSecondDelay (1); + gBS->Stall (1); Timeout--; } else { if ((MmcHostInstance->CardInfo.CardType == SD_CARD_2) && (MmcHostInstance->CardInfo.OCRData.AccessMode & BIT1)) { @@ -333,7 +330,7 @@ MmcIdentificationMode ( break; // The MMC/SD card is ready. Continue the Identification Mode } } else { - MicroSecondDelay (1); + gBS->Stall (1); Timeout--; } }