From 50c5f187314c55735135d9c47025286d1c0bf1d5 Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Tue, 26 Apr 2011 16:54:05 +0000 Subject: ArmPkg/PL180MciDxe: Use the new flag MMC_CMD_NO_CRC_RESPONSE 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 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ArmPkg') diff --git a/ArmPkg/Drivers/PL180MciDxe/PL180Mci.c b/ArmPkg/Drivers/PL180MciDxe/PL180Mci.c index 250ea8b54d..23bb7d90f9 100644 --- a/ArmPkg/Drivers/PL180MciDxe/PL180Mci.c +++ b/ArmPkg/Drivers/PL180MciDxe/PL180Mci.c @@ -118,7 +118,7 @@ MciSendCommand ( } // Create Command for PL180 - Cmd = INDX(MmcCmd); + Cmd = (MMC_GET_INDX(MmcCmd) & INDX_MASK) | MCI_CPSM_ENABLED; if (MmcCmd & MMC_CMD_WAIT_RESPONSE) { Cmd |= MCI_CPSM_WAIT_RESPONSE; } @@ -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)); RetVal = EFI_TIMEOUT; goto Exit; - } else if (!((Cmd & 0x3F) == INDX(1)) && (Status & MCI_STATUS_CMD_CMDCRCFAIL)) { - // The CMD1 does not contain CRC. We should ignore the CRC failed Status. + } else if ((!(MmcCmd & MMC_CMD_NO_CRC_RESPONSE)) && (Status & MCI_STATUS_CMD_CMDCRCFAIL)) { + // The CMD1 and response type R3 do not contain CRC. We should ignore the CRC failed Status. RetVal = EFI_CRC_ERROR; goto Exit; } else { @@ -173,7 +173,7 @@ MciSendCommand ( RetVal = EFI_TIMEOUT; goto Exit; } else - if (!((Cmd & 0x3F) == INDX(1)) && (Status & MCI_STATUS_CMD_CMDCRCFAIL)) { + if ((!(MmcCmd & MMC_CMD_NO_CRC_RESPONSE)) && (Status & MCI_STATUS_CMD_CMDCRCFAIL)) { // The CMD1 does not contain CRC. We should ignore the CRC failed Status. RetVal = EFI_CRC_ERROR; goto Exit; @@ -257,8 +257,8 @@ MciReadBlockData ( Buffer[Loop] = MmioRead32(MCI_FIFO_REG); Loop++; } else if (Status & MCI_STATUS_CMD_RXDATAAVAILBL) { - Buffer[Loop] = MmioRead32(MCI_FIFO_REG); - Loop++; + Buffer[Loop] = MmioRead32(MCI_FIFO_REG); + Loop++; } else { //Check for error conditions and timeouts if(Status & MCI_STATUS_CMD_DATATIMEOUT) { -- cgit v1.2.3