From b29a99cd0b5f322ae76bf1b91c60e73d21792271 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 9 Jul 2021 17:32:43 +0200 Subject: [PATCH] liblitedram/sdram.c: Fix DFII_PIX_DATA_BYTES computation. DFII CSR size is not necessarily multiple of 4 (often the case but not with ECC for example). --- litex/soc/software/liblitedram/sdram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litex/soc/software/liblitedram/sdram.c b/litex/soc/software/liblitedram/sdram.c index 68d1c99cb..1e65d9601 100644 --- a/litex/soc/software/liblitedram/sdram.c +++ b/litex/soc/software/liblitedram/sdram.c @@ -57,7 +57,7 @@ __attribute__((unused)) void cdelay(int i) #define MEMTEST_DATA_SIZE (2*1024*1024) #endif -#define DFII_PIX_DATA_BYTES DFII_PIX_DATA_SIZE*CONFIG_CSR_DATA_WIDTH/8 +#define DFII_PIX_DATA_BYTES SDRAM_PHY_DATABITS*SDRAM_PHY_XDR/8 int sdram_get_databits(void) { return SDRAM_PHY_DATABITS;