diff options
Diffstat (limited to 'lib_nios2')
-rw-r--r-- | lib_nios2/board.c | 7 | ||||
-rw-r--r-- | lib_nios2/bootm.c | 19 |
2 files changed, 19 insertions, 7 deletions
diff --git a/lib_nios2/board.c b/lib_nios2/board.c index 41d3297190..8ec66a3540 100644 --- a/lib_nios2/board.c +++ b/lib_nios2/board.c @@ -139,6 +139,13 @@ void board_init (void) board_late_init (); #endif +#if defined(CONFIG_CMD_NET) +#if defined(CONFIG_NET_MULTI) + puts ("Net: "); +#endif + eth_initialize (bd); +#endif + /* main_loop */ for (;;) { WATCHDOG_RESET (); diff --git a/lib_nios2/bootm.c b/lib_nios2/bootm.c index 675bfac63a..5d25edf80d 100644 --- a/lib_nios2/bootm.c +++ b/lib_nios2/bootm.c @@ -26,21 +26,26 @@ #include <asm/byteorder.h> #include <asm/cache.h> +#define NIOS_MAGIC 0x534f494e /* enable command line and initrd passing */ + int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { - void (*kernel)(void) = (void (*)(void))images->ep; + void (*kernel)(int, int, int, char *) = (void *)images->ep; + char *commandline = getenv("bootargs"); + ulong initrd_start = images->rd_start; + ulong initrd_end = images->rd_end; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1; /* flushes data and instruction caches before calling the kernel */ - flush_dcache (0,CONFIG_SYS_DCACHE_SIZE); - flush_icache (0,CONFIG_SYS_ICACHE_SIZE); + disable_interrupts(); + flush_dcache((ulong)kernel, CONFIG_SYS_DCACHE_SIZE); + flush_icache((ulong)kernel, CONFIG_SYS_ICACHE_SIZE); - /* For now we assume the Microtronix linux ... which only - * needs to be called ;-) - */ - kernel (); + debug("bootargs=%s @ 0x%lx\n", commandline, (ulong)&commandline); + debug("initrd=0x%lx-0x%lx\n", (ulong)initrd_start, (ulong)initrd_end); + kernel(NIOS_MAGIC, initrd_start, initrd_end, commandline); /* does not return */ return 1; |