Commit Graph

1928 Commits

Author SHA1 Message Date
Simon Glass
5e41088364 bootstage: Convert progress numbers 10-19 to enums
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-18 20:59:53 +01:00
Simon Glass
5dc887164e bootstage: Convert progress numbers 1-9 into enums
Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-18 20:57:37 +01:00
Simon Glass
5ddb118da4 bootstage: Use show_boot_error() for -ve progress numbers
Rather than the caller negating our progress numbers to indicate an
error has occurred, which seems hacky, add a function to indicate this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-18 20:56:00 +01:00
Simon Glass
578ac1e9ba bootstage: Make use of BOOTSTAGE_ID_RUN_OS in show_boot_progress()
This changes the number 15 as used in boot_stage_progress() to use the
new name provided for it. This is a separate patch because it touches
so many files.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-18 20:45:57 +01:00
Reinhard Arlt
6eee21daf3 bootvx: Clear and disable data cache, and call vxWorks with parameter.
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>
2012-03-18 20:14:05 +01:00
Stephen Warren
e37ae40e9d image: Support FDTs already loaded at their load address
boot_get_fdt() expects a uImage-wrapped FDT to be loaded to a staging
location, and then memmove()s it to the load address specified in the
header. This change enhances boot_get_fdt() to detect when the image has
already been loaded to the correct address, and skip this memmove(). The
detection algorithm was written to match the equivalent for the kernel;
see bootm_load_os()'s IH_COMP_NONE case.

v2: New patch

Signed-off-by: Stephen Warren <swarren@nvidia.com>
2012-03-06 22:18:48 +01:00
Stefan Kristiansson
23498935fa cmd_cache: use cache/invalidate functions available in common.h
flush_dcache()/flush_icache() aren't defined in common.h,
flush_dcache_all()/invalidate_icache_all() however are.

Let the icache and dcache commands use those instead.

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-06 22:12:54 +01:00
Simon Glass
4c12eeb8b5 Convert cmd_usage() calls in common to use a return value
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>
2012-03-06 21:09:46 +01:00
Simon Glass
9d12d5d41d Add cmd_process() to process commands in one place
We currently have the same code in hush.c and main.c. This brings the
code into one place.

As an added feature, if the command function returns CMD_RET_USAGE then
cmd_process() will print a usage message for the command before
returning the standard failure code of 1.

ARM code size increases about 32 bytes with this clean-up.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-06 21:09:41 +01:00
Simon Glass
7344f9128d Remove interleave of non-U-Boot code in hush
There is a nasty interleave of #ifdefs in hush.c where the two code
paths have different indents. Remove this ickiness.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-06 21:09:37 +01:00
Simon Glass
bdf8e34b93 Create a single cmd_call() function to handle command execution
We should aim for a single point of entry to the commands, whichever
parser is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-06 21:09:34 +01:00
Simon Glass
7fed89e00e Don't include standard parser if hush is used
This saves about 1KB of code space on ARM with CONFIG_SYS_HUSH_PARSER
defined.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-03-06 21:09:30 +01:00
Simon Glass
5307153236 Stop using builtin_run_command()
Boards can select either the 'built-in' parser or the hush parser. We
should not call builtin_run_command() if we are using the hush parser.
We use run_command() instead, since it knows how to call the correct
parser.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-06 21:09:26 +01:00
Simon Glass
009dde1955 Rename run_command2() to run_command()
This is a more sensible name, so rename it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-06 21:09:22 +01:00
Simon Glass
f47360a74e Rename run_command() to builtin_run_command()
The current run_command() is only one of the parsing options - the other
is hush. We should not call run_command() when the hush parser is being
used. So we rename this function to better explain its purpose.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-06 21:09:18 +01:00
Simon Glass
79714c1e26 Remove CMD_PXE's static on run_command()
It really isn't clear why this is here and there is no comment, so
drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-06 21:09:14 +01:00
Wolfgang Grandegger
a1a28c6e64 USB: relax usbcore reset timings
Following the corresponding Linux code, this patch relaxes reset timings
waiting at least 100ms after power to the ports. There are some reports
that it helps make enumeration work better on some high speed devices.
Furthermore, the wait is only done once after power has been enabled
on all ports.

CC: Remy Bohmer <linux@bohmer.net>
CC: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
2012-03-03 16:56:35 +01:00
amartin@nvidia.com
f9636e8d38 USB: move keyboard polling into kbd driver
This moves keyboard polling logic from USB HCD drivers into USB
keyboard driver.  Remove usb_event_poll() as keyboard polling was
the only user of this API.  With this patch USB keyboard works with
EHCI controllers again.  Tested on a tegra2 seaboard.

