]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - arch/blackfin/lib/board.c
Merge branch 'master' of git://git.denx.de/u-boot-blackfin
[people/ms/u-boot.git] / arch / blackfin / lib / board.c
index 2d3230cd64b8a9ca94a845d52e2d417212272fb5..bfdb586b343804554cf2f016bedfc2f5ca475ee3 100644 (file)
 #include <common.h>
 #include <command.h>
 #include <stdio_dev.h>
+#include <serial.h>
 #include <environment.h>
 #include <malloc.h>
 #include <mmc.h>
 #include <net.h>
-#include <timestamp.h>
 #include <status_led.h>
 #include <version.h>
 
@@ -39,8 +39,6 @@ int post_flag;
 
 DECLARE_GLOBAL_DATA_PTR;
 
-const char version_string[] = U_BOOT_VERSION " ("U_BOOT_DATE" - "U_BOOT_TIME")";
-
 __attribute__((always_inline))
 static inline void serial_early_puts(const char *s)
 {
@@ -52,10 +50,11 @@ static inline void serial_early_puts(const char *s)
 
 static int display_banner(void)
 {
-       printf("\n\n%s\n\n", version_string);
-       printf("CPU:   ADSP " MK_STR(CONFIG_BFIN_CPU) " "
+       display_options();
+       printf("CPU:   ADSP %s "
                "(Detected Rev: 0.%d) "
                "(%s boot)\n",
+               gd->bd->bi_cpu,
                bfin_revid(),
                get_bfin_boot_mode(CONFIG_BFIN_BOOT_MODE));
        return 0;
@@ -206,7 +205,6 @@ extern int timer_init(void);
 
 void board_init_f(ulong bootflag)
 {
-       ulong addr;
        bd_t *bd;
        char buf[32];
 
@@ -236,21 +234,16 @@ void board_init_f(ulong bootflag)
 #endif
 
 #ifdef DEBUG
-       if (CONFIG_SYS_GBL_DATA_SIZE < sizeof(*gd))
+       if (GENERATED_GBL_DATA_SIZE < sizeof(*gd))
                hang();
 #endif
        serial_early_puts("Init global data\n");
        gd = (gd_t *) (CONFIG_SYS_GBL_DATA_ADDR);
-       memset((void *)gd, 0, CONFIG_SYS_GBL_DATA_SIZE);
-
-       /* Board data initialization */
-       addr = (CONFIG_SYS_GBL_DATA_ADDR + sizeof(gd_t));
+       memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);
 
-       /* Align to 4 byte boundary */
-       addr &= ~(4 - 1);
-       bd = (bd_t *) addr;
+       bd = (bd_t *) (CONFIG_SYS_BD_INFO_ADDR);
        gd->bd = bd;
-       memset((void *)bd, 0, sizeof(bd_t));
+       memset((void *)bd, 0, GENERATED_BD_INFO_SIZE);
 
        bd->bi_r_version = version_string;
        bd->bi_cpu = MK_STR(CONFIG_BFIN_CPU);
@@ -270,6 +263,9 @@ void board_init_f(ulong bootflag)
        init_baudrate();
        serial_early_puts("Serial init\n");
        serial_init();
+#ifdef CONFIG_SERIAL_MULTI
+       serial_initialize();
+#endif
        serial_early_puts("Console init flash\n");
        console_init_f();
        serial_early_puts("End of early debugging\n");
@@ -282,8 +278,11 @@ void board_init_f(ulong bootflag)
        printf("Core: %s MHz, ", strmhz(buf, get_cclk()));
        printf("System: %s MHz\n", strmhz(buf, get_sclk()));
 
-       printf("RAM:   ");
-       print_size(bd->bi_memsize, "\n");
+       if (CONFIG_MEM_SIZE) {
+               printf("RAM:   ");
+               print_size(bd->bi_memsize, "\n");
+       }
+
 #if defined(CONFIG_POST)
        post_init_f();
        post_bootmode_init();
@@ -321,7 +320,6 @@ void board_init_r(gd_t * id, ulong dest_addr)
 
 #if defined(CONFIG_POST)
        post_output_backlog();
-       post_reloc();
 #endif
 
        /* initialize malloc() area */
@@ -351,7 +349,7 @@ void board_init_r(gd_t * id, ulong dest_addr)
 #endif
 
 #ifdef CONFIG_GENERIC_MMC
-       puts("MMC:  ");
+       puts("MMC:   ");
        mmc_initialize(bd);
 #endif
 
@@ -393,7 +391,7 @@ 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()) {
+       if (CONFIG_MEM_SIZE && bfin_os_log_check()) {
                puts("\nLog buffer from operating system:\n");
                bfin_os_log_dump();
                puts("\n");