From faeb4d6aef455ee8817d0112f4dd3bc870d6e5dc Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Sun, 20 Mar 2011 09:57:43 +0000 Subject: 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 --- firmware/target/arm/as3525/sd-as3525v2.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'firmware/target') 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) /* CMD6 */ if(!send_cmd(drive, SD_SWITCH_FUNC, 0x80fffff1, MCI_NO_RESP, NULL)) return -9; - mci_delay(); + + /* 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. */ + udelay(100000); /* 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 */ @@ -572,6 +577,7 @@ static int sd_init_card(const int drive) 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]); -- cgit v1.2.3