Commit Graph

2033 Commits

Author SHA1 Message Date
Benoît Thébaudeau 4796bc4bbc env import/export: Remove from help if disabled
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-09-18 12:01:51 -07:00
Iwo Mergler b8496cced8 memsize: Fix for bug in memory sizing code
The original memory sizing code in get_ram_size clobbers the word
at the base address, but forgets to restore it.

Signed-off-by: Iwo Mergler <Iwo.Mergler@netcommwireless.com>
2012-09-18 12:01:51 -07:00
Stephen Warren 78b2de802f env_nand: fix incorrect size parameter to ALLOC_CACHE_ALIGN_BUFFER
The third parameter to ALLOC_CACHE_ALIGN_BUFFER is not size (as named),
but rather count (number of elements of the type to allocate). The
current code ends up allocating one copy of env_t for each byte in its
size, which quite possibly ends up overflowing RAM.

This fixes a bug in commit 3801a15 "env_nand: align NAND buffers".

Reported-by: Prabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reported-by: Prabhakar Lad <prabhakar.lad@ti.com>
2012-09-18 12:01:51 -07:00
Marek Vasut d97f01a64f dm: sparc: common: Fixup cmd_bdinfo warnings
cmd_bdinfo.c: In function ‘do_bdinfo’:
cmd_bdinfo.c:220:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat]
cmd_bdinfo.c:222:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat]
cmd_bdinfo.c:224:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat]
cmd_bdinfo.c:226:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat]
cmd_bdinfo.c:228:9: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘int’ [-Wformat]

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Cc: u-boot-dm@lists.denx.de
2012-09-18 12:01:50 -07:00
Tom Rini c413a004ea Merge branch 'master' of git://git.denx.de/u-boot-nand-flash 2012-09-18 07:55:07 -07:00
Joe Hershberger e70bfa2986 nand: Make NAND lock status compatible with Micron
Micron NAND flash (e.g. MT29F4G08ABADAH4) BLOCK LOCK READ STATUS is not
the same as others.  Instead of bit 1 being lock, it is #lock_tight.
To make the driver support either format, ignore bit 1 and use only
bit 0 and bit 2.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-09-17 17:33:43 -05:00
Joe Hershberger eee623a504 nand: Add support for unlock.invert
NAND unlock command allows an invert bit to be set to unlock all but
the selected page range.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
[scottwood@freescale.com: updated docs and added comment about invert bit]
Signed-off-by: Scott Wood <scottwood@freescale.com>
2012-09-17 17:32:10 -05:00
Tom Rini cd40a66c19 Merge branch 'master' of git://git.denx.de/u-boot-fdt 2012-09-17 11:34:08 -07:00
Marek Vasut e02c945874 fdt: Check if the FDT address is configured
In case the "fdt addr" command wasn't ran yet and any other "fdt"
subcommand was issued, the system crashed due to NULL pointer being
used.

This is caused by "fdt addr" command setting up a pointer to the
FDT memory location. Prior issuing "fdt addr", the pointer is NULL
so calling any other subcommands crashed the u-boot.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
2012-09-15 09:16:08 -04:00
Tom Rini f71d5cd56b Merge branch 'master' of git://git.denx.de/u-boot-avr32 2012-09-13 10:34:24 -07:00
Simon Glass 93691842e8 Fix strict-aliasing warning in dlmalloc
This fixes the following warnings in dlmalloc seen with my gcc 4.6.

dlmalloc.c: In function 'malloc_bin_reloc':
dlmalloc.c:1493: warning: dereferencing pointer 'p' does break strict-aliasing rules
dlmalloc.c:1493: warning: dereferencing pointer 'p' does break strict-aliasing rules
dlmalloc.c:1490: note: initialized from here
dlmalloc.c:1493: note: initialized from here

