diff --git a/software/bios/sdram.c b/software/bios/sdram.c index 841147995..939c42a72 100644 --- a/software/bios/sdram.c +++ b/software/bios/sdram.c @@ -422,13 +422,16 @@ int sdrlevel(void) #endif /* CSR_DDRPHY_BASE */ -#define TEST_SIZE (2*1024*1024) +#define TEST_DATA_SIZE (2*1024*1024) #define TEST_RANDOM_DATA 1 +#define TEST_ADDR_SIZE 32*1024 +#define TEST_RANDOM_ADDR 1 + #define ONEZERO 0xAAAAAAAA #define ZEROONE 0x55555555 -static unsigned int seed_to_data(unsigned int seed, int random) +static unsigned int seed_to_data_32(unsigned int seed, int random) { if (random) return 1664525*seed + 1013904223; @@ -436,11 +439,20 @@ static unsigned int seed_to_data(unsigned int seed, int random) return seed + 1; } +static unsigned short seed_to_data_16(unsigned short seed, int random) +{ + if (random) + return 25173*seed + 13849; + else + return seed + 1; +} + int memtest_silent(void) { volatile unsigned int *array = (unsigned int *)MAIN_RAM_BASE; int i; - unsigned int seed; + unsigned int seed_32; + unsigned short seed_16; unsigned int error_cnt; /* test data bus */ @@ -463,19 +475,35 @@ int memtest_silent(void) } /* test counter or random data */ - seed = 0; - for(i=0;i