From: Florent Kermarrec Date: Wed, 22 Jul 2020 21:15:36 +0000 (+0200) Subject: liblitesdcard/sdcard: use max divider of 256 (128 was not enough for the initial... X-Git-Tag: 24jan2021_ls180~62 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8bdf6941a36e6f386132fae7107bed0d85186541;p=litex.git liblitesdcard/sdcard: use max divider of 256 (128 was not enough for the initial 400Khz clock frequency). --- 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)