mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
liblitesdcard/sdcard: use new SDClocker enable CSR.
This commit is contained in:
parent
f0a97791a9
commit
31d4d7c22c
1 changed files with 3 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
|
Loading…
Reference in a new issue