Skip to content

Commit

Permalink
software/bios/sdram: flush dcache and l2 in memtest (otherwise we are…
Browse files Browse the repository at this point in the history
… partially testing the cache)
enjoy-digital committed Jun 23, 2015
1 parent 2150e6c commit 351e654
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions software/bios/sdram.c
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
#include <generated/sdram_phy.h>
#include <generated/mem.h>
#include <hw/flags.h>
#include <system.h>

#include "sdram.h"

@@ -460,6 +461,8 @@ int memtest_silent(void)
array[i] = ONEZERO;
}
error_cnt = 0;
flush_cpu_dcache();
flush_l2_cache();
for(i=0;i<128;i++) {
if(array[i] != ONEZERO)
error_cnt++;
@@ -469,6 +472,8 @@ int memtest_silent(void)
array[i] = ZEROONE;
}
error_cnt = 0;
flush_cpu_dcache();
flush_l2_cache();
for(i=0;i<128;i++) {
if(array[i] != ZEROONE)
error_cnt++;
@@ -483,6 +488,8 @@ int memtest_silent(void)

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

seed_16 = 0;
error_cnt = 0;
flush_cpu_dcache();
flush_l2_cache();
for(i=0;i<TEST_ADDR_SIZE/4;i++) {
seed_16 = seed_to_data_16(seed_16, TEST_ADDR_RANDOM);
if(array[(unsigned int) seed_16] != i)

0 comments on commit 351e654

Please sign in to comment.