From c9e36f90a2269a7c34fe0512c6cb673417ab17d2 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 5 Dec 2012 10:35:27 -0300 Subject: [PATCH] tornado/fw/mmc-hw.c (mmc_activate): allow card to "pre-charge" (Ben needs this) --- tornado/fw/mmc-hw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tornado/fw/mmc-hw.c b/tornado/fw/mmc-hw.c index 6682423..c4c0a4f 100644 --- a/tornado/fw/mmc-hw.c +++ b/tornado/fw/mmc-hw.c @@ -104,10 +104,14 @@ void mmc_activate(void) SET(MMC_nCS); CLR(MMC_CLK); OUT(MMC_nCS); + SET(MMC_MOSI); + SET(MMC_CLK); /* for pre-charging */ OUT(MMC_MOSI); OUT(MMC_CLK); IN(MMC_MISO); + _delay_ms(100); /* allow card to pre-charge, to limit inrush current */ + CLR(CARD_nPWR); _delay_ms(10);