瀏覽代碼

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 年之前
父節點
當前提交
f3992b85ad
共有 6 個文件被更改,包括 2873 次插入2873 次删除
  1. 二進制
      fpga/output_files/max80.jbc
  2. 二進制
      fpga/output_files/max80.jic
  3. 二進制
      fpga/output_files/max80.pof
  4. 二進制
      fpga/output_files/max80.sof
  5. 2866 2866
      fw/boot.mif
  6. 7 7
      fw/sdcard.c

二進制
fpga/output_files/max80.jbc


二進制
fpga/output_files/max80.jic


二進制
fpga/output_files/max80.pof


二進制
fpga/output_files/max80.sof


文件差異過大導致無法顯示
+ 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);

部分文件因文件數量過多而無法顯示