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>

git-svn-id: svn://coreboot.org/repository/coreboot-v3@1014 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Mart Raudsepp 2008-11-13 17:04:11 +00:00
parent 99e68b9345
commit 6cc92990ce
2 changed files with 8 additions and 4 deletions

View file

@ -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 */

View file

@ -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;
}