bios/sdcard: provide sdclk_set_clk() stub for clocker-less targets
authorGabriel Somlo <gsomlo@gmail.com>
Sat, 14 Mar 2020 19:54:07 +0000 (15:54 -0400)
committerGabriel Somlo <gsomlo@gmail.com>
Wed, 18 Mar 2020 19:11:23 +0000 (15:11 -0400)
Targets which lack an adjustable clocker will not expose the required
registers. Provide a stub sdclk_set_clk() routine for those situations.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
litex/soc/software/bios/sdcard.c

index a732e063ece61e98a5a6556bd2d554ccbdc7cb71..c12b2db17d672eaf742e0b005bf7e741621a54e9 100644 (file)
@@ -70,7 +70,7 @@ void sdclk_set_clk(unsigned int freq) {
        while(!(sdclk_status_read() & CLKGEN_STATUS_LOCKED));
 }
 
-#else
+#elif CSR_SDCLK_MMCM_DRP_WRITE_ADDR
 
 static void sdclk_mmcm_write(unsigned int adr, unsigned int data) {
        sdclk_mmcm_drp_adr_write(adr);
@@ -133,6 +133,12 @@ void sdclk_set_clk(unsigned int freq) {
        sdclk_set_config(clk_m, clk_d);
 }
 
+#else
+
+void sdclk_set_clk(unsigned int freq) {
+       printf("Unimplemented!\n");
+}
+
 #endif
 
 /* command utils */