]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/PL180MciDxe: Use the new flag MMC_CMD_NO_CRC_RESPONSE
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 26 Apr 2011 16:54:05 +0000 (16:54 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 26 Apr 2011 16:54:05 +0000 (16:54 +0000)
This new MMC flag defines if a CRC is attached to MMC Response.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11587 6f19259b-4bc3-4df7-8a09-765794883524

ArmPkg/Drivers/PL180MciDxe/PL180Mci.c

index 250ea8b54d58f494d5c9daba02197d4ed2ee931f..23bb7d90f92be8c190811316cdab00d359c45f86 100644 (file)
@@ -118,7 +118,7 @@ MciSendCommand (
   }\r
 \r
   // Create Command for PL180\r
-  Cmd = INDX(MmcCmd);\r
+  Cmd = (MMC_GET_INDX(MmcCmd) & INDX_MASK)  | MCI_CPSM_ENABLED;\r
   if (MmcCmd & MMC_CMD_WAIT_RESPONSE) {\r
     Cmd |= MCI_CPSM_WAIT_RESPONSE;\r
   }\r
@@ -150,8 +150,8 @@ MciSendCommand (
       //DEBUG ((EFI_D_ERROR, "MciSendCommand(CmdIndex:%d) TIMEOUT! Response:0x%X Status:0x%x\n",(Cmd & 0x3F),MmioRead32(MCI_RESPONSE0_REG),Status));\r
       RetVal = EFI_TIMEOUT;\r
       goto Exit;\r
-    } else if (!((Cmd & 0x3F) == INDX(1)) && (Status & MCI_STATUS_CMD_CMDCRCFAIL)) {\r
-      // The CMD1 does not contain CRC. We should ignore the CRC failed Status.\r
+    } else if ((!(MmcCmd & MMC_CMD_NO_CRC_RESPONSE)) && (Status & MCI_STATUS_CMD_CMDCRCFAIL)) {\r
+      // The CMD1 and response type R3 do not contain CRC. We should ignore the CRC failed Status.\r
       RetVal = EFI_CRC_ERROR;\r
       goto Exit;\r
     } else {\r
@@ -173,7 +173,7 @@ MciSendCommand (
       RetVal = EFI_TIMEOUT;\r
       goto Exit;\r
     } else\r
-    if (!((Cmd & 0x3F) == INDX(1)) && (Status & MCI_STATUS_CMD_CMDCRCFAIL)) {\r
+    if ((!(MmcCmd & MMC_CMD_NO_CRC_RESPONSE)) && (Status & MCI_STATUS_CMD_CMDCRCFAIL)) {\r
         // The CMD1 does not contain CRC. We should ignore the CRC failed Status.\r
       RetVal = EFI_CRC_ERROR;\r
       goto Exit;\r
@@ -257,8 +257,8 @@ MciReadBlockData (
       Buffer[Loop] = MmioRead32(MCI_FIFO_REG);\r
       Loop++;\r
     } else if (Status & MCI_STATUS_CMD_RXDATAAVAILBL) {\r
-        Buffer[Loop] = MmioRead32(MCI_FIFO_REG);\r
-        Loop++;\r
+      Buffer[Loop] = MmioRead32(MCI_FIFO_REG);\r
+      Loop++;\r
     } else {\r
       //Check for error conditions and timeouts\r
       if(Status & MCI_STATUS_CMD_DATATIMEOUT) {\r