Browse Source

sdcard: run in slow mode (400 kHz during initialization)

Match the spec by running in slow mode (400 kHz) until after CMD0 is
accepted.
H. Peter Anvin 3 years ago
parent
commit
f3992b85ad
6 changed files with 2873 additions and 2873 deletions
  1. BIN
      fpga/output_files/max80.jbc
  2. BIN
      fpga/output_files/max80.jic
  3. BIN
      fpga/output_files/max80.pof
  4. BIN
      fpga/output_files/max80.sof
  5. 2866 2866
      fw/boot.mif
  6. 7 7
      fw/sdcard.c

BIN
fpga/output_files/max80.jbc


BIN
fpga/output_files/max80.jic


BIN
fpga/output_files/max80.pof


BIN
fpga/output_files/max80.sof


File diff suppressed because it is too large
+ 2866 - 2866
fw/boot.mif


+ 7 - 7
fw/sdcard.c

@@ -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);

Some files were not shown because too many files changed in this diff