Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.

My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff --git a/firmware/target/arm/as3525/sd-as3525.c b/firmware/target/arm/as3525/sd-as3525.c
index 19914ab..a0d6020 100644
--- a/firmware/target/arm/as3525/sd-as3525.c
+++ b/firmware/target/arm/as3525/sd-as3525.c
@@ -879,11 +879,14 @@ void sd_enable(bool on)
     if(on)
     {
         /*  Enable both NAF_CLOCK & IDE clk for internal SD */
-        CGU_PERI |= CGU_NAF_CLOCK_ENABLE;
         CGU_IDE  |= (1<<6);     /* enable non AHB interface*/
+        CGU_PERI |= CGU_NAF_CLOCK_ENABLE;
+        MCI_CLOCK(INTERNAL_AS3525) |= MCI_CLOCK_ENABLE;
 #ifdef HAVE_MULTIDRIVE
         /* Enable MCI clk for uSD */
         CGU_PERI |= CGU_MCI_CLOCK_ENABLE;
+        if(card_detect_target())
+            MCI_CLOCK(SD_SLOT_AS3525) |= MCI_CLOCK_ENABLE;
 #ifdef HAVE_BUTTON_LIGHT
         /* buttonlight AMSes need a bit of special handling for the buttonlight
          * here due to the dual mapping of GPIOD and XPD */
@@ -923,10 +926,12 @@ void sd_enable(bool on)
             _buttonlight_on();
 #endif /* HAVE_BUTTON_LIGHT */
         /* Disable MCI clk for uSD */
+        MCI_CLOCK(SD_SLOT_AS3525) &= ~MCI_CLOCK_ENABLE;
         CGU_PERI &= ~CGU_MCI_CLOCK_ENABLE;
 #endif /* HAVE_MULTIDRIVE */

         /*  Disable both NAF_CLOCK & IDE clk for internal SD */
+        MCI_CLOCK(INTERNAL_AS3525) &= ~MCI_CLOCK_ENABLE;
         CGU_PERI &= ~CGU_NAF_CLOCK_ENABLE;
         CGU_IDE &= ~(1<<6);       /* disable non AHB interface*/
     }