sdram: Unconditionally switch to SW control before inits
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 1 Jun 2020 13:44:09 +0000 (23:44 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 1 Jun 2020 13:44:09 +0000 (23:44 +1000)
This will allow the controller to default to HW control which means
the sim model can be used without specific initializations

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
litex/soc/software/liblitedram/sdram.c

index 55ea65f164ad43f443ed5690bb84917ca21557bf..147d96d50f748cc9ba4510d457dab696e482542e 100644 (file)
@@ -995,7 +995,6 @@ int _write_level_cdly_scan = 1;
 int sdrlevel(void)
 {
        int module;
-       sdrsw();
 
        for(module=0; module<SDRAM_PHY_MODULES; module++) {
 #ifdef SDRAM_PHY_WRITE_LEVELING_CAPABLE
@@ -1033,7 +1032,7 @@ int sdrinit(void)
        ddrctrl_init_done_write(0);
        ddrctrl_init_error_write(0);
 #endif
-
+       sdrsw();
        init_sequence();
 #ifdef CSR_DDRPHY_BASE
 #ifdef DDRPHY_CMD_DELAY