summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/sd-as3525v2.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525/sd-as3525v2.c')
-rw-r--r--firmware/target/arm/as3525/sd-as3525v2.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c
index 67ef7b34ef..73816e5537 100644
--- a/firmware/target/arm/as3525/sd-as3525v2.c
+++ b/firmware/target/arm/as3525/sd-as3525v2.c
@@ -549,40 +549,11 @@ static int sd_init_card(const int drive)
549 /* Card back to full speed */ 549 /* Card back to full speed */
550 MCI_CLKDIV &= ~(0xFF); /* CLK_DIV_0 : bits 7:0 = 0x00 */ 550 MCI_CLKDIV &= ~(0xFF); /* CLK_DIV_0 : bits 7:0 = 0x00 */
551 551
552 if (sd_v2)
553 {
554 /* Attempt to switch cards to HS timings, non HS cards just ignore this */
555 /* CMD7 w/rca: Select card to put it in TRAN state */
556 if(!send_cmd(drive, SD_SELECT_CARD, card_info[drive].rca, MCI_RESP, &response))
557 return -7;
558
559 if(sd_wait_for_tran_state(drive))
560 return -8;
561
562 /* CMD6 */
563 if(!send_cmd(drive, SD_SWITCH_FUNC, 0x80fffff1, MCI_RESP, &response))
564 return -9;
565
566 /* This delay is a bit of a hack, but seems to fix card detection
567 problems with some SD cards (particularly 16 GB and bigger cards).
568 Preferably we should handle this properly instead of using a delay,
569 see also FS#11870. */
570 sleep(HZ/10);
571
572 /* We need to go back to STBY state now so we can read csd */
573 /* CMD7 w/rca=0: Deselect card to put it in STBY state */
574 if(!send_cmd(drive, SD_DESELECT_CARD, 0, MCI_NO_RESP, NULL))
575 return -10;
576 }
577
578 /* CMD9 send CSD */ 552 /* CMD9 send CSD */
579 if(!send_cmd(drive, SD_SEND_CSD, card_info[drive].rca, 553 if(!send_cmd(drive, SD_SEND_CSD, card_info[drive].rca,
580 MCI_RESP|MCI_LONG_RESP, card_info[drive].csd)) 554 MCI_RESP|MCI_LONG_RESP, card_info[drive].csd))
581 return -11; 555 return -11;
582 556
583 /* Another delay hack, see FS#11798 */
584 mci_delay();
585
586 sd_parse_csd(&card_info[drive]); 557 sd_parse_csd(&card_info[drive]);
587 558
588 if(drive == INTERNAL_AS3525) /* The OF is stored in the first blocks */ 559 if(drive == INTERNAL_AS3525) /* The OF is stored in the first blocks */