testdram: CONFIG_SYS_DRAM_TEST
#if defined(CONFIG_SYS_DRAM_TEST) int testdram(void) { uint *pstart = (uint *) CONFIG_SYS_MEMTEST_START; uint *pend = (uint *) CONFIG_SYS_MEMTEST_END; uint *p;
printf("Testing DRAM from 0x%08x to 0x%08x\n", CONFIG_SYS_MEMTEST_START, CONFIG_SYS_MEMTEST_END);
printf("DRAM test phase 1:\n"); for (p = pstart; p < pend; p++) *p = 0xaaaaaaaa;
for (p = pstart; p < pend; p++) { if (*p != 0xaaaaaaaa) { printf ("DRAM test fails at: %08x\n", (uint) p); return 1; } }
printf("DRAM test phase 2:\n"); for (p = pstart; p < pend; p++) *p = 0x55555555;
for (p = pstart; p < pend; p++) { if (*p != 0x55555555) { printf ("DRAM test fails at: %08x\n", (uint) p); return 1; } }
printf("DRAM test passed.\n"); return 0; } #endif