From df99cc66e8273b0ea9cf5860d46dd4922f99c88a Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 2 Jul 2018 14:12:27 +0200 Subject: [PATCH] bios/sdram: also check for last read of scan to choose optimal window --- litex/soc/software/bios/sdram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litex/soc/software/bios/sdram.c b/litex/soc/software/bios/sdram.c index b0e741611..cd1894243 100644 --- a/litex/soc/software/bios/sdram.c +++ b/litex/soc/software/bios/sdram.c @@ -422,7 +422,7 @@ static int read_level_scan(int silent) if(MMPTR(sdram_dfii_pix_rddata_addr[p]+4*(i+DFII_PIX_DATA_SIZE/2)) != prs[DFII_PIX_DATA_SIZE*p+i+DFII_PIX_DATA_SIZE/2]) working = 0; } - if (j == 0) + if ((j == 0) || (j == (ERR_DDRPHY_DELAY-1))) /* to have an optimal scan, first tap should not be working */ optimal &= (working == 0); if (!silent)