]> git.proxmox.com Git - mirror_edk2.git/commitdiff
EmbeddedPkg/MmcDxe: Fix the indexes in the response array
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 15 Aug 2011 16:20:55 +0000 (16:20 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 15 Aug 2011 16:20:55 +0000 (16:20 +0000)
The indexes have been reversed compare to the specification which
created confusions in some MMC responses.

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

ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.c
ArmPlatformPkg/Drivers/PL180MciDxe/PL180Mci.h
EmbeddedPkg/Universal/MmcDxe/Mmc.h

index 697e33f0d0841709dc6025c7569b985349d42c23..03500af88c606a9422ca8152481c196af2e12315 100644 (file)
@@ -210,8 +210,7 @@ MciReceiveResponse (
       (Type == MMC_RESPONSE_TYPE_R3) || (Type == MMC_RESPONSE_TYPE_R6) ||\r
       (Type == MMC_RESPONSE_TYPE_R7))\r
   {\r
-    Buffer[0] = MmioRead32(MCI_RESPONSE0_REG);\r
-    Buffer[1] = MmioRead32(MCI_RESPONSE1_REG);\r
+    Buffer[0] = MmioRead32(MCI_RESPONSE3_REG);\r
   } else if (Type == MMC_RESPONSE_TYPE_R2) {\r
     Buffer[0] = MmioRead32(MCI_RESPONSE0_REG);\r
     Buffer[1] = MmioRead32(MCI_RESPONSE1_REG);\r
index 53a0b1c5af687a88c0a2968dfbb11c85e75829b7..43a92bf4d939bab201ef052191a2bb7007ae3575 100644 (file)
 #define MCI_ARGUMENT_REG                (MCI_SYSCTL+0x008)\r
 #define MCI_COMMAND_REG                 (MCI_SYSCTL+0x00C)\r
 #define MCI_RESPCMD_REG                 (MCI_SYSCTL+0x010)\r
-#define MCI_RESPONSE0_REG               (MCI_SYSCTL+0x014)\r
-#define MCI_RESPONSE1_REG               (MCI_SYSCTL+0x018)\r
-#define MCI_RESPONSE2_REG               (MCI_SYSCTL+0x01C)\r
-#define MCI_RESPONSE3_REG               (MCI_SYSCTL+0x020)\r
+#define MCI_RESPONSE3_REG               (MCI_SYSCTL+0x014)\r
+#define MCI_RESPONSE2_REG               (MCI_SYSCTL+0x018)\r
+#define MCI_RESPONSE1_REG               (MCI_SYSCTL+0x01C)\r
+#define MCI_RESPONSE0_REG               (MCI_SYSCTL+0x020)\r
 #define MCI_DATA_TIMER_REG              (MCI_SYSCTL+0x024)\r
 #define MCI_DATA_LENGTH_REG             (MCI_SYSCTL+0x028)\r
 #define MCI_DATA_CTL_REG                (MCI_SYSCTL+0x02C)\r
index 8858454d0965099da464225fd1e1fda51097348a..2904d91484116f497791626724ef4e5e1479f010 100644 (file)
 \r
 #define MMC_OCR_POWERUP             0x80000000\r
 \r
-#define MMC_CSD_GET_CCC(Response)    (Response[1] >> 20)\r
-#define MMC_CSD_GET_TRANSPEED(Response)    (Response[0] & 0xFF)\r
-#define MMC_CSD_GET_READBLLEN(Response)    ((Response[1] >> 16) & 0xF)\r
-#define MMC_CSD_GET_WRITEBLLEN(Response)  ((Response[3] >> 22) & 0xF)\r
-#define MMC_CSD_GET_FILEFORMAT(Response)  ((Response[3] >> 10) & 0x3)\r
-#define MMC_CSD_GET_FILEFORMATGRP(Response)  ((Response[3] >> 15) & 0x1)\r
-#define MMC_CSD_GET_DEVICESIZE(csd)         (((Response[2] >> 30) & 0x3) | ((Response[1] & 0x3FF) << 2))\r
+#define MMC_CSD_GET_CCC(Response)    (Response[2] >> 20)\r
+#define MMC_CSD_GET_TRANSPEED(Response)    (Response[3] & 0xFF)\r
+#define MMC_CSD_GET_READBLLEN(Response)    ((Response[2] >> 16) & 0xF)\r
+#define MMC_CSD_GET_WRITEBLLEN(Response)  ((Response[0] >> 22) & 0xF)\r
+#define MMC_CSD_GET_FILEFORMAT(Response)  ((Response[0] >> 10) & 0x3)\r
+#define MMC_CSD_GET_FILEFORMATGRP(Response)  ((Response[0] >> 15) & 0x1)\r
+#define MMC_CSD_GET_DEVICESIZE(csd)         (((Response[1] >> 30) & 0x3) | ((Response[2] & 0x3FF) << 2))\r
 #define HC_MMC_CSD_GET_DEVICESIZE(Response)    ((Response[1] >> 16) | ((Response[2] & 0x40) << 16));\r
-#define MMC_CSD_GET_DEVICESIZEMULT(csd)     ((Response[2] >> 15) & 0x7)\r
+#define MMC_CSD_GET_DEVICESIZEMULT(csd)     ((Response[1] >> 15) & 0x7)\r
 \r
 #define MMC_R0_READY_FOR_DATA               (1 << 8)\r
 \r