summaryrefslogtreecommitdiff
path: root/common/cmd_load.c
Commit message (Collapse)AuthorAgeLines
* Convert cmd_usage() calls in common to use a return valueSimon Glass2012-03-06-1/+1
| | | | | | | | | Change all files in common/ to use CMD_RET_USAGE instead of calling cmd_usage() directly. I'm not completely sure about this patch since the code since impact is small (100 byte or so on ARM) and it might need splitting into smaller patches. But for now here it is. Signed-off-by: Simon Glass <sjg@chromium.org>
* cmd_usage(): simplify return code handlingWolfgang Denk2010-07-24-1/+1
| | | | | | | | | | | | | | | | Lots of code use this construct: cmd_usage(cmdtp); return 1; Change cmd_usage() let it return 1 - then we can replace all these ocurrances by return cmd_usage(cmdtp); This fixes a few places with incorrect return code handling, too. Signed-off-by: Wolfgang Denk <wd@denx.de>
* Make sure that argv[] argument pointers are not modified.Wolfgang Denk2010-07-04-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hush shell dynamically allocates (and re-allocates) memory for the argument strings in the "char *argv[]" argument vector passed to commands. Any code that modifies these pointers will cause serious corruption of the malloc data structures and crash U-Boot, so make sure the compiler can check that no such modifications are being done by changing the code into "char * const argv[]". This modification is the result of debugging a strange crash caused after adding a new command, which used the following argument processing code which has been working perfectly fine in all Unix systems since version 6 - but not so in U-Boot: int main (int argc, char **argv) { while (--argc > 0 && **++argv == '-') { /* ====> */ while (*++*argv) { switch (**argv) { case 'd': debug++; break; ... default: usage (); } } } ... } The line marked "====>" will corrupt the malloc data structures and usually cause U-Boot to crash when the next command gets executed by the shell. With the modification, the compiler will prevent this with an error: increment of read-only location '*argv' N.B.: The code above can be trivially rewritten like this: while (--argc > 0 && **++argv == '-') { char *arg = *argv; while (*++arg) { switch (*arg) { ... Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Remove deprecated 'autoscr' command/variablesPeter Tyser2009-09-22-18/+0
| | | | | | | | | | | | | | | The more standard 'source' command provides identical functionality to the autoscr command. Environment variable names/values on the MVBC_P, MVBML7, kmeter1, mgcoge, and km8xx boards are updated to no longer refernce 'autoscr'. The 'autoscript' and 'autoscript_uname' environment variables are also removed. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Acked-by: Andre Schwarz <andre.schwarz@matrix-vision.de> Acked-by: Heiko Schocher <hs@denx.de>
* General help message cleanupWolfgang Denk2009-06-12-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many of the help messages were not really helpful; for example, many commands that take no arguments would not print a correct synopsis line, but "No additional help available." which is not exactly wrong, but not helpful either. Commit ``Make "usage" messages more helpful.'' changed this partially. But it also became clear that lots of "Usage" and "Help" messages (fields "usage" and "help" in struct cmd_tbl_s respective) were actually redundant. This patch cleans this up - for example: Before: => help dtt dtt - Digital Thermometer and Thermostat Usage: dtt - Read temperature from digital thermometer and thermostat. After: => help dtt dtt - Read temperature from Digital Thermometer and Thermostat Usage: dtt Signed-off-by: Wolfgang Denk <wd@denx.de>
* Fix quoting bug introduced by commit 74de7aefWolfgang Denk2009-04-04-1/+1
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Add "source" command; prepare removal of "autoscr" commandWolfgang Denk2009-04-03-3/+4
| | | | | | | | | | | | | | | | | | | | | According to the doc/feature-removal-schedule.txt, the "autoscr" command will be replaced by the "source" command in approximately 6 months from now. This patch prepares this change and starts a 6 month transition period as follows: - The new "source" command has been added, which implements exactly the same functionlaity as the old "autoscr" command before - The old "autoscr" command name is kept as an alias for compatibility - Command sequences, script files atc. have been adapted to use the new "source" command - Related environment variables ("autoscript", "autoscript_uname") have *not* been adapted yet; these will be renamed resp. removed in a separate patch when the support for the "autoscr" command get's finally dropped. Signed-off-by: Wolfgang Denk <wd@denx.de>
* Command usage cleanupPeter Tyser2009-01-28-7/+7
| | | | | | | | Remove command name from all command "usage" fields and update common/command.c to display "name - usage" instead of just "usage". Also remove newlines from command usage fields. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* Standardize command usage messages with cmd_usage()Peter Tyser2009-01-28-1/+1
| | | | Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD2008-10-18-20/+20
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* loads: allow negative offsetsRicardo Ribalda Delgado2008-09-06-5/+5
| | | | Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
* common/cmd_load.c cleanup - remove unused variablesGururaja Hebbar K R2008-08-27-10/+0
| | | | | | | - Remove unused global variable os_data_count. - Remove unused variable z. Signed-off-by: Gururaja Hebbar <gururajakr@sanyo.co.in>
* common/cmd_load.c - Minor code & Coding Style cleanupGururaja Hebbar K R2008-08-11-7/+8
| | | | | | | | | - os_data_header Variable is a carry over feature & unused. So removed all instance of this variable - Minor Code Style Update Signed-off-by: Gururaja Hebbar <gururajakr@sanyo.co.in> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* [new uImage] Add new uImage format support to autoscript routineMarian Balakowicz2008-03-12-2/+9
| | | | | | | | | | | | | | | autoscript() routine is updated to accept second argument, which is only used for FIT images and provides a FIT subimage unit name. autoscript() routine callers must now pass two arguments. For non-interactive use (like in cmd_load.c, cmd_net.c), new environment variable 'autoscript_uname' is introduced and used as a FIT subimage unit name source. autoscript command accepts extended syntax of the addr argument: addr:<subimg_uname> Signed-off-by: Marian Balakowicz <m8@semihalf.com>
* common/: Remove lingering references to CFG_CMD_* symbols.Jon Loeliger2007-07-10-9/+9
| | | | | | | | Fixed some broken instances of "#ifdef CMD_CFG_IDE" too. Those always evaluated TRUE, and thus were always compiled even when IDE really wasn't defined/wanted. Signed-off-by: Jon Loeliger <jdl@freescale.com>
* common/cmd_[i-n]*: Remove obsolete references to CONFIG_COMMANDS.Jon Loeliger2007-07-08-10/+10
| | | | Signed-off-by: Jon Loeliger <jdl@freescale.com>
* common/cmd_[i-z]* : Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).Jon Loeliger2007-07-04-11/+13
| | | | | | | | | | | | | | This is a compatibility step that allows both the older form and the new form to co-exist for a while until the older can be removed entirely. All transformations are of the form: Before: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) After: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) Signed-off-by: Jon Loeliger <jdl@freescale.com>
* Declare load_serial_ymodem() when using CFG_CMD_LOADB.Wolfgang Denk2006-05-02-1/+4
| | | | Patch by Jon Loeliger, 01. May 2006
* Some code cleanupWolfgang Denk2006-04-16-35/+37
|
* * Add support for ymodem protocol downloadWolfgang Denk2006-04-01-12/+92
|\ | | | | | | | | | | | | | | Patch by Stefano Babic, 29 Mar 2006 * Memory Map Update for Delta board: U-Boot is at 0x80000000-0x84000000 Merge with /home/mk/8-benq/u-boot
| * Add support for ymodem protocol (loady command).Markus Klotzbuecher2006-03-30-13/+92
| | | | | | | | Patch by Stefano Babic, 29 Mar 2006
* | GCC-4.x fixes: clean up global data pointer initialization for all boards.Wolfgang Denk2006-03-31-5/+1
|/
* Cleanup for GCC-4.xWolfgang Denk2005-10-13-1/+1
|
* Add support for Siemens SX1 mobile phone;wdenk2004-03-12-21/+21
| | | | | add support for USB-based console (enable with "setenv stdout usbtty; setenv stdin usbtty")
* * CVS add missing fileswdenk2004-02-23-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * Cleanup compiler warnings * Fix problem with side effects in macros in include/usb.h * Patch by David Benson, 13 Nov 2003: bug 841358 - fix TFTP download size limit * Fixing bug 850768: improper flush_cache() in load_serial() * Fixing bug 834943: MPC8540 - missing volatile declarations * Patch by Stephen Williams, 09 Feb 2004: Add support for Xilinx SystemACE chip: - New files common/cmd_ace.c and include/systemace.h - Hook systemace support into cmd_fat and the partition manager * Patch by Travis Sawyer, 09 Feb 2004: Add bi_opbfreq & bi_iic_fast to 440GX bd_info as needed for Linux
* * Implement new mechanism to export U-Boot's functions to standalonewdenk2003-07-24-5/+4
| | | | | | | | applications: instead of using (PPC-specific) system calls we now use a jump table; please see doc/README.standalone for details * Patch by Dave Westwood, 24 Jul 2003: added support for Unity OS (a proprietary OS)
* * Add support for NSCU boardwdenk2003-07-07-2/+2
| | | | | | | * Add support for TQM823M, TQM850M, TQM855M and TQM860M modules * Add support for Am29LV160ML, Am29LV320ML, and Am29LV640ML mirror bit flash on TQM8xxM modules
* Patch by Kenneth Johansson, 30 Jun 2003:wdenk2003-07-01-12/+12
| | | | get rid of MK_CMD_ENTRY macro; update doc/README.command
* Fix some missing commands, cleanup header fileswdenk2003-06-29-1/+0
| | | | (autoscript, bmp, bsp, fat, mmc, nand, portio, ...)
* * Code cleanup:wdenk2003-06-27-0/+1057
- 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)