1
0
Fork 0
forked from len0rd/rockbox

AMSv2 sd: do not try to switch sd cards into high-speed mode.

High-speed mode is only half implemented (sd controller still uses normal speed) and causes card detection problems.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29660 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Bertrik Sikken 2011-03-29 20:37:40 +00:00
parent 8c3fc23ae6
commit 8351a1aa9d
2 changed files with 1 additions and 29 deletions

View file

@ -1,3 +1,4 @@
test_disk.c
/* plugins common to all models */
chessclock.c
credits.c

View file

@ -549,40 +549,11 @@ static int sd_init_card(const int drive)
/* Card back to full speed */
MCI_CLKDIV &= ~(0xFF); /* CLK_DIV_0 : bits 7:0 = 0x00 */
if (sd_v2)
{
/* Attempt to switch cards to HS timings, non HS cards just ignore this */
/* CMD7 w/rca: Select card to put it in TRAN state */
if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_RESP, &response))
return -7;
if(sd_wait_for_tran_state(drive))
return -8;
/* CMD6 */
if(!send_cmd(drive, SD_SWITCH_FUNC, 0x80fffff1, MCI_RESP, &response))
return -9;
/* This delay is a bit of a hack, but seems to fix card detection
problems with some SD cards (particularly 16 GB and bigger cards).
Preferably we should handle this properly instead of using a delay,
see also FS#11870. */
sleep(HZ/10);
/* We need to go back to STBY state now so we can read csd */
/* CMD7 w/rca=0: Deselect card to put it in STBY state */
if(!send_cmd(drive, SD_DESELECT_CARD, 0, MCI_NO_RESP, NULL))
return -10;
}
/* CMD9 send CSD */
if(!send_cmd(drive, SD_SEND_CSD, card_info[drive].rca,
MCI_RESP|MCI_LONG_RESP, card_info[drive].csd))
return -11;
/* Another delay hack, see FS#11798 */
mci_delay();
sd_parse_csd(&card_info[drive]);
if(drive == INTERNAL_AS3525) /* The OF is stored in the first blocks */