Missed a const in my previous checkin, r3426 (trivial).
[coreboot.git] / src / ram / ramtest.c
index af77fcc3860e16a93402df300ad842b413fc40f6..3b2d741a36e95018f0d94ee8224565a4b8307569 100644 (file)
@@ -1,10 +1,3 @@
-#if defined(i786)
-#define HAVE_MOVNTI 1
-#endif
-#if defined(k8)
-#define HAVE_MOVNTI 1
-#endif
-
 static void write_phys(unsigned long addr, unsigned long value)
 {
 #if HAVE_MOVNTI
@@ -12,7 +5,9 @@ static void write_phys(unsigned long addr, unsigned long value)
                "movnti %1, (%0)"
                : /* outputs */
                : "r" (addr), "r" (value) /* inputs */
+#ifndef __GNUC__
                : /* clobbers */
+#endif
                );
 #else
        volatile unsigned long *ptr;
@@ -43,7 +38,7 @@ static void ram_fill(unsigned long start, unsigned long stop)
                /* Display address being filled */
                if (!(addr & 0xffff)) {
                        print_debug_hex32(addr);
-                       print_debug("\r");
+                       print_debug(" \r");
                }
                write_phys(addr, addr);
        };
@@ -55,6 +50,7 @@ static void ram_fill(unsigned long start, unsigned long stop)
 static void ram_verify(unsigned long start, unsigned long stop)
 {
        unsigned long addr;
+       int i = 0;
        /* 
         * Verify.
         */
@@ -68,26 +64,36 @@ static void ram_verify(unsigned long start, unsigned long stop)
                /* Display address being tested */
                if (!(addr & 0xffff)) {
                        print_debug_hex32(addr);
-                       print_debug("\r");
+                       print_debug(" \r");
                }
                value = read_phys(addr);
                if (value != addr) {
                        /* Display address with error */
+                       print_err("Fail: @0x");
                        print_err_hex32(addr);
-                       print_err_char(':');
+                       print_err(" Read value=0x");
                        print_err_hex32(value);
                        print_err("\r\n");
+                       i++;
+                       if(i>256) {
+                               print_debug("Aborting.\n\r");
+                               break;
+                       }
                }
        }
        /* Display final address */
        print_debug_hex32(addr);
-       print_debug("\r\nDRAM verified\r\n");
+       if (i) {
+               print_debug("\r\nDRAM did _NOT_ verify!\r\n");
+       }
+       else {
+               print_debug("\r\nDRAM range verified.\r\n");
+       }
 }
 
 
 void ram_check(unsigned long start, unsigned long stop)
 {
-       int result;
        /*
         * This is much more of a "Is my DRAM properly configured?"
         * test than a "Is my DRAM faulty?" test.  Not all bits