]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
EmbeddedPkg: Remove dependency on TimerLib
[mirror_edk2.git] / EmbeddedPkg / Universal / MmcDxe / MmcIdentification.c
index 32efe19c31694e8fd83a3d0cf3c92024b4cf77c7..2d8038ffe02f14ff66e0fb0d2958279eda2ca2ff 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 *\r
 *  This program and the accompanying materials\r
 *  are licensed and made available under the terms and conditions of the BSD License\r
@@ -12,8 +12,6 @@
 *\r
 **/\r
 \r
-#include <Library/TimerLib.h>\r
-\r
 #include "Mmc.h"\r
 \r
 typedef union {\r
@@ -222,7 +220,8 @@ MmcIdentificationMode (
     return Status;\r
   }\r
 \r
-  // Send CMD1 to get OCR (SD / MMC)\r
+  // Send CMD1 to get OCR (MMC)\r
+  // This command only valid for MMC and eMMC\r
   Status = MmcHost->SendCommand (MmcHost, MMC_CMD1, EMMC_CMD1_CAPACITY_GREATER_THAN_2GB);\r
   if (Status == EFI_SUCCESS) {\r
     Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, (UINT32 *)&OcrResponse);\r
@@ -242,13 +241,11 @@ MmcIdentificationMode (
     else {\r
       MmcHostInstance->CardInfo.OCRData.AccessMode = 0x0;\r
     }\r
+    // Check whether MMC or eMMC\r
     if (OcrResponse.Raw == EMMC_CMD1_CAPACITY_GREATER_THAN_2GB ||\r
         OcrResponse.Raw == EMMC_CMD1_CAPACITY_LESS_THAN_2GB) {\r
       return EmmcIdentificationMode (MmcHostInstance, OcrResponse);\r
     }\r
-  } else {\r
-    DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD1) : Failed to send command, Status=%r.\n", Status));\r
-    return Status;\r
   }\r
 \r
   // Are we using SDIO ?\r
@@ -323,7 +320,7 @@ MmcIdentificationMode (
 \r
     if (!EFI_ERROR (Status)) {\r
       if (!MmcHostInstance->CardInfo.OCRData.PowerUp) {\r
-        MicroSecondDelay (1);\r
+        gBS->Stall (1);\r
         Timeout--;\r
       } else {\r
         if ((MmcHostInstance->CardInfo.CardType == SD_CARD_2) && (MmcHostInstance->CardInfo.OCRData.AccessMode & BIT1)) {\r
@@ -333,7 +330,7 @@ MmcIdentificationMode (
         break;  // The MMC/SD card is ready. Continue the Identification Mode\r
       }\r
     } else {\r
-      MicroSecondDelay (1);\r
+      gBS->Stall (1);\r
       Timeout--;\r
     }\r
   }\r