soc/software/bios/sdram: add ECP5 support
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 25 Feb 2019 13:40:47 +0000 (14:40 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 25 Feb 2019 13:41:33 +0000 (14:41 +0100)
litex/soc/software/bios/sdram.c

index d3d07583a84550a2baaed3707b9e13d68ea2aa69..c41d59cf35e21d70f8e36308c1f8060cbcfa929b 100644 (file)
@@ -208,14 +208,17 @@ void sdrwr(char *startaddr)
 
 #ifdef CSR_DDRPHY_BASE
 
-#ifdef USDDRPHY
+#if defined (USDDRPHY)
 #define ERR_DDRPHY_DELAY 512
+#elif defined (ECP5DDRPHY)
+#define ERR_DDRPHY_DELAY 8
 #else
 #define ERR_DDRPHY_DELAY 32
 #endif
-#define ERR_DDRPHY_BITSLIP 8
 
-#define NBMODULES DFII_PIX_DATA_SIZE/2
+#define ERR_DDRPHY_BITSLIP DFII_NPHASES*2
+
+#define NBMODULES DFII_PIX_DATA_SIZE*DFII_NPHASES/8
 
 #ifdef CSR_DDRPHY_WLEVEL_EN_ADDR