sdram: improve memtest by adding 2 different writes/reads

doing only a write and read is not enough: if we reloaded a fpga with write that is not working after functional fpga, it would not trigger an error.
This commit is contained in:
Florent Kermarrec 2015-03-02 10:51:53 +01:00
parent 46020fd253
commit 0980becb56
1 changed files with 17 additions and 8 deletions

View File

@ -422,7 +422,7 @@ int sdrlevel(void)
#endif /* DDRPHY_BASE */
#define TEST_SIZE (4*1024*1024)
#define TEST_SIZE (2*1024*1024)
int memtest_silent(void)
{
@ -431,6 +431,15 @@ int memtest_silent(void)
unsigned int prv;
unsigned int error_cnt;
for(i=0;i<TEST_SIZE/4;i++) {
array[i] = 0x5A5A5A5A;
}
error_cnt = 0;
for(i=0;i<TEST_SIZE/4;i++) {
if(array[i] != 0x5A5A5A5A)
error_cnt++;
}
prv = 0;
for(i=0;i<TEST_SIZE/4;i++) {
prv = 1664525*prv + 1013904223;