//#define SDCARD_DEBUG
#define SDCARD_WAIT_WORKAROUND
+#define SDCARD_MULTIPLE_BLOCK_SUPPORT
+
#ifdef CSR_SDCORE_BASE
unsigned int sdcard_response[SD_RESPONSE_SIZE/4];
sdreader_enable_write(1);
/* Read Block(s) from SDCard */
+#ifdef SDCARD_MULTIPLE_BLOCK_SUPPORT
sdcard_set_block_count(count);
- if (count > 0)
- sdcard_read_multiple_block(sector, count);
- else
+ sdcard_read_multiple_block(sector, count);
+#else
+ while (count) {
sdcard_read_single_block(sector);
+ sector += 1;
+ count -= 1;
+ }
+#endif
/* Wait for DMA Writer to complete */
while ((sdreader_done_read() & 0x1) == 0);
while ((sdwriter_done_read() & 0x1) == 0);
/* Write Single Block to SDCard */
+#ifdef SDCARD_MULTIPLE_BLOCK_SUPPORT
sdcard_set_block_count(1);
+#endif
sdcard_write_single_block(sector);
/* Update buf/sector */