]> git.sur5r.net Git - u-boot/blobdiff - arch/blackfin/lib/board.c
Blackfin: fix bd_t handling
[u-boot] / arch / blackfin / lib / board.c
index 2d3230cd64b8a9ca94a845d52e2d417212272fb5..47d487fae55daa04563ad16b4ae52fd9c844ce80 100644 (file)
@@ -53,9 +53,10 @@ 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) " "
+       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 +207,6 @@ extern int timer_init(void);
 
 void board_init_f(ulong bootflag)
 {
-       ulong addr;
        bd_t *bd;
        char buf[32];
 
@@ -236,21 +236,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);
+       memset((void *)gd, 0, GENERATED_GBL_DATA_SIZE);
 
-       /* Board data initialization */
-       addr = (CONFIG_SYS_GBL_DATA_ADDR + sizeof(gd_t));
-
-       /* 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);
@@ -282,8 +277,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 +319,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 +348,7 @@ void board_init_r(gd_t * id, ulong dest_addr)
 #endif
 
 #ifdef CONFIG_GENERIC_MMC
-       puts("MMC:  ");
+       puts("MMC:   ");
        mmc_initialize(bd);
 #endif