summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeLines
* ARM: prevent misaligned array initsAlbert ARIBAUD2012-10-15-1/+5
| | | | | | | | | | | | | | Under option -munaligned-access, gcc can perform local char or 16-bit array initializations using misaligned native accesses which will throw a data abort exception. Fix files where these array initializations were unneeded, and for files known to contain such initializations, enforce gcc option -mno-unaligned-access. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> [trini: Switch to usign call cc-option for -mno-unaligned-access as Albert had done previously as that's really correct] Signed-off-by: Tom Rini <trini@ti.com>
* env: fix crash using default -f -aGerlando Falauto2012-10-05-0/+3
| | | | | | | | | | | env default -a -f calls env_check_apply on all existing environment variables with a NULL value for "newval" as a way of cleaning up. This causes string manipulation functions to crash on most architectures. So replace a NULL argument with an empty string. Reported-By: Stefano Babic <sbabic@denx.de> Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Tested-by: Stefano Babic <sbabic@denx.de>
* Improve license declaration for cmd_ini.hJoe Hershberger2012-10-05-2/+30
| | | | | | | | | | | | Instead of referenceing the source webpage (which can change) include the license in the source file. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reported-by: Igor Grinberg <grinberg@compulab.co.il> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Tom Rini <trini@ti.com> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Wolfgang Denk <wd@denx.de>
* Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2012-10-04-2/+89
|\
| * serial: Add Zynq serial driverMichal Simek2012-10-04-0/+8
| | | | | | | | | | | | | | | | | | The driver is used on Xilinx Zynq platform. Signed-off-by: Michal Simek <monstr@monstr.eu> CC: Joe Hershberger <joe.hershberger@gmail.com> CC: Marek Vasut <marex@denx.de> Acked-by: Marek Vasut <marex@denx.de>
| * OMAP: networking support for SPLIlya Yanok2012-10-01-2/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for networking in SPL. Some devices are capable of loading SPL via network so it makes sense to load the main U-Boot binary via network too. This patch tries to use existing network code as much as possible. Unfortunately, it depends on environment which in turn depends on other code so SPL size is increased significantly. No effort was done to decouple network code and environment so far. Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Tom Rini <trini@ti.com>
| * OMAP: spl: call timer_init() from SPLIlya Yanok2012-10-01-0/+2
| | | | | | | | | | | | | | We need to initialize timer properly, otherwise all delays inside SPL will be wrong. Signed-off-by: Ilya Yanok <ilya.yanok@cogentembedded.com>
* | Output strings from echo with puts where easyJoe Hershberger2012-10-03-7/+21
| | | | | | | | | | | | | | | | Change echo to puts characters together where it knows about them together. This improves netconsole performance by greatly reducing the number of packets that are sent. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* | Add a command to access the system timerJoe Hershberger2012-10-03-0/+27
| | | | | | | | | | | | | | | | | | | | Two sub-commands... start and get. * start sets the reference. * get prints out the time since the last start (in "<sec>.<msec>" format). If get is called without start, returns time since boot. Simple way to benchmark an operation: "timer start;<commands-to-measure>;timer get" Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* | Add a new "ini" commandJoe Hershberger2012-10-03-0/+248
| | | | | | | | | | | | | | | | | | This allows you to read ini-formatted data from anywhere and then import one of the sections into the environment This is based on rev 16 at http://code.google.com/p/inih/ Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* | Cleanup cache command printsJoe Hershberger2012-10-03-1/+1
| | | | | | | | | | | | Only print when queried, not every time the setting is changed. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* | Fix checkpatch.pl complaints in cmd_cache.cJoe Hershberger2012-10-03-21/+26
| | | | | | | | | | | | Old code that is not compliant. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* | Add parameter to md5sum to save the md5 sumJoe Hershberger2012-10-03-4/+37
| | | | | | | | | | | | | | Add a parameter that allows you to store the md5 sum to either a memory location or a variable. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* | Implement verify option for md5sum commandJoe Hershberger2012-10-03-0/+105
| | | | | | | | | | | | | | | | | | Loosely based on CONFIG_CRC32_VERIFY. The sum to verify against can be in memory, in a variable, or the last parameter to the function directly. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* | Add parameter to sha1sum to save the SHA1 sumJoe Hershberger2012-10-03-4/+37
| | | | | | | | | | | | | | Add a parameter that allows you to store the SHA1 sum to either a memory location or a variable. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* | Implement verify option for sha1sum commandJoe Hershberger2012-10-03-0/+105
| | | | | | | | | | | | | | | | | | Loosely based on CONFIG_CRC32_VERIFY. The sum to verify against can be in memory, in a variable, or the last parameter to the function directly. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* | Change dead code in "test" cmd to debug outputJoe Hershberger2012-10-03-3/+3
| | | | | | | | | | | | | | Improve debug output for test by indicating the number of parameters and quoting the parameters to make it clear exactly what each contains Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* | Allow runtime configuration of "zero-delay" checkJoe Hershberger2012-10-03-2/+3
|/ | | | | | | Define the new "-2" value for bootdelay to mean autoboot with no delay and don't check for an abort key (while "0" value means do check). Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* cmd_fat.c: fix build warningAnatolij Gustschin2012-09-29-1/+0
| | | | | | | | | | | | | | Commit cfda5aeab89d73779e26f0d34cf10f64caa67431 (cmd_fat: use common get_device_and_partition function) introduced a warning: cmd_fat.c: In function 'do_fat_fswrite': cmd_fat.c:178:8: warning: unused variable 'ep' [-Wunused-variable] Fix it. Signed-off-by: Anatolij Gustschin <agust@denx.de> Reported-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Tested-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
* common: add zip command supportLei Wen2012-09-29-0/+61
| | | | Signed-off-by: Lei Wen <leiwen@marvell.com>
* Merge branch 'master' of git://git.denx.de/u-boot-netTom Rini2012-09-27-3/+53
|\
| * PXE: FDT: Add support for fdt in PXEChander Kashyap2012-09-27-3/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now DT support is becoming common for all new SoC's. Hence it is better to have option for getting specific FDT from the remote server. This patch adds support for new label i.e. 'fdt'. This will allow to retrieve 'fdt blob' from the remote server. This patch take care for the following scenarios. The usage of fdt is optional. The 'fdt blob' can be retrieved from tftp or can be available locally or can be absent. If 'fdt_addr_r' environment variable is set and 'fdt' label is defined retrieve 'fdt blob' from tftp. 'fdt_addr_r' is then passed along bootm command. If 'fdt_addr' is set and 'fdt blob' is not retrieved from the tftp pass 'fdt_addr' to bootm command. In this case 'fdt blob' will be available at 'fdt_addr'. If 'fdt_addr' is not set and 'fdt blob' is not retrieve from tftp pass NULL to boot command. In this case 'fdt blob' is not required and absent. Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org> Acked-by: Jason Hobbs <jason.hobbs@calxeda.com>
| * net: Improve the speed of netconsoleJoe Hershberger2012-09-24-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously u-boot would initialize the network interface for every network operation and then shut it down again. This makes sense for most operations where the network in not known to be needed soon after the operation is complete. In the case of netconsole, it will use the network for every interaction with the shell or every printf. This means that the network is being reinitialized very often. On many devices, this intialization is very slow. This patch checks for consecutive netconsole actions and leaves the ethernet hardware initialized between them. It will still behave the same old way for all other network operations and any time another network operation happens between netconsole operations. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Cc: Stefano Babic <sbabic@denx.de> Acked-by: Stefano Babic <sbabic@denx.de>
* | SPL: Add support for loading image from ram in SPL.Pavel Machek2012-09-27-0/+22
| | | | | | | | | | Signed-off-by: Pavel Machek <pavel@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Rework how we inform about un-headered imagesTom Rini2012-09-27-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | First, remove the puts from the case where we don't have an mkimage header as this is somewhat common and intentional for no-arg target images. Second, rework the final switch statement in board_init_r to, in the case of !CONFIG_SPL_OS_BOOT be only about doing debug prints about if we know what the magic is or not (the CONFIG_SPL_OS_BOOT case is unchanged). Then we call jump_to_image_no_args(). This gives us the same behavior as before but with slightly smaller code. Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Make un-supported boot device puts a debug insteadTom Rini2012-09-27-3/+1
| | | | | | | | Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Enable use of custom defined U-Boot entry pointStefan Roese2012-09-27-1/+4
| | | | | | | | | | | | | | | | | | By setting CONFIG_SYS_UBOOT_START boards can now use a different entry point for their U-Boot image. So the U-Boot entry point is not fixed to CONFIG_SYS_TEXT_BASE any more. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: SPI: Enhance spi_spl_load to match the other load functionsTom Rini2012-09-27-2/+2
| | | | | | | | Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Add option to skip copying of the mkimage headerStefan Roese2012-09-27-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some system (e.g. powerpc), the load-address and entry-point is located at address 0. So the current approach to load the image (payload) including the header to the address "load-address - 64" can't work here. This patch adds an flag to skip this copying including header to the SPL framework. By setting SPL_COPY_PAYLOAD_ONLY, only the playload will be copied. This will be used by the SPL NOR flash driver on powerpc. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Add NOR flash booting supportStefan Roese2012-09-27-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | SPL NOR flash booting support is quite simple. Only copying of the images is needed. On MPC5xxx we need to make sure to only use the standard memcpy() implementation and not the MPC5xxx specific one. As the MPC5xxx version has some complexity which is not needed for this SPL booting. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: NAND: Move arch/arm/cpu/armv7/omap-common/spl_nand.c to common/splTom Rini2012-09-27-0/+101
| | | | | | | | | | | | | | We move the spl_nand_load_image function to common/spl. This will allow for easier integration of SPL-boots-Linux code on other arches. Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Use image_get_xxx() functions to access header valuesStefan Roese2012-09-27-5/+5
| | | | | | | | | | Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: do not use fix value for u-boot sizeStefano Babic2012-09-27-1/+5
| | | | | | | | | | | | | | | | | | | | If an u-boot image is not found, SPL thinks to load a bare u-boot.bin image with a maximum size of 200KB. Use CONFIG_SYS_MONITOR_LEN instead. Signed-off-by: Stefan Roese <stefan.roese@gmail.com> Signed-off-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Create arch/arm/lib/spl.c for board_init_f and jump_to_image_linuxTom Rini2012-09-27-35/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In SPL (CONFIG_SPL_FRAMEWORK) board_init_f must setup the stack pointer, clear the BSS and call board_init_r. We mark this as weak as some platforms may need to perform additional initalization at this point. We provide a gd that we know will be in a usable location, once the BSS has been cleared to help with this as well. Finally, we no longer call relocate_code so remove that from the armv7 version. Next, both board_init_f and jump_to_image_linux are going to be inherently arch-specific, so move these versions to arch/arm/lib/spl.c Signed-off-by: Tom Rini <trini@ti.com>
* | SPL: Move the omap SPL framework to common/splTom Rini2012-09-27-0/+336
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a new flag, CONFIG_SPL_FRAMEWORK to opt into the common/spl SPL framework, enable on all of the previously using boards. We move the spl_ymodem.c portion to common/ and spl_mmc.c to drivers/mmc/. We leave the NAND one in-place as we plan to replace it later in this series. We use common/spl to avoid linker problems with respect to merging constant strings in objects. Otherwise all strings in common/ will be linked in and kept which grows SPL in size too much. Signed-off-by: Tom Rini <trini@ti.com>
* | FAT: Make it possible to read from any file positionBenoît Thébaudeau2012-09-26-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When storage devices contain files larger than the embedded RAM, it is useful to be able to read these files by chunks, e.g. for a software update to the embedded NAND Flash from an external storage device (USB stick, SD card, etc.). Hence, this patch makes it possible by adding a new FAT API to read files from a given position. This patch also adds this feature to the fatload command. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Wolfgang Denk <wd@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
* | env: checkpatch clean env_fatIgor Grinberg2012-09-26-6/+14
| | | | | | | | | | | | env_fat has several checkpatch warnings - clean those up. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
* | env: remove duplicated env_get_char_spec()Igor Grinberg2012-09-26-10/+0
| | | | | | | | | | | | | | | | env_fat and env_remote have an implementation of env_get_char_spec() function that is not different than the default. Remove the duplicated code. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
* | Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini2012-09-25-70/+83
|\ \
| * | common/lcd: fix build breakage for at91sam9x5ek and trats boardsAnatolij Gustschin2012-09-24-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 203c37b8c5556aad1901ce4954792afd718c7d42 (common lcd: simplify core functions) and commit bfdcc65e1163b4891643c2a670570c478b9af2a4 (common lcd: simplify lcd_display_bitmap) caused build breakage for at91sam9x5ek board configurations and for trats board. Fix these build errors. Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
| * | common/lcd: add protection from null bmp pointerNikita Kiryanov2012-09-21-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the bmp pointer is null then U-Boot will get stuck when trying to load the image. What's worse, it will get stuck before the U-Boot shell becomes available to the user, thus making it difficult to correct the situation. To protect from the above scenario, check if the pointer is valid. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
| * | common lcd: simplify lcd_display_bitmapNikita Kiryanov2012-09-05-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move highly platform dependant code into its own functions to reduce the number of #ifdefs in lcd_display_bitmap To avoid breaking the mcc200 board which does not #define CONFIG_CMD_BMP, this patch also implements bmp_display() for mcc200. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
| * | common lcd: simplify core functionsNikita Kiryanov2012-09-05-32/+30
| | | | | | | | | | | | | | | | | | | | | | | | Move highly platform dependant code into its own function to reduce the number of #ifdefs in the bigger functions Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
| * | common lcd: simplify lcd_displayNikita Kiryanov2012-09-05-9/+18
| | | | | | | | | | | | | | | | | | | | | Simplify lcd_display by centralizing code into a funciton Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
| * | common lcd: simplify lcd_logoNikita Kiryanov2012-09-05-11/+1
| | | | | | | | | | | | | | | | | | | | | Simplify lcd_logo by extracting bmp unzip into its own function. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
* | | cmd_part: add partition-related commandStephen Warren2012-09-25-0/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements the following: part uuid mmc 0:1 -> print partition UUID part uuid mmc 0:1 uuid -> set environment variable to partition UUID part list mmc 0 -> list the partitions on the specified device "part uuid" can be useful when writing a bootcmd which searches all known devices for something bootable, and then wants the kernel to use the same partition as the root device, e.g.: part uuid ${devtype} ${devnum}:${rootpart} uuid setenv bootargs root=PARTUUID=${uuid} ... Signed-off-by: Stephen Warren <swarren@nvidia.com>
* | | disk: get_device_and_partition() "auto" partition and cleanupStephen Warren2012-09-25-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework get_device_and_partition() to: a) Implement a new partition ID of "auto", which requests that U-Boot search for the first "bootable" partition, and fall back to the first valid partition if none is found. This way, users don't need to specify an explicit partition in their commands. b) Make use of get_device(). c) Add parameter to indicate whether returning a whole device is acceptable, or whether a partition is mandatory. d) Make error-checking of the user's device-/partition-specification more complete. In particular, if strtoul() doesn't convert all characters, it's an error rather than just ignored. The resultant device/partition returned by the function will be as follows, based on whether the disk has a partition table (ptable) or not, and whether the calling command allows the whole device to be returned or not. (D and P are integers, P >= 1) D D: No ptable: !allow_whole_dev: error allow_whole_dev: device D ptable: device D partition 1 D:0 !allow_whole_dev: error allow_whole_dev: device D D:P No ptable: error ptable: device D partition P D:auto No ptable: !allow_whole_dev: error allow_whole_dev: device D ptable: first partition in device D with bootable flag set. If none, first valid paratition in device D. Note: In order to review this patch, it's probably easiest to simply look at the file contents post-application, rather than reading the patch itself. Signed-off-by: Rob Herring <rob.herring@calxeda.com> [swarren: Rob implemented scanning for bootable partitions. I fixed a couple of issues there, switched the syntax to ":auto", added the error-checking rework, and ":0" syntax for the whole device] Signed-off-by: Stephen Warren <swarren@nvidia.com>
* | | cmd_reiser: use common get_device_and_partition functionRob Herring2012-09-25-64/+17
| | | | | | | | | | | | | | | | | | | | | | | | Convert reiserload and reiserls to use common device and partition parsing function. With the common function "dev:part" can come from the environment and a '-' can be used in that case. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | | cmd_zfs: use common get_device_and_partition functionRob Herring2012-09-25-69/+19
| | | | | | | | | | | | | | | | | | | | | | | | Convert zfsload and zfsls to use common device and partition parsing function. With the common function "dev:part" can come from the environment and a '-' can be used in that case. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
* | | cmd_disk: use common get_device_and_partition functionRob Herring2012-09-25-58/+19
| | | | | | | | | | | | Signed-off-by: Rob Herring <rob.herring@calxeda.com>