bios/sdram: also check for last read of scan to choose optimal window
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 2 Jul 2018 12:12:27 +0000 (14:12 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 2 Jul 2018 12:12:27 +0000 (14:12 +0200)
litex/soc/software/bios/sdram.c

index b0e7416114f0824120962917ec3e118aecaf7e1d..cd1894243a1da64f14f6c73963e0e15ae75b2ab4 100644 (file)
@@ -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)