From bda54b11778ab2651dfee34b1d72a57d119d19e3 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 28 Aug 2020 17:59:24 +0200 Subject: [PATCH] software/liblitedram: reset ddrphy before initialization if rst CSR present (added on 7-series). --- litex/soc/software/liblitedram/sdram.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/litex/soc/software/liblitedram/sdram.c b/litex/soc/software/liblitedram/sdram.c index 7946a9d16..0714d2d33 100644 --- a/litex/soc/software/liblitedram/sdram.c +++ b/litex/soc/software/liblitedram/sdram.c @@ -798,6 +798,12 @@ int sdrinit(void) { printf("Initializing DRAM @0x%08x...\n", MAIN_RAM_BASE); +#if CSR_DDRPHY_RST_ADDR + ddrphy_rst_write(1); + cdelay(100); + ddrphy_rst_write(0); +#endif + #ifdef CSR_DDRCTRL_BASE ddrctrl_init_done_write(0); ddrctrl_init_error_write(0);