sofware/memtest: use MAIN_RAM_SIZE from mem.h
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 25 Mar 2015 18:00:07 +0000 (19:00 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 25 Mar 2015 18:00:07 +0000 (19:00 +0100)
software/memtest/main.c

index 8ac178bcbea53a7f5fc85c9151caea6fd66c5064..a52ddbac2e800c24b0a1e46fa729d9c805266870 100644 (file)
@@ -5,6 +5,7 @@
 #include <uart.h>
 #include <time.h>
 #include <generated/csr.h>
+#include <generated/mem.h>
 #include <hw/flags.h>
 #include <console.h>
 #include <system.h>
@@ -31,7 +32,7 @@ static void membw_service(void)
 
 static void memtest_service(void)
 {
-       static unsigned int test_buffer[64*1024*1024/4] __attribute__((aligned(16)));
+       static unsigned int test_buffer[(MAIN_RAM_SIZE/2)/4] __attribute__((aligned(16)));
        static unsigned char reading;
        static unsigned int err, total_err;
 #ifdef DEBUG