Lines Matching +full:long +full:- +full:ram +full:- +full:code
1 // SPDX-License-Identifier: GPL-2.0+
44 * ---------------
77 * ------------------
79 * hooked up to the RAM work properly. If there is an address line
89 * In the actual code, we start with address sizeof(ulong) since our
95 * 0000 <- base
96 * 0001 <- test 1
97 * 0010 <- test 2
98 * 0100 <- test 3
99 * 1000 <- test 4
101 * 0010 <- base
102 * 0011 <- test 1
103 * 0000 <- (below the base address, skipped)
104 * 0110 <- test 2
105 * 1010 <- test 3
112 * Memory tests 1-4:
113 * -----------------
114 * These tests verify RAM using sequential writes and reads
115 * to/from RAM. There are several test cases that use different patterns to
116 * verify RAM. Each test case fills a region of RAM with one pattern and
124 * 2) bit-flip pattern ((1 << (offset % 32))
129 * regions of RAM around each 1Mb boundary. For example, for 64Mb
130 * RAM the following areas are verified: 0x00000000-0x00000800,
131 * 0x000ff800-0x00100800, 0x001ff800-0x00200800, ..., 0x03fff800-
132 * 0x04000000. If the test is run in slow-test mode, it verifies
133 * the whole RAM.
168 * For other processors, let the compiler generate the best code it can.
170 static void move64(const unsigned long long *src, unsigned long long *dest) in move64()
177 * (which presumably works) and the tests write them to RAM which may
184 const static unsigned long long pattern[] = {
198 const unsigned long long otherpattern = 0x0123456789abcdefULL;
201 static int memory_post_dataline(unsigned long long * pmem) in memory_post_dataline()
203 unsigned long long temp64 = 0; in memory_post_dataline()
213 * may float long enough to read back what we wrote. in memory_post_dataline()
215 move64(&otherpattern, pmem--); in memory_post_dataline()
232 ret = -1; in memory_post_dataline()
260 post_log("Memory (address line) error at %08x<->%08x, " in memory_post_addrline()
263 ret = -1; in memory_post_addrline()
270 static int memory_post_test1(unsigned long start, in memory_post_test1()
271 unsigned long size, in memory_post_test1()
272 unsigned long val) in memory_post_test1()
274 unsigned long i; in memory_post_test1()
292 ret = -1; in memory_post_test1()
302 static int memory_post_test2(unsigned long start, unsigned long size) in memory_post_test2()
304 unsigned long i; in memory_post_test2()
322 ret = -1; in memory_post_test2()
332 static int memory_post_test3(unsigned long start, unsigned long size) in memory_post_test3()
334 unsigned long i; in memory_post_test3()
352 ret = -1; in memory_post_test3()
362 static int memory_post_test4(unsigned long start, unsigned long size) in memory_post_test4()
364 unsigned long i; in memory_post_test4()
382 ret = -1; in memory_post_test4()
392 static int memory_post_test_lines(unsigned long start, unsigned long size) in memory_post_test_lines()
396 ret = memory_post_dataline((unsigned long long *)start); in memory_post_test_lines()
403 ret = memory_post_addrline((ulong *)(start+size-8), in memory_post_test_lines()
410 static int memory_post_test_patterns(unsigned long start, unsigned long size) in memory_post_test_patterns()
438 static int memory_post_test_regions(unsigned long start, unsigned long size) in memory_post_test_regions()
440 unsigned long i; in memory_post_test_regions()
455 static int memory_post_tests(unsigned long start, unsigned long size) in memory_post_tests()
472 bd_t *bd = gd->bd; in arch_memory_test_prepare()
475 *size = (gd->ram_size >= 256 << 20 ? in arch_memory_test_prepare()
476 256 << 20 : gd->ram_size) - (1 << 20); in arch_memory_test_prepare()
480 *size = (ulong)bd - *vstart; in arch_memory_test_prepare()