2 static inline void ecc_off(void)
4 *(volatile int *)(INTERNAL_REG_BASE_ADDR+0x4b4) &= ~0x00200000;
7 static inline void ecc_on(void)
9 *(volatile int *)(INTERNAL_REG_BASE_ADDR+0x4b4) |= 0x00200000;
12 static int putshex(const char *buf, int len)
16 printf("%02x", buf[i]);
21 static int char_memcpy(void *d, const void *s, int len)
32 static int memory_test(char *buf)
34 const char src[][16]={
35 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
36 {0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01},
37 {0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02},
38 {0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04},
39 {0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08},
40 {0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10},
41 {0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20},
42 {0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40},
43 {0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80},
44 {0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55},
45 {0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa},
46 {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}
48 const int foo[] = {0};
51 printf("\ntest @ %d %p\n", foo[0], buf);
54 const char *s=src[i]+a;
55 int align=(unsigned)(s)&0x7;
63 printf(" [FAIL] (%p) align=%d\n", s, align);
65 s[j]==buf[j]?puts(" "):printf("%02x", (s[j])^(buf[j]));
69 printf(" [PASS] (%p) align=%d\n", s, align);
78 printf(" [FAIL] (%p) align=%d\n", s, align);
80 s[j]==buf[j]?puts(" "):printf("%02x", (s[j])^(buf[j]));
84 printf(" [PASS] (%p) align=%d\n", s, align);