]> 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 46e36c8904ce58fb01505130c62d14e3f5fc4009..47d487fae55daa04563ad16b4ae52fd9c844ce80 100644 (file)
@@ -207,7 +207,6 @@ extern int timer_init(void);
 
 void board_init_f(ulong bootflag)
 {
-       ulong addr;
        bd_t *bd;
        char buf[32];
 
@@ -237,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);
@@ -283,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();
@@ -322,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 */
@@ -352,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