Author: mraudsepp Date: 2008-11-13 18:04:11 +0100 (Thu, 13 Nov 2008) New Revision: 1014
Modified: coreboot-v3/include/lib.h coreboot-v3/lib/ramtest.c Log: Return the count of failures from ram_check.
Will be necessary for DBE61 automatic memory size selection.
Signed-off-by: Mart Raudsepp mart.raudsepp@artecdesign.ee Acked-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Modified: coreboot-v3/include/lib.h =================================================================== --- coreboot-v3/include/lib.h 2008-11-13 01:53:55 UTC (rev 1013) +++ coreboot-v3/include/lib.h 2008-11-13 17:04:11 UTC (rev 1014) @@ -50,6 +50,6 @@ 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 */
Modified: coreboot-v3/lib/ramtest.c =================================================================== --- coreboot-v3/lib/ramtest.c 2008-11-13 01:53:55 UTC (rev 1013) +++ coreboot-v3/lib/ramtest.c 2008-11-13 17:04:11 UTC (rev 1014) @@ -84,7 +84,7 @@ * @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 @@
/* Print whether or not the verify failed. */ printk(BIOS_DEBUG, "\nDRAM range %sverified.", i ? "_NOT_ " : ""); + return i; }
/** @@ -123,11 +124,14 @@ * * @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; }