]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ColdFire:Add mb for 5253 dram initialization
authorJason Jin <Jason.jin@freescale.com>
Mon, 18 Apr 2011 09:54:04 +0000 (17:54 +0800)
committerjason <jason@jason-ThinkPad-T61.(none)>
Sun, 4 Sep 2011 14:46:55 +0000 (22:46 +0800)
The dram initialization sequence should be in order.
This patch add mb for the dram intialization code to make
sure the compiler do not disorder the code.

Signed-off-by: Jason Jin <Jason.jin@freescale.com>
arch/m68k/include/asm/io.h
board/freescale/m5253demo/m5253demo.c

index 531f420336cd447b6781f6a27ae3e9965c010e5c..d86eaf95eac8c84875b641a9e33f002eb2cbb53a 100644 (file)
@@ -81,6 +81,8 @@
 #define outl(val, port)                out_le32((u32 *)((port)+_IO_BASE), (val))
 #endif
 
+#define mb() __asm__ __volatile__ ("" : : : "memory")
+
 extern inline void _insb(volatile u8 * port, void *buf, int ns)
 {
        u8 *data = (u8 *) buf;
index 4772074d81fb94e55672804ecd2235c492f5b33d..8ffb2cc0447d9df58cf48523619f87af7687ef59 100644 (file)
@@ -27,6 +27,7 @@
 #include <common.h>
 #include <asm/immap.h>
 #include <netdev.h>
+#include <asm/io.h>
 
 int checkboard(void)
 {
@@ -63,10 +64,12 @@ phys_size_t initdram(int board_type)
                __asm__("nop");
 
                mbar_writeLong(MCFSIM_DACR0, 0x0000322c);
+               mb();
                __asm__("nop");
 
                /* Write to this block to initiate precharge */
                *(u32 *) (CONFIG_SYS_SDRAM_BASE) = 0xa5a5a5a5;
+               mb();
                __asm__("nop");
 
                /* Set RE bit in DACR */
@@ -83,6 +86,7 @@ phys_size_t initdram(int board_type)
                __asm__("nop");
 
                *(u32 *) (CONFIG_SYS_SDRAM_BASE + 0x800) = 0xa5a5a5a5;
+               mb();
        }
 
        return dramsize;