From 334635a97f40a855bc9cc3a3bd4f2d7ec1ef7963 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 26 Aug 2020 12:47:50 +0200 Subject: [PATCH] software/liblitesdcard: remove wait for DMA Reader to complete, fix ifdef on SDCARD_CMD23_SUPPORT. The FIFO after the DMA has been reduced and is no longer able to store an entire block, so the DMA will not complete if write is not released. --- litex/soc/software/liblitesdcard/sdcard.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/litex/soc/software/liblitesdcard/sdcard.c b/litex/soc/software/liblitesdcard/sdcard.c index e23fee862..c9753964d 100644 --- a/litex/soc/software/liblitesdcard/sdcard.c +++ b/litex/soc/software/liblitesdcard/sdcard.c @@ -508,11 +508,8 @@ void sdcard_write(uint32_t sector, uint32_t count, uint8_t* buf) sdmem2block_dma_length_write(512); sdmem2block_dma_enable_write(1); - /* Wait for DMA Reader to complete */ - while ((sdmem2block_dma_done_read() & 0x1) == 0); - /* Write Single Block to SDCard */ -#ifndef SDCARD_CMD23_SUPPORT +#ifdef SDCARD_CMD23_SUPPORT sdcard_set_block_count(1); #endif sdcard_write_single_block(sector);