[new uImage] ppc: Re-order ramdisk/fdt handling sequence
[platform/kernel/u-boot.git] / lib_ppc / board.c
index c87d46c..45d1328 100644 (file)
@@ -87,6 +87,9 @@ void doc_init (void);
     defined(CONFIG_SOFT_I2C)
 #include <i2c.h>
 #endif
+#if defined(CONFIG_HARD_SPI)
+#include <spi.h>
+#endif
 #if defined(CONFIG_CMD_NAND)
 void nand_init (void);
 #endif
@@ -209,9 +212,12 @@ static int init_baudrate (void)
 
 /***********************************************************************/
 
-#ifdef CONFIG_ADD_RAM_INFO
-void board_add_ram_info(int);
-#endif
+void __board_add_ram_info(int use_default)
+{
+       /* please define platform specific board_add_ram_info() */
+}
+void board_add_ram_info(int) __attribute__((weak, alias("__board_add_ram_info")));
+
 
 static int init_func_ram (void)
 {
@@ -224,9 +230,7 @@ static int init_func_ram (void)
 
        if ((gd->ram_size = initdram (board_type)) > 0) {
                print_size (gd->ram_size, "");
-#ifdef CONFIG_ADD_RAM_INFO
                board_add_ram_info(0);
-#endif
                putc('\n');
                return (0);
        }
@@ -246,6 +250,16 @@ static int init_func_i2c (void)
 }
 #endif
 
+#if defined(CONFIG_HARD_SPI)
+static int init_func_spi (void)
+{
+       puts ("SPI:   ");
+       spi_init ();
+       puts ("ready\n");
+       return (0);
+}
+#endif
+
 /***********************************************************************/
 
 #if defined(CONFIG_WATCHDOG)
@@ -328,6 +342,9 @@ init_fnc_t *init_sequence[] = {
 #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
        init_func_i2c,
 #endif
+#if defined(CONFIG_HARD_SPI)
+       init_func_spi,
+#endif
 #if defined(CONFIG_DTT)                /* Digital Thermometers and Thermostats */
        dtt_init,
 #endif
@@ -554,6 +571,9 @@ void board_init_f (ulong bootflag)
        bd->bi_sccfreq = gd->scc_clk;
        bd->bi_vco     = gd->vco_out;
 #endif /* CONFIG_CPM2 */
+#if defined(CONFIG_MPC512X)
+       bd->bi_ipsfreq = gd->ips_clk;
+#endif /* CONFIG_MPC512X */
 #if defined(CONFIG_MPC5xxx)
        bd->bi_ipbfreq = gd->ipb_clk;
        bd->bi_pcifreq = gd->pci_clk;
@@ -831,6 +851,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
 #if defined(CONFIG_SC3)
        sc3_read_eeprom();
 #endif
+
+#ifdef CFG_ID_EEPROM
+       mac_read_from_eeprom();
+#endif
+
        s = getenv ("ethaddr");
 #if defined (CONFIG_MBX) || \
     defined (CONFIG_RPXCLASSIC) || \
@@ -898,10 +923,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
        }
 #endif
 
-#ifdef CFG_ID_EEPROM
-       mac_read_from_eeprom();
-#endif
-
 #if defined(CONFIG_TQM8xxL) || defined(CONFIG_TQM8260) || \
     defined(CONFIG_TQM8272) || \
     defined(CONFIG_CCM) || defined(CONFIG_KUP4K) || \
@@ -927,6 +948,11 @@ void board_init_r (gd_t *id, ulong dest_addr)
        /* Initialize the jump table for applications */
        jumptable_init ();
 
+#if defined(CONFIG_API)
+       /* Initialize API */
+       api_init ();
+#endif
+
        /* Initialize the console (after the relocation and devices init) */
        console_init_r ();