bios/sdram: set init done after memtest (for standalone LiteDRAM controllers)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 14 Aug 2019 17:09:58 +0000 (19:09 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 14 Aug 2019 17:09:58 +0000 (19:09 +0200)
litex/soc/software/bios/sdram.c

index ecf5fe5a14121955bd0f5d2ea8e1dee16856d166..03dc2b134a1eb4f554c68916ecb212cc0b9855dd 100644 (file)
@@ -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;
 }