Merge with /home/wd/git/u-boot/custodian/u-boot-testing
[oweals/u-boot.git] / board / mpc8266ads / mpc8266ads.c
index d97b5c1f8d2015e1925f62d07ebcd67c3dffbec3..8f7273c41d8761d30d03ed18ed71f7cd038fa2ec 100644 (file)
@@ -46,7 +46,7 @@
  *   PSDMR_BUFCMD adds a clock
  *   0            no extra clock
  */
-#define CONFIG_PBI             PSDMR_PBI
+#define CONFIG_PBI             0
 #define PESSIMISTIC_SDRAM      0
 #define EAMUX                  0       /* EST requires EAMUX */
 #define BUFCMD                 0
@@ -232,7 +232,7 @@ void reset_phy(void)
 }
 
 
-int board_pre_init (void)
+int board_early_init_f (void)
 {
     volatile bcsr_t  *bcsr         = (bcsr_t *)CFG_BCSR;
     volatile pci_ic_t *pci_ic      = (pci_ic_t *) CFG_PCI_INT;
@@ -427,7 +427,7 @@ long int initdram(int board_type)
     bsma = ((31 - width) - 14) - ((rows > cols) ? rows : cols);
     sda10 = sdam + 2;
 #else
-    sdam = cols - 6;
+    sdam = cols + banks - 8;
     bsma = ((31 - width) - 14) - ((rows > cols) ? rows : cols);
     sda10 = sdam;
 #endif
@@ -557,9 +557,18 @@ long int initdram(int board_type)
        printf("SDRAM configuration read from SPD\n");
        printf("\tSize per side = %dMB\n", sdram_size >> 20);
        printf("\tOrganization: %d sides, %d banks, %d Columns, %d Rows, Data width = %d bits\n", chipselects, 1<<(banks), cols, rows, data_width);
-       printf("\tRefresh rate = %d, CAS latency = %d\n", psrt, caslatency);
+       printf("\tRefresh rate = %d, CAS latency = %d", psrt, caslatency);
+#if(CONFIG_PBI == 0)   /* bank-based interleaving */
+    printf(", Using Bank Based Interleave\n");
+#else
+    printf(", Using Page Based Interleave\n");
+#endif
        printf("\tTotal size: ");
 
+    /* this delay only needed for original 16MB DIMM...
+     * Not needed for any other memory configuration */
+    if ((sdram_size * chipselects) == (16 *1024 *1024))
+       udelay (250000);
     return (sdram_size * chipselects);
        /*return (16 * 1024 * 1024);*/
 }