From 351e654e9d03d15a4820bd84b604d8e8bfae5978 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 23 Jun 2015 09:01:34 +0200 Subject: [PATCH] software/bios/sdram: flush dcache and l2 in memtest (otherwise we are partially testing the cache) --- software/bios/sdram.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/software/bios/sdram.c b/software/bios/sdram.c index b8c7262e..08f0162c 100644 --- a/software/bios/sdram.c +++ b/software/bios/sdram.c @@ -7,6 +7,7 @@ #include #include #include +#include #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