diff --git a/litex/soc/software/liblitesdcard/sdcard.c b/litex/soc/software/liblitesdcard/sdcard.c index 1329433d2..b3281959c 100644 --- a/litex/soc/software/liblitesdcard/sdcard.c +++ b/litex/soc/software/liblitesdcard/sdcard.c @@ -484,25 +484,22 @@ int sdcard_init(void) { void sdcard_read(uint32_t sector, uint32_t count, uint8_t* buf) { - uint32_t i; - for (i=0; i 0) + sdcard_read_multiple_block(sector, count); + else sdcard_read_single_block(sector); - /* Wait for DMA Writer to complete */ - while ((sdreader_done_read() & 0x1) == 0); + /* Wait for DMA Writer to complete */ + while ((sdreader_done_read() & 0x1) == 0); - /* Update buf/sector */ - buf += 512; - sector += 1; - } flush_cpu_dcache(); /* FIXME */ }