diff options
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r-- | firmware/target/arm/as3525/ata_sd_as3525.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c index 6a2860528f..65df027c30 100644 --- a/firmware/target/arm/as3525/ata_sd_as3525.c +++ b/firmware/target/arm/as3525/ata_sd_as3525.c | |||
@@ -310,25 +310,27 @@ static int sd_init_card(const int drive) | |||
310 | MCI_CLOCK(drive) |= MCI_CLOCK_BYPASS; /* FIXME: 50 MHz is spec limit */ | 310 | MCI_CLOCK(drive) |= MCI_CLOCK_BYPASS; /* FIXME: 50 MHz is spec limit */ |
311 | mci_delay(); | 311 | mci_delay(); |
312 | 312 | ||
313 | /* CMD7 w/rca: Select card to put it in TRAN state */ | 313 | #ifdef HAVE_MULTIDRIVE |
314 | if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_ARG, NULL)) | ||
315 | return -7; | ||
316 | |||
317 | /* Try to switch V2 cards to HS timings, non HS seem to ignore this */ | 314 | /* Try to switch V2 cards to HS timings, non HS seem to ignore this */ |
318 | if(sd_v2) | 315 | if(sd_v2) |
319 | { | 316 | { |
317 | /* CMD7 w/rca: Select card to put it in TRAN state */ | ||
318 | if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_ARG, NULL)) | ||
319 | return -7; | ||
320 | |||
320 | if(sd_wait_for_state(drive, SD_TRAN)) | 321 | if(sd_wait_for_state(drive, SD_TRAN)) |
321 | return -8; | 322 | return -8; |
322 | /* CMD6 */ | 323 | /* CMD6 */ |
323 | if(!send_cmd(drive, SD_SWITCH_FUNC, 0x80fffff1, MCI_ARG, NULL)) | 324 | if(!send_cmd(drive, SD_SWITCH_FUNC, 0x80fffff1, MCI_ARG, NULL)) |
324 | return -9; | 325 | return -9; |
325 | mci_delay(); | 326 | mci_delay(); |
326 | } | ||
327 | 327 | ||
328 | /* go back to STBY state so we can read csd */ | 328 | /* go back to STBY state so we can read csd */ |
329 | /* CMD7 w/rca=0: Deselect card to put it in STBY state */ | 329 | /* CMD7 w/rca=0: Deselect card to put it in STBY state */ |
330 | if(!send_cmd(drive, SD_DESELECT_CARD, 0, MCI_ARG, NULL)) | 330 | if(!send_cmd(drive, SD_DESELECT_CARD, 0, MCI_ARG, NULL)) |
331 | return -10; | 331 | return -10; |
332 | } | ||
333 | #endif /* HAVE_MULTIDRIVE */ | ||
332 | 334 | ||
333 | /* CMD9 send CSD */ | 335 | /* CMD9 send CSD */ |
334 | if(!send_cmd(drive, SD_SEND_CSD, card_info[drive].rca, | 336 | if(!send_cmd(drive, SD_SEND_CSD, card_info[drive].rca, |