Add command for handling DDR ECC registers on MPC8349EE MDS board.
[oweals/u-boot.git] / lib_microblaze / board.c
index 3e3fb3762ca94f2b83f506c623b932b2c4865f4a..bc987a338088546c17685a231c9398f2965dbfd4 100644 (file)
@@ -26,6 +26,7 @@
 #include <command.h>
 #include <malloc.h>
 #include <version.h>
+#include <watchdog.h>
 
 const char version_string[] =
        U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
@@ -69,6 +70,37 @@ init_fnc_t *init_sequence[] = {
        NULL,
 };
 
+void board_init(void)
+{
+       DECLARE_GLOBAL_DATA_PTR;
+
+       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) {
+                       hang ();
+               }
+       }
+
+       /* main_loop */
+       for (;;) {
+               WATCHDOG_RESET ();
+               main_loop ();
+       }
+}
+
 void hang (void)
 {
        puts ("### ERROR ### Please RESET the board ###\n");