From b5ee110e63cdf45c379b76750a48d61e63269e2a Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 27 Jun 2018 15:31:54 +0200 Subject: [PATCH] bios/sdram: add write/read leveling scans --- litex/soc/software/bios/sdram.c | 95 ++++++++++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 1 deletion(-) diff --git a/litex/soc/software/bios/sdram.c b/litex/soc/software/bios/sdram.c index b9fb015c8..6b334853a 100644 --- a/litex/soc/software/bios/sdram.c +++ b/litex/soc/software/bios/sdram.c @@ -222,11 +222,41 @@ void sdrwloff(void) ddrphy_wlevel_en_write(0); } -static int write_level(int *delay, int *high_skew) +static void write_level_scan(void) { int i, j; int dq_address; unsigned char dq; + + printf("Write leveling scan:\n"); + + sdrwlon(); + cdelay(100); + for(i=0;i