diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-08-15 16:38:27 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-08-15 16:38:27 +0000 |
commit | e0932788c3b2b9e57f1546cb201d355c11f308cd (patch) | |
tree | df9b0760bd52c39713e27db5a0a22232e467b759 /EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c | |
parent | bb0f9e9ba31f9722faa84c5d57195df013660214 (diff) | |
download | edk2-platforms-e0932788c3b2b9e57f1546cb201d355c11f308cd.tar.xz |
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
Diffstat (limited to 'EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c')
-rw-r--r-- | EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c index 8fd86f7244..e222a784b7 100644 --- a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c +++ b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c @@ -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;
|