summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Halpin <jack.halpin@gmail.com>2009-12-06 07:32:40 +0000
committerJack Halpin <jack.halpin@gmail.com>2009-12-06 07:32:40 +0000
commit472bab654b98951a81a7a6fcf732ce37ed79836c (patch)
tree2b24ac2115f1e8a91286fa4c484003fa02f9f406
parent50512cdeacdc66bd13c5848d15bf005ee3b456cd (diff)
downloadrockbox-472bab654b98951a81a7a6fcf732ce37ed79836c.zip
rockbox-472bab654b98951a81a7a6fcf732ce37ed79836c.tar.gz
rockbox-472bab654b98951a81a7a6fcf732ce37ed79836c.tar.bz2
rockbox-472bab654b98951a81a7a6fcf732ce37ed79836c.tar.xz
Sansa AMS: Move the boost from SD ident to operating frequency to after the cards get switched to HS timings.
It seems that lowering the operating frequency for the SD cards has made some uSD cards have problems with the init process. By moving the boost from ident to operating frequency to after the switch to HS timing these card now seem to init normally. We still need to fix the problem where the internal cards and non HS uSD cards are still slightly overclocked at 31 MHz. As of now we experience data crc failures during writes at the next lower frequency of 15.5 MHz. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23870 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/ata_sd_as3525.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c
index 6270f43..43c1a37 100644
--- a/firmware/target/arm/as3525/ata_sd_as3525.c
+++ b/firmware/target/arm/as3525/ata_sd_as3525.c
@@ -312,9 +312,6 @@ static int sd_init_card(const int drive)
/* End of Card Identification Mode ************************************/
- /* Boost MCICLK to operating speed */ /*FIXME: v1 at 31 MHz still too high*/
- MCI_CLOCK(drive) = (sd_v2 ? MCI_HALFSPEED : MCI_HALFSPEED);
-
#ifdef HAVE_MULTIDRIVE /* The internal SDs are v1 */
/* Try to switch V2 cards to HS timings, non HS seem to ignore this */
@@ -323,6 +320,7 @@ static int sd_init_card(const int drive)
/* 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))
return -5;
+ mci_delay();
if(sd_wait_for_state(drive, SD_TRAN))
return -6;
@@ -338,6 +336,9 @@ static int sd_init_card(const int drive)
}
#endif /* HAVE_MULTIDRIVE */
+ /* Boost MCICLK to operating speed */ /*FIXME: v1 at 31 MHz still too high*/
+ MCI_CLOCK(drive) = (sd_v2 ? MCI_HALFSPEED : MCI_HALFSPEED);
+
/* CMD9 send CSD */
if(!send_cmd(drive, SD_SEND_CSD, card_info[drive].rca,
MCI_RESP|MCI_LONG_RESP|MCI_ARG, temp_reg))