From 8bdf6941a36e6f386132fae7107bed0d85186541 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 22 Jul 2020 23:15:36 +0200 Subject: [PATCH] liblitesdcard/sdcard: use max divider of 256 (128 was not enough for the initial 400Khz clock frequency). --- litex/soc/software/liblitesdcard/sdcard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litex/soc/software/liblitesdcard/sdcard.c b/litex/soc/software/liblitesdcard/sdcard.c index 5089939d..9c2a5622 100644 --- a/litex/soc/software/liblitesdcard/sdcard.c +++ b/litex/soc/software/liblitesdcard/sdcard.c @@ -132,7 +132,7 @@ static void sdcard_set_clk_freq(uint32_t clk_freq) { divider = CONFIG_CLOCK_FREQUENCY/clk_freq + 1; divider = (1 << log2(divider)); divider = max(divider, 2); - divider = min(divider, 128); + divider = min(divider, 256); #ifdef SDCARD_DEBUG printf("Setting SDCard clk freq to "); if (clk_freq > 1000000) -- 2.30.2