|
@@ -702,17 +702,17 @@ DSTATUS disk_initialize(BYTE drive)
|
|
|
|
|
|
sdcard_led_on();
|
|
|
|
|
|
- /* This doesn't work for MMC, but speeds up debugging */
|
|
|
-#undef SD_SLOW
|
|
|
-#define SD_SLOW SD_20MHZ
|
|
|
-
|
|
|
/* Allow 4 retries in case the card is in a funky state */
|
|
|
i = 4;
|
|
|
while (1) {
|
|
|
- /* Generate 256 clock cycles in slow mode, with CS# high */
|
|
|
+ /*
|
|
|
+ * Generate 256 clock cycles in slow mode, with CS# high.
|
|
|
+ * Use byte writes to reduce the time the CPU is held blocking
|
|
|
+ * interrupts. (Todo: polling loop?)
|
|
|
+ */
|
|
|
sd_set_mode(SD_SLOW, false);
|
|
|
- for (j = 0; j < 8; j++)
|
|
|
- sd_writel(~0, SD_GO32);
|
|
|
+ for (j = 0; j < 32; j++)
|
|
|
+ sd_writeb(~0, SD_GO8);
|
|
|
|
|
|
/* Assert CS# and send reset command */
|
|
|
sd_set_mode(SD_SLOW, true);
|