forked from len0rd/rockbox
imx233: always keep cards in TRAN mode
Instead of going back and forth between TRAN and STBY modes, stay in TRAN mode all the time, this avoid two commands on each read/write and a potential delay to wait for the card. Change-Id: Iafd456ab9a581d870331b622eeb48dcc254eda7f
This commit is contained in:
parent
e90a5efe54
commit
462adf2a0f
1 changed files with 0 additions and 22 deletions
|
@ -497,9 +497,6 @@ static int init_mmc_drive(int drive)
|
|||
window_start[drive] = 0;
|
||||
window_end[drive] = *sec_count;
|
||||
}
|
||||
/* deselect card */
|
||||
if(!send_cmd(drive, MMC_DESELECT_CARD, 0, MCI_NO_RESP, NULL))
|
||||
return -13;
|
||||
|
||||
/* MMC always support CMD23 */
|
||||
support_set_block_count[drive] = false;
|
||||
|
@ -578,18 +575,6 @@ static int transfer_sectors(int drive, unsigned long start, int count, void *buf
|
|||
ret = -201;
|
||||
goto Lend;
|
||||
}
|
||||
/* select card.
|
||||
* NOTE: rely on SD_SELECT_CARD=MMC_SELECT_CARD */
|
||||
if(!send_cmd(drive, SD_SELECT_CARD, SDMMC_RCA(drive), MCI_NO_RESP, NULL))
|
||||
{
|
||||
ret = -20;
|
||||
goto Lend;
|
||||
}
|
||||
/* wait for TRAN state */
|
||||
/* NOTE: rely on SD_TRAN=MMC_TRAN */
|
||||
ret = wait_for_state(drive, SD_TRAN);
|
||||
if(ret < 0)
|
||||
goto Ldeselect;
|
||||
|
||||
/**
|
||||
* NOTE: we need to make sure dma transfers are aligned. This is handled
|
||||
|
@ -646,13 +631,6 @@ static int transfer_sectors(int drive, unsigned long start, int count, void *buf
|
|||
else
|
||||
ret = __xfer_sectors(drive, start, count, buf, read);
|
||||
}
|
||||
|
||||
/* deselect card */
|
||||
Ldeselect:
|
||||
/* CMD7 w/rca =0 : deselects card & puts it in STBY state
|
||||
* NOTE: rely on SD_DESELECT_CARD=MMC_DESELECT_CARD */
|
||||
if(!send_cmd(drive, SD_DESELECT_CARD, 0, MCI_NO_RESP, NULL))
|
||||
ret = -23;
|
||||
Lend:
|
||||
/* update led status */
|
||||
led(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue