diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2010-12-12 14:04:07 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2010-12-12 14:04:07 +0000 |
commit | 9da76f3031a91d24167c93dd818eeaea6a9f0a67 (patch) | |
tree | 754b3f35fef1abdeb3f11a054b367af506a34d2e /firmware/target/arm/as3525 | |
parent | 7b3c7db486febc6b830db106af6df5aaf5838421 (diff) |
AMSv2: only switch sd cards to high speed mode for for v2 sd cards, just like is done for AMSv1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28808 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r-- | firmware/target/arm/as3525/sd-as3525v2.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c index a4b6285c55..7eeac21f5e 100644 --- a/firmware/target/arm/as3525/sd-as3525v2.c +++ b/firmware/target/arm/as3525/sd-as3525v2.c @@ -541,23 +541,26 @@ static int sd_init_card(const int drive) #endif /* End of Card Identification Mode ************************************/ - /* 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_NO_RESP, NULL)) - return -7; - - if(sd_wait_for_tran_state(drive)) - return -8; - - /* CMD6 */ - if(!send_cmd(drive, SD_SWITCH_FUNC, 0x80fffff1, MCI_NO_RESP, NULL)) - return -9; - mci_delay(); - - /* 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; + 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_NO_RESP, NULL)) + return -7; + + if(sd_wait_for_tran_state(drive)) + return -8; + + /* CMD6 */ + if(!send_cmd(drive, SD_SWITCH_FUNC, 0x80fffff1, MCI_NO_RESP, NULL)) + return -9; + mci_delay(); + + /* 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, |