soc/software/libbase: limit number of errors printed when using MEMTEST_*_DEBUG
This commit is contained in:
parent
b90d0bd1f7
commit
d610c9da44
|
@ -11,6 +11,11 @@
|
|||
//#define MEMTEST_DATA_DEBUG
|
||||
//#define MEMTEST_ADDR_DEBUG
|
||||
|
||||
// Limits the number of errors printed, so that we can still access bios console
|
||||
#ifndef MEMTEST_DEBUG_MAX_ERRORS
|
||||
#define MEMTEST_DEBUG_MAX_ERRORS 400
|
||||
#endif
|
||||
|
||||
#define KIB 1024
|
||||
#define MIB (KIB*1024)
|
||||
#define GIB (MIB*1024)
|
||||
|
@ -85,6 +90,7 @@ int memtest_bus(unsigned int *addr, unsigned long size)
|
|||
if(rdata != ONEZERO) {
|
||||
errors++;
|
||||
#ifdef MEMTEST_BUS_DEBUG
|
||||
if (MEMTEST_DEBUG_MAX_ERRORS < 0 || errors <= MEMTEST_DEBUG_MAX_ERRORS)
|
||||
printf("memtest_bus error @ %p: 0x%08x vs 0x%08x\n", addr + i, rdata, ONEZERO);
|
||||
#endif
|
||||
}
|
||||
|
@ -105,6 +111,7 @@ int memtest_bus(unsigned int *addr, unsigned long size)
|
|||
if(rdata != ZEROONE) {
|
||||
errors++;
|
||||
#ifdef MEMTEST_BUS_DEBUG
|
||||
if (MEMTEST_DEBUG_MAX_ERRORS < 0 || errors <= MEMTEST_DEBUG_MAX_ERRORS)
|
||||
printf("memtest_bus error @ %p:: 0x%08x vs 0x%08x\n", addr + i, rdata, ZEROONE);
|
||||
#endif
|
||||
}
|
||||
|
@ -141,6 +148,7 @@ int memtest_addr(unsigned int *addr, unsigned long size, int random)
|
|||
if(rdata != i) {
|
||||
errors++;
|
||||
#ifdef MEMTEST_ADDR_DEBUG
|
||||
if (MEMTEST_DEBUG_MAX_ERRORS < 0 || errors <= MEMTEST_DEBUG_MAX_ERRORS)
|
||||
printf("memtest_addr error @ %p: 0x%08x vs 0x%08x\n", addr + i, rdata, i);
|
||||
#endif
|
||||
}
|
||||
|
@ -213,6 +221,7 @@ int memtest_data(unsigned int *addr, unsigned long size, int random, struct memt
|
|||
return errors;
|
||||
}
|
||||
#ifdef MEMTEST_DATA_DEBUG
|
||||
if (MEMTEST_DEBUG_MAX_ERRORS < 0 || errors <= MEMTEST_DEBUG_MAX_ERRORS)
|
||||
printf("memtest_data error @ %p: 0x%08x vs 0x%08x\n", addr + i, rdata, seed_32);
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue