software/liblitedram: reset ddrphy before initialization if rst CSR present (added on 7-series).

This commit is contained in:
Florent Kermarrec 2020-08-28 17:59:24 +02:00
parent b44ca6d61a
commit bda54b1177
1 changed files with 6 additions and 0 deletions

View File

@ -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);