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) int i; + /* MCLCK on and set to 400kHz ident frequency */ + MCI_CLOCK(drive) = MCI_CLOCK_ENABLE | AS3525_SD_IDENT_DIV; + /* 100 - 400kHz clock required for Identification Mode */ - MCI_CLOCK(drive) = (MCI_CLOCK(drive) & 0xf00) | AS3525_SD_IDENT_DIV; - - /* Start of Card Identification Mode ************************************/ - /* CMD0 Go Idle */ if(!send_cmd(drive, SD_GO_IDLE_STATE, 0, MCI_NO_FLAGS, NULL)) return -1; @@ -306,10 +305,8 @@ static int sd_init_card(const int drive) &card_info[drive].rca)) return -4; - /* End of Card Identification Mode ************************************/ - /* full speed for controller clock MCICLK = MCLK = PCLK = 62 MHz */ MCI_CLOCK(drive) |= MCI_CLOCK_BYPASS; /* FIXME: 50 MHz is spec limit */ mci_delay(); @@ -490,8 +487,7 @@ static void init_pl180_controller(const int drive) MCI_SELECT(drive) = 0; - MCI_CLOCK(drive) = MCI_CLOCK_ENABLE; - mci_delay(); + /* Pl180 clocks get turned on at start of card init */ } int sd_init(void)