Signed-off-by: Allen Martin <amartin@nvidia.com>
2012-03-03 16:56:29 +01:00
amartin@nvidia.com
fb3ef649ed USB: reevaluate iomux stdin on USB kbd detect
If CONSOLE_MUX is enabled, reevaluate console stdin when USB keyboard
device is detected.

Signed-off-by: Allen Martin <amartin@nvidia.com>
2012-03-03 16:56:22 +01:00
Vincent Palatin
d53da847cf usb: add numeric keypad support to HID driver
When keys are pressed on the numeric keypad, emit key codes for the numbers,
operators, dot and enter.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
2012-03-03 16:56:15 +01:00
Vincent Palatin
3d17308e40 USB: fix USB keyboard polling parameter
When doing a "GET_REPORT" request on the keyboard control endpoint,
the report ID should 0 (ie report ID not used) rather than 1
as reports are not used in boot mode.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
2012-03-03 16:56:09 +01:00
Marek Vasut
e159e4868e USB: Make struct devrequest setup_packet local
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Remy Bohmer <linux@bohmer.net>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-03 16:55:54 +01:00
Marek Vasut
23faf2bc9e USB: Separate out USB hub driver
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Remy Bohmer <linux@bohmer.net>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-03 16:55:24 +01:00
Marek Vasut
c08b1b264d USB: Staticize internal functions
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Remy Bohmer <linux@bohmer.net>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-03 16:53:48 +01:00
Wolfgang Denk
e91004201c Merge branch 'master' of git://git.denx.de/u-boot-nand-flash
* 'master' of git://git.denx.de/u-boot-nand-flash:
  cmd_nand.c: Fix 'nand dump' after latest MTD resync
  mtd/nand:Fix wrong usage of is_blank() in fsl_ifc_run_command
  mtd/nand: Fix IFC driver to support 2K NAND page
  nand: reinstate lazy bad block scanning
  Revert "nand: make 1-bit software ECC configurable"
2012-03-03 15:15:07 +01:00
Tom Rini
cfdae12f37 cmd_nand.c: Fix 'nand dump' after latest MTD resync
With 2a8e0fc nand_do_read_ops changed in behavior slightly (keeping in sync
with the kernel which did this change in b64d39d8) such that the OOB data is
always copied into oobbuf and never appended to datbuf.  Within U-Boot only
the nand_dump function (for the dump nand subcommand) was expecting the OOB
data to only be appended to datbuf.  So we now change nand_dump to not
malloc extra space, correct the comment about datbuf and OOB data and switch
the pointer to oobbuf before printing.

Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Tom Rini <trini@ti.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-02-28 14:04:54 -06:00
Shawn Guo
fa34f6b25b common/image.c: align usage of fdt_high with initrd_high
The commit message of a28afca (Add uboot "fdt_high" enviroment variable)
states that fdt_high behaves similarly to the existing initrd_high.
But fdt_high actually has an outstanding difference from initrd_high.
The former specifies the start address, while the later specifies the
end address.

As fdt_high and initrd_high will likely be used together, it'd be nice
to have them behave same.  The patch changes the behavior of fdt_high
to have it aligned with initrd_high.

The document of fdt_high in README is updated with an example to
demonstrate the usage of this environment variable.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Simon Glass <sjg@chromium.org>
2012-02-27 21:19:24 +01:00
Wolfgang Denk
dbe20fc797 Merge branch 'trini@ti.com' of git://git.denx.de/u-boot-staging
* 'trini@ti.com' of git://git.denx.de/u-boot-staging:
  usb_ether: fix typo
  cmd_eeprom: typo
  doc: complete, typos
2012-02-17 23:52:52 +01:00
Peter Meerwald
e506a00691 cmd_eeprom: typo
Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-02-14 11:02:46 -07:00
Wolfgang Denk
e9d44b35be Merge branch 'sf' of git://git.denx.de/u-boot-blackfin
* 'sf' of git://git.denx.de/u-boot-blackfin:
  README: Add description of SPI Flash (SF) command configuration
  sf command: allow default bus and chip selects
  sf: eeprom_m95xxx: set a sane default timeout
  sf: eeprom_m95xxx: fix up style
2012-02-13 23:15:25 +01:00
Eric Nelson
c1173bd075 sf command: allow default bus and chip selects
This patch allows a board configuration file to provide default bus
and chip-selects for SPI flash so that first argument to the 'sf' command
is optional.

On boards that use the mxc_spi driver and a GPIO for chip select, this allows
a much simpler command line:
	U-Boot> sf probe
instead of
	U-Boot> sf probe 0x5300

