EmbeddedPkg/MmcDxe: Set the BlockLength at the beginning of the BlockIo transfer

Before the SetBlockLength command was called prior to a Read or Write command.



git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12133 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
oliviermartin 2011-08-15 16:38:27 +00:00
parent bb0f9e9ba3
commit e0932788c3
1 changed files with 12 additions and 10 deletions

View File

@ -498,6 +498,18 @@ MmcIoBlocks (
DEBUG((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcTransferState\n"));
return Status;
}
// Set Block Length
Status = MmcHost->SendCommand(MMC_CMD16, This->Media->BlockSize);
if (EFI_ERROR(Status)) {
DEBUG((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD16): Error This->Media->BlockSize: %d and Error = %r\n",This->Media->BlockSize, Status));
return Status;
}
// Block Count (not used). Could return an error for SD card
if (MmcHostInstance->CardInfo.CardType == MMC_CARD) {
MmcHost->SendCommand(MMC_CMD23, BlockCount);
}
} else {
// Maybe test if the card has changed to update gMmcMedia information
if (MmcHostInstance->State == MmcTransferState) {
@ -548,16 +560,6 @@ MmcIoBlocks (
return EFI_NOT_READY;
}
// Set Block Length
Status = MmcHost->SendCommand(MMC_CMD16, This->Media->BlockSize);
if (EFI_ERROR(Status)) {
DEBUG((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD16): Error This->Media->BlockSize:%d and Error = %r\n",This->Media->BlockSize, Status));
return Status;
}
// Block Count (not used). Could return an error for SD card
MmcHost->SendCommand(MMC_CMD23, BlockCount);
//Set command argument based on the card access mode (Byte mode or Block mode)
if (MmcHostInstance->CardInfo.OCRData.AccessMode & BIT1) {
CmdArg = Lba;