]> git.sur5r.net Git - u-boot/blobdiff - lib_arm/board.c
Fix problems with I2C support for mpc5200
[u-boot] / lib_arm / board.c
index 54f554b6d4dc567bad9035cee06d2ea19ea77747..493112d55ed1a35212e82b4b72871e6a8e1e33c2 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <malloc.h>
 #include <devices.h>
 #include <version.h>
 #include <net.h>
 void nand_init (void);
 #endif
 
+ulong monitor_flash_len;
+
+#ifdef CONFIG_HAS_DATAFLASH
+extern int  AT91F_DataflashInit(void);
+extern void dataflash_print_info(void);
+#endif
+
+#ifndef CONFIG_IDENT_STRING
+#define CONFIG_IDENT_STRING ""
+#endif
+
 const char version_string[] =
-       U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
+       U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")"CONFIG_IDENT_STRING;
 
 #ifdef CONFIG_DRIVER_CS8900
 extern void cs8900_get_enetaddr (uchar * addr);
@@ -90,8 +102,7 @@ static int init_baudrate (void)
 
        uchar tmp[64];  /* long enough for environment variables */
        int i = getenv_r ("baudrate", tmp, sizeof (tmp));
-
-       gd->baudrate = (i > 0)
+       gd->bd->bi_baudrate = gd->baudrate = (i > 0)
                        ? (int) simple_strtoul (tmp, NULL, 10)
                        : CONFIG_BAUDRATE;
 
@@ -143,11 +154,10 @@ static void display_flash_config (ulong size)
 }
 
 
-
 /*
  * Breath some life into the board...
  *
- * Initialize an SMC for serial comms, and carry out some hardware
+ * Initialize a serial port as console, and carry out some hardware
  * tests.
  *
  * The first part of initialization is running from Flash memory;
@@ -176,6 +186,7 @@ init_fnc_t *init_sequence[] = {
        env_init,               /* initialize environment */
        init_baudrate,          /* initialze baudrate settings */
        serial_init,            /* serial communications setup */
+       console_init_f,         /* stage 1 init of console */
        display_banner,         /* say that we are here */
        dram_init,              /* configure available RAM banks */
        display_dram_config,
@@ -200,10 +211,12 @@ void start_armboot (void)
 
        /* Pointer is writable since we allocated a register for it */
        gd = &gd_data;
-       memset (gd, 0, sizeof (gd_t));
+       memset ((void *)gd, 0, sizeof (gd_t));
        gd->bd = &bd_data;
        memset (gd->bd, 0, sizeof (bd_t));
 
+       monitor_flash_len = _armboot_end_data - _armboot_start;
+
        for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
                if ((*init_fnc_ptr)() != 0) {
                        hang ();
@@ -235,9 +248,15 @@ void start_armboot (void)
 #endif /* CONFIG_VFD */
 
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
+       puts ("NAND:");
        nand_init();            /* go init the NAND */
 #endif
 
+#ifdef CONFIG_HAS_DATAFLASH
+       AT91F_DataflashInit();
+       dataflash_print_info();
+#endif
+
        /* initialize environment */
        env_relocate ();
 
@@ -266,6 +285,12 @@ void start_armboot (void)
                }
        }
 
+       devices_init ();        /* get the devices list going. */
+
+       jumptable_init ();
+
+       console_init_r ();      /* fully init console as a device */
+
 #if defined(CONFIG_MISC_INIT_R)
        /* miscellaneous platform dependent initialisations */
        misc_init_r ();