Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#10309 - Sansa AMS : correctly sets timeout for data access

Attached to Project: Rockbox
Opened by Rafaël Carré (funman) - Tuesday, 09 June 2009, 21:08 GMT+2
Last edited by Rafaël Carré (funman) - Thursday, 11 June 2009, 19:17 GMT+2
Task Type Patches
Category Drivers
Status Closed
Assigned To No-one
Player Type Another
Severity Low
Priority Normal
Reported Version Version 3.2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

Sets MCI_DATA_TIMER to a correct value (100ms for read, 250ms for write)

We should also calculate a timeout given what the card CSD reports, and take the lower between the calculated value and 100/250ms.

The OF doesn't seem to do that so we just save some calculations at each boot and µSD insertion.

In the same process I started removing the duplicate tSDCardInfo structure and putting the 2 needed struct members into tCardInfo (designed for MMC iiuc).

I also let some crude debug code into the isr to detect infinite loops (I actually detected a timeout - status 0x8 - and I started working on this patch)

TODO:
- check if speed calculation is correct (didn't bother)
- modify ata-sd-pp.c (tSDCardInfo -> tCardInfo) - can wait release branching since we are now frozen
   ams-sd-timeout.diff (12.8 KiB)
 b/firmware/export/hotswap.h                  |    5 +
 b/firmware/target/arm/as3525/ata_sd_as3525.c |  128 ++++++++++++++-------------
 b/firmware/target/arm/as3525/clock-target.h  |    5 -
 b/firmware/target/arm/ata-sd-target.h        |   17 ---
 4 files changed, 77 insertions(+), 78 deletions(-)

This task depends upon

Closed by  Rafaël Carré (funman)
Thursday, 11 June 2009, 19:17 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  use sd_max_write_timeout for bank selection (the attached patch was wrong about that)
Comment by Rafaël Carré (funman) - Tuesday, 09 June 2009, 21:39 GMT+2
Simpler patch : only MCI_DATA_TIMER changes.

I wanted to use the tCardInfo struct because it has tsac & nsac members, but these are not used by Sansa OF so I just ignored them and used the default timeout mentioned in SD spec
   ams-sd-timeoutv2.diff (1.7 KiB)
 b/firmware/target/arm/as3525/ata_sd_as3525.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Loading...