]> git.sur5r.net Git - u-boot/blobdiff - lib_ppc/board.c
SPEAr : Supporting new mach ids for spear310 and spear320
[u-boot] / lib_ppc / board.c
index 8b8ddb5340e38d0a66336b78c9c0a2417164a9dd..2889b2c2c516af21f444a54f10d0fe926bf8062c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2000-2006
+ * (C) Copyright 2000-2010
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
  * See file CREDITS for list of people who contributed to this
 #include <asm/mp.h>
 #endif
 
+#ifdef CONFIG_BITBANGMII
+#include <miiphy.h>
+#endif
+
 #ifdef CONFIG_SYS_UPDATE_FLASH_SIZE
 extern int update_flash_size (int flash_size);
 #endif
@@ -251,14 +255,12 @@ static int init_func_watchdog_reset (void)
  */
 
 init_fnc_t *init_sequence[] = {
-
-#if defined(CONFIG_BOARD_EARLY_INIT_F)
-       board_early_init_f,
-#endif
-
 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
        probecpu,
 #endif
+#if defined(CONFIG_BOARD_EARLY_INIT_F)
+       board_early_init_f,
+#endif
 #if !defined(CONFIG_8xx_CPUCLK_DEFAULT)
        get_clocks,             /* get CPU and bus clocks (etc.) */
 #if defined(CONFIG_TQM8xxL) && !defined(CONFIG_TQM866M) \
@@ -376,8 +378,9 @@ void board_init_f (ulong bootflag)
        /* compiler optimization barrier needed for GCC >= 3.4 */
        __asm__ __volatile__("": : :"memory");
 
-#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC83xx) && \
-    !defined(CONFIG_MPC85xx) && !defined(CONFIG_MPC86xx)
+#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC512X) && \
+    !defined(CONFIG_MPC83xx) && !defined(CONFIG_MPC85xx) && \
+    !defined(CONFIG_MPC86xx)
        /* Clear initial global data */
        memset ((void *) gd, 0, sizeof (gd_t));
 #endif
@@ -643,6 +646,14 @@ void board_init_r (gd_t *id, ulong dest_addr)
        /* The Malloc area is immediately below the monitor copy in DRAM */
        malloc_start = dest_addr - TOTAL_MALLOC_LEN;
 
+#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
+       /*
+        * The gd->cpu pointer is set to an address in flash before relocation.
+        * We need to update it to point to the same CPU entry in RAM.
+        */
+       gd->cpu += dest_addr - CONFIG_SYS_MONITOR_BASE;
+#endif
+
 #ifdef CONFIG_SERIAL_MULTI
        serial_initialize();
 #endif
@@ -942,6 +953,9 @@ void board_init_r (gd_t *id, ulong dest_addr)
        doc_init ();
 #endif
 
+#ifdef CONFIG_BITBANGMII
+       bb_miiphy_init();
+#endif
 #if defined(CONFIG_CMD_NET)
 #if defined(CONFIG_NET_MULTI)
        WATCHDOG_RESET ();