summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2011-03-20 09:57:43 +0000
committerBertrik Sikken <bertrik@sikken.nl>2011-03-20 09:57:43 +0000
commitfaeb4d6aef455ee8817d0112f4dd3bc870d6e5dc (patch)
tree248b933d580178f0fb35343b43b77b4f7226ce3f /firmware/target
parent5c47872b9c91d28268ccd27c2890a5642550ad4d (diff)
downloadrockbox-faeb4d6aef455ee8817d0112f4dd3bc870d6e5dc.tar.gz
rockbox-faeb4d6aef455ee8817d0112f4dd3bc870d6e5dc.zip
Add another delay in the AMSv2 sd controller driver as a work-around for SD initialisation problems, see FS#11870
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29619 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index b863337cbc..42db1cb471 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -559,7 +559,12 @@ static int sd_init_card(const int drive)
559 /* CMD6 */ 559 /* CMD6 */
560 if(!send_cmd(drive, SD_SWITCH_FUNC, 0x80fffff1, MCI_NO_RESP, NULL)) 560 if(!send_cmd(drive, SD_SWITCH_FUNC, 0x80fffff1, MCI_NO_RESP, NULL))
561 return -9; 561 return -9;
562 mci_delay(); 562
563 /* This delay is a bit of a hack, but seems to fix card detection
564 problems with some SD cards (particularly 16 GB and bigger cards).
565 Preferably we should handle this properly instead of using a delay,
566 see also FS#11870. */
567 udelay(100000);
563 568
564 /* We need to go back to STBY state now so we can read csd */ 569 /* We need to go back to STBY state now so we can read csd */
565 /* CMD7 w/rca=0: Deselect card to put it in STBY state */ 570 /* CMD7 w/rca=0: Deselect card to put it in STBY state */
@@ -572,6 +577,7 @@ static int sd_init_card(const int drive)
572 MCI_RESP|MCI_LONG_RESP, card_info[drive].csd)) 577 MCI_RESP|MCI_LONG_RESP, card_info[drive].csd))
573 return -11; 578 return -11;
574 579
580 /* Another delay hack, see FS#11798 */
575 mci_delay(); 581 mci_delay();
576 582
577 sd_parse_csd(&card_info[drive]); 583 sd_parse_csd(&card_info[drive]);