]> git.sur5r.net Git - u-boot/blobdiff - board/freescale/mpc8560ads/mpc8560ads.c
Merge branch 'master' of ssh://10.10.0.7/home/wd/git/u-boot/master
[u-boot] / board / freescale / mpc8560ads / mpc8560ads.c
index bb7f11bcc8a94f5036cfc7d2713cdd59c3bf5fb0..851fc5706a067e81c1386b39275267732de22c22 100644 (file)
 #include <common.h>
 #include <pci.h>
 #include <asm/processor.h>
+#include <asm/mmu.h>
 #include <asm/immap_85xx.h>
+#include <asm/fsl_ddr_sdram.h>
 #include <ioports.h>
-#include <spd.h>
+#include <spd_sdram.h>
 #include <miiphy.h>
 #include <libfdt.h>
 #include <fdt_support.h>
@@ -39,7 +41,6 @@
 extern void ddr_enable_ecc(unsigned int dram_size);
 #endif
 
-extern long int spd_sdram(void);
 
 void local_bus_init(void);
 void sdram_init(void);
@@ -213,12 +214,6 @@ typedef struct bcsr_ {
        volatile unsigned char bcsr5;
 } bcsr_t;
 
-
-int board_early_init_f (void)
-{
-    return 0;
-}
-
 void reset_phy (void)
 {
 #if defined(CONFIG_ETHER_ON_FCC) /* avoid compile warnings for now */
@@ -271,11 +266,10 @@ int checkboard (void)
 }
 
 
-long int
+phys_size_t
 initdram(int board_type)
 {
        long dram_size = 0;
-       extern long spd_sdram (void);
 
        puts("Initializing\n");
 
@@ -293,10 +287,13 @@ initdram(int board_type)
        }
 #endif
 
-#if defined(CONFIG_SPD_EEPROM)
-       dram_size = spd_sdram ();
+#ifdef CONFIG_SPD_EEPROM
+       dram_size = fsl_ddr_sdram();
+       dram_size = setup_ddr_tlbs(dram_size / 0x100000);
+
+       dram_size *= 0x100000;
 #else
-       dram_size = fixed_sdram ();
+       dram_size = fixed_sdram();
 #endif
 
 #if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
@@ -435,42 +432,6 @@ sdram_init(void)
        udelay(100);
 }
 
-
-#if defined(CFG_DRAM_TEST)
-int testdram (void)
-{
-       uint *pstart = (uint *) CFG_MEMTEST_START;
-       uint *pend = (uint *) CFG_MEMTEST_END;
-       uint *p;
-
-       printf("SDRAM test phase 1:\n");
-       for (p = pstart; p < pend; p++)
-               *p = 0xaaaaaaaa;
-
-       for (p = pstart; p < pend; p++) {
-               if (*p != 0xaaaaaaaa) {
-                       printf ("SDRAM test fails at: %08x\n", (uint) p);
-                       return 1;
-               }
-       }
-
-       printf("SDRAM test phase 2:\n");
-       for (p = pstart; p < pend; p++)
-               *p = 0x55555555;
-
-       for (p = pstart; p < pend; p++) {
-               if (*p != 0x55555555) {
-                       printf ("SDRAM test fails at: %08x\n", (uint) p);
-                       return 1;
-               }
-       }
-
-       printf("SDRAM test passed.\n");
-       return 0;
-}
-#endif
-
-
 #if !defined(CONFIG_SPD_EEPROM)
 /*************************************************************************
  *  fixed sdram init -- doesn't use serial presence detect.