From 1610a7f3fb24954d3829f9cc4a4fe9369b34cd10 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 14 Aug 2018 18:33:28 +0200 Subject: [PATCH] bios/sdram: fix read_level_scan result --- litex/soc/software/bios/sdram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.30.2