From c3d902ef42484831a4703df8bbe87789d02e37cb Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 8 Nov 2017 12:59:38 +0100 Subject: [PATCH] soc/software/bios/sdram: add Kintex Ultrascale support --- litex/soc/software/bios/sdram.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/litex/soc/software/bios/sdram.c b/litex/soc/software/bios/sdram.c index cc497f6b..c833227d 100644 --- a/litex/soc/software/bios/sdram.c +++ b/litex/soc/software/bios/sdram.c @@ -213,7 +213,11 @@ void sdrwloff(void) ddrphy_wlevel_en_write(0); } +#ifdef KUSDDRPHY +#define ERR_DDRPHY_DELAY 512 +#else #define ERR_DDRPHY_DELAY 32 +#endif static int write_level(int *delay, int *high_skew) { @@ -302,10 +306,14 @@ static void read_bitslip(int *delay, int *high_skew) for(i=DFII_PIX_DATA_SIZE/2-1;i>=0;i--) if(delay[i] > bitslip_thr) { ddrphy_dly_sel_write(1 << i); +#ifdef KUSDDRPHY + ddrphy_rdly_dq_bitslip_write(1); +#else /* 7-series SERDES in DDR mode needs 3 pulses for 1 bitslip */ ddrphy_rdly_dq_bitslip_write(1); ddrphy_rdly_dq_bitslip_write(1); ddrphy_rdly_dq_bitslip_write(1); +#endif printf("%d ", i); } printf("\n"); @@ -371,8 +379,15 @@ static void read_delays(void) delay_min = delay; /* Get a bit further into the working zone */ +#ifdef KUSDDRPHY + for(j=0;j<8;j++) { + delay += 1; + ddrphy_rdly_dq_inc_write(1); + } +#else delay++; ddrphy_rdly_dq_inc_write(1); +#endif /* Find largest working delay */ while(1) { -- 2.30.2