Merge branch 'master' of /home/wd/git/u-boot/custodians
[platform/kernel/u-boot.git] / lib_avr32 / board.c
index 8b9ca38..f3d0c52 100644 (file)
@@ -261,9 +261,10 @@ void board_init_f(ulong board_type)
 void board_init_r(gd_t *new_gd, ulong dest_addr)
 {
        extern void malloc_bin_reloc (void);
-#ifndef CFG_ENV_IS_NOWHERE
+#ifndef CONFIG_ENV_IS_NOWHERE
        extern char * env_name_spec;
 #endif
+       char *s;
        cmd_tbl_t *cmdtp;
        bd_t *bd;
 
@@ -301,7 +302,7 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
        }
 
        /* there are some other pointer constants we must deal with */
-#ifndef CFG_ENV_IS_NOWHERE
+#ifndef CONFIG_ENV_IS_NOWHERE
        env_name_spec += gd->reloc_off;
 #endif
 
@@ -310,10 +311,22 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
        malloc_bin_reloc();
        dma_alloc_init();
        board_init_info();
-       flash_init();
+
+       enable_interrupts();
+
+       bd->bi_flashstart = 0;
+       bd->bi_flashsize = 0;
+       bd->bi_flashoffset = 0;
+
+#ifndef CFG_NO_FLASH
+       bd->bi_flashstart = CFG_FLASH_BASE;
+       bd->bi_flashsize = flash_init();
+       bd->bi_flashoffset = (unsigned long)_edata - (unsigned long)_text;
 
        if (bd->bi_flashsize)
                display_flash_config();
+#endif
+
        if (bd->bi_dram[0].size)
                display_dram_config();
 
@@ -324,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