Tested-by: Jason Liu <jason.hui@linaro.org>
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-02-12 15:18:29 -05:00
Hadli, Manjunath
8f5d468721 davinci: add support for printing clock frequency
add support for printing various clock frequency info found
in SOC such as ARM core frequency, DSP core frequency and DDR
frequency as part of bdinfo command.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Cc: Tom Rini <trini@ti.com>
2012-02-12 10:11:32 +01:00
Heiko Schocher
fc4fa6a16d common, menu: do not trigger timeout again, if a line is read
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Jason Hobbs <jason.hobbs@calxeda.com>
Acked-by: Jason Hobbs <jason.hobbs@calxeda.com>
2012-02-12 10:11:24 +01:00
Heiko Schocher
317d6c57d5 common, menu: show menu on startup if CONFIG_MENU_SHOW is defined
show a menu on startup instead running the shell.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Jason Hobbs <jason.hobbs@calxeda.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Jason Hobbs <jason.hobbs@calxeda.com>
2012-02-12 10:11:24 +01:00
Heiko Schocher
e0611dd97b common, menu: add statusline support
add the possibility to show a statusline when printing a menu

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Jason Hobbs <jason.hobbs@calxeda.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-02-12 10:11:24 +01:00
Heiko Schocher
9c3483113d common: add possibility for readline_into_buffer timeout
add possibility to add a timeout when reading a line
into a buffer.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-02-12 10:11:23 +01:00
Stefan Kristiansson
2be9fdbfcc openrisc: Add board info printout to cmd_bdinfo
Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
2012-01-13 21:16:52 +01:00
Stefan Kristiansson
3ddcaccda3 openrisc: Add architecture image support
Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
2012-01-13 21:16:40 +01:00
Kyle Moffett
5dd95cf93d usb_storage: Fix EHCI "out of buffer pointers" with CD-ROM
When performing large bulk reads from a CD or DVD using the U-Boot
usb_storage driver, it generates requests of up to 20 blocks at a time.

With a standard 512-byte block size, that is 10240 bytes and within the
limit of U-Boot's EHCI driver (maximum 5 pages at 4k per page).

Unfortunately CD-ROM media has a 2048-byte blocksize, resulting in a
maximum transfer size of 40960 bytes, which does not fit.

Since the EHCI specification is impossibly obtuse and far beyond my
comprehension, I chose to dynamically compute the limit based on the
blocksize.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
2012-01-05 20:10:38 +01:00
Igor Grinberg
bf95df44ff env: factor out the env_get_char_spec() function
env_get_char_spec() function is duplicated across multiple environment
files.
Remove the duplication by providing a default implementation.
Add "weak" declaration, so the default implementation can be overridden.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2012-01-05 16:34:10 +01:00
Stefano Babic
06297db066 FPGA: use debug() instead of module debug printf
Replace also __FUNCTION__ with standard __func__

Signed-off-by: Stefano Babic <sbabic@denx.de>
2012-01-05 16:19:20 +01:00
Wolfgang Denk
bfcc40bb09 Merge branch 'next' of ../next
* 'next' of ../next:
  mkenvimage: Add version info switch (-V)
  mkenvimage: Fix getopt() error handling
  mkenvimage: Fix some typos
  phy: add Micrel KS8721BL phy definition
  net: introduce per device index
  mvgbe: remove setting of ethaddr within the driver
  x86: Add support for specifying an initrd with the zboot command
  x86: Refactor the zboot innards so they can be reused with a vboot image
  x86: Add infrastructure to extract an e820 table from the coreboot tables
  x86: Add support for booting Linux using the 32 bit boot protocol
  x86: Clean up the x86 zimage code in preparation to extend it
  x86: Import code from coreboot's libpayload to parse the coreboot table
  x86: Initial commit for running as a coreboot payload
  CHECKPATCH: ./board/esd/hh405/logo_320_240_8bpp.c
  CHECKPATCH: ./board/esd/hh405/logo_1024_768_8bpp.c
  CHECKPATCH: ./board/esd/hh405/logo_320_240_4bpp.c
  CHECKPATCH: ./board/esd/hh405/logo_640_480_24bpp.c
  CHECKPATCH: ./board/esd/apc405/logo_640_480_24bpp.c
  CHECKPATCH: ./board/esd/voh405/logo_320_240_4bpp.c
  CHECKPATCH: ./board/esd/voh405/logo_640_480_24bpp.c
  CHECKPATCH: ./board/esd/hh405/fpgadata.c
  CHECKPATCH: ./board/esd/pci405/fpgadata.c
  CHECKPATCH: ./board/esd/tasreg/fpgadata.c
  CHECKPATCH: ./board/esd/apc405/fpgadata.c
  CHECKPATCH: ./board/esd/voh405/fpgadata.c
  CHECKPATCH: ./board/esd/ash405/fpgadata.c
  CHECKPATCH: ./board/esd/dasa_sim/fpgadata.c
  CHECKPATCH: ./board/esd/ar405/fpgadata_xl30.c
  CHECKPATCH: ./board/esd/ar405/fpgadata.c
  CHECKPATCH: ./board/esd/plu405/fpgadata.c
  CHECKPATCH: ./board/esd/wuh405/fpgadata.c
  CHECKPATCH: ./board/esd/cpci405/fpgadata_cpci405.c
  CHECKPATCH: ./board/esd/cpci405/fpgadata_cpci405ab.c
  CHECKPATCH: ./board/esd/cpci405/fpgadata_cpci4052.c
  CHECKPATCH: ./board/esd/canbt/fpgadata.c
  CHECKPATCH: ./board/esd/du405/fpgadata.c
  CHECKPATCH: ./board/esd/cpciiser4/fpgadata.c
  CHECKPATCH: ./board/dave/PPChameleonEVB/fpgadata.c
  avr32:mmu.c: fix printf() length modifier
  fat.c: fix printf() length modifier
  cmd_sf.c: fix printf() length modifier
  Make printf and vprintf safe from buffer overruns
  vsprintf: Move function documentation into header file
  Add safe vsnprintf and snprintf library functions
  Move vsprintf functions into their own header

