summaryrefslogtreecommitdiff
path: root/firmware
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 /firmware
parent50512cdeacdc66bd13c5848d15bf005ee3b456cd (diff)
downloadrockbox-472bab654b98951a81a7a6fcf732ce37ed79836c.tar.gz
rockbox-472bab654b98951a81a7a6fcf732ce37ed79836c.zip
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
Diffstat (limited to 'firmware')
-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 6270f4363b..43c1a37670 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)
312 312
313 /* End of Card Identification Mode ************************************/ 313 /* End of Card Identification Mode ************************************/
314 314
315 /* Boost MCICLK to operating speed */ /*FIXME: v1 at 31 MHz still too high*/
316 MCI_CLOCK(drive) = (sd_v2 ? MCI_HALFSPEED : MCI_HALFSPEED);
317
318#ifdef HAVE_MULTIDRIVE /* The internal SDs are v1 */ 315#ifdef HAVE_MULTIDRIVE /* The internal SDs are v1 */
319 316
320 /* Try to switch V2 cards to HS timings, non HS seem to ignore this */ 317 /* 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)
323 /* CMD7 w/rca: Select card to put it in TRAN state */ 320 /* CMD7 w/rca: Select card to put it in TRAN state */
324 if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_ARG, NULL)) 321 if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_ARG, NULL))
325 return -5; 322 return -5;
323 mci_delay();
326 324
327 if(sd_wait_for_state(drive, SD_TRAN)) 325 if(sd_wait_for_state(drive, SD_TRAN))
328 return -6; 326 return -6;
@@ -338,6 +336,9 @@ static int sd_init_card(const int drive)
338 } 336 }
339#endif /* HAVE_MULTIDRIVE */ 337#endif /* HAVE_MULTIDRIVE */
340 338
339 /* Boost MCICLK to operating speed */ /*FIXME: v1 at 31 MHz still too high*/
340 MCI_CLOCK(drive) = (sd_v2 ? MCI_HALFSPEED : MCI_HALFSPEED);
341
341 /* CMD9 send CSD */ 342 /* CMD9 send CSD */
342 if(!send_cmd(drive, SD_SEND_CSD, card_info[drive].rca, 343 if(!send_cmd(drive, SD_SEND_CSD, card_info[drive].rca,
343 MCI_RESP|MCI_LONG_RESP|MCI_ARG, temp_reg)) 344 MCI_RESP|MCI_LONG_RESP|MCI_ARG, temp_reg))