From: Florent Kermarrec Date: Mon, 25 Feb 2019 13:40:47 +0000 (+0100) Subject: soc/software/bios/sdram: add ECP5 support X-Git-Tag: 24jan2021_ls180~1386 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3dd529e40b6109d6abbc41429bb22db1b81c3d67;p=litex.git soc/software/bios/sdram: add ECP5 support --- diff --git a/litex/soc/software/bios/sdram.c b/litex/soc/software/bios/sdram.c index d3d07583..c41d59cf 100644 --- a/litex/soc/software/bios/sdram.c +++ b/litex/soc/software/bios/sdram.c @@ -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