Add support for Freescale M5271: Merge with /work/u-boot.mcf5271
[platform/kernel/u-boot.git] / lib_microblaze / board.c
index b720e82..026d247 100644 (file)
@@ -28,6 +28,8 @@
 #include <version.h>
 #include <watchdog.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 const char version_string[] =
        U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
 
@@ -72,8 +74,19 @@ init_fnc_t *init_sequence[] = {
 
 void board_init(void)
 {
+       bd_t *bd;
        init_fnc_t **init_fnc_ptr;
 
+       /* Pointer is writable since we allocated a register for it. */
+       gd = (gd_t *)CFG_GBL_DATA_OFFSET;
+       memset((void *)gd, 0, CFG_GBL_DATA_SIZE);
+
+       gd->bd = (bd_t *)(gd+1);        /* At end of global data */
+       gd->baudrate = CONFIG_BAUDRATE;
+
+       bd = gd->bd;
+       bd->bi_baudrate = CONFIG_BAUDRATE;
+
        for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
                WATCHDOG_RESET ();
                if ((*init_fnc_ptr) () != 0) {