Index: ../firmware/target/arm/as3525/sd-as3525v2.c
===================================================================
--- ../firmware/target/arm/as3525/sd-as3525v2.c (revision 29587)
+++ ../firmware/target/arm/as3525/sd-as3525v2.c (working copy)
@@ -1038,10 +1038,16 @@
{
if (on)
{
+ int hcon_numcards = ((MCI_HCON>>1) & 0x1F) + 1;
+
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 */
+
+ MCI_CLKENA = (1 << hcon_numcards) - 1;
+ MCI_CLKENA |= 1<<( 16);
+ MCI_CLKENA |= 1<<( 1+16);
}
else
{
@@ -1049,6 +1055,9 @@
CGU_MEMSTICK &= ~(1<<7); /* interface enable */
CGU_IDE &= ~(1<<7); /* AHB interface enable */
bitclr32(&CGU_PERI, CGU_MCI_CLOCK_ENABLE);
+
+ MCI_CLKENA = 0;
+
}
}