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 #if CONFIG_USE_PRINTK_IN_CAR
33 printk_debug("DRAM fill: 0x%08lx-0x%08lx\r\n", start, stop);
35 print_debug("DRAM fill: ");
36 print_debug_hex32(start);
38 print_debug_hex32(stop);
41 for(addr = start; addr < stop ; addr += 4) {
42 /* Display address being filled */
43 if (!(addr & 0xfffff)) {
44 #if CONFIG_USE_PRINTK_IN_CAR
45 printk_debug("%08lx \r", addr);
47 print_debug_hex32(addr);
51 write_phys(addr, addr);
53 /* Display final address */
54 #if CONFIG_USE_PRINTK_IN_CAR
55 printk_debug("%08lx\r\nDRAM filled\r\n", addr);
57 print_debug_hex32(addr);
58 print_debug("\r\nDRAM filled\r\n");
62 static void ram_verify(unsigned long start, unsigned long stop)
69 #if CONFIG_USE_PRINTK_IN_CAR
70 printk_debug("DRAM verify: 0x%08lx-0x%08lx\r\n", start, stop);
72 print_debug("DRAM verify: ");
73 print_debug_hex32(start);
74 print_debug_char('-');
75 print_debug_hex32(stop);
78 for(addr = start; addr < stop ; addr += 4) {
80 /* Display address being tested */
81 if (!(addr & 0xfffff)) {
82 #if CONFIG_USE_PRINTK_IN_CAR
83 printk_debug("%08lx \r", addr);
85 print_debug_hex32(addr);
89 value = read_phys(addr);
91 /* Display address with error */
92 #if CONFIG_USE_PRINTK_IN_CAR
93 printk_err("Fail: @0x%08lx Read value=0x%08lx\r\n", addr, value);
95 print_err("Fail: @0x");
96 print_err_hex32(addr);
97 print_err(" Read value=0x");
98 print_err_hex32(value);
103 #if CONFIG_USE_PRINTK_IN_CAR
104 printk_debug("Aborting.\n\r");
106 print_debug("Aborting.\n\r");
112 /* Display final address */
113 #if CONFIG_USE_PRINTK_IN_CAR
114 printk_debug("%08lx", addr);
116 print_debug_hex32(addr);
120 #if CONFIG_USE_PRINTK_IN_CAR
121 printk_debug("\r\nDRAM did _NOT_ verify!\r\n");
123 print_debug("\r\nDRAM did _NOT_ verify!\r\n");
128 #if CONFIG_USE_PRINTK_IN_CAR
129 printk_debug("\r\nDRAM range verified.\r\n");
131 print_debug("\r\nDRAM range verified.\r\n");
137 void ram_check(unsigned long start, unsigned long stop)
140 * This is much more of a "Is my DRAM properly configured?"
141 * test than a "Is my DRAM faulty?" test. Not all bits
144 #if CONFIG_USE_PRINTK_IN_CAR
145 printk_debug("Testing DRAM : %08lx - %08lx\r\n", start, stop);
147 print_debug("Testing DRAM : ");
148 print_debug_hex32(start);
150 print_debug_hex32(stop);
153 ram_fill(start, stop);
154 ram_verify(start, stop);
155 #if CONFIG_USE_PRINTK_IN_CAR
156 printk_debug("Done.\r\n");
158 print_debug("Done.\r\n");