]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/mach-sunxi/dram_helpers.c
Merge branch 'master' of git://git.denx.de/u-boot-mmc
[u-boot] / arch / arm / mach-sunxi / dram_helpers.c
index 9a94e1b6795ed7d131d9d7382af4cf676be8fce7..95143d19ab50fa4f86c41888fad6ee0c9ae492dd 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <asm/barriers.h>
 #include <asm/io.h>
 #include <asm/arch/dram.h>
 
@@ -30,8 +31,9 @@ bool mctl_mem_matches(u32 offset)
 {
        /* Try to write different values to RAM at two addresses */
        writel(0, CONFIG_SYS_SDRAM_BASE);
-       writel(0xaa55aa55, CONFIG_SYS_SDRAM_BASE + offset);
+       writel(0xaa55aa55, (ulong)CONFIG_SYS_SDRAM_BASE + offset);
+       dsb();
        /* Check if the same value is actually observed when reading back */
        return readl(CONFIG_SYS_SDRAM_BASE) ==
-              readl(CONFIG_SYS_SDRAM_BASE + offset);
+              readl((ulong)CONFIG_SYS_SDRAM_BASE + offset);
 }