From b39fea4ecbbaee7f659cb73a0c342628142dca6c Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 7 Sep 2020 18:53:31 +0200 Subject: [PATCH] software/liblitedram/write_level_scan: reset write delay even if not succeeding. --- litex/soc/software/liblitedram/sdram.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litex/soc/software/liblitedram/sdram.c b/litex/soc/software/liblitedram/sdram.c index 8fd02be44..206187f13 100644 --- a/litex/soc/software/liblitedram/sdram.c +++ b/litex/soc/software/liblitedram/sdram.c @@ -333,12 +333,15 @@ static int write_level_scan(int *delays, int loops, int show) } } } + + /* rst delay */ + write_delay_rst(i); + /* succeed only if the start of a 1s window has been found */ if (one_window_best_count > 0 && one_window_best_start > 0) { delays[i] = one_window_best_start; /* configure write delay */ - write_delay_rst(i); for(j=0; j