summaryrefslogtreecommitdiff
path: root/common/cmd_elf.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-06-27 21:31:46 +0000
committerwdenk <wdenk>2003-06-27 21:31:46 +0000
commit8bde7f776c77b343aca29b8c7b58464d915ac245 (patch)
tree20f1fd99975215e7c658454a15cdb4ed4694e2d4 /common/cmd_elf.c
parent993cad9364c6b87ae429d1ed1130d8153f6f027e (diff)
downloadu-boot-imx-8bde7f776c77b343aca29b8c7b58464d915ac245.zip
u-boot-imx-8bde7f776c77b343aca29b8c7b58464d915ac245.tar.gz
u-boot-imx-8bde7f776c77b343aca29b8c7b58464d915ac245.tar.bz2
* Code cleanup:
- remove trailing white space, trailing empty lines, C++ comments, etc. - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c) * Patches by Kenneth Johansson, 25 Jun 2003: - major rework of command structure (work done mostly by Michal Cendrowski and Joakim Kristiansen)
Diffstat (limited to 'common/cmd_elf.c')
-rw-r--r--common/cmd_elf.c50
1 files changed, 31 insertions, 19 deletions
diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index 7495762..c068c10 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -17,8 +17,6 @@
#include <command.h>
#include <linux/ctype.h>
#include <net.h>
-
-#include <cmd_elf.h>
#include <elf.h>
@@ -28,6 +26,8 @@
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
+int valid_elf_image (unsigned long addr);
+unsigned long load_elf_image (unsigned long addr);
/* ======================================================================
* Interpreter command to boot an arbitrary ELF image from memory.
@@ -136,11 +136,11 @@ int do_bootvx ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
printf ("## Ethernet MAC address not copied to NV RAM\n");
#endif
- /*
- * Use bootaddr to find the location in memory that VxWorks
- * will look for the bootline string. The default value for
- * PowerPC is LOCAL_MEM_LOCAL_ADRS + BOOT_LINE_OFFSET which
- * defaults to 0x4200
+ /*
+ * Use bootaddr to find the location in memory that VxWorks
+ * will look for the bootline string. The default value for
+ * PowerPC is LOCAL_MEM_LOCAL_ADRS + BOOT_LINE_OFFSET which
+ * defaults to 0x4200
*/
if ((tmp = getenv ("bootaddr")) == NULL)
@@ -148,10 +148,10 @@ int do_bootvx ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
else
bootaddr = simple_strtoul (tmp, NULL, 16);
- /*
- * Check to see if the bootline is defined in the 'bootargs'
- * parameter. If it is not defined, we may be able to
- * construct the info
+ /*
+ * Check to see if the bootline is defined in the 'bootargs'
+ * parameter. If it is not defined, we may be able to
+ * construct the info
*/
if ((bootline = getenv ("bootargs")) != NULL) {
@@ -194,10 +194,10 @@ int do_bootvx ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
flush_cache (bootaddr, MAX(strlen(build_buf), 255));
#else
- /*
- * I'm not sure what the device should be for other
- * PPC flavors, the hostname and ipaddr should be ok
- * to just copy
+ /*
+ * I'm not sure what the device should be for other
+ * PPC flavors, the hostname and ipaddr should be ok
+ * to just copy
*/
printf ("No bootargs defined\n");
@@ -205,10 +205,10 @@ int do_bootvx ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
#endif
}
- /*
- * If the data at the load address is an elf image, then
- * treat it like an elf image. Otherwise, assume that it is a
- * binary image
+ /*
+ * If the data at the load address is an elf image, then
+ * treat it like an elf image. Otherwise, assume that it is a
+ * binary image
*/
if (valid_elf_image (addr)) {
@@ -321,4 +321,16 @@ unsigned long load_elf_image (unsigned long addr)
}
/* ====================================================================== */
+cmd_tbl_t U_BOOT_CMD(BOOTELF) = MK_CMD_ENTRY(
+ "bootelf", 2, 0, do_bootelf,
+ "bootelf - Boot from an ELF image in memory\n",
+ " [address] - load address of ELF image.\n"
+);
+
+cmd_tbl_t U_BOOT_CMD(BOOTVX) = MK_CMD_ENTRY(
+ "bootvx", 2, 0, do_bootvx,
+ "bootvx - Boot vxWorks from an ELF image\n",
+ " [address] - load address of vxWorks ELF image.\n"
+);
+
#endif /* CFG_CMD_ELF */