From: Florent Kermarrec Date: Thu, 25 Jun 2020 11:46:39 +0000 (+0200) Subject: liblitesdcard/sdcard_read: enable multiple block read. X-Git-Tag: 24jan2021_ls180~137 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c07703124faa16274eb014502bc3614da6c82e5c;p=litex.git liblitesdcard/sdcard_read: enable multiple block read. >10MB/s read speed with a 25MHz clock. --- diff --git a/litex/soc/software/liblitesdcard/sdcard.c b/litex/soc/software/liblitesdcard/sdcard.c index 1329433d..b3281959 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 */ }