summaryrefslogtreecommitdiff
path: root/common/cmd_bootm.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-10-08 23:26:14 +0000
committerwdenk <wdenk>2003-10-08 23:26:14 +0000
commit4a5517094dd30bb1f271403b62e23053301668e6 (patch)
tree55bd5e64828e7645caa5506302e27715cfecdbda /common/cmd_bootm.c
parent54387ac931fa7cc92cd45c53798379af1f9adc44 (diff)
* Patch by Scott McNutt, 04 Oct 2003:
- add support for Altera Nios-32 CPU - add support for Nios Cyclone Development Kit (DK-1C20) * Patch by Steven Scholz, 29 Sep 2003: - A second parameter for bootm overwrites the load address for "Standalone Application" images. - bootm sets environment variable "filesize" to the resulting (uncompressed) data length for "Standalone Application" images when autostart is set to "no". Now you can do something like if bootm $fpgadata $some_free_ram ; then fpga load 0 $some_free_ram $filesize fi * Patch by Denis Peter, 25 Sept 2003: add support for the MIP405 Rev. C board
Diffstat (limited to 'common/cmd_bootm.c')
-rw-r--r--common/cmd_bootm.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 45c4f33be98..79b763ec136 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;