summaryrefslogtreecommitdiffstats
path: root/common/cmd_elf.c
Commit message (Collapse)AuthorAgeFilesLines
* Move all command code into its own directorySimon Glass2016-01-251-410/+0
| | | | | | | | | | | | | | | | | | | | | | | | | There are a lot of unrelated files in common, including all of the commands. Moving them into their own directory makes them easier to find and is more logical. Some commands include non-command code, such as cmd_scsi.c. This should be sorted out at some point so that the function can be enabled with or without the associated command. Unfortunately, with m68k I get this error: m68k: + M5329AFEE +arch/m68k/cpu/mcf532x/start.o: In function `_start': +arch/m68k/cpu/mcf532x/start.S:159:(.text+0x452): relocation truncated to fit: R_68K_PC16 against symbol `board_init_f' defined in .text.board_init_f section in common/built-in.o I hope someone can shed some light on what this means. I hope it isn't depending on the position of code in the image. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>
* Fix GCC format-security errors and convert sprintfs.Ben Whitten2016-01-141-5/+8
| | | | | | | | | | | With format-security errors turned on, GCC picks up the use of sprintf with a format parameter not being a string literal. Simple uses of sprintf are also converted to use strcpy. Signed-off-by: Ben Whitten <ben.whitten@gmail.com> Acked-by: Wolfgang Denk <wd@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
* cmd: bootvx: Add asmlinkage to the VxWorks x86 entryBin Meng2015-10-211-0/+6
| | | | | | | | VxWorks on x86 uses stack to pass parameters. Reported-by: Jian Luo <jian.luo4@boschrexroth.de> Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
* cmd: bootvx: Pass E820 information to an x86 VxWorks kernelBin Meng2015-10-211-0/+30
| | | | | | | | | | E820 is critical to the kernel as it provides system memory map information. Pass it to an x86 VxWorks kernel. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Tested-by: Jian Luo <jian.luo4@boschrexroth.de>
* cmd: bootvx: Always get VxWorks bootline from envBin Meng2015-10-211-53/+66
| | | | | | | | | | | | | | | | | | | So far VxWorks bootline can be contructed from various environment variables, but when these variables do not exist we get these from corresponding config macros. This is not helpful as it requires rebuilding U-Boot, and to make sure these config macros take effect we should not have these environment variables. This is a little bit complex and confusing. Now we change the logic to always contruct the bootline from environments (the only single source), by adding two new variables "bootdev" and "othbootargs", and adding some comments about network related settings mentioning they are optional. The doc about the bootline handling is also updated. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
* cmd: bootvx: Pass netmask and gatewayip to VxWorks bootlineBin Meng2015-10-211-2/+15
| | | | | | | | | There are fields in VxWorks bootline for netmask and gatewayip. We can get these from U-Boot environment variables and pass them to VxWorks, just like ipaddr and serverip. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* cmd: bootvx: Avoid strlen() calls when constructing VxWorks bootlineBin Meng2015-10-211-10/+10
| | | | | | | | Remember the position in the VxWorks bootline buffer to avoid the call to strlen() each time. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* cmd: elf: Reorder load_elf_image_phdr() and load_elf_image_shdr()Bin Meng2015-10-211-82/+79
| | | | | | | | Move load_elf_image_phdr() and load_elf_image_shdr() to the beginning of the cmd_elf.c so that forward declaration is not needed. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* cmd: Clean up cmd_elf a little bitBin Meng2015-10-211-98/+73
| | | | | | | | | This commit cleans up cmd_elf.c per U-Boot coding convention, and removes the unnecessary DECLARE_GLOBAL_DATA_PTR and out-of-date powerpc comments (it actually supports not only powerpc targets). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* net: cosmetic: Fix checkpatch.pl failures in net.cJoe Hershberger2015-04-181-1/+1
| | | | | | | Finish eliminating CamelCase from net.c and other failures Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* common: cmd_elf: Add support to disable start of applicationSiva Durga Prasad Paladugu2015-03-091-0/+4
| | | | | | | | Added support to disable the start of application by using a environment variable autostart Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* linux/kernel.h: sync min, max, min3, max3 macros with LinuxMasahiro Yamada2014-11-231-6/+6
| | | | | | | | | | | | | | | | | | | | U-Boot has never cared about the type when we get max/min of two values, but Linux Kernel does. This commit gets min, max, min3, max3 macros synced with the kernel introducing type checks. Many of references of those macros must be fixed to suppress warnings. We have two options: - Use min, max, min3, max3 only when the arguments have the same type (or add casts to the arguments) - Use min_t/max_t instead with the appropriate type for the first argument Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Pavel Machek <pavel@denx.de> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Lukasz Majewski <l.majewski@samsung.com> [trini: Fixup arch/blackfin/lib/string.c] Signed-off-by: Tom Rini <trini@ti.com>
* common/cmd_elf.c: add missing includeJeroen Hofstee2014-10-251-0/+1
| | | | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> [trini: bootm.h must come after common.h] Signed-off-by: Tom Rini <trini@ti.com>
* common: cmd_elf: make do_bootelf_exec staticJeroen Hofstee2014-10-251-2/+1
| | | | | | | do_bootelf_exec was a weak function without a prototype nor and strong version. Just make it static. Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* Correct vxWorks elf boot to load at correct addressStany MARCEL2013-12-131-3/+3
| | | | | | | argv[0] contains bootvx (command name) not the load address, if called with argv < 2 use load_addr, else use address argument given to the command. Signed-off-by: Stany MARCEL <smarcel@novasys-ingenierie.com>
* bootm: Correct the arguments for the ELF image loaderSimon Glass2013-07-121-3/+3
| | | | | | | The arguments were out of place since commit 983c72f, since this file was missed and not tested. Correct this. Signed-off-by: Simon Glass <sjg@chromium.org>
* cmd_elf: Fix broken bootvx commandReinhard Arlt2013-02-201-1/+1
| | | | | | Fix broken bootvx command. Signed-off-by: Reinhard Arlt <reinhard.arlt@esd.eu>
* common: cmd_elf.c: use uintptr_t for casts from u32 to void*Daniel Schwierzeck2012-10-151-3/+4
| | | | | | | | | | | | This fixes warnings when compiling with ELDK-5.2.1 for MIPS64: cmd_elf.c: In function 'load_elf_image_phdr': cmd_elf.c:289:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] cmd_elf.c: In function 'load_elf_image_shdr': cmd_elf.c:343:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] cmd_elf.c:346:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
* common: cmd_elf.c: fix checkpath.pl warningsDaniel Schwierzeck2012-10-151-95/+94
| | | | | | | | [Tom: Move valid_elf_image around and don't mark it as static as another board makes use of this function] Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Tom Rini <trini@ti.com>
* bootvx: Clear and disable data cache, and call vxWorks with parameter.Reinhard Arlt2012-03-181-1/+2
| | | | | | | | | | | | | | | | | This patch clear and disable the data cache for vxWorks. The entry point sysInit(int) intended by Windriver to be called from the vxWorks bootrom, a very small vxWorks system. The routine is called by the go() handler in the bootrom, that clears the cache from start of image to end of usable memory. The PowerPC implementations only invalidates and disable the cache, the ARM implementations also flush it. U-Boot will be on the safe side, if it disables the data cache before calling vxWorks sysInit(int). Signed-off-by: Reinhard Arlt <reinhard.arlt@esd.eu>
* net: tftpput: Rename TFTP to TFTPGETSimon Glass2011-10-261-3/+3
| | | | | | | | This is a better name for this protocol. Also remove the typedef to keep checkpatch happy, and move zeroing of NetBootFileXferSize a little earlier since TFTPPUT will need to change this. Signed-off-by: Simon Glass <sjg@chromium.org>
* 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