]> git.sur5r.net Git - u-boot/commitdiff
AVR32: Initialize ipaddr, loadaddr and bootfile at startup
authorHaavard Skinnemoen <hskinnemoen@atmel.com>
Sat, 24 Nov 2007 17:15:31 +0000 (18:15 +0100)
committerHaavard Skinnemoen <hskinnemoen@atmel.com>
Fri, 18 Jan 2008 08:53:18 +0000 (09:53 +0100)
I don't know why the relevant layers can't do this by itself, but this
is what ppc does.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
lib_avr32/board.c

index 809ee3be92c29665861cef4fd296b0c15931d3d6..d6423d4f3f91b5316507a22e4735e7cb42781cbe 100644 (file)
@@ -264,6 +264,7 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 #ifndef CFG_ENV_IS_NOWHERE
        extern char * env_name_spec;
 #endif
+       char *s;
        cmd_tbl_t *cmdtp;
        bd_t *bd;
 
@@ -336,11 +337,20 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
        /* initialize environment */
        env_relocate();
 
+       bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
+
        devices_init();
        jumptable_init();
        console_init_r();
 
+       s = getenv("loadaddr");
+       if (s)
+               load_addr = simple_strtoul(s, NULL, 16);
+
 #if defined(CONFIG_CMD_NET)
+       s = getenv("bootfile");
+       if (s)
+               copy_filename(BootFile, s, sizeof(BootFile));
 #if defined(CONFIG_NET_MULTI)
        puts("Net:   ");
 #endif