From: Florent Kermarrec Date: Thu, 26 Mar 2015 21:16:31 +0000 (+0100) Subject: software/bios/sdram: select the type of data we want to generate for memtest with... X-Git-Tag: 24jan2021_ls180~2435 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e79a71642524583ce1bcd252fd5675bcafb78124;p=litex.git software/bios/sdram: select the type of data we want to generate for memtest with TEST_RANDOM_DATA (debugging hardware is easier with a simple counter) --- diff --git a/software/bios/sdram.c b/software/bios/sdram.c index d374e9d3..f3dca3e4 100644 --- a/software/bios/sdram.c +++ b/software/bios/sdram.c @@ -423,15 +423,24 @@ int sdrlevel(void) #endif /* CSR_DDRPHY_BASE */ #define TEST_SIZE (2*1024*1024) +#define TEST_RANDOM_DATA 1 #define ONEZERO 0xAAAAAAAA #define ZEROONE 0x55555555 +unsigned int seed_to_data(unsigned int seed, int random) +{ + if (random) + return 1664525*seed + 1013904223; + else + return seed + 1; +} + int memtest_silent(void) { volatile unsigned int *array = (unsigned int *)MAIN_RAM_BASE; int i; - unsigned int prv; + unsigned int seed; unsigned int error_cnt; /* test data bus */ @@ -453,18 +462,18 @@ int memtest_silent(void) error_cnt++; } - /* test random data */ - prv = 0; + /* test counter or random data */ + seed = 0; for(i=0;i