summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/target/arm/as3525/ata_sd_as3525.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c
index f9a875974d..961a124df3 100644
--- a/firmware/target/arm/as3525/ata_sd_as3525.c
+++ b/firmware/target/arm/as3525/ata_sd_as3525.c
@@ -257,13 +257,12 @@ static int sd_init_card(const int drive)
257 int i; 257 int i;
258 258
259 259
260 /* 100 - 400kHz clock required for Identification Mode */ 260 /* MCLCK on and set to 400kHz ident frequency */
261 MCI_CLOCK(drive) = (MCI_CLOCK(drive) & 0xf00) | AS3525_SD_IDENT_DIV; 261 MCI_CLOCK(drive) = MCI_CLOCK_ENABLE | AS3525_SD_IDENT_DIV;
262
263 262
263 /* 100 - 400kHz clock required for Identification Mode */
264 /* Start of Card Identification Mode ************************************/ 264 /* Start of Card Identification Mode ************************************/
265 265
266
267 /* CMD0 Go Idle */ 266 /* CMD0 Go Idle */
268 if(!send_cmd(drive, SD_GO_IDLE_STATE, 0, MCI_NO_FLAGS, NULL)) 267 if(!send_cmd(drive, SD_GO_IDLE_STATE, 0, MCI_NO_FLAGS, NULL))
269 return -1; 268 return -1;
@@ -306,10 +305,8 @@ static int sd_init_card(const int drive)
306 &card_info[drive].rca)) 305 &card_info[drive].rca))
307 return -4; 306 return -4;
308 307
309
310 /* End of Card Identification Mode ************************************/ 308 /* End of Card Identification Mode ************************************/
311 309
312
313 /* full speed for controller clock MCICLK = MCLK = PCLK = 62 MHz */ 310 /* full speed for controller clock MCICLK = MCLK = PCLK = 62 MHz */
314 MCI_CLOCK(drive) |= MCI_CLOCK_BYPASS; /* FIXME: 50 MHz is spec limit */ 311 MCI_CLOCK(drive) |= MCI_CLOCK_BYPASS; /* FIXME: 50 MHz is spec limit */
315 mci_delay(); 312 mci_delay();
@@ -490,8 +487,7 @@ static void init_pl180_controller(const int drive)
490 487
491 MCI_SELECT(drive) = 0; 488 MCI_SELECT(drive) = 0;
492 489
493 MCI_CLOCK(drive) = MCI_CLOCK_ENABLE; 490 /* Pl180 clocks get turned on at start of card init */
494 mci_delay();
495} 491}
496 492
497int sd_init(void) 493int sd_init(void)