13#define rand_ul() rand32()
14#define UL_ONEBITS 0xffffffff
16#define CHECKERBOARD1 0x55555555
17#define CHECKERBOARD2 0xaaaaaaaa
18#define UL_BYTE(x) ((x | x << 8 | x << 16 | x << 24))
20typedef unsigned int ul;
21typedef unsigned long long ull;
22typedef unsigned int volatile ulv;
23typedef unsigned char volatile u8v;
24typedef unsigned short volatile u16v;
47#define PROGRESSOFTEN 2500
48#define ONE 0x00000001L
58 for (i = 0; i < count; i++, p1++, p2++) {
61 "FAILURE: 0x%x != 0x%x at physical address "
77 for (j = 0; j < 16; j++) {
81 for (i = 0; i < count; i++) {
82 *p1 = ((j + i) % 2) == 0 ? (
ul) p1 : ~((
ul) p1);
88 for (i = 0; i < count; i++, p1++) {
89 if (*p1 != (((j + i) % 2) == 0 ? (
ul) p1 : ~((
ul) p1))) {
91 "FAILURE: possible bad address line at physical "
95 printk(
LOG_LEVEL_MUTE,
"address 0x%x value is 0x%x, should be 0x%x\n", p1, *p1, (((j + i) % 2) == 0 ? (
ul) p1 : ~((
ul) p1)));
113 for (i = 0; i < count; i++) {
130 for (i = 0; i < count; i++) {
143 for (i = 0; i < count; i++) {
156 for (i = 0; i < count; i++) {
169 for (i = 0; i < count; i++) {
185 for (i = 0; i < count; i++) {
198 for (i = 0; i < count; i++) {
211 for (i = 0; i < count; i++) { *p1++ = *p2++ = (i + q); }
223 for (j = 0; j < 64; j++) {
229 for (i = 0; i < count; i++) { *p1++ = *p2++ = (i % 2) == 0 ? q : ~q; }
248 for (j = 0; j < 64; j++) {
254 for (i = 0; i < count; i++) { *p1++ = *p2++ = (i % 2) == 0 ? q : ~q; }
272 for (j = 0; j < 256; j++) {
277 for (i = 0; i < count; i++) { *p1++ = *p2++ = (
ul)
UL_BYTE(j); }
295 for (j = 0; j <
UL_LEN * 2; j++) {
300 for (i = 0; i < count; i++) {
302 *p1++ = *p2++ =
ONE << j;
304 *p1++ = *p2++ =
ONE << (
UL_LEN * 2 - j - 1);
324 for (j = 0; j <
UL_LEN * 2; j++) {
329 for (i = 0; i < count; i++) {
353 for (j = 0; j <
UL_LEN * 2; j++) {
358 for (i = 0; i < count; i++) {
360 *p1++ = *p2++ = (i % 2 == 0) ? (
ONE << j) | (
ONE << (j + 2)) :
UL_ONEBITS ^ ((
ONE << j) | (
ONE << (j + 2)));
384 for (k = 0; k <
UL_LEN; k++) {
386 for (j = 0; j < 8; j++) {
392 for (i = 0; i < count; i++) { *p1++ = *p2++ = (i % 2) == 0 ? q : ~q; }
408 unsigned int b, j = 0;
412 for (attempt = 0; attempt < 2; attempt++) {
420 for (i = 0; i < count; i++) {
423 for (b = 0; b <
UL_LEN / 8; b++) { *p1++ = *t++; }
441 unsigned int b, j = 0;
445 for (attempt = 0; attempt < 2; attempt++) {
453 for (i = 0; i < count; i++) {
456 for (b = 0; b <
UL_LEN / 16; b++) { *p1++ = *t++; }
492 uint64_t bufsize, wantbytes, wantmb, halflen, count;
497 wantbytes = test_size;
498 wantmb = (wantbytes >> 20);
499 halflen = wantbytes / 2;
500 count = halflen /
sizeof(
ul);
502 bufb = (
ulv *) ((
size_t) bufa + test_size);
520 if (!
tests[i].
fp(bufa, bufb, count)) {
uint32_t time_ms(void)
Get the current time in milliseconds.
Definition timer.c:36
int test_bitspread_comparison(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:346
int test_stuck_address(ulv *bufa, size_t count)
Definition memtester.c:71
unsigned char bytes[UL_LEN/8]
Definition memtester.c:32
#define PROGRESSLEN
Definition memtester.c:46
#define UL_BYTE(x)
Definition memtester.c:18
static struct test tests[]
Definition memtester.c:470
#define CHECKERBOARD1
Definition memtester.c:16
#define ONE
Definition memtester.c:48
int compare_regions(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:52
unsigned int volatile ulv
Definition memtester.c:22
int test_walkbits1_comparison(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:317
int test_solidbits_comparison(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:215
#define UL_LEN
Definition memtester.c:15
char progress[]
Definition memtester.c:45
uint32_t rand32()
Definition memtester.c:41
int test_or_comparison(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:179
int test_mul_comparison(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:150
int test_bitflip_comparison(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:376
int test_walkbits0_comparison(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:288
#define CHECKERBOARD2
Definition memtester.c:17
int test_seqinc_comparison(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:205
#define PROGRESSOFTEN
Definition memtester.c:47
int test_and_comparison(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:192
int test_16bit_wide_random(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:437
unsigned long long ull
Definition memtester.c:21
int test_random_value(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:106
int test_checkerboard_comparison(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:240
unsigned short volatile u16v
Definition memtester.c:24
ul val
Definition memtester.c:33
unsigned int ul
Definition memtester.c:20
int test_8bit_wide_random(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:404
static int do_memtester(uint64_t start_addr, uint32_t dram_size, uint64_t test_size, uint32_t loops)
Definition memtester.c:490
int test_div_comparison(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:163
#define UL_ONEBITS
Definition memtester.c:14
#define rand_ul()
Definition memtester.c:13
unsigned char volatile u8v
Definition memtester.c:23
int test_xor_comparison(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:124
unsigned short u16s[UL_LEN/16]
Definition memtester.c:37
int test_sub_comparison(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:137
int test_blockseq_comparison(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:265
unsigned int volatile ulv
Definition memtester.c:22
char name[ANDR_BOOT_NAME_SIZE]
Definition bimage.c:76
#define NULL
Definition stddef.h:7
u64_t uint64_t
Definition stdint.h:16
u32_t uint32_t
Definition stdint.h:13
static uint32_t dram_size
Definition sys-dram.c:22
int uart_putchar(int c)
Writes a single character 'c' to the UART output.
Definition uart.c:27
void printk(int level, const char *fmt,...)
Print message to kernel log.
Definition log.c:13
#define LOG_LEVEL_MUTE
Definition log.h:21
Definition memtester.c:26
char * name
Definition memtester.c:27
int(* fp)(ulv *bufa, ulv *bufb, size_t count)
Definition memtester.c:28