Merge branch 'master' of git://git.denx.de/u-boot-arm
[platform/kernel/u-boot.git] / lib_blackfin / board.c
index 537f69a..b957a9d 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <common.h>
 #include <command.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <environment.h>
 #include <malloc.h>
 #include <net.h>
@@ -291,6 +291,25 @@ void board_init_f(ulong bootflag)
        board_init_r((gd_t *) gd, 0x20000010);
 }
 
+static void board_net_init_r(bd_t *bd)
+{
+#ifdef CONFIG_CMD_NET
+       uchar enetaddr[6];
+       char *s;
+
+       if ((s = getenv("bootfile")) != NULL)
+               copy_filename(BootFile, s, sizeof(BootFile));
+
+       bd->bi_ip_addr = getenv_IPaddr("ipaddr");
+
+       printf("Net:   ");
+       eth_initialize(gd->bd);
+
+       eth_getenv_enetaddr("ethaddr", enetaddr);
+       printf("MAC:   %pM\n", enetaddr);
+#endif
+}
+
 void board_init_r(gd_t * id, ulong dest_addr)
 {
        extern void malloc_bin_reloc(void);
@@ -305,11 +324,15 @@ void board_init_r(gd_t * id, ulong dest_addr)
        post_reloc();
 #endif
 
+       /* initialize malloc() area */
+       mem_malloc_init();
+       malloc_bin_reloc();
+
 #if    !defined(CONFIG_SYS_NO_FLASH)
        /* Initialize the flash and protect u-boot by default */
        extern flash_info_t flash_info[];
-       ulong size = flash_init();
        puts("Flash: ");
+       ulong size = flash_init();
        print_size(size, "\n");
        flash_protect(FLAG_PROTECT_SET, CONFIG_SYS_FLASH_BASE,
                CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN - 1,
@@ -322,9 +345,6 @@ void board_init_r(gd_t * id, ulong dest_addr)
        bd->bi_flashsize = 0;
        bd->bi_flashoffset = 0;
 #endif
-       /* initialize malloc() area */
-       mem_malloc_init();
-       malloc_bin_reloc();
 
 #ifdef CONFIG_CMD_NAND
        puts("NAND:  ");
@@ -334,8 +354,8 @@ void board_init_r(gd_t * id, ulong dest_addr)
        /* relocate environment function pointers etc. */
        env_relocate();
 
-       /* Initialize devices */
-       devices_init();
+       /* Initialize stdio devices */
+       stdio_init();
        jumptable_init();
 
        /* Initialize the console (after the relocation and devices init) */
@@ -349,22 +369,13 @@ void board_init_r(gd_t * id, ulong dest_addr)
        /* Initialize from environment */
        if ((s = getenv("loadaddr")) != NULL)
                load_addr = simple_strtoul(s, NULL, 16);
-#ifdef CONFIG_CMD_NET
-       if ((s = getenv("bootfile")) != NULL)
-               copy_filename(BootFile, s, sizeof(BootFile));
-#endif
 
 #if defined(CONFIG_MISC_INIT_R)
        /* miscellaneous platform dependent initialisations */
        misc_init_r();
 #endif
 
-#ifdef CONFIG_CMD_NET
-       /* IP Address */
-       bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-       printf("Net:   ");
-       eth_initialize(gd->bd);
-#endif
+       board_net_init_r(bd);
 
        display_global_data();
 
@@ -373,6 +384,12 @@ void board_init_r(gd_t * id, ulong dest_addr)
                post_run(NULL, POST_RAM | post_bootmode_get(0));
 #endif
 
+       if (bfin_os_log_check()) {
+               puts("\nLog buffer from operating system:\n");
+               bfin_os_log_dump();
+               puts("\n");
+       }
+
        /* main_loop() can return to retry autoboot, if so just run it again. */
        for (;;)
                main_loop();