diff --git a/litex/soc/software/bios/sdram.c b/litex/soc/software/bios/sdram.c index ecf5fe5a1..03dc2b134 100644 --- a/litex/soc/software/bios/sdram.c +++ b/litex/soc/software/bios/sdram.c @@ -891,15 +891,16 @@ int sdrinit(void) #endif #endif sdrhw(); -#ifdef CSR_DDRCTRL_BASE - ddrctrl_init_done_write(1); -#endif if(!memtest()) { #ifdef CSR_DDRCTRL_BASE + ddrctrl_init_done_write(1); ddrctrl_init_error_write(1); #endif return 0; } +#ifdef CSR_DDRCTRL_BASE + ddrctrl_init_done_write(1); +#endif return 1; }