This version is tested on avr32 arch boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2012-09-13 13:32:41 +02:00
Benoît Thébaudeau d1424ee544 mmcinfo: Fix help message
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Andy Fleming <afleming@gmail.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
2012-09-05 17:32:42 -05:00
Stephen Warren 9404a5fc7c env_mmc: allow environment to be in an eMMC partition
eMMC devices may have hardware-level partitions: 2 boot partitions,
up to 4 general partitions, plus the user area. This change introduces
optional config variable CONFIG_SYS_MMC_ENV_PART to indicate which
partition the environment should be stored in: 0=user, 1=boot0, 2=boot1,
4..7=general0..3. This allows the environment to be kept out of the user
area, which simplifies the management of OS-/user-level (MBR/GPT)
partitions within the user area.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
2012-09-05 17:32:41 -05:00
Joe Hershberger de15a06aad cfi: Make the flash erase and write operations abortable
Check for ctrlc() in operations that take time and loop over the flash
addresses.

In netconsole, tstc() is expensive.  Only check once in a while to not
slow down the operation significantly.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2012-09-03 11:24:27 +02:00
Joe Hershberger a005f19eff hush: Don't parse the contents of a dereferenced var
When a variable which contains a user-supplied value is dereferenced
(e.g. to be echo'ed), make sure that the value is not further parsed
by hush.

Set the hush local variable "HUSH_NO_EVAL=1" to enable this behavior.

Without this patch, a sequence like this occurs:

	Panda # env set my_user_string Bob\'s favorite device
	Panda # print my_user_string
	my_user_string=Bob's favorite device
	Panda # echo $my_user_string
	syntax error hush.c:3007

With this patch, it looks like this:

	Panda # HUSH_NO_EVAL=1
	Panda # env set my_user_string Bob\'s favorite device
	Panda # print my_user_string
	my_user_string=Bob's favorite device
	Panda # echo $my_user_string
	Bob's favorite device

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-09-02 20:31:21 +02:00
Joe Hershberger 641b0d374e hush: Add default value substitution support
Use standard sh syntax:
${VAR:-default}
	Use default value: if VAR is set and non-null, expands to $VAR.
	Otherwise, expands to default.
${VAR:=default}
	Set default value: if VAR is set and non-null, expands to $VAR.
	Otherwise, sets hush VAR to default and expands to default.
${VAR:+default}
	If VAR is set and non-null, expands to the empty string.
	Otherwise, expands to default.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-09-02 20:30:24 +02:00
Stephen Warren 3801a15f67 env_nand: align NAND buffers
This allows cache flush/invalidate operations to succeed on the buffers.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Acked-by: Scott Wood <scottwood@freescale.com>
2012-09-02 17:40:19 +02:00
Jagannadha Sutradharudu Teki cee84e8257 image/FIT: Add ramdisk load, entry address and OS tag inclusion
This patch adds support to include Load, Entry address and OS tag
of ramdisk on to FIT image through mkimage tool.

Signed-off-by: Jagannadha Sutradharudu Teki <402jagan@gmail.com>
2012-09-02 17:39:15 +02:00
Jim Shimer b7006958ea usb: Optimize USB storage read/write
Trim down the IO times by removing uneeded
test unit reeady calls.

Signed-off-by: Jim Shimer <mgi2475@motorola.com>
2012-09-01 16:21:52 +02:00
Benoît Thébaudeau 3e8581bb95 usb_stor_BBB_transport: Do not delay when not required
There is a 5-ms delay in usb_stor_BBB_transport, which occurs every 10 kiB of
data for fragmented fatload usb, i.e. roughly 500 ms of delay per MiB. This adds
up to quite a bit of delay if you're loading a large ramdisk.

The purpose of this delay should be to debounce the 5-V/100-mA USB power up.
This patch skips the delay if the device has already been queried as ready.

Signed-off-by: Jim Shimer <mgi2475@motorola.com>

Rework following the review:
 - Rebase against the latest u-boot-usb master.
 - Replace typedef with #define.
 - Use the existing flags struct field instead of adding a new field.
 - Remove the setter function.
 - Remove the typecasts.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>

Cc: Marek Vasut <marex@denx.de>
Cc: Ilya Yanok <ilya.yanok@cogentembedded.com>
Cc: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
Cc: Jim Shimer <mgi2475@motorola.com>
2012-09-01 16:21:52 +02:00
Benoît Thébaudeau 4bee5c83ea usb_storage: Remove EHCI constraints
Now that the EHCI driver allocates its qTDs from the heap, the MSC driver is
only limited by the SCSI commands it uses.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Ilya Yanok <ilya.yanok@cogentembedded.com>
Cc: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2012-09-01 16:21:52 +02:00
Benoît Thébaudeau cffcc50358 usb_storage: Restore non-EHCI support
The commit 5dd95cf made the MSC driver EHCI-specific. This patch restores a
basic support of non-EHCI HCDs, like before that commit.

The fallback transfer size is certainly not optimal, but at least it should work
like before.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Ilya Yanok <ilya.yanok@cogentembedded.com>
Cc: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2012-09-01 16:21:52 +02:00
Lukasz Majewski a006a5deaa dfu:cmd: Support for DFU u-boot command
Support for u-boot's command line command "dfu <interface> <dev> [list]".

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Vasut <marex@denx.de>
2012-09-01 16:21:51 +02:00
Marek Vasut 2d5e7c7a4c cmd_spi: remove superfluous semicolon
Reported-by: James Miller <jamesmiller@chromium.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-08-09 20:41:32 -04:00
Jorgen Lundman 4d3c95f5ea zfs: Add ZFS filesystem support
U-Boot port is based on sources forked from GRUB-0.97 by Sun in 2004,
which can be found here:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/grub/grub-0.97/stage2/zfs-include/zfs.h

Released by Sun for GRUB under the license:
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 2 of the License, or
  *  (at your option) any later version.

GRUB official releases include ZFS in version:
ftp://alpha.gnu.org/gnu/grub/grub-1.99~rc1.tar.gz

And patched against GRUB Bazaar repository for ashift fixes (4KB HDDs)
more conveniently found at github:
e7b6ef3ac3

Signed-off-by: Jorgen Lundman <lundman@lundman.net>
2012-08-09 23:42:20 +02:00
Charles Manning 753ac61088 u-boot: Update yaffs2 file system
This patch updates the yaffs2 in u-boot to correspond to
git://www.aleph1.co.uk/yaffs2
commit id 9ee5d0643e559568dbe62215f76e0a7bd5a63d93

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2012-08-09 23:39:18 +02:00
Dirk Eibach a5aae0a1a9 Consider CONFIG_ZERO_BOOTDELAY_CHECK when CONFIG_AUTOBOOT_KEYED is set
When CONFIG_ZERO_BOOTDELAY_CHECK is not defined, bootdelay==0
prevents the check for console input (as stated in README.autoboot).
This must also work in CONFIG_AUTOBOOT_KEYED mode.

Signed-off-by: Dirk Eibach <eibach@gdsys.de>
2012-08-09 22:40:15 +02:00
Simon Glass 3a8a02beb7 Allow newlines within command environment vars
Any environment variable can hold commands to be executed by the 'run'
command. The environment variables preboot, bootcmd and menucmd have
special code for triggering execution in certain circumstances.

We adjust these calls to use run_command_list() instead of run_command().
This change permits these variables to have embedded newlines so that
they work the same as the 'source' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2012-08-09 22:06:23 +02:00
Simon Glass d51004a832 Add run_command_list() to run a list of commands
This new function runs a list of commands separated by semicolon or newline.
We move this out of cmd_source so that it can be used by other code. The
PXE code also uses the new function.

Suggested-by: Michael Walle <michael@walle.cc>
Signed-off-by: Simon Glass <sjg@chromium.org>
2012-08-09 22:06:03 +02:00
David du Colombier 034afbcc16 env_onenand: set ONENAND_MAX_ENV_SIZE to CONFIG_ENV_SIZE
This fix prevents env_import() CRC to fail when CONFIG_ENV_SIZE
is not equal to 4096 bytes
It also prevents mtd->read and mtd->write to be incomplete when
the environment is larger than 4096 bytes.

Signed-off-by: David du Colombier <0intro@gmail.com>
2012-08-06 10:38:47 +02:00
Wolfgang Denk 948fa1713c Merge branch 'master' of git://git.denx.de/u-boot-i2c
* 'master' of git://git.denx.de/u-boot-i2c:
  km/common: remove printfs for i2c deblocking code
  CONFIG: SMDK5250: I2C: Enable I2C
  I2C: Add support for Multi channel
  I2C: Modify the I2C driver for EXYNOS5
  I2C: Move struct s3c24x0_i2c to a common place.
  EXYNOS: PINMUX: Add pinmux support for I2C
  EXYNOS5: define EXYNOS5_I2C_SPACING
  EXYNOS: Add I2C base address.
  EXYNOS: CLK: Add i2c clock
  mx6qsabrelite: add i2c multi-bus support
  imx-common: add i2c.c for bus recovery support
  i.mx53: add definition for I2C3_BASE_ADDR
  i.mx: iomux-v3.c: move to imx-common directory
  i.mx: iomux-v3.h: move to imx-common include directory
  iomux-v3: remove include of mx6x_pins.h
  mxc_i2c: finish adding CONFIG_I2C_MULTI_BUS support
  mxc_i2c: add bus recovery support
  mxc_i2c: prep work for multiple busses support
  mxc_i2c: add i2c_regs argument to i2c_imx_stop
  mxc_i2c: add retries
  mxc_i2c: check for arbitration lost
  mxc_i2c: change slave addr if conflicts with destination.
  mxc_i2c: don't disable controller after every transaction
  mxc_i2c: place i2c_reset code inline
  mxc_i2c: place imx_start code inline
  mxc_i2c: remove redundant read
  mxc_i2c: combine i2c_imx_bus_busy and i2c_imx_trx_complete into wait_for_sr_state
  mxc_i2c.c: code i2c_probe as a 0 length i2c_write
  mxc_i2c: call i2c_imx_stop on error in i2c_read/i2c_write
  mxc_i2c: create i2c_init_transfer
  mxc_i2c: clear i2sr before waiting for bit
  mxc_i2c: create tx_byte function
  mxc_i2c: remove ifdef of CONFIG_HARD_I2C
  mxc_i2c: fix i2c_imx_stop
  i2c: deblock i2c bus also if accessed before realocation

Signed-off-by: Wolfgang Denk <wd@denx.de>
2012-07-31 22:07:42 +02:00
Holger Brunck 8ec038a6a5 i2c: deblock i2c bus also if accessed before realocation
If we switch to a different i2c bus in changing the mux config for the
i2c mux, we have to be sure to deblock the bus also before realocation.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Heiko Schocher <hs@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
2012-07-31 07:40:15 +02:00
Stefan Herbrechtsmeier 1b4bd0e66c usb_storage: fix ehci driver max transfer size
The commit 5dd95cf93d 'usb_storage:
Fix EHCI "out of buffer pointers" with CD-ROM' introduce a bug in
usb_storage as it wrongly assumes that every transfer can use
4096 bytes per qt_buffer. This is wrong if the start address of
the data is not page aligned to 4096 bytes and leads to 'EHCI
timed out on TD' messages because of 'out of buffer pointers'
in ehci_td_buffer function.

The bug appears during load of a fragmented file and
read from or write to an unaligned memory address.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2012-07-18 14:46:19 +02:00
Ilya Yanok fd06028df8 usb: check return value of submit_{control, bulk}_msg
Return values of submit_{control,bulk}_msg() functions
should be checked to detect possible error.

Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>
2012-07-18 14:43:42 +02:00
Ilya Yanok 80ab414afd usb: pass cache-aligned buffer to usb_get_descriptor()
usb_get_descriptor passes it's buffer argument directly to
usb_control_msg() so it has to be properly aligned/padded.

Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>
2012-07-18 14:43:42 +02:00
Nikita Kiryanov 8f47d917c6 common lcd: minor coding style changes
No functional changes

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2012-07-10 11:35:38 +02:00
Wolfgang Denk 3fe63839f3 Minor Coding Style cleanup
Signed-off-by: Wolfgang Denk <wd@denx.de>
2012-07-10 09:18:33 +02:00
Stephen Warren 5e724ca2b6 Add env vars describing U-Boot target board
This can be useful for generic scripts. For example, rather than hard-
coding a script to ext2load tegra-harmony.dtb, it could load
${soc}-${board}.dtb and hence not need adjustments to run on multiple
boards.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-07-09 22:44:33 +02:00
Stefan Roese 22b7cfff32 SPL: common/Makefile: Add image.c to SPL build
This is needed for the SPEAr SPL support, as SPEAr uses the mkimage
header to wrap and validate the images (SPL & U-Boot).

Signed-off-by: Stefan Roese <sr@denx.de>
2012-07-07 14:07:43 +02:00
Stephen Warren 4036b6301e env_mmc: align buffers using ALLOC_CACHE_ALIGN_BUFFER
This allows MMC drivers to perform cache flusing on the bufffers
without issue.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Cc: Andy Fleming <afleming@gmail.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2012-07-07 14:07:20 +02:00
Rob Herring 669df7e42d pxe: add support for parsing local syslinux files
Add a new command "sysboot" which parses syslinux menu files and boots
using kernel and initrd specified by menu files. The operation is similar
to "pxe boot" except local files on ext2 or fat filesystem are parsed.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-06-21 22:35:56 +02:00
Rob Herring 34bd23e42f pxe: parse initrd file from append string
For syslinux, the initrd can be set in the append string as
"initrd=<file>", so try to find it there if we haven't already set the
initrd.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-06-21 22:35:34 +02:00
Rob Herring 90ba7d7c44 pxe: support absolute paths
If the file path starts with a '/', then don't pre-pend the bootfile path.
This fixes a problem with running 'pxe boot' multiple times where the
bootfile path gets pre-pended to itself each time.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-06-21 22:35:15 +02:00
Rob Herring beb9f6c678 pxe: support linux entries for labels
Kernels can be specified using "linux" or "kernel" entry. The difference
is kernel is supposed to detect the type of file, but for u-boot both are
treated the same.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-06-21 22:35:00 +02:00
Rob Herring 7815c4e89f pxe: add support for label menu text
Use a menu string if present, otherwise use the kernel string.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-06-21 22:34:45 +02:00
Rob Herring 1e08522699 pxe: support include files at top-level
Include files outside of a menu were not getting included and parsed.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-06-21 22:34:26 +02:00
Rob Herring 8594753ba0 menu: only timeout when menu is displayed
Make the menu timeout apply only when prompt flag is set and after the
menu is displayed. This allows auto boot to work no matter whether prompt
is set or cleared. Use the default selection if the menu times out.

This also fixes the timeout value given to readline_into_buffer to be
seconds instead of 10th of seconds.

Old behavior:

if prompt
  display menu and wait for choice
else
  wait for timeout
  if key pressed
    display menu and wait for choice
  else
    exit command

New behavior:

if prompt
  display menu
  if key pressed
    wait for choice
  else
    boot default entry on timeout
else
  boot default entry

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
2012-06-21 22:34:00 +02:00
Marek Vasut b37d41aa24 Block: Remove MG DISK support
This driver is unused and obsolete.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: unsik Kim <donari75@gmail.com>
2012-06-21 20:53:09 +02:00
Tom Rini 219f4788d3 hush.c: Move default CONFIG_SYS_PROMPT_HUSH_PS2 to hush.c
Exactly one board has defined CONFIG_SYS_PROMPT_HUSH_PS2 to a value
different than "> " which is vision2.  I have Cc'd the maintainer here
as I strongly suspect this is a bug rather than intentional behavior.

Cc: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@ti.com>
Acked-by: Stefano Babic <sbabic@denx.de>
2012-06-20 20:36:51 +02:00
Mike Frysinger feb12a1f6d cmd_mem: cmp: convert while() to for() loop
Simplify the code slightly by using a for() loop since this is
basically what we're already doing -- incrementing "ngood" to
the value in "count".

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-06-19 22:32:11 +02:00