Merge: Add support for AMCC 440SPe CPU based eval board (Yucca).
[platform/kernel/u-boot.git] / lib_ppc / board.c
index c3ce33f..dbb752e 100644 (file)
@@ -90,6 +90,7 @@ extern flash_info_t flash_info[];
 #endif
 
 #include <environment.h>
+
 DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CFG_ENV_IS_EMBEDDED)
@@ -197,6 +198,10 @@ static int init_baudrate (void)
 
 /***********************************************************************/
 
+#ifdef CONFIG_ADD_RAM_INFO
+void board_add_ram_info(int);
+#endif
+
 static int init_func_ram (void)
 {
 #ifdef CONFIG_BOARD_TYPES
@@ -207,7 +212,11 @@ static int init_func_ram (void)
        puts ("DRAM:  ");
 
        if ((gd->ram_size = initdram (board_type)) > 0) {
-               print_size (gd->ram_size, "\n");
+               print_size (gd->ram_size, "");
+#ifdef CONFIG_ADD_RAM_INFO
+               board_add_ram_info(0);
+#endif
+               putc('\n');
                return (0);
        }
        puts (failed);
@@ -573,7 +582,6 @@ void board_init_f (ulong bootflag)
        /* NOTREACHED - relocate_code() does not return */
 }
 
-
 /************************************************************************
  *
  * This is the next part if the initialization sequence: we are now
@@ -583,7 +591,6 @@ void board_init_f (ulong bootflag)
  *
  ************************************************************************
  */
-
 void board_init_r (gd_t *id, ulong dest_addr)
 {
        cmd_tbl_t *cmdtp;
@@ -603,6 +610,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
        bd = gd->bd;
 
        gd->flags |= GD_FLG_RELOC;      /* tell others: relocation done */
+       gd->reloc_off = dest_addr - CFG_MONITOR_BASE;
+
+#ifdef CONFIG_SERIAL_MULTI
+       serial_initialize();
+#endif
 
        debug ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
 
@@ -612,14 +624,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
        board_early_init_r ();
 #endif
 
-       gd->reloc_off = dest_addr - CFG_MONITOR_BASE;
-
        monitor_flash_len = (ulong)&__init_end - dest_addr;
 
-#ifdef CONFIG_SERIAL_MULTI
-       serial_initialize();
-#endif
-
        /*
         * We have to relocate the command table manually
         */
@@ -664,7 +670,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
        WATCHDOG_RESET();
 
-#if defined(CONFIG_IP860) || defined(CONFIG_PCU_E) || defined (CONFIG_FLAGADM)
+#if defined(CONFIG_IP860) || defined(CONFIG_PCU_E) || \
+       defined (CONFIG_FLAGADM) || defined(CONFIG_MPC83XX)
        icache_enable ();       /* it's time to enable the instruction cache */
 #endif
 
@@ -899,27 +906,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
                hermes_start_lxt980 ((int) bd->bi_ethspeed);
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && ( \
-    defined(CONFIG_CCM)                || \
-    defined(CONFIG_ELPT860)    || \
-    defined(CONFIG_EP8260)     || \
-    defined(CONFIG_IP860)      || \
-    defined(CONFIG_IVML24)     || \
-    defined(CONFIG_IVMS8)      || \
-    defined(CONFIG_MPC8260ADS) || \
-    defined(CONFIG_MPC8266ADS) || \
-    defined(CONFIG_MPC8560ADS) || \
-    defined(CONFIG_PCU_E)      || \
-    defined(CONFIG_RPXSUPER)   || \
-    defined(CONFIG_STXGP3)     || \
-    defined(CONFIG_SPD823TS)   || \
-    defined(CONFIG_RESET_PHY_R)        )
-
-       WATCHDOG_RESET ();
-       debug ("Reset Ethernet PHY\n");
-       reset_phy ();
-#endif
-
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
        WATCHDOG_RESET ();
        puts ("KGDB:  ");
@@ -978,12 +964,35 @@ void board_init_r (gd_t *id, ulong dest_addr)
        nand_init();            /* go init the NAND */
 #endif
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI)
+#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_NET_MULTI)
        WATCHDOG_RESET ();
        puts ("Net:   ");
+#endif
        eth_initialize (bd);
 #endif
 
+#if (CONFIG_COMMANDS & CFG_CMD_NET) && ( \
+    defined(CONFIG_CCM)                || \
+    defined(CONFIG_ELPT860)    || \
+    defined(CONFIG_EP8260)     || \
+    defined(CONFIG_IP860)      || \
+    defined(CONFIG_IVML24)     || \
+    defined(CONFIG_IVMS8)      || \
+    defined(CONFIG_MPC8260ADS) || \
+    defined(CONFIG_MPC8266ADS) || \
+    defined(CONFIG_MPC8560ADS) || \
+    defined(CONFIG_PCU_E)      || \
+    defined(CONFIG_RPXSUPER)   || \
+    defined(CONFIG_STXGP3)     || \
+    defined(CONFIG_SPD823TS)   || \
+    defined(CONFIG_RESET_PHY_R)        )
+
+       WATCHDOG_RESET ();
+       debug ("Reset Ethernet PHY\n");
+       reset_phy ();
+#endif
+
 #ifdef CONFIG_POST
        post_run (NULL, POST_RAM | post_bootmode_get(0));
 #endif
@@ -1114,8 +1123,6 @@ static inline void mdm_readline(char *buf, int bufsiz)
        }
 }
 
-
-
 extern void  dbg(const char *fmt, ...);
 int mdm_init (void)
 {