diff options
Diffstat (limited to 'lib_mips')
-rw-r--r-- | lib_mips/board.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib_mips/board.c b/lib_mips/board.c index a07cb3f..4bab3c5 100644 --- a/lib_mips/board.c +++ b/lib_mips/board.c @@ -177,6 +177,9 @@ void board_init_f(ulong bootflag) bd_t *bd; init_fnc_t **init_fnc_ptr; ulong addr, addr_sp, len = CFG_MONITOR_LEN; +#ifdef CONFIG_PURPLE + void copy_code (ulong); +#endif /* Pointer is writable since we allocated a register for it. */ @@ -271,6 +274,14 @@ void board_init_f(ulong bootflag) bd->bi_baudrate = gd->baudrate; /* Console Baudrate */ memcpy (id, gd, sizeof (gd_t)); + + /* On the purple board we copy the code in a special way + * in order to solve flash problems + */ +#ifdef CONFIG_PURPLE + copy_code(addr); +#endif + relocate_code (addr_sp, id, addr); /* NOTREACHED - relocate_code() does not return */ @@ -383,6 +394,21 @@ void board_init_r (gd_t *id, ulong dest_addr) console_init_r (); /** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/ + /* Initialize from environment */ + if ((s = getenv ("loadaddr")) != NULL) { + load_addr = simple_strtoul (s, NULL, 16); + } +#if (CONFIG_COMMANDS & CFG_CMD_NET) + if ((s = getenv ("bootfile")) != NULL) { + copy_filename (BootFile, s, sizeof (BootFile)); + } +#endif /* CFG_CMD_NET */ + +#if defined(CONFIG_MISC_INIT_R) + /* miscellaneous platform dependent initialisations */ + misc_init_r (); +#endif + #if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) puts ("Net: "); eth_initialize(gd->bd); |