mirror of https://github.com/acidanthera/audk.git
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:
parent
bb0f9e9ba3
commit
e0932788c3
|
@ -498,6 +498,18 @@ MmcIoBlocks (
|
||||||
DEBUG((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcTransferState\n"));
|
DEBUG((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcTransferState\n"));
|
||||||
return Status;
|
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 {
|
} else {
|
||||||
// Maybe test if the card has changed to update gMmcMedia information
|
// Maybe test if the card has changed to update gMmcMedia information
|
||||||
if (MmcHostInstance->State == MmcTransferState) {
|
if (MmcHostInstance->State == MmcTransferState) {
|
||||||
|
@ -548,16 +560,6 @@ MmcIoBlocks (
|
||||||
return EFI_NOT_READY;
|
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)
|
//Set command argument based on the card access mode (Byte mode or Block mode)
|
||||||
if (MmcHostInstance->CardInfo.OCRData.AccessMode & BIT1) {
|
if (MmcHostInstance->CardInfo.OCRData.AccessMode & BIT1) {
|
||||||
CmdArg = Lba;
|
CmdArg = Lba;
|
||||||
|
|
Loading…
Reference in New Issue