summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorJack Halpin <jack.halpin@gmail.com>2010-03-22 02:29:53 +0000
committerJack Halpin <jack.halpin@gmail.com>2010-03-22 02:29:53 +0000
commit48b8080330cad231de9b02b48b631e02d3cb554a (patch)
tree503398289d32d98da0ebef64fc14d945465e0658 /firmware
parent6357c5a085fe8959085db5a741e315e0a03c9824 (diff)
downloadrockbox-48b8080330cad231de9b02b48b631e02d3cb554a.tar.gz
rockbox-48b8080330cad231de9b02b48b631e02d3cb554a.tar.bz2
rockbox-48b8080330cad231de9b02b48b631e02d3cb554a.zip
sd-as3525v2 Remove post transfer wait for state call and move pre transfer wait for state call inside the transfer loop.
We don't need the post transfer call this way. We check on TRAN state before each partial transfer. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25282 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index 9698a149ed..4e550a96d4 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -744,19 +744,6 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
#endif
last_disk_activity = current_tick;
- ret = sd_wait_for_state(drive, SD_TRAN);
- if (ret < 0)
- {
- static const char *st[9] = {
- "IDLE", "RDY", "IDENT", "STBY", "TRAN", "DATA", "RCV", "PRG", "DIS"
- };
- if(ret <= -10)
- panicf("wait for state failed (%s) %d", st[(-ret / 10) % 9], drive);
- else
- panicf("wait for state failed");
- goto sd_transfer_error;
- }
-
dma_retain();
const int cmd = write ? SD_WRITE_MULTIPLE_BLOCK : SD_READ_MULTIPLE_BLOCK;
@@ -781,6 +768,20 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
while(MCI_CTRL & (FIFO_RESET|DMA_RESET))
;
+ ret = sd_wait_for_state(drive, SD_TRAN);
+ if (ret < 0)
+ {
+ static const char *st[9] = {
+ "IDLE", "RDY", "IDENT", "STBY", "TRAN", "DATA", "RCV",
+ "PRG", "DIS"};
+ if(ret <= -10)
+ panicf("wait for TRAN state failed (%s) %d",
+ st[(-ret / 10) % 9], drive);
+ else
+ panicf("wait for state failed");
+ goto sd_transfer_error;
+ }
+
MCI_CTRL |= DMA_ENABLE;
MCI_MASK = MCI_INT_CD|MCI_INT_DTO|MCI_INT_DCRC|MCI_INT_DRTO| \
MCI_INT_HTO|MCI_INT_FRUN|MCI_INT_HLE|MCI_INT_SBE|MCI_INT_EBE;
@@ -816,13 +817,6 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
goto sd_transfer_error;
}
- ret = sd_wait_for_state(drive, SD_TRAN);
- if (ret < 0)
- {
- panicf(" wait for state TRAN failed (%d)", ret);
- goto sd_transfer_error;
- }
-
if(!retry)
{
if(!write)