soc/software/bios/sdram: add Kintex Ultrascale support
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 8 Nov 2017 11:59:38 +0000 (12:59 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 8 Nov 2017 11:59:38 +0000 (12:59 +0100)
litex/soc/software/bios/sdram.c

index cc497f6bcd101f2a60d9628304d4b756d4636e5d..c833227dbab66dd4dddb15afa4f7014b09f86220 100644 (file)
@@ -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) {