1 indent: Standard input:49: Warning:old style assignment ambiguity in "=*". Assuming "= *"
6 * See file CREDITS for list of people who contributed to this
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 static inline void ecc_off (void)
28 *(volatile int *) (INTERNAL_REG_BASE_ADDR + 0x4b4) &= ~0x00200000;
31 static inline void ecc_on (void)
33 *(volatile int *) (INTERNAL_REG_BASE_ADDR + 0x4b4) |= 0x00200000;
36 static int putshex (const char *buf, int len)
40 for (i = 0; i < len; i++) {
41 printf ("%02x", buf[i]);
46 static int char_memcpy (void *d, const void *s, int len)
52 for (i = 0; i < len; i++) {
58 static int memory_test (char *buf)
60 const char src[][16] = {
61 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
62 {0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
63 0x01, 0x01, 0x01, 0x01, 0x01, 0x01},
64 {0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
65 0x02, 0x02, 0x02, 0x02, 0x02, 0x02},
66 {0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
67 0x04, 0x04, 0x04, 0x04, 0x04, 0x04},
68 {0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
69 0x08, 0x08, 0x08, 0x08, 0x08, 0x08},
70 {0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
71 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
72 {0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
73 0x20, 0x20, 0x20, 0x20, 0x20, 0x20},
74 {0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
75 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
76 {0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
77 0x80, 0x80, 0x80, 0x80, 0x80, 0x80},
78 {0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
79 0x55, 0x55, 0x55, 0x55, 0x55, 0x55},
80 {0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
81 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa},
82 {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
83 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
85 const int foo[] = { 0 };
88 printf ("\ntest @ %d %p\n", foo[0], buf);
89 for (i = 0; i < 12; i++) {
90 for (a = 0; a < 8; a++) {
91 const char *s = src[i] + a;
92 int align = (unsigned) (s) & 0x7;
98 if (memcmp (buf, s, 8)) {
101 printf (" [FAIL] (%p) align=%d\n", s, align);
102 for (j = 0; j < 8; j++) {
103 s[j] == buf[j] ? puts (" ") :
109 printf (" [PASS] (%p) align=%d\n", s, align);
112 char_memcpy (buf, s, 8);
115 if (memcmp (buf, s, 8)) {
118 printf (" [FAIL] (%p) align=%d\n", s, align);
119 for (j = 0; j < 8; j++) {
120 s[j] == buf[j] ? puts (" ") :
126 printf (" [PASS] (%p) align=%d\n", s, align);