]> git.sur5r.net Git - u-boot/blobdiff - post/memory.c
Merge branch 'i2c'
[u-boot] / post / memory.c
index 8b4263161c36838fdfe740637e9e0481ce6ed643..a2c088bad8d5f3cf274b4e62085e9b664f96cedd 100644 (file)
 
 #if CONFIG_POST & CFG_POST_MEMORY
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * Define INJECT_*_ERRORS for testing error detection in the presence of
  * _good_ hardware.
@@ -206,24 +208,25 @@ static void move64(unsigned long long *src, unsigned long long *dest)
  *
  */
 const static unsigned long long pattern[] = {
-    0xaaaaaaaaaaaaaaaa,
-    0xcccccccccccccccc,
-    0xf0f0f0f0f0f0f0f0,
-    0xff00ff00ff00ff00,
-    0xffff0000ffff0000,
-    0xffffffff00000000,
-    0x00000000ffffffff,
-    0x0000ffff0000ffff,
-    0x00ff00ff00ff00ff,
-    0x0f0f0f0f0f0f0f0f,
-    0x3333333333333333,
-    0x5555555555555555};
-const unsigned long long otherpattern = 0x0123456789abcdef;
+       0xaaaaaaaaaaaaaaaaULL,
+       0xccccccccccccccccULL,
+       0xf0f0f0f0f0f0f0f0ULL,
+       0xff00ff00ff00ff00ULL,
+       0xffff0000ffff0000ULL,
+       0xffffffff00000000ULL,
+       0x00000000ffffffffULL,
+       0x0000ffff0000ffffULL,
+       0x00ff00ff00ff00ffULL,
+       0x0f0f0f0f0f0f0f0fULL,
+       0x3333333333333333ULL,
+       0x5555555555555555ULL
+};
+const unsigned long long otherpattern = 0x0123456789abcdefULL;
 
 
 static int memory_post_dataline(unsigned long long * pmem)
 {
-       unsigned long long temp64;
+       unsigned long long temp64 = 0;
        int num_patterns = sizeof(pattern)/ sizeof(pattern[0]);
        int i;
        unsigned int hi, lo, pathi, patlo;
@@ -417,14 +420,14 @@ static int memory_post_tests (unsigned long start, unsigned long size)
        int ret = 0;
 
        if (ret == 0)
-               ret = memory_post_dataline ((long long *)start);
+               ret = memory_post_dataline ((unsigned long long *)start);
        WATCHDOG_RESET ();
        if (ret == 0)
-               ret = memory_post_addrline ((long *)start, (long *)start, size);
+               ret = memory_post_addrline ((ulong *)start, (ulong *)start, size);
        WATCHDOG_RESET ();
        if (ret == 0)
-               ret = memory_post_addrline ((long *)(start + size - 8),
-                                           (long *)start, size);
+               ret = memory_post_addrline ((ulong *)(start + size - 8),
+                                           (ulong *)start, size);
        WATCHDOG_RESET ();
        if (ret == 0)
                ret = memory_post_test1 (start, size, 0x00000000);
@@ -454,7 +457,6 @@ static int memory_post_tests (unsigned long start, unsigned long size)
 int memory_post_test (int flags)
 {
        int ret = 0;
-       DECLARE_GLOBAL_DATA_PTR;
        bd_t *bd = gd->bd;
        unsigned long memsize = (bd->bi_memsize >= 256 << 20 ?
                                 256 << 20 : bd->bi_memsize) - (1 << 20);