diff options
author | Tobias Diedrich <ranma+coreboot@tdiedrich.de> | 2010-06-22 21:49:33 +0000 |
---|---|---|
committer | Tobias Diedrich <ranma+coreboot@tdiedrich.de> | 2010-06-22 21:49:33 +0000 |
commit | 1396c335ac4d83701c9ed699156e0e78015c174b (patch) | |
tree | 5413172f8fad1b1ad0e11bd302fbb9bca94aab00 /firmware/target | |
parent | 6e45f87e0f69619e721377a43eeb178c98b071bb (diff) |
The mci_delay()s should be unnecessary if we properly tell the controller to wait for the response these commands send back to the host.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27066 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/as3525/sd-as3525.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c index 02b0d725f7..7e61fa509f 100644 --- a/firmware/target/arm/as3525/sd-as3525.c +++ b/firmware/target/arm/as3525/sd-as3525.c @@ -319,9 +319,8 @@ static int sd_init_card(const int drive) if(sd_v2) { /* CMD7 w/rca: Select card to put it in TRAN state */ - if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_ARG, NULL)) + if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_RESP|MCI_ARG, &response)) return -5; - mci_delay(); if(sd_wait_for_tran_state(drive)) return -6; @@ -359,9 +358,8 @@ static int sd_init_card(const int drive) #endif /* CMD7 w/rca: Select card to put it in TRAN state */ - if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_ARG, NULL)) + if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_RESP|MCI_ARG, &response)) return -10; - mci_delay(); #ifndef BOOTLOADER /* Switch to to 4 bit widebus mode */ @@ -395,7 +393,7 @@ static int sd_init_card(const int drive) if(ret < 0) return ret -16; - /* CMD7 w/rca = 0: Select card to put it in STBY state */ + /* CMD7 w/rca = 0: Unselect card to put it in STBY state */ if(!send_cmd(drive, SD_SELECT_CARD, 0, MCI_ARG, NULL)) return -17; mci_delay(); @@ -410,9 +408,8 @@ static int sd_init_card(const int drive) card_info[INTERNAL_AS3525].numblocks -= AMS_OF_SIZE; /* CMD7 w/rca: Select card to put it in TRAN state */ - if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_ARG, NULL)) + if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_RESP|MCI_ARG, &response)) return -19; - mci_delay(); } card_info[drive].initialized = 1; @@ -729,6 +726,7 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start, const int cmd = write ? SD_WRITE_MULTIPLE_BLOCK : SD_READ_MULTIPLE_BLOCK; unsigned long bank_start = start; + unsigned long status; /* Only switch banks for internal storage */ if(drive == INTERNAL_AS3525) @@ -816,7 +814,7 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start, last_disk_activity = current_tick; - if(!send_cmd(drive, SD_STOP_TRANSMISSION, 0, MCI_NO_FLAGS, NULL)) + if(!send_cmd(drive, SD_STOP_TRANSMISSION, 0, MCI_RESP, &status)) { ret = -4*20; goto sd_transfer_error; |