summaryrefslogtreecommitdiffstats
path: root/common/cmd_elf.c
Commit message (Collapse)AuthorAgeFilesLines
* cmd_elf: add an option for loading ELFs according to PHDRsMike Frysinger2010-10-061-9/+53
| | | | | | | | | | | | | | The current ELF loading function does a lot of work above and beyond a simple "loading". It ignores the real load addresses and loads things into their virtual (runtime) address. This is undesirable when we just want it to load an ELF and let the ELF do the actual C runtime init. So add a command line option to let people choose to load via either the program or section headers. I'd prefer to have program header loading be the default, but this would break historical behavior, so I'll leave section header loading as the norm. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Make sure that argv[] argument pointers are not modified.Wolfgang Denk2010-07-041-3/+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>
* Less verbose output when loading vxworks 6.x imagesNiklaus Giger2009-07-271-1/+1
| | | | | | | | Loading vxWorks 5.x images resulted just into 3 or 4 lines of output. With vxWorks 6.x and the new GCC it emits about 30 lines, which is far too noisy in my opinion. Signed-off-by: Niklaus Giger <niklaus.giger@member.fsf.org>
* General help message cleanupWolfgang Denk2009-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ppc: cleanup compiler errors/warningsHeiko Schocher2009-03-271-2/+2
| | | | | | | | | | | | | Current u-boot top of tree builds with warnings/errors for the following boards: ads5121 cpci5200 mecp5200 v38b IAD210 MBX MBX860T NX823 RPXClassic debris PN62 following patch solves this. Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* bootvx: get mac address from environmentMike Frysinger2009-03-201-2/+4
| | | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Niklaus Giger <niklaus.giger@member.fsf.org> CC: Ben Warren <biggerbadderben@gmail.com>
* Command usage cleanupPeter Tyser2009-01-281-2/+2
| | | | | | | | 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>
* cmd_elf.c: Cleanup bootvx and handle new CONFIG_SYS_VXWORKS parametersNiklaus Giger2008-12-071-47/+30
| | | | | | | | | | | | - fix size too small by one in sprintf - changed old (pre 2004) device name ibmEmac to emac - boot device may be overriden in board config - servername may be defined in board config - additional parameters may be defined in board config - fixed some line wrappings - replaced redundant MAX define by max Signed-off-by: Niklaus Giger <niklaus.giger@member.fsf.org>
* Consolidate MAX/MIN definitionsAndy Fleming2008-11-021-4/+0
| | | | | | | There were several, now there is one (two if you count the lower-case versions). Signed-off-by: Andy Fleming <afleming@freescale.com>
* rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD2008-10-181-4/+4
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* allow ports to override bootelf behaviorMike Frysinger2008-04-181-12/+21
| | | | | | Change the bootelf setup function into a dedicated weak function called do_bootelf_exec. This way ports can control the behavior however they like before/after calling the ELF entry point.
* disable caches before booting an app for Blackfin appsMike Frysinger2008-04-131-6/+16
| | | | | | | | | | | | It isn't generally save to execute applications outside of U-Boot with caches enabled due to the way the Blackfin processor handles caches (requires software assistance). This patch disables caches before booting an ELF or just booting raw code. The previous discussion on the patch was that we wanted to use weaks instead, but that proved to not be feasible when multiple symbols are involved, which puts us back at the ifdef solution. I've minimized the ugliness by moving the setup step outside of the main function. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* [BUILD] conditionally compile common/cmd_*.c in common/MakefileGrant Likely2007-11-201-4/+0
| | | | | | | Modify common/Makefile to conditionally compile the cmd_*.c files based on the board config. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* common/: Remove lingering references to CFG_CMD_* symbols.Jon Loeliger2007-07-101-1/+1
| | | | | | | | 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_[af]*: Remove obsolete references to CONFIG_COMMANDS.Jon Loeliger2007-07-081-2/+2
| | | | Signed-off-by: Jon Loeliger <jdl@freescale.com>
* common/cmd_[a-f]* : Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).Jon Loeliger2007-07-041-2/+2
| | | | | | | | | | | | | | 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>
* [PATCH] common/cmd_elf.c: Enable loadaddr as parameter in bootvx commandStefan Roese2006-11-291-7/+5
| | | | | | | | | In the bootvx command the load address was only read from the env variable "loadaddr" and not optionally passed as paramter as described in the help. This is fixed with this patch. The behaviour is now the same as in the bootelf command. Signed-off-by: Stefan Roese <sr@denx.de>
* GCC-4.x fixes: clean up global data pointer initialization for all boards.Wolfgang Denk2006-03-311-5/+3
|
* Add support for AMCC PPC440EP/GR eval boards Yosemite and Yellowstone.Stefan Roese2005-08-011-2/+2
| | | | Patch by Steven Blakeslee, 27 Jul 2005
* code cleanup: use CFG_VXWORKS_MAC_PTR instead of multiple board definesstroese2004-12-161-8/+3
|
* * Patches by Thomas Viehweger, 16 Mar 2004:wdenk2004-03-231-5/+5
| | | | | | | | | - show PCI clock frequency on MPC8260 systems - add FCC_PSMR_RMII flag for HiP7 processors - in do_jffs2_fsload(), take load address from load_addr if not set explicit, update load_addr otherwise - replaced printf by putc/puts when no formatting is needed (smaller code size, faster execution)
* Patch by Kenneth Johansson, 30 Jun 2003:wdenk2003-07-011-4/+4
| | | | get rid of MK_CMD_ENTRY macro; update doc/README.command
* * Code cleanup:wdenk2003-06-271-19/+31
| | | | | | | | | - 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)
* * Add support for 16 MB flash configuration of TRAB boardwdenk2003-02-281-0/+2
| | | | | | | | | | | | | | | | | * Patch by Erwin Rol, 27 Feb 2003: Add support for RTEMS * Add image information to README * Fix dual PCMCIA slot support (when running with just one slot populated) * Add VFD type detection to trab board * extend drivers/cs8900.c driver to synchronize ethaddr environment variable with value in the EEPROM * Start adding MIPS support files
* * Patch by Andreas Oberritter, 09 Nov 2002:wdenk2002-11-111-1/+1
| | | | | | | | | | | | | | | | Change behaviour of NetLoop(): return -1 for errors, filesize otherwise; return code 0 is valid an means no file loaded - in this case the environment still gets updated! * Patches by Jon Diekema, 9 Nov 2002: - improve ADC/DAC clocking on the SACSng board to align the failing edges of LRCLK and SCLK - sbc8260 configuration tweaks - add status LED support for 82xx systems - wire sspi/sspo commands into command handler; improved error handlering - add timestamp support and alternate memory test to the SACSng configuration
* Initial revisionwdenk2002-09-201-0/+322
OpenPOWER on IntegriCloud