summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/as3525/sd-as3525.c
diff options
context:
space:
mode:
authorTobias Diedrich <ranma+coreboot@tdiedrich.de>2010-06-22 21:44:42 +0000
committerTobias Diedrich <ranma+coreboot@tdiedrich.de>2010-06-22 21:44:42 +0000
commit6e45f87e0f69619e721377a43eeb178c98b071bb (patch)
treec53ef696c15821b7d03c95a6e980047bd5487ca6 /firmware/target/arm/as3525/sd-as3525.c
parent9b8d53adfe21bc62e404f0e1a83183e637bc43b2 (diff)
downloadrockbox-6e45f87e0f69619e721377a43eeb178c98b071bb.tar.gz
rockbox-6e45f87e0f69619e721377a43eeb178c98b071bb.zip
Give 4-bit mode another chance on AMSv1 since other bugs were fixed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27065 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sd-as3525.c')
-rw-r--r--firmware/target/arm/as3525/sd-as3525.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index 9e55c16be6..02b0d725f7 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -363,6 +363,26 @@ static int sd_init_card(const int drive)
return -10;
mci_delay();
+#ifndef BOOTLOADER
+ /* Switch to to 4 bit widebus mode */
+ if(sd_wait_for_tran_state(drive) < 0)
+ return -11;
+ /* CMD55 */ /* Response is requested due to timing issue */
+ if(!send_cmd(drive, SD_APP_CMD, card_info[drive].rca, MCI_ARG|MCI_RESP, &response))
+ return -14;
+ /* ACMD42 */
+ if(!send_cmd(drive, SD_SET_CLR_CARD_DETECT, 0, MCI_ARG|MCI_RESP, &response))
+ return -15;
+ /* CMD55 */ /* Response is requested due to timing issue */
+ if(!send_cmd(drive, SD_APP_CMD, card_info[drive].rca, MCI_ARG|MCI_RESP, &response))
+ return -12;
+ /* ACMD6 */
+ if(!send_cmd(drive, SD_SET_BUS_WIDTH, 2, MCI_ARG|MCI_RESP, &response))
+ return -13;
+ /* Now that card is widebus make controller aware */
+ MCI_CLOCK(drive) |= MCI_CLOCK_WIDEBUS;
+#endif
+
/*
* enable bank switching
* without issuing this command, we only have access to 1/4 of the blocks