From e28e808c244ce1d57146c92a270ce4d08c9967cc Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 15 Sep 2020 17:22:58 +0200 Subject: [PATCH] software/liblitedram: allow forced write leveling delays, improve delay printf when failing. --- litex/soc/software/liblitedram/sdram.c | 20 +++++++++++++++++--- litex/soc/software/liblitedram/sdram.h | 2 ++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/litex/soc/software/liblitedram/sdram.c b/litex/soc/software/liblitedram/sdram.c index 206187f13..bda139dcd 100644 --- a/litex/soc/software/liblitedram/sdram.c +++ b/litex/soc/software/liblitedram/sdram.c @@ -337,16 +337,27 @@ static int write_level_scan(int *delays, int loops, int show) /* rst delay */ write_delay_rst(i); + /* use forced delay if configured */ + if (sdrwl_delays[i] >= 0) { + delays[i] = sdrwl_delays[i]; + + /* configure write delay */ + for(j=0; j 0 && one_window_best_start > 0) { + } else if (one_window_best_count > 0 && one_window_best_start > 0) { delays[i] = one_window_best_start; /* configure write delay */ for(j=0; j