bios/sdram: set init_done/error when DDRCTRL is present (litedram_gen)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 22 Jun 2019 08:53:12 +0000 (10:53 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 22 Jun 2019 08:55:15 +0000 (10:55 +0200)
litex/soc/software/bios/sdram.c

index 948f2cbf31acc7f84db841f97173844acd9abf20..eeee93bad0913317b018a61cf17c951f23359f9d 100644 (file)
@@ -861,6 +861,11 @@ int sdrinit(void)
 {
        printf("Initializing SDRAM...\n");
 
+#ifdef CSR_DDRCTRL_BASE
+       ddrctrl_init_done_write(0);
+       ddrctrl_init_error_write(0);
+#endif
+
        init_sequence();
 #ifdef CSR_DDRPHY_BASE
 #if CSR_DDRPHY_EN_VTC_ADDR
@@ -872,7 +877,13 @@ int sdrinit(void)
 #endif
 #endif
        sdrhw();
+#ifdef CSR_DDRCTRL_BASE
+       ddrctrl_init_done_write(1);
+#endif
        if(!memtest()) {
+#ifdef CSR_DDRCTRL_BASE
+               ddrctrl_init_error_write(1);
+#endif
                return 0;
        }