Commit Graph

38 Commits

Author SHA1 Message Date
Wolfgang Denk
1a4596601f Add GPL-2.0+ SPDX-License-Identifier to source files
Signed-off-by: Wolfgang Denk <wd@denx.de>
[trini: Fixup common/cmd_io.c]
Signed-off-by: Tom Rini <trini@ti.com>
2013-07-24 09:44:38 -04:00
Wolfgang Denk
54841ab50c Make sure that argv[] argument pointers are not modified.
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>
2010-07-04 23:55:42 +02:00
Wolfgang Denk
a89c33db96 General help message cleanup
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>
2009-06-12 20:47:16 +02:00
Peter Tyser
2fb2604d5c Command usage cleanup
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>
2009-01-28 08:49:52 +01:00
Jean-Christophe PLAGNIOL-VILLARD
6d0f6bcf33 rename CFG_ macros to CONFIG_SYS
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-10-18 21:54:03 +02:00
Jon Loeliger
fd9bcaa35b common/cmd_[p-x]*: Remove obsolete references to CONFIG_COMMANDS.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
2007-07-08 18:05:39 -05:00
Jon Loeliger
65c450b47a common/cmd_[i-z]* : Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
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>
2007-07-04 00:23:09 +02:00
Detlev Zundel
9912121f7e Change 'repeatable' attribute of some commands to sensible values.
Most prominently this changes 'erase' to be non-repeatable.

Signed-off-by: Detlev Zundel <dzu@denx.de>
2007-06-12 14:23:00 +02:00
Wolfgang Denk
9d40799551 Major PCMCIA Cleanup to make code better readable and maintainable.
Notes:
- Board-dependend code for RPXLITE and RPXCLASSIC-based boards
  placed to the drivers/rpx_pmcia.c file to avoid duplication.
  Same for TQM8xx-based boards (drivers/tqm8xx_pmcia.c).
- drivers/i82365.c has been split into two parts located at
  board/atc/ti113x.c and board/cpc45/pd67290.c (ATC and CPC45 are
  the only boards using CONFIG_82365).
- Changes were tested for clean build and *very* *few* boards.
2006-07-10 23:07:28 +02:00
Wolfgang Denk
6516525083 Fix PCMCIA support on virtlab2 2006-05-15 13:52:51 +02:00
Wolfgang Denk
319b9a5467 Cleanup compile warning. 2006-05-12 16:32:32 +02:00
Wolfgang Denk
8cba090c58 Add support for VirtLab2 board
(needed because of differences in the PCMCIA hardware).
2006-05-12 16:15:46 +02:00
Wolfgang Denk
77ddac9480 Cleanup for GCC-4.x 2005-10-13 16:45:02 +02:00
wdenk
e2ffd59b4d * Code cleanup, mostly for GCC-3.3.x
* Cleanup confusing use of CONFIG_ETH*ADDR - ust his only to
  pre-define a MAC address; use CONFIG_HAS_ETH* to enable support for
  additional ethernet addresses.

* Cleanup drivers/i82365.c - avoid duplication of code

* Fix bogus "cannot span across banks" flash error message

* Add support for CompactFlash for the CPC45 Board.
2004-12-31 09:32:47 +00:00
wdenk
f7d1572bf5 Add support for UC100 board 2004-12-18 22:35:43 +00:00
wdenk
6e5923851e * Cleanup, minor fixes
* Patch by Rune Torgersen, 16 Apr 2004:
  LBA48 fixes

* Patches by Pantelis Antoniou, 16 Apr 2004:
  - Fix some compile problems;
    add "once" functionality for the netretry variable
2004-04-18 17:39:38 +00:00
wdenk
c26e454dfc Patches by Pantelis Antoniou, 16 Apr 2004:
- add support for a new version of an Intracom board and fix
  various other things on others.
- add verify support to the crc32 command (define
  CONFIG_CRC32_VERIFY to enable it)
