Skip to content

Commit

Permalink
software/liblitedram: add optional SDRAM_TEST_DISABLE that can be def…
Browse files Browse the repository at this point in the history
…ined to full disable SDRAM test.

This is useful in simulation where SDRAM contents is pre-initialized from files (ex Linux-on-LiteX-Vexriscv).
  • Loading branch information
enjoy-digital committed Dec 22, 2020
1 parent 12dabde commit d90d3e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions litex/soc/software/liblitedram/sdram.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#include "sdram.h"

//#define SDRAM_TEST_DISABLE

#ifdef CSR_SDRAM_BASE

/*-----------------------------------------------------------------------*/
Expand Down Expand Up @@ -1014,6 +1016,7 @@ int sdram_init(void)
sdram_leveling();
#endif
sdram_software_control_off();
#ifndef SDRAM_TEST_DISABLE
if(!memtest((unsigned int *) MAIN_RAM_BASE, MEMTEST_DATA_SIZE)) {
#ifdef CSR_DDRCTRL_BASE
ddrctrl_init_done_write(1);
Expand All @@ -1022,6 +1025,7 @@ int sdram_init(void)
return 0;
}
memspeed((unsigned int *) MAIN_RAM_BASE, MEMTEST_DATA_SIZE, false);
#endif
#ifdef CSR_DDRCTRL_BASE
ddrctrl_init_done_write(1);
#endif
Expand Down

0 comments on commit d90d3e0

Please sign in to comment.