diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/cmd_bdinfo.c | 27 | ||||
-rw-r--r-- | common/cmd_boot.c | 7 | ||||
-rw-r--r-- | common/cmd_bootm.c | 12 |
3 files changed, 45 insertions, 1 deletions
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c index dd9a4899cb..ceffe6a775 100644 --- a/common/cmd_bdinfo.c +++ b/common/cmd_bdinfo.c @@ -95,6 +95,33 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } +#elif defined(CONFIG_NIOS) /* NIOS*/ + +int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +{ + DECLARE_GLOBAL_DATA_PTR; + + int i; + bd_t *bd = gd->bd; + + print_num ("memstart", (ulong)bd->bi_memstart); + print_num ("memsize", (ulong)bd->bi_memsize); + print_num ("flashstart", (ulong)bd->bi_flashstart); + print_num ("flashsize", (ulong)bd->bi_flashsize); + print_num ("flashoffset", (ulong)bd->bi_flashoffset); + + printf ("ethaddr ="); + for (i=0; i<6; ++i) { + printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]); + } + printf ("\nip_addr = "); + print_IPaddr (bd->bi_ip_addr); + printf ("\nbaudrate = %ld bps\n", bd->bi_baudrate); + + return 0; +} + + #else /* ! PPC, which leaves MIPS */ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) diff --git a/common/cmd_boot.c b/common/cmd_boot.c index b2f0331dc9..5b58d4e2f1 100644 --- a/common/cmd_boot.c +++ b/common/cmd_boot.c @@ -59,7 +59,14 @@ int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) */ argv[0] = (char *)gd; #endif +#if !defined(CONFIG_NIOS) rc = ((ulong (*)(int, char *[]))addr) (--argc, &argv[1]); +#else + /* + * Nios function pointers are address >> 1 + */ + rc = ((ulong (*)(int, char *[]))(addr>>1)) (--argc, &argv[1]); +#endif if (rc != 0) rcode = 1; printf ("## Application terminated, rc = 0x%lX\n", rc); diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 45c4f33be9..79b763ec13 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -235,6 +235,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) if (hdr->ih_arch != IH_CPU_I386) #elif defined(__mips__) if (hdr->ih_arch != IH_CPU_MIPS) +#elif defined(__nios__) + if (hdr->ih_arch != IH_CPU_NIOS) #else # error Unknown CPU type #endif @@ -247,6 +249,10 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) switch (hdr->ih_type) { case IH_TYPE_STANDALONE: name = "Standalone Application"; + /* A second argument overwrites the load address */ + if (argc > 2) { + hdr->ih_load = simple_strtoul(argv[2], NULL, 16); + } break; case IH_TYPE_KERNEL: name = "Kernel Image"; break; @@ -347,8 +353,12 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) /* load (and uncompress), but don't start if "autostart" * is set to "no" */ - if (((s = getenv("autostart")) != NULL) && (strcmp(s,"no") == 0)) + if (((s = getenv("autostart")) != NULL) && (strcmp(s,"no") == 0)) { + char buf[32]; + sprintf(buf, "%lX", len); + setenv("filesize", buf); return 0; + } appl = (int (*)(cmd_tbl_t *, int, int, char *[]))ntohl(hdr->ih_ep); (*appl)(cmdtp, flag, argc-1, &argv[1]); return 0; |