liblitesdcard/sdcard: use max divider of 256 (128 was not enough for the initial...
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 22 Jul 2020 21:15:36 +0000 (23:15 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 22 Jul 2020 21:15:36 +0000 (23:15 +0200)
litex/soc/software/liblitesdcard/sdcard.c

index 5089939d56aed60a48a04718a93444d75e154439..9c2a56228268711babde945f637f36a9fae8eba4 100644 (file)
@@ -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)