summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeLines
* env: make "env default" selective, check and applyGerlando Falauto2012-09-18-7/+61
| | | | | | | | | | | | Change the syntax (user API) for "env default": -f: override write-once variables var... : accept individual variable(s) -a: all (resetting the whole env is NOT the default behavior) Enable variable checking and make changes effective by enabling do_apply argument to himport_r(). Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
* env: check and apply changes on delete/destroyGerlando Falauto2012-09-18-1/+1
| | | | | Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Reviewed-by: Marek Vasut <marex@denx.de>
* env: add check/apply logic to himport_r()Gerlando Falauto2012-09-18-4/+7
| | | | | | | | | | | | | | | | | | | Change hashtable so that a callback function will decide whether a variable can be overwritten, and possibly apply the changes. So add a new field to struct hsearch_data: o "apply" callback function to check whether a variable can be overwritten, and possibly immediately apply the changes; when NULL, no check is performed. And a new argument to himport_r(): o "do_apply": whether to call the apply callback function NOTE: This patch does not change the current behavior. Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Reviewed-by: Marek Vasut <marex@denx.de>
* env: make himport_r() selective on variablesGerlando Falauto2012-09-18-3/+6
| | | | | | | | | | | | Add 2 new arguments to himport_r(): o "nvars", "vars": number and list of variables to take into account (0 means ALL) NOTE: This patch does not change the current behaviour. Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Reviewed-by: Marek Vasut <marex@denx.de>
* env: unify logic to check and apply changesGerlando Falauto2012-09-18-49/+92
| | | | | | | | | | | | | | The logic of checking special parameters (e.g. baudrate, stdin, stdout, for a valid value and/or whether can be overwritten) and applying the new value to the running system is now all within a single function env_check_apply() which can be called whenever changes are made to the environment, no matter if by set, default or import. With this patch env_check_apply() is only called by "env set", retaining previous behavior. Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Reviewed-by: Marek Vasut <marex@denx.de>
* env: cosmetic: drop assignment i = iomux_doenv()Gerlando Falauto2012-09-18-3/+2
| | | | | | | | | iomux_doenv() can only return 0 or 1. So there is no need to save its return value in variable i, as checking its truth value within an if statement is enough. Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Reviewed-by: Marek Vasut <marex@denx.de>
* env_common: Add missing ethprimeBenoît Thébaudeau2012-09-18-0/+3
| | | | | | | The ethprime env var was missing from env_common. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de>
* env import/export: Remove from help if disabledBenoît Thébaudeau2012-09-18-0/+4
| | | | | | Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* memsize: Fix for bug in memory sizing codeIwo Mergler2012-09-18-0/+1
| | | | | | | 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>
* env_nand: fix incorrect size parameter to ALLOC_CACHE_ALIGN_BUFFERStephen Warren2012-09-18-1/+1
| | | | | | | | | | | | | 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>
* dm: sparc: common: Fixup cmd_bdinfo warningsMarek Vasut2012-09-18-5/+5
| | | | | | | | | | | | | 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
* Merge branch 'master' of git://git.denx.de/u-boot-nand-flashTom Rini2012-09-18-4/+17
|\
| * nand: Make NAND lock status compatible with MicronJoe Hershberger2012-09-17-1/+7
| | | | | | | | | | | | | | | | | | | | 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>
| * nand: Add support for unlock.invertJoe Hershberger2012-09-17-3/+10
| | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'master' of git://git.denx.de/u-boot-fdtTom Rini2012-09-17-1/+12
|\ \
| * | fdt: Check if the FDT address is configuredMarek Vasut2012-09-15-1/+12
| |/ | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'master' of git://git.denx.de/u-boot-avr32Tom Rini2012-09-13-5/+5
|\ \
| * | Fix strict-aliasing warning in dlmallocSimon Glass2012-09-13-5/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | mmcinfo: Fix help messageBenoît Thébaudeau2012-09-05-2/+1
| | | | | | | | | | | | 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>
* | env_mmc: allow environment to be in an eMMC partitionStephen Warren2012-09-05-8/+56
|/ | | | | | | | | | | | | 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>
* cfi: Make the flash erase and write operations abortableJoe Hershberger2012-09-03-1/+5
| | | | | | | | | | | 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>
* hush: Don't parse the contents of a dereferenced varJoe Hershberger2012-09-02-3/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* hush: Add default value substitution supportJoe Hershberger2012-09-02-3/+40
| | | | | | | | | | | | | | | 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>
* env_nand: align NAND buffersStephen Warren2012-09-02-5/+5
| | | | | | | | 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>
* image/FIT: Add ramdisk load, entry address and OS tag inclusionJagannadha Sutradharudu Teki2012-09-02-3/+4
| | | | | | | 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>
* usb: Optimize USB storage read/writeJim Shimer2012-09-01-12/+0
| | | | | | | Trim down the IO times by removing uneeded test unit reeady calls. Signed-off-by: Jim Shimer <mgi2475@motorola.com>
* usb_stor_BBB_transport: Do not delay when not requiredBenoît Thébaudeau2012-09-01-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* usb_storage: Remove EHCI constraintsBenoît Thébaudeau2012-09-01-18/+15
| | | | | | | | | | 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>
* usb_storage: Restore non-EHCI supportBenoît Thébaudeau2012-09-01-0/+4
| | | | | | | | | | | | | 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>
* dfu:cmd: Support for DFU u-boot commandLukasz Majewski2012-09-01-0/+82
| | | | | | | | 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>
* cmd_spi: remove superfluous semicolonMarek Vasut2012-08-09-1/+1
| | | | | | Reported-by: James Miller <jamesmiller@chromium.org> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* zfs: Add ZFS filesystem supportJorgen Lundman2012-08-09-0/+237
| | | | | | | | | | | | | | | | | | | | | 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: https://github.com/pendor/grub-zfs/commit/e7b6ef3ac3b9685ac4c394c897b1d4221b7381f1 Signed-off-by: Jorgen Lundman <lundman@lundman.net>
* u-boot: Update yaffs2 file systemCharles Manning2012-08-09-135/+248
| | | | | | | | 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>
* Consider CONFIG_ZERO_BOOTDELAY_CHECK when CONFIG_AUTOBOOT_KEYED is setDirk Eibach2012-08-09-0/+5
| | | | | | | | 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>
* Allow newlines within command environment varsSimon Glass2012-08-09-3/+3
| | | | | | | | | | | | 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>
* Add run_command_list() to run a list of commandsSimon Glass2012-08-09-65/+89
| | | | | | | | | 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>
* env_onenand: set ONENAND_MAX_ENV_SIZE to CONFIG_ENV_SIZEDavid du Colombier2012-08-06-1/+1
| | | | | | | | | 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>
* Merge branch 'master' of git://git.denx.de/u-boot-i2cWolfgang Denk2012-07-31-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * '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>
| * i2c: deblock i2c bus also if accessed before realocationHolger Brunck2012-07-31-0/+1
| | | | | | | | | | | | | | | | | | 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>
* | cmd_sf: add size checking to spi flash commandsGerlando Falauto2012-04-03-0/+14
|/ | | | | | | | | | | SPI flash operations inadvertently stretching beyond the flash size will result in a wraparound. This may be particularly dangerous when burning u-boot, because the flash contents will be corrupted rendering the board unusable, without any warning being issued. So add a consistency checking so not to overflow past the flash size. Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* usb_storage: fix ehci driver max transfer sizeStefan Herbrechtsmeier2012-07-18-17/+20
| | | | | | | | | | | | | | | | The commit 5dd95cf93dfffa1d19a1928990852aac9f55b9d9 '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>
* usb: check return value of submit_{control, bulk}_msgIlya Yanok2012-07-18-2/+4
| | | | | | | Return values of submit_{control,bulk}_msg() functions should be checked to detect possible error. Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>
* usb: pass cache-aligned buffer to usb_get_descriptor()Ilya Yanok2012-07-18-2/+4
| | | | | | | 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>
* common lcd: minor coding style changesNikita Kiryanov2012-07-10-121/+124
| | | | | | | No functional changes Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
* Minor Coding Style cleanupWolfgang Denk2012-07-10-4/+0
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Add env vars describing U-Boot target boardStephen Warren2012-07-09-0/+22
| | | | | | | | | | | 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>
* SPL: common/Makefile: Add image.c to SPL buildStefan Roese2012-07-07-1/+1
| | | | | | | 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>
* env_mmc: align buffers using ALLOC_CACHE_ALIGN_BUFFERStephen Warren2012-07-07-5/+5
| | | | | | | | | 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>
* pxe: add support for parsing local syslinux filesRob Herring2012-06-21-8/+133
| | | | | | | | 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>
* pxe: parse initrd file from append stringRob Herring2012-06-21-1/+14
| | | | | | | | 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>