diff --git a/litex/soc/software/liblitedram/sdram.c b/litex/soc/software/liblitedram/sdram.c index 688706996..6c14c6143 100644 --- a/litex/soc/software/liblitedram/sdram.c +++ b/litex/soc/software/liblitedram/sdram.c @@ -34,6 +34,12 @@ #ifdef CSR_SDRAM_BASE +#ifdef SDRAM_WRITE_LATENCY_CALIBRATION_DEBUG +#define SDRAM_WLC_DEBUG 1 +#else +#define SDRAM_WLC_DEBUG 0 +#endif + #if SDRAM_PHY_DELAYS > 32 #define MODULO (SDRAM_PHY_DELAYS/32) #else @@ -1085,9 +1091,9 @@ static void sdram_write_latency_calibration(void) { best_score = 0; best_bitslip = -1; for(bitslip=0; bitslip score ? subscore : score; /* Increment bitslip */ sdram_read_leveling_inc_bitslip(module); @@ -1130,9 +1135,9 @@ static void sdram_write_latency_calibration(void) { printf("m%d:- ", module); else printf("m%d:%d ", module, bitslip); -#ifdef SDRAM_WRITE_LATENCY_CALIBRATION_DEBUG - printf("\n"); -#endif + + if (SDRAM_WLC_DEBUG) + printf("\n"); /* Select best write window */ ddrphy_dly_sel_write(1 << module);