Conflicts:
	tools/mkenvimage.c

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-12-23 20:53:58 +01:00
Wolfgang Denk
e27334212c Merge branch 'master' of /home/wd/git/u-boot/custodians
* 'master' of /home/wd/git/u-boot/custodians:
  common/cmd_pxe.c: Fix GCC 4.6 build warnings
  AVR32: fix timer_init() function
2011-12-20 23:14:37 +01:00
Simon Glass
38bd80b485 net: Fix arguments in tftpput command
The switch to strict_strtoul() was not done correctly - this fixes
the compile error when CONFIG_CMD_TFTPPUT is active.

There appears to very little use of strict_strtoul() in commands, so
it might be easier to switch to simple_strtoul(). If not, we should
decide the best way to use strict_strtoul(). For now I have added a
friendly message which will of course increase code size.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-12-20 23:12:32 +01:00
Heiko Schocher
43d4a5e687 common/cmd_pxe.c: Fix GCC 4.6 build warnings
Fix:
cmd_pxe.c: In function 'parse_pxefile_top':
cmd_pxe.c:941:5: warning: 'err' may be used uninitialized in this
  function [-Wuninitialized]
cmd_pxe.c:921:6: note: 'err' was declared here

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Jason Hobbs <jason.hobbs@calxeda.com>
Acked-by: Jason Hobbs <jason.hobbs@calxeda.com>
2011-12-20 22:28:51 +01:00
Horst Kronstorfer
d3f80c77ca common/cmd_nvedit.c: Fix size calculation in do_env_import()
do_env_import() missed the final '\0' terminator when calculating the
size of an environment data block.  This led to an erroneous 'bad CRC,
import failed' message for a checksum protected environment (-c.)

Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
2011-12-19 10:19:34 +01:00
Andreas Bießmann
a97f6efdb1 cmd_sf.c: fix printf() length modifier
size_t is not always 'unsigned int', use corret length modifer.

This patch fixes following warning:

---8<---
cmd_sf.c: In function 'spi_flash_update_block':
cmd_sf.c:130: warning: format '%#x' expects type 'unsigend int', but argument 4 has type 'size_t'
cmd_sf.c:135: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'size_t'
--->8---

Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
cc: Mike Frysinger <vapier@gentoo.org>
cc: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-12-17 23:55:36 +01:00
Sonny Rao
068af6f843 Make printf and vprintf safe from buffer overruns
From: Sonny Rao <sonnyrao@chromium.org>

utilize the added vscnprintf functions to avoid buffer overruns
The implementation is fairly dumb in that it doesn't detect
that the buffer is too small, but at least will not cause crashes.

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
2011-12-17 23:34:43 +01:00
Tom Rini
b2fb47f187 USB: Use (get|put)_unaligned for accessing wMaxPacketSize
In 9792987721 Stefan describes a usecase
where the previous behavior of leaving wMaxPacketSize be unaligned
caused fatal problems.  The initial fix for this problem was incomplete
however as it showed another cases of non-aligned access that previously
worked implicitly.  This switches to making sure that all access of
wMaxPacketSize are done via (get|put)_unaligned.

In order to maintain a level of readability to the code in some cases
we now use a variable for the value of wMaxPacketSize and in others, a
macro.

Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Remy Bohmer <linux@bohmer.net>

OpenRISC:
Tested-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>

Beagleboard xM, Pandaboard run-tested, s5p_goni build-tested.
Signed-off-by: Tom Rini <trini@ti.com>
2011-12-16 21:37:17 +01:00
Horst Kronstorfer
d798a9b5d5 common/cmd_nvedit.c: Add missing 'env save' preproc guard
Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
2011-12-12 08:25:38 +01:00