software/liblitedram: add optional SDRAM_TEST_DISABLE that can be defined to full disable SDRAM test.

This is useful in simulation where SDRAM contents is pre-initialized from files (ex Linux-on-LiteX-Vexriscv).
This commit is contained in:
Florent Kermarrec 2020-12-22 10:50:03 +01:00
parent 12dabde77c
commit d90d3e043b

View file

@ -24,6 +24,8 @@
#include "sdram.h" #include "sdram.h"
//#define SDRAM_TEST_DISABLE
#ifdef CSR_SDRAM_BASE #ifdef CSR_SDRAM_BASE
/*-----------------------------------------------------------------------*/ /*-----------------------------------------------------------------------*/
@ -1014,6 +1016,7 @@ int sdram_init(void)
sdram_leveling(); sdram_leveling();
#endif #endif
sdram_software_control_off(); sdram_software_control_off();
#ifndef SDRAM_TEST_DISABLE
if(!memtest((unsigned int *) MAIN_RAM_BASE, MEMTEST_DATA_SIZE)) { if(!memtest((unsigned int *) MAIN_RAM_BASE, MEMTEST_DATA_SIZE)) {
#ifdef CSR_DDRCTRL_BASE #ifdef CSR_DDRCTRL_BASE
ddrctrl_init_done_write(1); ddrctrl_init_done_write(1);
@ -1022,6 +1025,7 @@ int sdram_init(void)
return 0; return 0;
} }
memspeed((unsigned int *) MAIN_RAM_BASE, MEMTEST_DATA_SIZE, false); memspeed((unsigned int *) MAIN_RAM_BASE, MEMTEST_DATA_SIZE, false);
#endif
#ifdef CSR_DDRCTRL_BASE #ifdef CSR_DDRCTRL_BASE
ddrctrl_init_done_write(1); ddrctrl_init_done_write(1);
#endif #endif