uboot下init_sequence_f函数之testdram

来源:互联网 发布:千牛和淘宝助理的区别 编辑:程序博客网 时间:2024/06/05 20:54
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

0 0