From: Florent Kermarrec Date: Mon, 6 Jul 2020 16:59:28 +0000 (+0200) Subject: liblitesdcard/sdcard: use new SDClocker enable CSR. X-Git-Tag: 24jan2021_ls180~105 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=31d4d7c22c4ab4c04a4e26ccbe5721c9a785f0b3;p=litex.git liblitesdcard/sdcard: use new SDClocker enable CSR. --- diff --git a/litex/soc/software/liblitesdcard/sdcard.c b/litex/soc/software/liblitesdcard/sdcard.c index ac066eb1..48959b50 100644 --- a/litex/soc/software/liblitesdcard/sdcard.c +++ b/litex/soc/software/liblitesdcard/sdcard.c @@ -117,13 +117,16 @@ static void sdcard_set_clk_freq(uint32_t clk_freq) { divider = CONFIG_CLOCK_FREQUENCY/clk_freq + 1; divider = (1 << log2(divider)); //#ifdef SDCARD_DEBUG + printf("Setting SDCard clk freq to "); if (clk_freq > 1000000) printf("%d MHz\n", (CONFIG_CLOCK_FREQUENCY/divider)/1000000); else printf("%d KHz\n", (CONFIG_CLOCK_FREQUENCY/divider)/1000); //#endif + sdphy_clocker_enable_write(0); sdphy_clocker_divider_write(divider); + sdphy_clocker_enable_write(1); } /*-----------------------------------------------------------------------*/