liblitesdcard/sdcard: use max divider of 256 (128 was not enough for the initial 400Khz clock frequency).

This commit is contained in:
Florent Kermarrec 2020-07-22 23:15:36 +02:00
parent 8f92034ddd
commit 8bdf6941a3
1 changed files with 1 additions and 1 deletions

View 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)