- fix FEC driver for MPC8xx systems:
  1. fix compilation problems for boards that use dynamic
     allocation of DPRAM
  2. shut down FEC after network transfers
- HUSH parser fixes:
  1. A new test command was added. This is a simplified version of
     the one in the bourne shell.
  2. A new exit command was added which terminates the current
     executing script.
  3. Fixed handing of $? (exit code of last executed command)
2004-04-18 10:13:26 +00:00
wdenk
db01a2ea99 * Patch by Stephen Williams, 01 Apr 2004:
Add support for Picture Elements JSE board

* Patch by Christian Pell, 01 Apr 2004:
  Add CompactFlash support for PXA systems.
2004-04-15 23:14:49 +00:00
wdenk
04a85b3b36 * Patches by Pantelis Antoniou, 30 Mar 2004:
- add auto-complete support to the U-Boot CLI
  - add support for NETTA and NETPHONE boards; fix NETVIA board

* Patch by Yuli Barcohen, 28 Mar 2004:
  - Add support for MPC8272 family including MPC8247/8248/8271/8272
  - Add support for MPC8272ADS evaluation board (another flavour of MPC8260ADS)
  - Change configuration method for MPC8260ADS family
2004-04-15 18:22:41 +00:00
wdenk
0608e04da9 * Patch by Klaus Heydeck, 13 Mar 2003:
Add support for KUP4X Board
2004-03-25 19:29:38 +00:00
wdenk
c40b295682 * Patch by Rune Torgersen, 27 Feb 2004:
- Added LBA48 support (CONFIG_LBA48 & CFG_64BIT_LBA)
  - Added support for 64bit printing in vsprintf (CFG_64BIT_VSPRINTF)
  - Added support for 64bit strtoul (CFG_64BIT_STRTOUL)

* Patch by Masami Komiya, 27 Feb 2004:
  Fix rarpboot: add autoload by NFS

* Patch by Dan Eisenhut, 26 Feb 2004:
  fix flash_write return value in saveenv

* Patch by Stephan Linz, 11 Dec 2003
  expand config.mk to avoid trigraph warnings on NIOS

* Rename "BMS2003" board into "HMI10"
2004-03-13 23:29:43 +00:00
wdenk
a6cccaea5a * Patch by Wolter Kamphuis, 15 Dec 2003:
made CONFIG_SILENT_CONSOLE usable on all architectures

* Disable date command on TQM866M - there is no RTC on MPC866
2004-02-06 21:48:22 +00:00
wdenk
a522fa0e7c * Make BMS2003 use a separate config file to avoid #ifdef mess;
add I2C support; add support for DS1337 RTC

* Add CompactFlash support  for BMS2003 board

* Add support for status LED on BMS2003 board
2004-01-04 22:51:12 +00:00
wdenk
7cb22f97ee * Make CPU clock on ICA-IP board controllable by a "cpuclk"
environment variable which can set to "100", "133", or "150". The
  CPU clock will be configured accordingly upon next reboot. Other
  values are ignored. In case of an invalid or undefined "cpuclk"
  value, the compile-time default CPU clock speed will be used.

* Enable Quad-UART on BMS2003 board (initialize the PCMCIA memory
  window that is used to access the UART registers by the Linux driver)

* Patch by Reinhard Meyer, 20 Dec 2003:
  Fix clock calculation for the MPC5200 for higher clock frequencies
  (above 2**32 / 10 = 429.5 MHz).
2003-12-27 19:24:54 +00:00
wdenk
b028f71513 * Patch by Yuli Barcohen, 3 Dec 2003:
"revive" U-Boot support for old Motorola MPC860ADS board

* Patch by Cam(ilo?), 03 Dec 2003:
  make examples build even with broken Montavista objcopy

* Patch by Pavel Bartusek, 27 Nov 2003:
  fix conversion problem with "bootretry" evironment variable
