summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeLines
* Fix number base handling of "load" commandWolfgang Denk2013-10-07-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As documented, almost all U-Boot commands expect numbers to be entered in hexadecimal input format. (Exception: for historical reasons, the "sleep" command takes its argument in decimal input format.) This rule was broken for the "load" command; for details please see especially commits 045fa1e "fs: add filesystem switch libary, implement ls and fsload commands" and 3f83c87 "fs: fix number base behaviour change in fatload/ext*load". In the result, the load command would always require an explicit "0x" prefix for regular (i. e. base 16 formatted) input. Change this to use the standard notation of base 16 input format. While strictly speaking this is a change of the user interface, we hope that it will not cause trouble. Stephen Warren comments (see [1]): I suppose you can change the behaviour if you want; anyone writing "0x..." for their values presumably won't be affected, and if people really do assume all values in U-Boot are in hex, presumably nobody currently relies upon using non-prefixed values with the generic load command, since it doesn't work like that right now. [1] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/171172 Acked-by: Tom Rini <trini@ti.com> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Wolfgang Denk <wd@denx.de>
* mtd: Fix function description in part_validate commentOtavio Salvador2013-10-07-4/+3
| | | | | | | | The part_validate comment had a wrong description of the actions it does and referenced to non-existent functions while in fact it calls 'part_validate_eraseblock()'. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
* usb:gadget:Remove redundant #includes for USB composite gadget and its functionsLukasz Majewski2013-09-24-4/+0
| | | | | | | | | | Only the <linux/usb/gadget.h> requires error.h include. Hence, several includes of error.h at USB gadget functions are not needed. Moreover unnecessary malloc.h includes were also removed. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
* dfu: Extract common DFU code to handle "dfu_alt_info" environment variableLukasz Majewski2013-09-24-14/+2
| | | | | | | | | | | New dfu_init_env_entities() function has been extracted from cmd_dfu.c and stored at dfu core. This is a dfu centric code, so it shall be processed in the core. Change-Id: I756c5de922fa31399d8804eaadc004ee98844ec2 Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Heiko Schocher <hs@denx.de>
* cmd_pxe.c: Pass along 'cmdtp' to do_bootm()/do_bootz()Tom Rini2013-09-24-10/+10
| | | | | | | | | | When we call do_bootm() with a vmlinuz, this would lead to a NULL pointer dereference, and after talking with Wolfgang the right thing to do here for now is to make sure that we pass cmdtp to these functions rather than NULL. Reported-by: Steven A. Falco <stevenfalco@gmail.com> Signed-off-by: Tom Rini <trini@ti.com>
* cmd_bootm.c: Only pass BOOTM_STATE_OS_CMDLINE on PowerPC/MIPSTom Rini2013-09-23-1/+4
| | | | | | | | | | | | In 5c427e4 we pass BOOTM_STATE_OS_CMDLINE as part of the bootm states to run, on all arches. However, this is only valid / useful on PowerPC and MIPS, and causes a problem on ARM where we specifically do not use it. Rather than make this state fake pass like we do for GO on some arches (which need updating to use the GO state), we should just not pass CMDLINE except when it may be used, like before. Tested-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Tom Rini <trini@ti.com>
* Merge branch 'master' of git://git.denx.de/u-boot-mmcTom Rini2013-09-20-1/+16
|\
| * spl_mmc: only call printf or puts with CONFIG_SPL_LIBCOMMON_SUPPORTPaul Burton2013-09-17-0/+16
| | | | | | | | | | | | | | If we don't have CONFIG_SPL_LIBCOMMON_SUPPORT defined then stdio functions are unavailable & calling them will cause a link failure. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
| * spl: remove unnecessary (& ARM specific) include of asm/utils.hPaul Burton2013-09-17-1/+0
| | | | | | | | | | | | | | ARM is the only architecture which includes this header and nothing in spl_mmc.c makes use of it. Remove the include. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
* | FIT: delete unnecessary castsMasahiro Yamada2013-09-20-7/+3
| | | | | | | | | | | | | | | | Becuase fdt_check_header function takes (const void *) type argument, the argument should be passed to it without being casted to (char *). Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | cosmetic: FIT: fix typos in commentsMasahiro Yamada2013-09-20-2/+2
| | | | | | | | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* | Cosmetic: Fix a number of typos, no functional changes.Robert P. J. Day2013-09-20-1/+1
| | | | | | | | | | | | | | Fix various misspellings of things like "environment", "kernel", "default" and "volatile", and throw in a couple grammar fixes. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
* | Fix loading freeze when netconsole is activeFrederic Leroy2013-09-20-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Netconsole calls eth_halt() before giving control to another operating system. But the state machine of netconsole don't take it into account. Thus, netconsole calls network functions of an halted network device, making the whole system freeze. Rather than modifying the state machine of netconsole, we just unregister the current network device before booting. It does work because nc_send_packet() verifies that the current network device is not null. Signed-off-by: Frédéric Leroy <fredo@starox.org>
* | Fix some obvious typos across multiple subsystems.Robert P. J. Day2013-09-20-6/+6
| | | | | | | | | | | | | | | | | | | | Typoes fixed: "partion" -> "partition" "retrive", "retreive" -> "retrieve" "th" -> "to" Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
* | bootm: use BOOTM_STATE_OS_CMDLINE flag for plain bootmPaul Burton2013-09-20-2/+3
|/ | | | | | | | | | | | | | | | | | | A plain bootm used to call the architecture specific boot function with no flags, but was modified by commit 35fc84fa "Refactor the bootm command to reduce code duplication" to call the architecture specific boot function multiple times with various flags in sequence. The BOOTM_STATE_OS_CMDLINE flag was not used, indeed it seems that at least ARM prepares the command line on BOOTM_STATE_OS_PREP. However on MIPS since commit 59e8cbdb "MIPS: bootm: refactor initialisation of kernel cmdline" the command line is not prepared in response to a BOOTM_STATE_OS_PREP flag, only on BOOTM_STATE_OS_CMDLINE or a call with no flags. The end result is that a combination of those 2 commits leads to MIPS boards booting kernels with no command line arguments. An extra invocation of the architecture specific boot function with BOOTM_STATE_OS_CMDLINE fixes this. Signed-off-by: Paul Burton <paul.burton@imgtec.com>
* Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini2013-09-16-1/+12
|\
| * cmd_sf: let "sf update" preserve the final part of the last sectorGerlando Falauto2013-08-27-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Since "sf update" erases the last block as a whole, but only rewrites the meaningful initial part of it, the rest would be left erased, potentially erasing meaningful information. So, as a safety measure, have it rewrite the original content. Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Cc: Valentin Longchamp <valentin.longchamp@keymile.com> Cc: Holger Brunck <holger.brunck@keymile.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
* | Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2013-09-06-0/+1
|\ \
| * \ Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'Albert ARIBAUD2013-09-05-0/+1
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/serial/serial.c The conflict above was a trivial case of adding one init function in each branch, and manually resolved in merge.
| | * | ARM: mxs: tools: Add mkimage support for MXS bootstreamMarek Vasut2013-08-31-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add mkimage support for generating and verifying MXS bootstream. The implementation here is mostly a glue code between MXSSB v0.4 and mkimage, but the long-term goal is to rectify this and merge MXSSB with mkimage more tightly. Once this code is properly in U-Boot, MXSSB shall be deprecated in favor of mkimage-mxsimage support. Note that the mxsimage generator needs libcrypto from OpenSSL, I therefore enabled the libcrypto/libssl unconditionally. MXSSB: http://git.denx.de/?p=mxssb.git;a=summary The code is based on research presented at: http://www.rockbox.org/wiki/SbFileFormat Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@ti.com> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Otavio Salvador <otavio@ossystems.com.br>
* | | | bootm: allow correct bounds-check of destinationKees Cook2013-09-03-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While nothing presently examines the destination size, it should at least be correct so that future users of sys_mapmem() will not be surprised. Without this, it might be possible to overflow memory. Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
* | | | sandbox: Correct compiler warnings in cmd_bootm/cmd_ximgSimon Glass2013-09-03-6/+9
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct the following warnings found with sandbox when compression is enabled. cmd_bootm.c: In function 'bootm_load_os': cmd_bootm.c:443:11: warning: passing argument 4 of 'lzop_decompress' from incompatible pointer type [enabled by default] /usr/local/google/c/cosarm/src/third_party/u-boot/files/include/linux/lzo.h:31:5: note: expected 'size_t *' but argument is of type 'uint *' cmd_ximg.c: In function 'do_imgextract': cmd_ximg.c:225:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] cmd_ximg.c:225:14: warning: 'hdr' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Kees Cook <keescook@chromium.org>
* | | Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini2013-08-27-26/+102
|\ \ \
| * | | console: usb: kbd: To fix slow TFTP bootingJim Lin2013-08-26-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TFTP booting is slow when a USB keyboard is installed and stdin has usbkbd added. This fix is to change Ctrl-C polling for USB keyboard to every second when NET transfer is running. My previous patch is expected to be put into usb_kbd_testc(). But it went into usb_kbd_getc() after applied. This patch is to put change in correct place. Signed-off-by: Jim Lin <jilin@nvidia.com>
| * | | console: usb: kbd: To improve TFTP booting performanceJim Lin2013-08-26-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TFTP booting is slow when a USB keyboard is installed and stdin has usbkbd added. This fix is to change Ctrl-C polling for USB keyboard to every second when NET transfer is running. Signed-off-by: Jim Lin <jilin@nvidia.com>
| * | | usb: Use well-known descriptor sizes when parsing configurationJulius Werner2013-08-26-26/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing USB configuration parsing code relies on the descriptors' own length values when reading through the configuration blob. Since the size of those descriptors is always well-defined, we should rather use the known sizes instead of trusting device-provided values to be correct. Also adds some safety to potential out-of-order descriptors. Change-Id: I16f69dfdd6793aa0fe930b5148d4521f3e5c3090 Signed-off-by: Julius Werner <jwerner@chromium.org>
| * | | USB: usb-hub: Add a weak function for resetting devicesDan Murphy2013-08-26-0/+12
| | |/ | |/| | | | | | | | | | | | | | | | Add a __weak function that can be overridden to reset devices attached to an ehci devices after the FEAT_POWER has been submitted Signed-off-by: Dan Murphy <dmurphy@ti.com>
* | | i2c: fix i2c dev command for not using new frameworkHeiko Schocher2013-08-27-0/+2
|/ / | | | | | | | | | | | | | | | | i2c dev command does not work anymore for legacy drivers because a check is executed that is valid only in the new framework. Signed-off-by: Heiko Schocher <hs@denx.de> Tested-by: Stefano Babic <sbabic@denx.de>
* | env_nand.c: support falling back to redundant env when writingPhil Sutter2013-08-22-62/+54
| | | | | | | | | | | | | | | | | | | | Without this patch, when the currently chosen environment to be written has bad blocks, saveenv fails completely. Instead, when there is redundant environment fall back to the other copy. Environment reading needs no adjustment, as the fallback logic for incomplete writes applies to this case as well. Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
* | cmd_nand: Do not show usage when scrub is abortedMasahiro Yamada2013-08-22-2/+2
| | | | | | | | | | | | | | | | | | | | When executing nand scrub, the user gets the prompt: Really scrub this NAND flash? <y/N> We do not want the annoying usage displayed when saying N here. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | cmd_nand: slight optimization of nand_dump functionMasahiro Yamada2013-08-22-5/+8
| | | | | | | | | | | | | | | | | | | | If a non-zero value is given to only_oob argument, printing the main area is skipped. With a little modification, we can skip the whole while loop. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | cmd_nand: fix a memory leak in nand_dump functionMasahiro Yamada2013-08-22-7/+16
| | | | | | | | | | | | | | | | | | If datbuf = memalign(ARCH_DMA_MINALIGN, nand->writesize); succeeds and oobbuf = memalign(ARCH_DMA_MINALIGN, nand->oobsize); fails, nand_dump function should free databuf. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | Merge branch 'master' of git://git.denx.de/u-boot-mpc85xxTom Rini2013-08-21-2/+0
|\ \
| * | spl: env_common.c: make CONFIG_SPL_BUILD contain function env_importYing Zhang2013-08-20-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The functionality env_import will be used in the SPL. They had been excluded by ifndef CONFIG_SPL_BUILD. Now, put it into the SPL. Signed-off-by: Ying Zhang <b40530@freescale.com> Acked-by: Tom Rini <trini@ti.com> Acked-by: York Sun <yorksun@freescale.com>
* | | ppc4xx: Remove support for PPC405CR CPUsMatthias Fuchs2013-08-20-3/+3
|/ / | | | | | | | | | | | | This patch removes support for the APM 405CR CPU. This CPU is EOL and no board uses this chip. Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
* | SPDX-License-Identifier: convert BSD-3-Clause filesWolfgang Denk2013-08-19-24/+1
| | | | | | | | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini Don't remove some copyrights by accident] Signed-off-by: Tom Rini <trini@ti.com>
* | Merge branch 'master' of git://88.191.163.10/u-boot-armTom Rini2013-08-18-0/+4
|\ \ | |/ | | | | | | | | | | | | | | | | Fixup an easy conflict over adding the clk_get prototype and USB_OTG defines for am33xx having moved. Conflicts: arch/arm/include/asm/arch-am33xx/hardware.h Signed-off-by: Tom Rini <trini@ti.com>
| * spl_mmc.c: Detect missing kernel image in RAW MMCTom Rini2013-07-26-0/+4
| | | | | | | | | | | | | | | | | | Currently, we assume that if we can read from MMC correctly, we have found a valid image. This is not the case as an empty area will read just fine. Add a check for a valid IH_MAGIC. Signed-off-by: Tom Rini <trini@ti.com> Reviewed-by: Peter Korsgaard <jacmet@sunsite.dk>
* | image: Display FIT timestamp when bootingSimon Glass2013-08-16-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | The timestamp is shown in fit_print_contents() but for some reason not in fit_image_print(). This seems to be an oversight, since it is the latter which is used by bootm. Add timestamp printing in this case. (There is code duplication in these two function, for looking at in a future patch). Signed-off-by: Simon Glass <sjg@chromium.org>
* | bootm: fix conditional controlling call to fixup_silent_linuxPaul B. Henson2013-08-16-1/+1
| | | | | | | | | | | | | | | | | | This function is only defined if CONFIG_SILENT_CONSOLE is set and CONFIG_SILENT_U_BOOT_ONLY is not set, the call to it should be based on the same conditions. Signed-off-by: Paul B. Henson <henson@acm.org> Acked-by: Simon Glass <sjg@chromium.org>
* | RFC: bootm: Add silent_linux environment variableSimon Glass2013-08-16-2/+12
| | | | | | | | | | | | | | | | | | | | At present the console for linux is silent if the U-Boot console is silent, unless CONFIG_SILENT_U_BOOT_ONLY is set. I wonder if a better way would be to have an environment variable to control this? Then we can control the verbosity from scripts, and set the variable to 'no' for those boards that want Linux to boot with console output. Signed-off-by: Simon Glass <sjg@chromium.org>
* | SPL: Limit image name print lengthTaras Kondratiuk2013-08-16-2/+3
| | | | | | | | | | | | | | | | | | If image name is longer than 32 bytes, then it will be truncated. This will remove '\0' at the end of the line, so printf will go out of string limit. Signed-off-by: Taras Kondratiuk <taras@ti.com> Reviewed-by: Tom Rini <trini@ti.com>
* | Enable xmodem supportAngus Ainslie2013-08-16-4/+20
| | | | | | | | | | | | | | This is a trivial patch that just enables xmodem downloads using the existing ymodem framework. Signed-off-by: Angus Ainslie <angus@akkea.ca>
* | Merge branch 'dcc' of git://www.denx.de/git/u-boot-microblazeTom Rini2013-08-13-3/+0
|\ \
| * | serial: arm_dcc: Remove stdio structure supportJagannadha Sutradharudu Teki2013-08-13-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Removed stdio structure ops support on arm_dcc driver, and need to register with serial core so-that it can access like remianing serial drivers. Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* | | Merge branch 'master' of git://www.denx.de/git/u-boot-videoTom Rini2013-08-12-1/+0
|\ \ \ | |/ / |/| |
| * | video: Encapsulate font in video_font_data.hMarek Vasut2013-08-12-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves all the font configuration values into video_font_data.h so they are all in the right place with the font. The video_font.h now only includes video_font_data.h and will allow us to select and include different font once more fonts are added. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Anatolij Gustschin <agust@denx.de> [agust: fixed build warning for mcc200] Signed-off-by: Anatolij Gustschin <agust@denx.de>
* | | cmd_sf: let "sf update" erase last sector as a wholeGerlando Falauto2013-08-07-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | make "sf update" work with unaligned `len' parameter, by deleting the whole last sector before writing, so to allow for: sf update ${load_addr_r} 0 ${filesize} Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Cc: Valentin Longchamp <valentin.longchamp@keymile.com> Cc: Holger Brunck <holger.brunck@keymile.com> Acked-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
* | | cmd_sf|env_sf: Fix code cleanupJagannadha Sutradharudu Teki2013-08-06-14/+15
|/ / | | | | | | | | | | | | | | - line over 80 characters - add tabs - CHECK: Alignment should match open parenthesis Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
* | usb_hub: fix power cycling logicNikita Kiryanov2013-07-29-2/+2
| | | | | | | | | | | | | | | | | | | | | | When power cycling the hub ports, a misbehaving port will prevent all ports from being powered on because we quit at the first sign of trouble. Skip problematic ports instead of failing the entire power on. Cc: Marek Vasut <marex@denx.de> Cc: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>