[wiki-lib] Change spacing with the new font...
[wikipediardware.git] / bootloader / ramtest.h
blobb91833eb1a3898695775f6a0b38149ed904568ba
1 #ifndef RAMTEST_H
2 #define RAMTEST_H
4 #define START 0x10000000
5 #define SIZE ((1024 * 1024 * 16))
7 static void ram_write(void)
9 unsigned int i;
11 for (i = 0; i < SIZE; i += 4) {
12 *(volatile unsigned int *) (START + i) = ~i;
13 if (i % 100000 == 0)
14 print(".");
17 print("\n");
20 static void ram_read(void)
22 unsigned int i;
24 for (i = 0; i < SIZE; i += 4) {
25 unsigned int v = *(volatile unsigned int *) (START + i);
26 if (~v != i) {
27 print("FAILED @");
28 print_u32(i);
29 print(" - ");
30 print_u32(v);
31 print("\n");
32 return;
35 if (i % 100000 == 0)
36 print(":");
39 print("\nPASSED\n");
42 #endif /* RAMTEST_H */