]> git.sur5r.net Git - u-boot/blobdiff - lib_m68k/board.c
fec_mxc: cleanup and factor out imx27 dependencies
[u-boot] / lib_m68k / board.c
index 7d4ffc779c4c094b46a1f403a94bfad56d0c5778..732023d67c008466c519bbf07840e8c495af1845 100644 (file)
@@ -28,7 +28,7 @@
 #include <watchdog.h>
 #include <command.h>
 #include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
 
 #include <asm/immap.h>
 
 #include <spi.h>
 #endif
 
+#ifdef CONFIG_BITBANGMII
+#include <miiphy.h>
+#endif
+
 #include <nand.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -101,47 +105,11 @@ extern int watchdog_disable(void);
 
 ulong monitor_flash_len;
 
-/*
- * Begin and End of memory area for malloc(), and current "brk"
- */
-static ulong   mem_malloc_start = 0;
-static ulong   mem_malloc_end   = 0;
-static ulong   mem_malloc_brk   = 0;
-
 /************************************************************************
  * Utilities                                                           *
  ************************************************************************
  */
 
-/*
- * The Malloc area is immediately below the monitor copy in DRAM
- */
-static void mem_malloc_init (void)
-{
-       ulong dest_addr = CONFIG_SYS_MONITOR_BASE + gd->reloc_off;
-
-       mem_malloc_end = dest_addr;
-       mem_malloc_start = dest_addr - TOTAL_MALLOC_LEN;
-       mem_malloc_brk = mem_malloc_start;
-
-       memset ((void *) mem_malloc_start,
-               0,
-               mem_malloc_end - mem_malloc_start);
-}
-
-void *sbrk (ptrdiff_t increment)
-{
-       ulong old = mem_malloc_brk;
-       ulong new = old + increment;
-
-       if ((new < mem_malloc_start) ||
-           (new > mem_malloc_end) ) {
-               return (NULL);
-       }
-       mem_malloc_brk = new;
-       return ((void *)old);
-}
-
 /*
  * All attempts to come up with a "common" initialization sequence
  * that works for all boards and architectures failed: some of the
@@ -518,8 +486,9 @@ void board_init_r (gd_t *id, ulong dest_addr)
         */
        trap_init (CONFIG_SYS_SDRAM_BASE);
 
-       /* initialize malloc() area */
-       mem_malloc_init ();
+       /* The Malloc area is immediately below the monitor copy in DRAM */
+       mem_malloc_init (CONFIG_SYS_MONITOR_BASE + gd->reloc_off -
+                       TOTAL_MALLOC_LEN, TOTAL_MALLOC_LEN);
        malloc_bin_reloc ();
 
 #if !defined(CONFIG_SYS_NO_FLASH)
@@ -535,7 +504,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
                 */
                s = getenv ("flashchecksum");
                if (s && (*s == 'y')) {
-                       printf ("  CRC: %08lX",
+                       printf ("  CRC: %08X",
                                        crc32 (0,
                                                   (const unsigned char *) CONFIG_SYS_FLASH_BASE,
                                                   flash_size)
@@ -595,8 +564,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
 #endif
 
        /** leave this here (after malloc(), environment and PCI are working) **/
-       /* Initialize devices */
-       devices_init ();
+       /* Initialize stdio devices */
+       stdio_init ();
 
        /* Initialize the jump table for applications */
        jumptable_init ();
@@ -665,6 +634,9 @@ void board_init_r (gd_t *id, ulong dest_addr)
        nand_init();            /* go init the NAND */
 #endif
 
+#ifdef CONFIG_BITBANGMII
+       bb_miiphy_init();
+#endif
 #if defined(CONFIG_CMD_NET)
        WATCHDOG_RESET();
 #if defined(FEC_ENET)