Commit Graph

1117 Commits

Author SHA1 Message Date
Peter Tyser
62c3ae7c6e Standardize command usage messages with cmd_usage()
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-01-28 08:43:45 +01:00
Mike Frysinger
cf7e399fb3 SATA: do not auto-initialize during boot
Rather than have the board code initialize SATA automatically during boot,
make the user manually run "sata init".  This brings the SATA subsystem in
line with common U-Boot policy.

Rather than having a dedicated weak function "is_sata_supported", people
can override sata_initialize() to do their weird board stuff.  Then they
can call the actual __sata_initialize().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-27 23:42:39 +01:00
Tomasz Figa
b5b004ad8a jffs2: Fix zero sector_size when not using CONFIG_JFFS2_CMDLINE
This patch fixes a bug (?) introduced after inclusion of the new
JFFS2 code.

When not using CONFIG_JFFS2_CMDLINE, the code in cmd_jffs2.c doesn't
fill in part->sector_size (keeping it as 0), but a correct value is
needed by the code in jffs2_1pass.c. This causes all JFFS2 accesses
to be in the same place of the memory, what obviously means
impossibility to use the JFFS2 partition.

This problem is fixed in this patch by including sector size
calculation in non-CONFIG_JFFS2_CMDLINE mtdparts_init variant.

Signed-off-by: Tomasz Figa <tomasz.figa_at_gmail.com>
2009-01-27 22:52:58 +01:00
Mike Frysinger
ba69dc26a5 saveenv: standardize enablement
Rather than special casing each environment type for enabling the saveenv
command, have them all behave the same.  This avoids bitrot as new env
sources are added/removed.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-27 22:30:42 +01:00
Matthias Fuchs
107b801cf3 Fix gunzip in case of insufficient output buffer
U-Boot's gunzip() function does not handle the return code
of zlib's inflate() function correctly. gunzip() is implemented
to uncompress all input data in one run. So the correct return
code for the good case is Z_STREAM_END. In case of insufficient
output buffer memory inflate returns Z_OK. For gunzip() this
is an error.

It also makes sense to me to call inflateEnd() also in case
of an error.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
2009-01-27 20:59:09 +01:00
Dirk Eibach
b6fc6fd49a common: Iteration limit for memory test.
The iteration limit is passed to mtest as a fourth parameter:
[start [end [pattern [iterations]]]]
If no fourth parameter is supplied, there is no iteration limit and the
test will loop forever.

Signed-off-by: Dirk Eibach <eibach@gdsys.de>
2009-01-24 01:42:05 +01:00
Peter Korsgaard
c3284b030b common/main: support bootdelay=0 for CONFIG_AUTOBOOT_KEYED
Support bootdelay=0 in abortboot for the CONFIG_AUTOBOOT_KEYED case
similar to the CONFIG_ZERO_BOOTDELAY_CHECK support for the
!CONFIG_AUTOBOOT_KEYED case.

Do this by reversing the loop so we do at least one iteration before
checking for timeout.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2009-01-24 01:24:15 +01:00
Mike Frysinger
6dadc9195a Blackfin: use common strmhz() in system output
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-23 22:59:16 +01:00
Mike Frysinger
d4bade8d77 nand: fixup printf modifiers to match types used
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-01-23 10:32:52 -06:00
Schlaegl Manfred jun
389e6620e2 nand read.jffs2 (nand_legacy) in common/cmd_nand.c
Error with CONFIG_NAND_LEGACY in common/cmd_nand.c:
With current code "nand read.jffs2s" (read and skip bad blocks) is always interpreted as
"nand read.jffs2" (read and fill bad blocks with 0xff). This is because ".jffs2" is
tested before ".jffs2s" and only the first two characters are compared.

Correction:
Test for ".jffs2s" first and compare the first 7 characters.

Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-01-23 10:32:52 -06:00
Nishanth Menon
50657c2732 NAND: Enable nand lock, unlock feature
Enable nand lock, unlock and status of lock feature.
Not every device and platform requires this, hence,
it is under define for CONFIG_CMD_NAND_LOCK_UNLOCK

Nand unlock and status operate on block boundary instead
of page boundary. Details in:
http://www.micron.com/products/partdetail?part=MT29C2G24MAKLAJG-6%20IT

