summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c37
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,