From: Florent Kermarrec Date: Tue, 14 Aug 2018 16:33:28 +0000 (+0200) Subject: bios/sdram: fix read_level_scan result X-Git-Tag: 24jan2021_ls180~1653 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1610a7f3fb24954d3829f9cc4a4fe9369b34cd10;p=litex.git bios/sdram: fix read_level_scan result --- diff --git a/litex/soc/software/bios/sdram.c b/litex/soc/software/bios/sdram.c index 59cfa8a9..b55f13f7 100644 --- a/litex/soc/software/bios/sdram.c +++ b/litex/soc/software/bios/sdram.c @@ -446,8 +446,8 @@ static int read_level_scan(int silent) command_p0(DFII_COMMAND_RAS|DFII_COMMAND_WE|DFII_COMMAND_CS); cdelay(15); - /* Successful if working and optimal or if number of working delays > 3/4 of the taps */ - return (working & optimal) | (working_delays > 3*ERR_DDRPHY_DELAY/4); + /* Successful if working and optimal or number of working delays > 3/4 of the taps */ + return working & (optimal | working_delays > 3*(DFII_PIX_DATA_SIZE/2)*ERR_DDRPHY_DELAY/4); } static void read_level(void)