From 6cc92990ce460dc681decea48f95845f796f6d09 Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Thu, 13 Nov 2008 17:04:11 +0000 Subject: [PATCH] Return the count of failures from ram_check. Will be necessary for DBE61 automatic memory size selection. Signed-off-by: Mart Raudsepp Acked-by: Carl-Daniel Hailfinger git-svn-id: svn://coreboot.org/repository/coreboot-v3@1014 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- include/lib.h | 2 +- lib/ramtest.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/lib.h b/include/lib.h index 31c685daaa..2132b2f413 100644 --- a/include/lib.h +++ b/include/lib.h @@ -50,6 +50,6 @@ void beep_short(void); void beep_long(void); /* Optional ramtest. */ -void ram_check(unsigned long start, unsigned long stop); +int ram_check(unsigned long start, unsigned long stop); #endif /* LIB_H */ diff --git a/lib/ramtest.c b/lib/ramtest.c index 8a0f4b1ba7..02a4bdb171 100644 --- a/lib/ramtest.c +++ b/lib/ramtest.c @@ -84,7 +84,7 @@ static void ram_fill(unsigned long start, unsigned long stop) * @param start The beginning of the RAM area. * @param stop The end of the RAM area. */ -static void ram_verify(unsigned long start, unsigned long stop) +static int ram_verify(unsigned long start, unsigned long stop) { unsigned long addr, value; int i = 0; @@ -112,6 +112,7 @@ static void ram_verify(unsigned long start, unsigned long stop) /* Print whether or not the verify failed. */ printk(BIOS_DEBUG, "\nDRAM range %sverified.", i ? "_NOT_ " : ""); + return i; } /** @@ -123,11 +124,14 @@ static void ram_verify(unsigned long start, unsigned long stop) * * @param start The beginning of the RAM area. * @param stop The end of the RAM area. + * @return verify failure count */ -void ram_check(unsigned long start, unsigned long stop) +int ram_check(unsigned long start, unsigned long stop) { + int result; printk(BIOS_DEBUG, "Testing DRAM: %lx-%lx\n", start, stop); ram_fill(start, stop); - ram_verify(start, stop); + result = ram_verify(start, stop); printk(BIOS_DEBUG, "Done.\n"); + return result; }