]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/motionpro/motionpro.c
Change initdram() return type to phys_size_t
[karo-tx-uboot.git] / board / motionpro / motionpro.c
index 6eb5fe9cfc9950a914e9ebfad3d274a9cc701e6a..3b340622266f5f2df8caf57e1cc2fdf69b114292 100644 (file)
@@ -29,9 +29,7 @@
 #include <common.h>
 #include <mpc5xxx.h>
 #include <miiphy.h>
-#if defined(CONFIG_OF_FLAT_TREE)
-#include <ft_build.h>
-#endif
+#include <libfdt.h>
 
 #if defined(CONFIG_STATUS_LED)
 #include <status_led.h>
@@ -134,12 +132,18 @@ static void sdram_start(int hi_addr)
 /*
  * Initalize SDRAM - configure SDRAM controller, detect memory size.
  */
-long int initdram(int board_type)
+phys_size_t initdram(int board_type)
 {
        ulong dramsize = 0;
 #ifndef CFG_RAMBOOT
        ulong test1, test2;
 
+       /* According to AN3221 (MPC5200B SDRAM Initialization and
+        * Configuration), the SDelay register must be written a value of
+        * 0x00000004 as the first step of the SDRAM contorller configuration.
+        */
+       *(vu_long *)MPC5XXX_SDRAM_SDELAY = 0x04;
+
        /* configure SDRAM start/end for detection */
        *(vu_long *)MPC5XXX_SDRAM_CS0CFG = 0x0000001e; /* 2G at 0x0 */
        *(vu_long *)MPC5XXX_SDRAM_CS1CFG = 0x80000000; /* disabled */
@@ -196,12 +200,12 @@ int checkboard(void)
 }
 
 
-#if defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP)
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 void ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 }
-#endif /* defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) */
+#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
 
 
 #if defined(CONFIG_STATUS_LED)