From f6d6611a81bf9bc3015fefd280dad34fe455f2ed Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 24 Feb 2022 17:31:54 +0100 Subject: [PATCH] software/liblitedram: Introduce SDRAM_PHY_DELAY_JUMP and set to 4 on 7-Series instead of 1 to improve calibration robustness on some boards. This is for example required on the STLV7325 board. --- litex/soc/software/liblitedram/sdram.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/litex/soc/software/liblitedram/sdram.c b/litex/soc/software/liblitedram/sdram.c index 859bb121d..277d0c641 100644 --- a/litex/soc/software/liblitedram/sdram.c +++ b/litex/soc/software/liblitedram/sdram.c @@ -398,14 +398,16 @@ static void sdram_leveling_center_module( /* Get a bit further into the working zone */ #if SDRAM_PHY_DELAYS > 32 - for(i=0;i<16;i++) { + #define SDRAM_PHY_DELAY_JUMP 16 +#elif SDRAM_PHY_DELAYS > 8 + #define SDRAM_PHY_DELAY_JUMP 4 +#else + #define SDRAM_PHY_DELAY_JUMP 1 +#endif + for(i=0;i