diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/as3525/sd-as3525.c | 20 |
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) | |||
363 | return -10; | 363 | return -10; |
364 | mci_delay(); | 364 | mci_delay(); |
365 | 365 | ||
366 | #ifndef BOOTLOADER | ||
367 | /* Switch to to 4 bit widebus mode */ | ||
368 | if(sd_wait_for_tran_state(drive) < 0) | ||
369 | return -11; | ||
370 | /* CMD55 */ /* Response is requested due to timing issue */ | ||
371 | if(!send_cmd(drive, SD_APP_CMD, card_info[drive].rca, MCI_ARG|MCI_RESP, &response)) | ||
372 | return -14; | ||
373 | /* ACMD42 */ | ||
374 | if(!send_cmd(drive, SD_SET_CLR_CARD_DETECT, 0, MCI_ARG|MCI_RESP, &response)) | ||
375 | return -15; | ||
376 | /* CMD55 */ /* Response is requested due to timing issue */ | ||
377 | if(!send_cmd(drive, SD_APP_CMD, card_info[drive].rca, MCI_ARG|MCI_RESP, &response)) | ||
378 | return -12; | ||
379 | /* ACMD6 */ | ||
380 | if(!send_cmd(drive, SD_SET_BUS_WIDTH, 2, MCI_ARG|MCI_RESP, &response)) | ||
381 | return -13; | ||
382 | /* Now that card is widebus make controller aware */ | ||
383 | MCI_CLOCK(drive) |= MCI_CLOCK_WIDEBUS; | ||
384 | #endif | ||
385 | |||
366 | /* | 386 | /* |
367 | * enable bank switching | 387 | * enable bank switching |
368 | * without issuing this command, we only have access to 1/4 of the blocks | 388 | * without issuing this command, we only have access to 1/4 of the blocks |