Intial solution provided by Vikram Pandita <vikram.pandita@ti.com>
Includes preliminary suggestions from Scott Wood

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-01-23 10:32:49 -06:00
Stefan Roese
c438ea175d OneNAND: Bad block aware read/write command support
Update OneNAND command to support bad block awareness.
Also change the OneNAND command style to better match the
NAND version.

Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
2009-01-23 10:32:47 -06:00
Peter Korsgaard
c088a108c7 fdt_resize(): fix actualsize calculations with unaligned blobs
The code in fdt_resize() to extend the fdt size to end on a page boundary
is wrong for fdt's not located at an address aligned on a page boundary.
What's even worse, the code would make actualsize shrink rather than grow
if (blob & 0xfff) was bigger than the amount of padding added by ALIGN(),
causing fdt_add_mem_rsv to fail.

Fix it by aligning end address (blob + size) to a page boundary instead.
For aligned fdt's this is equivalent to what we had before.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2009-01-17 13:03:29 -05:00
Jean-Christophe PLAGNIOL-VILLARD
fea91edee8 usb_kbd: fix usb_kbd_deregister when DEVICE_DEREGISTER not enable
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Remy Böhmer <linux@bohmer.net>
2008-12-20 11:03:01 +01:00
Wolfgang Denk
455ae7e87f Coding style cleanup, update CHANGELOG.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-12-16 01:02:17 +01:00
Mike Frysinger
5b3375ac8c env_sf: support embedded environments
If both CONFIG_ENV_SECT_SIZE and CONFIG_ENV_SIZE are defined, and the sect
size is larger than the env size, then it means the env is embedded in a
block.  So we have to save/restore the part of the sector which is not the
environment.  Previously, saving the environment in SPI flash in this
setup would probably brick the board as the rest of the sector tends to
contain actual U-Boot data/code.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-12-16 00:47:10 +01:00
Peter Tyser
d16da93430 cmd_mem: Remove unused variable
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2008-12-14 11:13:52 +01:00
Jean-Christophe PLAGNIOL-VILLARD
cd6734510a Fix FIT and FDT support to have CONFIG_OF_LIBFDT and CONFIG_FIT independent
FDT support is used for both FIT style images and for architectures
that can pass a fdt blob to an OS (ppc, m68k, sparc).

For other architectures and boards which do not pass a fdt blob to an
OS but want to use the new uImage format, we just need FIT support.

Now we can have the 4 following configurations :

1) FIT only             CONFIG_FIT
2) fdt blob only        CONFIG_OF_LIBFDT
3) both                 CONFIG_OF_LIBFDT & CONFIG_FIT
4) none                 none

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-12-13 23:31:49 +01:00
Wolfgang Denk
bd4345c175 Merge branch 'master' of git://git.denx.de/u-boot-ubi 2008-12-13 00:20:01 +01:00
Stefan Roese
3b089e4f88 UBI: Set ubi_dev.type back to DEV_TYPE_NONE upon failing initialization
With this patch we set the type back to NONE upon failing UBI partition
initialization. Otherwise further calls to the UBI subsystem would try
to really access the non-existing UBI partition.

Thanks to Michael Lawnick for pointing this out.

Signed-off-by: Stefan Roese <sr@denx.de>
2008-12-10 12:55:29 +01:00
Ilya Yanok
e0b5532579 jffs2: add sector_size field to part_info structure
This patch adds sector_size field to part_info structure (used
by new JFFS2 code).

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
2008-12-09 23:38:46 +01:00
Stefan Roese
2d2e05727f UBI: Fix size parsing in "ubi create"
Signed-off-by: Stefan Roese <sr@denx.de>
2008-12-09 10:07:41 +01:00
Stefan Roese
2ee951ba2a UBI: Enable re-initializing of the "ubi part" command
With this patch now, the user can call "ubi part" multiple times to
re-connect the UBI device to another MTD partition.

