1 static void write_phys(unsigned long addr, unsigned long value)
7 : "r" (addr), "r" (value) /* inputs */
13 volatile unsigned long *ptr;
19 static unsigned long read_phys(unsigned long addr)
21 volatile unsigned long *ptr;
26 static void ram_fill(unsigned long start, unsigned long stop)
32 print_debug("DRAM fill: ");
33 print_debug_hex32(start);
35 print_debug_hex32(stop);
37 for(addr = start; addr < stop ; addr += 4) {
38 /* Display address being filled */
39 if (!(addr & 0xffff)) {
40 print_debug_hex32(addr);
43 write_phys(addr, addr);
45 /* Display final address */
46 print_debug_hex32(addr);
47 print_debug("\r\nDRAM filled\r\n");
50 static void ram_verify(unsigned long start, unsigned long stop)
57 print_debug("DRAM verify: ");
58 print_debug_hex32(start);
59 print_debug_char('-');
60 print_debug_hex32(stop);
62 for(addr = start; addr < stop ; addr += 4) {
64 /* Display address being tested */
65 if (!(addr & 0xffff)) {
66 print_debug_hex32(addr);
69 value = read_phys(addr);
71 /* Display address with error */
72 print_err_hex32(addr);
74 print_err_hex32(value);
80 /* Display final address */
81 print_debug_hex32(addr);
82 print_debug("\r\nDRAM verified\r\n");
86 void ram_check(unsigned long start, unsigned long stop)
90 * This is much more of a "Is my DRAM properly configured?"
91 * test than a "Is my DRAM faulty?" test. Not all bits
94 print_debug("Testing DRAM : ");
95 print_debug_hex32(start);
97 print_debug_hex32(stop);
99 ram_fill(start, stop);
100 ram_verify(start, stop);
101 print_debug("Done.\r\n");