Skip to content

Commit 351e654

Browse files
committedJun 23, 2015
software/bios/sdram: flush dcache and l2 in memtest (otherwise we are partially testing the cache)
1 parent 2150e6c commit 351e654

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

Diff for: ‎software/bios/sdram.c

+9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <generated/sdram_phy.h>
88
#include <generated/mem.h>
99
#include <hw/flags.h>
10+
#include <system.h>
1011

1112
#include "sdram.h"
1213

@@ -460,6 +461,8 @@ int memtest_silent(void)
460461
array[i] = ONEZERO;
461462
}
462463
error_cnt = 0;
464+
flush_cpu_dcache();
465+
flush_l2_cache();
463466
for(i=0;i<128;i++) {
464467
if(array[i] != ONEZERO)
465468
error_cnt++;
@@ -469,6 +472,8 @@ int memtest_silent(void)
469472
array[i] = ZEROONE;
470473
}
471474
error_cnt = 0;
475+
flush_cpu_dcache();
476+
flush_l2_cache();
472477
for(i=0;i<128;i++) {
473478
if(array[i] != ZEROONE)
474479
error_cnt++;
@@ -483,6 +488,8 @@ int memtest_silent(void)
483488

484489
seed_32 = 0;
485490
error_cnt = 0;
491+
flush_cpu_dcache();
492+
flush_l2_cache();
486493
for(i=0;i<TEST_DATA_SIZE/4;i++) {
487494
seed_32 = seed_to_data_32(seed_32, TEST_DATA_RANDOM);
488495
if(array[i] != seed_32)
@@ -498,6 +505,8 @@ int memtest_silent(void)
498505

499506
seed_16 = 0;
500507
error_cnt = 0;
508+
flush_cpu_dcache();
509+
flush_l2_cache();
501510
for(i=0;i<TEST_ADDR_SIZE/4;i++) {
502511
seed_16 = seed_to_data_16(seed_16, TEST_ADDR_RANDOM);
503512
if(array[(unsigned int) seed_16] != i)

0 commit comments

Comments
 (0)
Please sign in to comment.