summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-02-21 22:01:37 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-02-21 22:01:37 +0000
commite9cd0f1c7aaa0443a3a2a33161fadf838862eda2 (patch)
tree643e92aed31ef17354cb397f6db0fd661aa32c28
parentf857fe145090711ba4c7a28e82da6bde4f4bba9a (diff)
sd-as3525v2: no limits on the amount of sectors to transfer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24832 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index 96c615a2be..27c73720b6 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -651,25 +651,19 @@ static int sd_transfer_sectors(unsigned long start, int count, void* buf, bool w
dma_retain();
- while(count)
- {
- /* Interrupt handler might set this to true during transfer */
- retry = false;
- /* 128 * 512 = 2^16, and doesn't fit in the 16 bits of DATA_LENGTH
- * register, so we have to transfer maximum 127 sectors at a time. */
- //unsigned int transfer = (count >= 128) ? 127 : count; /* sectors */
- unsigned int transfer = count;
-
- const int cmd =
- write ? SD_WRITE_MULTIPLE_BLOCK : SD_READ_MULTIPLE_BLOCK;
+ const int cmd = write ? SD_WRITE_MULTIPLE_BLOCK : SD_READ_MULTIPLE_BLOCK;
+ /* Interrupt handler might set this to true during transfer */
+ retry = false;
+ do
+ {
MCI_CTRL |= FIFO_RESET;
while(MCI_CTRL & FIFO_RESET)
;
//MCI_BLKSIZ = 512;
- MCI_BYTCNT = transfer * 512;
+ MCI_BYTCNT = count * 512;
MCI_CTRL |= FIFO_RESET;
while(MCI_CTRL & FIFO_RESET)
@@ -708,13 +702,6 @@ static int sd_transfer_sectors(unsigned long start, int count, void* buf, bool w
printf("dma <-");
int delay = 0x1000000; while(delay--) ;
- if(!retry)
- {
- buf += transfer * SECTOR_SIZE;
- start += transfer;
- count -= transfer;
- }
-
last_disk_activity = current_tick;
if(!send_cmd(SD_STOP_TRANSMISSION, 0, MCI_NO_RESP, NULL))
@@ -730,7 +717,7 @@ static int sd_transfer_sectors(unsigned long start, int count, void* buf, bool w
panicf(" wait for state TRAN failed (%d)", ret);
goto sd_transfer_error;
}
- }
+ } while(retry);
dma_release();