diff options
Diffstat (limited to 'firmware/usb.c')
-rw-r--r-- | firmware/usb.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/usb.c b/firmware/usb.c index 181b1ead1a..e27c003154 100644 --- a/firmware/usb.c +++ b/firmware/usb.c | |||
@@ -89,11 +89,15 @@ static void usb_enable(bool on) | |||
89 | #ifdef HAVE_MMC | 89 | #ifdef HAVE_MMC |
90 | mmc_select_clock(mmc_detect() ? 1 : 0); | 90 | mmc_select_clock(mmc_detect() ? 1 : 0); |
91 | #endif | 91 | #endif |
92 | if (!(read_hw_mask() & MMC_CLOCK_POLARITY)) | ||
93 | and_b(~0x20, &PBDRH); /* old circuit needs SCK1 = low while on USB */ | ||
92 | or_b(0x20, &PADRL); /* enable USB */ | 94 | or_b(0x20, &PADRL); /* enable USB */ |
93 | and_b(~0x08, &PADRL); /* assert card detect */ | 95 | and_b(~0x08, &PADRL); /* assert card detect */ |
94 | } | 96 | } |
95 | else | 97 | else |
96 | { | 98 | { |
99 | if (!(read_hw_mask() & MMC_CLOCK_POLARITY)) | ||
100 | or_b(0x20, &PBDRH); /* reset SCK1 = high for old circuit */ | ||
97 | and_b(~0x20, &PADRL); /* disable USB */ | 101 | and_b(~0x20, &PADRL); /* disable USB */ |
98 | or_b(0x08, &PADRL); /* deassert card detect */ | 102 | or_b(0x08, &PADRL); /* deassert card detect */ |
99 | } | 103 | } |