diff options
Diffstat (limited to 'firmware/target/arm')
-rw-r--r-- | firmware/target/arm/as3525/ata_sd_as3525.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c index 18cbb139e0..26208cc6f6 100644 --- a/firmware/target/arm/as3525/ata_sd_as3525.c +++ b/firmware/target/arm/as3525/ata_sd_as3525.c | |||
@@ -187,7 +187,6 @@ static int sd_init_card(const int drive) | |||
187 | { | 187 | { |
188 | unsigned int c_size; | 188 | unsigned int c_size; |
189 | unsigned long c_mult; | 189 | unsigned long c_mult; |
190 | |||
191 | int response; | 190 | int response; |
192 | int max_tries = 100; /* max acmd41 attemps */ | 191 | int max_tries = 100; /* max acmd41 attemps */ |
193 | bool sdhc; | 192 | bool sdhc; |
@@ -372,11 +371,10 @@ static void init_pl180_controller(const int drive) | |||
372 | MMC_CLOCK(drive) = MCI_CLOCK_ENABLE; | 371 | MMC_CLOCK(drive) = MCI_CLOCK_ENABLE; |
373 | MMC_CLOCK(drive) &= ~MCI_CLOCK_POWERSAVE; | 372 | MMC_CLOCK(drive) &= ~MCI_CLOCK_POWERSAVE; |
374 | 373 | ||
374 | #else /* controller already initialized by bootloader */ | ||
375 | |||
375 | /* set MCLK divider */ | 376 | /* set MCLK divider */ |
376 | mci_set_clock_divider(drive, 200); | 377 | mci_set_clock_divider(drive, 200); |
377 | #else | ||
378 | /* controller already initialized by bootloader */ | ||
379 | (void)drive; | ||
380 | #endif /* BOOTLOADER */ | 378 | #endif /* BOOTLOADER */ |
381 | } | 379 | } |
382 | 380 | ||
@@ -384,6 +382,7 @@ int sd_init(void) | |||
384 | { | 382 | { |
385 | int ret; | 383 | int ret; |
386 | 384 | ||
385 | #ifdef BOOTLOADER /* No need to do twice the same thing */ | ||
387 | CGU_IDE = (1<<7) /* AHB interface enable */ | | 386 | CGU_IDE = (1<<7) /* AHB interface enable */ | |
388 | (1<<6) /* interface enable */ | | 387 | (1<<6) /* interface enable */ | |
389 | (2<<2) /* clock didiver = 2+1 */ | | 388 | (2<<2) /* clock didiver = 2+1 */ | |
@@ -397,6 +396,7 @@ int sd_init(void) | |||
397 | CCU_IO &= ~8; /* bits 3:2 = 01, xpd is SD interface */ | 396 | CCU_IO &= ~8; /* bits 3:2 = 01, xpd is SD interface */ |
398 | CCU_IO |= 4; | 397 | CCU_IO |= 4; |
399 | 398 | ||
399 | #endif | ||
400 | init_pl180_controller(NAND_AS3525); | 400 | init_pl180_controller(NAND_AS3525); |
401 | ret = sd_init_card(NAND_AS3525); | 401 | ret = sd_init_card(NAND_AS3525); |
402 | if(ret < 0) | 402 | if(ret < 0) |