Skip to content

Commit 106e4c6

Browse files
committedJul 30, 2015
bios/sdram: fix error_cnt computation in memtest
1 parent 94cb3cb commit 106e4c6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed
 

Diff for: ‎software/bios/sdram.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,12 @@ int memtest_silent(void)
456456
unsigned short seed_16;
457457
unsigned int error_cnt;
458458

459+
error_cnt = 0;
460+
459461
/* test data bus */
460462
for(i=0;i<128;i++) {
461463
array[i] = ONEZERO;
462464
}
463-
error_cnt = 0;
464465
flush_cpu_dcache();
465466
flush_l2_cache();
466467
for(i=0;i<128;i++) {
@@ -471,7 +472,6 @@ int memtest_silent(void)
471472
for(i=0;i<128;i++) {
472473
array[i] = ZEROONE;
473474
}
474-
error_cnt = 0;
475475
flush_cpu_dcache();
476476
flush_l2_cache();
477477
for(i=0;i<128;i++) {
@@ -487,7 +487,6 @@ int memtest_silent(void)
487487
}
488488

489489
seed_32 = 0;
490-
error_cnt = 0;
491490
flush_cpu_dcache();
492491
flush_l2_cache();
493492
for(i=0;i<TEST_DATA_SIZE/4;i++) {
@@ -504,7 +503,6 @@ int memtest_silent(void)
504503
}
505504

506505
seed_16 = 0;
507-
error_cnt = 0;
508506
flush_cpu_dcache();
509507
flush_l2_cache();
510508
for(i=0;i<TEST_ADDR_SIZE/4;i++) {
@@ -522,7 +520,7 @@ int memtest(void)
522520

523521
e = memtest_silent();
524522
if(e != 0) {
525-
printf("Memtest failed: %d/%d words incorrect\n", e, TEST_DATA_SIZE/4 + TEST_ADDR_SIZE/4);
523+
printf("Memtest failed: %d/%d words incorrect\n", e, 2*128 + TEST_DATA_SIZE/4 + TEST_ADDR_SIZE/4);
526524
return 0;
527525
} else {
528526
printf("Memtest OK\n");

0 commit comments

Comments
 (0)
Please sign in to comment.