From 31d4d7c22c4ab4c04a4e26ccbe5721c9a785f0b3 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 6 Jul 2020 18:59:28 +0200 Subject: [PATCH] liblitesdcard/sdcard: use new SDClocker enable CSR. --- litex/soc/software/liblitesdcard/sdcard.c | 3 +++ 1 file changed, 3 insertions(+) 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); } /*-----------------------------------------------------------------------*/ -- 2.30.2