diff --git a/firmware/target/arm/as3525/sd-as3525v2.c b/firmware/target/arm/as3525/sd-as3525v2.c index 8134869..26d2d6a 100644 --- a/firmware/target/arm/as3525/sd-as3525v2.c +++ b/firmware/target/arm/as3525/sd-as3525v2.c @@ -334,9 +334,6 @@ static long sd_stack [(DEFAULT_STACK_SIZE*2 + 0x200)/sizeof(long)]; static const char sd_thread_name[] = "ata/sd"; static struct mutex sd_mtx SHAREDBSS_ATTR; static struct event_queue sd_queue; -#ifndef BOOTLOADER -bool sd_enabled = false; -#endif static struct semaphore transfer_completion_signal; static struct semaphore command_completion_signal; @@ -619,7 +616,6 @@ static void sd_thread(void) if (ev.id == SYS_HOTSWAP_INSERTED) { - sd_enable(true); microsd_init = sd_init_card(SD_SLOT_AS3525); if (microsd_init < 0) /* initialisation failed */ panicf("microSD init failed : %d", microsd_init); @@ -634,8 +630,6 @@ static void sd_thread(void) if (microsd_init) queue_broadcast(SYS_FS_CHANGED, 0); - sd_enable(false); - /* Access is now safe */ mutex_unlock(&sd_mtx); fat_unlock(); @@ -770,10 +764,6 @@ int sd_init(void) create_thread(sd_thread, sd_stack, sizeof(sd_stack), 0, sd_thread_name IF_PRIO(, PRIORITY_USER_INTERFACE) IF_COP(, CPU)); -#ifndef BOOTLOADER - sd_enabled = true; - sd_enable(false); -#endif return 0; } @@ -794,7 +784,6 @@ static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start, mutex_lock(&sd_mtx); #ifndef BOOTLOADER - sd_enable(true); led(true); #endif @@ -954,7 +943,6 @@ sd_transfer_retry_with_reinit: while (1) { #ifndef BOOTLOADER - sd_enable(false); led(false); #endif mutex_unlock(&sd_mtx); @@ -1001,24 +989,6 @@ long sd_last_disk_activity(void) return last_disk_activity; } -void sd_enable(bool on) -{ - if (on) - { - bitset32(&CGU_PERI, CGU_MCI_CLOCK_ENABLE); - CGU_IDE |= (1<<7); /* AHB interface enable */ - CGU_MEMSTICK |= (1<<7); /* interface enable */ - CGU_SDSLOT |= (1<<7); /* interface enable */ - } - else - { - CGU_SDSLOT &= ~(1<<7); /* interface enable */ - CGU_MEMSTICK &= ~(1<<7); /* interface enable */ - CGU_IDE &= ~(1<<7); /* AHB interface enable */ - bitclr32(&CGU_PERI, CGU_MCI_CLOCK_ENABLE); - } -} - tCardInfo *card_get_info_target(int card_no) { return &card_info[card_no];