Signed-off-by: Stefan Roese <sr@denx.de>
2008-12-09 10:07:36 +01:00
Wolfgang Denk
c645b181a9 Merge branch 'master' of git://git.denx.de/u-boot-net 2008-12-09 01:00:24 +01:00
Heiko Schocher
4b53001876 jffs2: rename devices_init () in common/jffs2.c
rename devices_init () in common/jffs2.c to
jffs2_devices_init (), because there is also a
devices_init () in common/devices.c.

Signed-off-by: Heiko Schocher <hs@denx.de>
2008-12-08 22:39:40 +01:00
Richard Retanubun
bcdf1d2cf6 common/cmd_ide.c: Corrected endian order printing for compact flash serial number.
Corrected endian order printing for compact flash serial number.

Signed-off-by: Richard Retanubun <RichardRetanubun@RuggedCom.com>
2008-12-07 01:24:53 +01:00
Gary Jennejohn
16a28ef219 IOMUX: Add console multiplexing support.
Modifications to support console multiplexing.  This is controlled using
CONFIG_SYS_CONSOLE_MUX in the board configuration file.

This allows a user to specify multiple console devices in the environment
with a command like this: setenv stdin serial,nc.  As a result, the user can
enter text on both the serial and netconsole interfaces.

All devices - stdin, stdout and stderr - can be set in this manner.

1) common/iomux.c and include/iomux.h contain the environment setting
implementation.
2) doc/README.iomux contains a somewhat more detailed description.
3) The implementation in (1) is called from common/cmd_nvedit.c to
handle setenv and from common/console.c to handle initialization of
input/output devices at boot time.
4) common/console.c also contains the code needed to poll multiple console
devices for input and send output to all devices registered for output.
5) include/common.h includes iomux.h and common/Makefile generates iomux.o
when CONFIG_SYS_CONSOLE_MUX is set.

Signed-off-by: Gary Jennejohn <garyj@denx.de>
2008-12-07 01:23:35 +01:00
Mike Frysinger
774ce72026 strings: use puts() rather than printf()
When running `strings` on really long strings, the stack tends to get
smashed due to printf().  Switch to puts() instead since we're only passing
the data through.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-12-07 01:17:19 +01:00
Niklaus Giger
29a4c24de9 cmd_elf.c: Cleanup bootvx and handle new CONFIG_SYS_VXWORKS parameters
- 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>
2008-12-07 00:18:53 +01:00
Peter Tyser
ace514837c lcd: Let the board code show board-specific info cleanup
remove unneeded version.h from lcd.c

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-12-07 00:08:33 +01:00
Jean-Christophe PLAGNIOL-VILLARD
c8aa7dfc18 FPGA: move fpga drivers to drivers/fpga
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-12-05 22:41:33 +01:00
Peter Tyser
2e4970d810 net: Fix download command parsing
When CONFIG_SYS_HUSH_PARSER is defined network download
commands with 1 argument in the format 'tftp "/path/file"'
do not work as expected. The hush command parser strips
the quotes from "/path/file" which causes the network
commands to interpret "/path/file" as an address
instead of the intended filename.

The previous check for a leading quote in netboot_common()
was replaced with a check which ensures only valid
numbers are treated as addresses.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
2008-12-04 22:51:54 -08:00
Wolfgang Denk
26f6a2b7f3 Merge branch 'master' of git://git.denx.de/u-boot-usb 2008-12-05 00:24:32 +01:00
Stefan Roese
5e46b1e541 OneNAND: Add missing mtd info struct before calling onenand_erase()
Without this patch "saveenv" crashes when MTD partitions are enabled (e.g.
for use in UBI) via CONFIG_MTD_PARTITIONS.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2008-12-02 13:48:15 -06:00
Michael Trimarchi
bebfc6ef3e Remove obsolete command (apply afte USB style patch, 80 chars strict)
Remove USB obsolete commmand

Signed-off-by: Michael Trimarchi <trimarchi@gandalf.sssup.it>
Signed-off-by: Remy Böhmer <linux@bohmer.net>
2008-11-28 21:24:13 +01:00
Michael Trimarchi
de39f8c19d USB style patch, 80 chars strict
USB Code style patch

Signed-off-by: Michael Trimarchi <trimarchi@gandalf.sssup.it>
Signed-off-by: Remy Böhmer <linux@bohmer.net>
2008-11-28 21:24:12 +01:00
Piotr Ziecik
25ea652e90 UBI: Add proof-of-concept CFI flash support
With this patch UBI can be used on CFI flash chips.

