]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/mips/lib/board.c
Merge 'u-boot-atmel/master' into 'u-boot-arm/master'
[karo-tx-uboot.git] / arch / mips / lib / board.c
index d998f0e74904416bcc7890c747b9990698bbb2e3..d79e1837d9a37c21c07556618a22dc9c60e173e7 100644 (file)
@@ -24,6 +24,7 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
+#include <serial.h>
 #include <stdio_dev.h>
 #include <version.h>
 #include <net.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-extern int timer_init(void);
-
-extern int incaip_set_cpuclk(void);
-
-extern ulong uboot_end_data;
-extern ulong uboot_end;
-
 ulong monitor_flash_len;
 
 static char *failed = "*** failed ***\n";
@@ -53,7 +47,7 @@ static char *failed = "*** failed ***\n";
  * mips_io_port_base is the begin of the address space to which x86 style
  * I/O ports are mapped.
  */
-unsigned long mips_io_port_base = -1;
+const unsigned long mips_io_port_base = -1;
 
 int __board_early_init_f(void)
 {
@@ -255,7 +249,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 #ifndef CONFIG_SYS_NO_FLASH
        ulong size;
 #endif
-       extern void malloc_bin_reloc(void);
 #ifndef CONFIG_ENV_IS_NOWHERE
        extern char *env_name_spec;
 #endif
@@ -270,12 +263,14 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
        monitor_flash_len = (ulong)&uboot_end_data - dest_addr;
 
+       serial_initialize();
+
 #if defined(CONFIG_NEEDS_MANUAL_RELOC)
        /*
         * We have to relocate the command table manually
         */
-       fixup_cmdtable(&__u_boot_cmd_start,
-               (ulong)(&__u_boot_cmd_end - &__u_boot_cmd_start));
+       fixup_cmdtable(ll_entry_start(cmd_tbl_t, cmd),
+                       ll_entry_count(cmd_tbl_t, cmd));
 #endif /* defined(CONFIG_NEEDS_MANUAL_RELOC) */
 
        /* there are some other pointer constants we must deal with */
@@ -294,15 +289,19 @@ void board_init_r(gd_t *id, ulong dest_addr)
        /* configure available FLASH banks */
        size = flash_init();
        display_flash_config(size);
+       bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
        bd->bi_flashsize = size;
-#endif
 
-       bd->bi_flashstart = CONFIG_SYS_FLASH_BASE;
 #if CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE
        bd->bi_flashoffset = monitor_flash_len; /* reserved area for U-Boot */
 #else
        bd->bi_flashoffset = 0;
 #endif
+#else
+       bd->bi_flashstart = 0;
+       bd->bi_flashsize = 0;
+       bd->bi_flashoffset = 0;
+#endif
 
 #ifdef CONFIG_CMD_NAND
        puts("NAND:  ");
@@ -316,9 +315,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
        /* relocate environment function pointers etc. */
        env_relocate();
 
-       /* IP Address */
-       bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 #if defined(CONFIG_PCI)
        /*
         * Do pci configuration
@@ -338,14 +334,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
        /* Initialize from environment */
        load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-       {
-               char *s = getenv("bootfile");
-
-               if (s != NULL)
-                       copy_filename(BootFile, s, sizeof(BootFile));
-       }
-#endif
 
 #ifdef CONFIG_CMD_SPI
        puts("SPI:   ");