[coreboot-gerrit] Patch set updated for coreboot: 43904e7 ramtest.c: Add silent ram_check

Alexandru Gagniuc (mr.nuke.me@gmail.com) gerrit at coreboot.org
Mon Jun 10 18:31:14 CEST 2013


Alexandru Gagniuc (mr.nuke.me at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3416

-gerrit

commit 43904e73b65e22995d42a23c7f4a1c89143d5e78
Author: Alexandru Gagniuc <mr.nuke.me at gmail.com>
Date:   Sat Jun 8 11:32:36 2013 -0500

    ramtest.c: Add silent ram_check
    
    In some cases, we want a ram_check that does not die and does not
    clobber the terminal with useless output that slows us down a lot.
    Usage examples include Checking if the RAM is up at the start of
    raminit, or checking if each rank is accessible as it is being
    initialized.
    
    As with all other ram_checks, this is more of a "Is my DRAM properly
    configured?" test, which is exactly what we want for something to use
    during memory initialization.
    
    Change-Id: I95d8d9a2ce1e29c74ef97b90aba0773f88ae832c
    Signed-off-by: Alexandru Gagniuc <mr.nuke.me at gmail.com>
---
 src/include/lib.h |  1 +
 src/lib/ramtest.c | 25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/src/include/lib.h b/src/include/lib.h
index 1f71d35..2f27149 100644
--- a/src/include/lib.h
+++ b/src/include/lib.h
@@ -37,6 +37,7 @@ void move_gdt(void);
 /* Defined in src/lib/ramtest.c */
 void ram_check(unsigned long start, unsigned long stop);
 int ram_check_nodie(unsigned long start, unsigned long stop);
+int ram_check_noprint_nodie(unsigned long start, unsigned long stop);
 void quick_ram_check(void);
 
 /* Defined in src/lib/stack.c */
diff --git a/src/lib/ramtest.c b/src/lib/ramtest.c
index 3457210..e9173fa 100644
--- a/src/lib/ramtest.c
+++ b/src/lib/ramtest.c
@@ -223,6 +223,31 @@ int ram_check_nodie(unsigned long start, unsigned long stop)
 	return ret;
 }
 
+int ram_check_noprint_nodie(unsigned long start, unsigned long stop)
+{
+	unsigned long addr, value, value2;
+	unsigned short int idx;
+	unsigned char failed, failures;
+
+	for (idx=0; idx<0x400; idx+=4) {
+		test_pattern(idx, &addr, &value);
+		write_phys(start + addr, value);
+	}
+
+	/* Make sure we don't read before we wrote */
+	phys_memory_barrier();
+
+	failures = 0;
+	for (idx=0; idx<0x400; idx+=4) {
+		test_pattern(idx, &addr, &value);
+		value2 = read_phys(start + addr);
+
+		failed = (value2 != value);
+		failures |= failed;
+	}
+	return failures;
+}
+
 void quick_ram_check(void)
 {
 	int fail = 0;



More information about the coreboot-gerrit mailing list