Signed-off-by: Piotr Ziecik <kosmo@semihalf.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2008-11-24 11:33:33 +01:00
Stefan Roese
a5c4067017 UBI: Change parsing of size in commands to default to hex
Currently the size parameters of the UBI commands (e.g. "ubi write") are
decoded as decimal instead of hex as default. This patch now interprets
all these values consistantly as hex, as all other standard U-Boot commands
do.

Signed-off-by: Stefan Roese <sr@denx.de>
2008-11-24 08:31:16 +01:00
Kyungmin Park
694a0b3f1c UBI: Add UBI command support
This patch adds these UBI commands:

ubi part [nand|onenand] [part] - Show or set current partition
ubi info [l[ayout]] -Display volume and UBI layout information
ubi create[vol] volume [size] [type] - Create volume name with size
ubi write[vol] address volume size - Write volume from address with size
ubi read[vol] address volume [size] - Read volume to address with size
ubi remove[vol] volume - Remove volume

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2008-11-19 20:34:39 +01:00
Jean-Christophe PLAGNIOL-VILLARD
a80b21d512 common/Makefile: create others group for non core, environment and command files
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-11-02 16:33:07 +01:00
Andy Fleming
20d04774f4 Consolidate MAX/MIN definitions
There were several, now there is one (two if you count the lower-case
versions).

Signed-off-by: Andy Fleming <afleming@freescale.com>
2008-11-02 16:23:46 +01:00
Wolfgang Denk
3cbd823116 Coding Style cleanup, update CHANGELOG
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-11-02 16:14:22 +01:00
Peter Korsgaard
f242a08871 fdt_resize(): ensure minimum padding
fdt_add_mem_rsv() requires space for a struct fdt_reserve_entry
(16 bytes), so make sure that fdt_resize at least adds that much
padding, no matter what the location or size of the fdt is.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Acked-by: Andy Fleming <afleming@freescale.com>
2008-10-30 20:37:57 -04:00
Scott Wood
695c130e4b NAND: Align right column of the shorthelp with other commands.
I accidentally broke this in when making consistent the partial
alignment of the longhelp.

Signed-off-by: Scott Wood <scottwood@freescale.com>
2008-10-29 10:42:18 -05:00
Kumar Gala
b1d0db1805 bootm: Added CONFIG_BOOTM_{LINUX, NETBSD, RTEMS}
Added the ability to config out bootm support for Linux, NetBSD, RTEMS

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-10-29 01:00:20 +01:00
Kumar Gala
49c3a861d1 bootm: Add subcommands
Add the ability to break the steps of the bootm command into several
subcommands: start, loados, ramdisk, fdt, bdt, cmdline, prep, go.

This allows us to do things like manipulate device trees before
they are passed to a booting kernel or setup memory for a secondary
core in multicore situations.

Not all OS types support all subcommands (currently only start, loados,
ramdisk, fdt, and go are supported).

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-10-29 00:59:50 +01:00
Kumar Gala
be08315933 bootm: Move to using a function pointer table for the boot os function
This removes a bit of code and makes it easier for the upcoming sub bootm
command support to call into the proper OS specific handler.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-10-29 00:57:31 +01:00
Wolfgang Denk
d35c451d6c Merge branch 'master' of git://git.denx.de/u-boot-video 2008-10-28 08:37:19 +01:00
Haavard Skinnemoen
6b59e03e02 lcd: Let the board code show board-specific info
The information displayed when CONFIG_LCD_INFO is set is inherently
board-specific, so it should be done by the board code. The current code
dealing with this only handles two cases, and is already a horrible mess
of #ifdeffery.

Yes, this duplicates some code, but it also allows boards to print more
board-specific information; this used to be very difficult.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2008-10-27 09:53:58 +01:00
Haavard Skinnemoen
6f93d2b8fc lcd: Set lcd_is_enabled before clearing the screen
This allows the logo/info rendering routines to use the regular
lcd_putc/lcd_puts/lcd_printf calls.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2008-10-25 22:59:41 +02:00