2003-12-07 21:39:28 +00:00
dzu
e7df029f1a Add CompactFlash support for NSCU 2003-10-19 21:43:26 +00:00
wdenk
0d4983930a Patch by Kenneth Johansson, 30 Jun 2003:
get rid of MK_CMD_ENTRY macro; update doc/README.command
2003-07-01 21:06:45 +00:00
wdenk
8bde7f776c * 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)
2003-06-27 21:31:46 +00:00
wdenk
7f70e85309 * Patch by David Updegraff, 22 Apr 2003:
update for CrayL1 board

* Patch by Pantelis Antoniou, 21 Apr 2003:
  add boot support for ARTOS (a proprietary OS)

* Patch by Steven Scholz, 11 Apr 2003:
  Add support for RTC DS1338

* Patch by Rod Boyce, 24 Jan 2003:
  Fix counting of extended partitions in diskboot command
2003-05-20 14:25:27 +00:00
wdenk
66fd3d1ce7 Add support for CompactFlash on ATC board
(includes support for Intel 82365 and compatible PC Card controllers,
and Yenta-compatible PCI-to-CardBus controllers)
2003-05-18 11:30:09 +00:00
wdenk
dc7c9a1a52 * Patch by Rick Bronson, 16 Mar 2003:
Add support for Atmel AT91RM9200DK w/NAND

* Patches by Robert Schwebel, 19 Mar 2003:
  - use arm-linux-gcc as default compiler for ARM
  - fix i2c fixup code
  - fix missing baudrate setting
  - added $loadaddr / CFG_LOAD_ADDR support to loadb
  - moved "ignoring trailing characters" _before_ u-boot wants to
    print out diagnostics messages; removes bogus characters at the
    end of transmission

* Patch by John Zhan, 18 Mar 2003:
  Add support for SinoVee Microsystems SC8xx boards

* Patch by Rolf Offermanns, 21 Mar 2003:
  ported the dnp1110 related changes from the current armboot cvs to
  current u-boot cvs. smc91111 does not work. problem marked in
  smc91111.c, grep for "FIXME".

* Patch by Brian Auld, 25 Mar 2003:
  Add support for STM flash chips on ebony board

 * Add PCI support for MPC8250 Boards (PM825 module)

 * Patch by Stefan Roese, 25 Mar 2003:
2003-03-26 06:55:25 +00:00
wdenk
6069ff2653 * Add support for 16 MB flash configuration of TRAB board
* 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
2003-02-28 00:49:47 +00:00
wdenk
d0fb80c302 * Restrict baudrate settings on LWMON to higher speeds
when watchdog is on

* Update baudrate in bd_info when it gets changed

* Add watchdog trigger points while waiting for serial port
  (so far only 8xx -- needed on LWMON with 100ms watchdog)

* Improve command line tool to access the U-Boot's environment
  (figuration of the utility, using a config file)
2003-01-11 09:48:40 +00:00
wdenk
1f53a41603 Add LED indication for IDE activity on KUP4K board 2002-12-04 23:39:58 +00:00
wdenk
a6c7ad2f65 * Fix startup problems with VFD display on TRAB
* Patch by Pierre Aubert, 20 Nov 2002
  Add driver for Epson SED13806 graphic controller.
  Add support for BMP logos in cfb_console driver.
2002-12-03 21:28:10 +00:00
wdenk
ea909b7604 * Added support for both PCMCIA slots (at the same time!) on MPC8xx
* Patch by Rod Boyce, 21 Nov 2002:
  fix PCMCIA on MBX8xx board

* Patch by Pierre Aubert , 21 Nov 2002
  Add CFG_CPM_POST_WORD_ADDR to make the offset of the
  bootmode word in DPRAM configurable
2002-11-21 23:11:29 +00:00
wdenk
56f94be3ef * Add support for log buffer which can be passed to Linux kernel's
syslog mechanism; used especially for POST results.

* Patch by Klaus Heydeck, 31 Oct 2002:
  Add initial support for kup4k board
2002-11-05 16:35:14 +00:00
wdenk
c609719b8d Initial revision 2002-11-03 00:24:07 +00:00