summaryrefslogtreecommitdiff
path: root/cmd
Commit message (Collapse)AuthorAgeLines
* sf: fix sf probeCyrille Pitchen2016-09-12-1/+0
| | | | | | | | | | | | | This patch fixes the "sf probe" command. The very first SPI flash probe passes, for instance when u-boot tries to read its environment settings from a (Q)SPI memory but next "sf probe" commands fail because the flash memory node is unbound from the SPI controller children nodes. Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Tested-by: Stefan Roese <sr@denx.de> Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at> Reviewed-by: Simon Glass <sjg@chromium.org>
* cmd: Rework disk.c usageTom Rini2016-09-09-7/+3
| | | | | | | | | | We only need the function found in cmd/disk.c when we have IDE, SCSI or USB_STORAGE enabled. While the first two are easy to get right, in the 3rd case we assume that the set of cases where we do have USB and do not enable USB_STORAGE are small enough that we can take the small bloat of un-discarded strings on gcc prior to 6.x Signed-off-by: Tom Rini <trini@konsulko.com>
* pxe: Fix pxe boot with FIT imageYork Sun2016-09-07-4/+5
| | | | | | | | | | | | | | | | | When FIT image is used, a single image provides kernel, device tree and optionally ramdisk. Argc and argv need to be adjusted to support this. Test cases: 1. Booting with legacy images 2. Booting with legacy images without initrd 3. Booting with FIT image Test commands: 1. pxe get && pxe boot 2. sysboot Signed-off-by: York Sun <york.sun@nxp.com> Signed-off-by: Wenbin Song <wenbin.song@nxp.com>
* nand: Fix some more NULL name testsScott Wood2016-09-01-1/+1
| | | | | | | | | | | Now that nand_info[] is an array of pointers we need to test the pointer itself rather than using name as a proxy for NULLness. Fixes: b616d9b0a708eb9 ("nand: Embed mtd_info in struct nand_chip") Signed-off-by: Scott Wood <oss@buserror.net> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Tony Lindgren <tony@atomide.com> Acked-by: Tony Lindgren <tony@atomide.com>
* nand: Fix nand info for no deviceTony Lindgren2016-09-01-3/+3
| | | | | | | | | | | | Looks like we have few more places where we're testing for nand_info[i]->name. We can now use just test for nand_info[i] instead. This fixes a data abort on devices with no NAND when doing nand info. Signed-off-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* nand: Fix set_dev checks for no deviceTony Lindgren2016-08-26-2/+1
| | | | | | | | | | | | If we do nand device 0 command in u-boot on a device that has NAND support enabled but no NAND chip, we can get data abort at least on omaps. Fix the issue by replacing the check with nand_info[dev] as suggested by Scott Wood. The check for name existed before because before the array-to-pointer conversion there was no way to directly test nand_info[dev] for emptiness. Signed-off-by: Tony Lindgren <tony@atomide.com>
* fastboot: implement KconfigSteve Rae2016-08-20-0/+62
| | | | | | implement Kconfig for the 'fastboot' feature set Signed-off-by: Steve Rae <steve.rae@raedomain.com>
* cmd: efi_loader: Return CMD_RET_USAGE in case of not enough argumentsBin Meng2016-08-20-1/+1
| | | | | | | | When typing 'bootefi' from U-Boot shell, nothing outputs. Like other commands, return CMD_RET_USAGE so that it can print help message. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Alexander Graf <agraf@suse.de>
* cmd: booti: move CONFIG_CMD_BOOTI to KconfigMasahiro Yamada2016-08-20-0/+7
| | | | | | | | | | This command is used to boot ARM64 Linux. I made DISTRO_DEFAULTS select this option for ARM64 to respect include/config_distro_defaults.h. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* cmd: Split 'bootz' and 'booti' out from 'bootm'Tom Rini2016-08-20-250/+269
| | | | | | | | | | | | The bootz and booti commands rely on common functionality that is found in common/bootm.c and common/bootm_os.c. They do not however rely on the rest of cmd/bootm.c to be implemented so split them into their own files. Have various Makefiles include the required infrastructure for CONFIG_CMD_BOOT[IZ] as well as CONFIG_CMD_BOOTM. Move the declaration of 'images' over to common/bootm.c. Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* cmd: fdt: add fdt overlay application subcommandMaxime Ripard2016-08-20-0/+24
| | | | | | | | | | | | | | | | | | | | | | | The device tree overlays are a good way to deal with user-modifyable boards or boards with some kind of an expansion mechanism where we can easily plug new board in (like the BBB or the raspberry pi). However, so far, the usual mechanism to deal with it was to have in Linux some driver detecting the expansion boards plugged in and then request these overlays using the firmware interface. That works in most cases, but in some cases, you might want to have the overlays applied before the userspace comes in. Either because the new board requires some kind of an early initialization, or because your root filesystem is accessed through that expansion board. The easiest solution in such a case is to simply have the component before Linux applying that overlay, removing all these drawbacks. Reviewed-by: Stefan Agner <stefan@agner.ch> Acked-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
* cmd: fdt: Narrow the check for fdt addrMaxime Ripard2016-08-20-1/+1
| | | | | | | | | | | The current code only checks if the fdt subcommand is fdt addr by checking whether it starts with 'a'. Since this is a pretty widely used letter, narrow down that check a bit. Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
* x86: bdinfo: Drop meaningless valuesSimon Glass2016-08-16-10/+0
| | | | | | | These are not useful on x86 so do not print them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* bdinfo: Don't print out empty DRAM banksSimon Glass2016-08-16-3/+5
| | | | | | | | | There is no sense in printing out DRAM banks of size 0 since this means they are empty. Skip them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* xtensa: add support for the xtensa processor architecture [1/2]Chris Zankel2016-08-15-0/+8
| | | | | | | | | | | | | | The Xtensa processor architecture is a configurable, extensible, and synthesizable 32-bit RISC processor core provided by Cadence. This is the first part of the basic architecture port with changes to common files. The 'arch/xtensa' directory, and boards and additional drivers will be in separate commits. Signed-off-by: Chris Zankel <chris@zankel.net> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* efi_loader: disk: Fix CONFIG_BLK breakageAlexander Graf2016-08-08-5/+18
| | | | | | | | | | | | | | | When using CONFIG_BLK, there were 2 issues: 1) The name we generate the device with has to match the name we set in efi_set_bootdev() 2) The device we pass into our block functions was wrong, we should not rediscover it but just use the already known pointer. This patch fixes both issues. Signed-off-by: Alexander Graf <agraf@suse.de>
* cmd: gpt: fix the wrong size parse for the last partitionKever Yang2016-08-05-2/+2
| | | | | | | | | | | The calculation of "dev_desc->lba - 34 - 1 - offset" is not correct for size '-', because both fist_usable_lba and last_usable_lba will remain 34 sectors. We can simply use 0 for size '-' because the part_efi module will decode the size and auto extend the size to maximum available size. Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
* cmd/bdinfo: extract print_std_bdinfoMax Filippov2016-08-05-20/+12
| | | | | | | | | | print_std_bdinfo outputs typical set of board information entries: boot params location, memory and flash addresses and sizes, network interfaces information and configured serial baud rate. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* cmd/bdinfo: extract print_baudrateMax Filippov2016-08-05-14/+25
| | | | | | | | print_baudrate outputs serial baud rate. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* cmd/bdinfo: extract print_eth_ip_addrMax Filippov2016-08-05-77/+36
| | | | | | | | | | print_eth_ip_addr outputs eth configurations for up to 6 interfaces and configured IP address. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* cmd/bdinfo: extract print_bi_flashMax Filippov2016-08-05-27/+27
| | | | | | | | print_bi_flash outputs flashstart, flashsize and flashoffset lines. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* cmd/bdinfo: extract print_bi_dramMax Filippov2016-08-05-41/+19
| | | | | | | | print_bi_dram outputs start address and size for each DRAM bank. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* cmd/bdinfo: extract print_bi_memMax Filippov2016-08-05-16/+26
| | | | | | | | print_bi_mem outputs memstart and memsize lines. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* cmd/bdinfo: extract print_bi_boot_paramsMax Filippov2016-08-05-7/+13
| | | | | | | | print_bi_boot_params outputs boot parameters structure location. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* crypto/fsl: Update blob cmd to accept 64bit addressesSumit Garg2016-08-02-1/+1
| | | | | | | | | Update blob cmd to accept 64bit source, key modifier and destination addresses. Also correct output result print format for fsl specific implementation of blob cmd. Signed-off-by: Sumit Garg <sumit.garg@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
* dm: usb: Use blk_dread/write() instead of direct callsSimon Glass2016-07-27-2/+2
| | | | | | Update the USB mass storage code to allow it to work with driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
* arm: Show early-malloc() usage in bdinfoSimon Glass2016-07-27-0/+5
| | | | | | | | | | | | | This is useful information to show how close we are to the limit. At present it is only available by enabling DEBUG in board_r.c. Make it available with the 'bdinfo' command also. Note that this affects ARM only. The bdinfo command is different for each architecture. Rather than duplicating the code it would be better to refactor it (as was done with global_data). Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge git://git.denx.de/u-boot-nand-flashTom Rini2016-07-25-7/+12
|\
| * mtd: fix compiler warningsSteve Rae2016-07-24-2/+2
| | | | | | | | | | | | | | - add missing declaration - update debug output format specifiers Signed-off-by: Steve Rae <steve.rae@raedomain.com>
| * cmd, nand: add an option to disable the verification when writing in raw modeBoris Brezillon2016-07-24-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modern NANDs do not guarantee that data written in raw mode will not contain bitflips just after writing them. This is fine since the number of bitflips should be rather low and thus fixable by the ECC engine, but since we are reading data in raw mode to verify if they match the input data we cannot prevent failures if some bits are flipped. The option of using standard mode to verify the data is not acceptable either, since one of the usage of raw mode is to allow flashing images that do not respect the standard NAND page layout or the default ECC config (this is the case on Allwinner platforms, where the ROM code tests several hardcoded configs, which are not necessarily matching the NAND characteristics). Add an extension to the nand write.raw command allowing one to disable the verification step. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* | lzmadec: Use the same type as the lzma callSimon Glass2016-07-25-2/+3
| | | | | | | | | | | | | | | | With sandbox on 32-bit the size_t type can be a little inconsistent. Use the same type as the caller expects to avoid a compiler warning. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* | efi_loader: Make exposed image loader path absoluteAlexander Graf2016-07-25-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | When loading an efi image, we pass it the location it was loaded from. On file system backends, there are no relative paths, so we should always pass in absolute ones. For network paths, we may be relative. This fixes distro booting with grub2 for me when it fetches the grub2 config file from the loader partition. Reported-by: york sun <york.sun@nxp.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* | cmd: misc: Add support for fractions in sleepmario.six@gdsys.cc2016-07-25-1/+20
|/ | | | | | | | | | | | | | | | | | | | | A feasible way to communicate certain errors for devices that have no other way of signalling besides LEDs is to flash these LEDs. For errors in U-Boot, a script that utilizes the led and sleep commands would be a practicable way, but currently the sleep command can only delay for an integral amount of seconds, which is too slow to create an easily noticeable pattern for flashing LEDs. Therefore, this patch adds support for fractions (down to .001 seconds) to the sleep command. The parsing is kept minimal, simplistic and as robust as possible: After converting the passed string using simple_strtoul and multiplying it with 1000, we search for the first dot, convert the three characters after that into a number (if they are not numbers, we ignore the fractional part and just use the delay we got from simple_strtoul), and add this number to the delay. Signed-off-by: Mario Six <mario.six@gdsys.cc>
* cmd: mtdparts: support runtime generated mtdpartsLadislav Michl2016-07-22-9/+12
| | | | | | | | | | | Some CPUs contains boot ROM code capable reading first few blocks (where SPL resides) of NAND flash and executing it. It is wise to create separate partition here for SPL. As block size depends on NAND chip used, we could either use worst case (biggest) partition size or base its size on actual block size. This patch adds support for the latter option. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
* cmd: mtdparts: use defaults by defaultLadislav Michl2016-07-22-6/+16
| | | | | | | | | | | Boards which are defining default mtdparts often need them early in boot process (to load environment from UBI volume, for example). This is currently solved by adding mtdparts and mtdids variable definitions also to default environment. With this change, default partitions are used by default unless explicitely deleted or redefined. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
* cmd: mtdparts: consolidate mtdparts reading from envLadislav Michl2016-07-22-22/+20
| | | | Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
* cmd: mtdparts: fix null pointer dereference in parse_mtdpartsLadislav Michl2016-07-22-10/+13
| | | | | | | | | | In case there is no mtdparts variable in relocated environment, NULL is assigned to p, which is later fed to strncpy. Also function parameter mtdparts is completely ignored, so use it in case mtdparts variable is not found in environment. This parameter is checked not to be NULL in caller. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
* cmd: mtdparts: fix mtdparts variable presence confusion in mtdparts_initLadislav Michl2016-07-22-4/+6
| | | | | | | | | A private buffer is used to read mtdparts variable from non-relocated environment. A pointer to that buffer is returned unconditionally, confusing later test for variable presence in the environment. Fix it by returning NULL when getenv_f fails. Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
* Merge git://git.denx.de/u-boot-fsl-qoriqTom Rini2016-07-19-2/+2
|\ | | | | | | | | | | | | | | Signed-off-by: Tom Rini <trini@konsulko.com> Conflicts: arch/arm/cpu/armv8/Makefile arch/arm/lib/bootm-fdt.c
| * armv8: Move secure_ram variable out of generic global dataYork Sun2016-07-15-2/+2
| | | | | | | | | | | | | | Secure_ram variable was put in generic global data. But only ARMv8 uses this variable. Move it to ARM specific data structure. Signed-off-by: York Sun <york.sun@nxp.com>
* | Various, unrelated tree-wide typo fixes.Robert P. J. Day2016-07-16-1/+1
|/ | | | | | | | | | | | | | | | | | | Fix a number of typos, including: * "compatble" -> "compatible" * "eanbeld" -> "enabled" * "envrionment" -> "environment" * "FTD" -> "FDT" (for "flattened device tree") * "ommitted" -> "omitted" * "overriden" -> "overridden" * "partiton" -> "partition" * "propogate" -> "propagate" * "resourse" -> "resource" * "rest in piece" -> "rest in peace" * "suport" -> "support" * "varible" -> "variable" Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
* Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini2016-07-11-0/+2
|\
| * dm: spi: Read default speed and mode values from DTVignesh R2016-07-09-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | In case of DT boot, don't read default speed and mode for SPI from CONFIG_*, instead read from DT node. This will make sure that boards with multiple SPI/QSPI controllers can be probed at different bus frequencies and SPI modes. Signed-off-by: Vignesh R <vigneshr@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com> Reviewed-by: Jagan Teki <jteki@openedev.com>
* | usb: dm: Make "usb info" use usb_for_each_root_dev()Hans de Goede2016-07-05-25/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old dm "usb info" implementation has several issues: 1) NULL pointer deref when a bus has no children 2) Not showing usb devices on busses without an emulated root-hub (otg host) 3) Attempting to show devices on inactive busses 4) "usb info" Would cause some hosts to get re-probed something which only "usb reset" should do TL;DR: proper iterating over usb bus root devs is hard, use the helper for it. Reported-by: Bernhard Nortmann <bernhard.nortmann@web.de> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* | usb: dm: Add a usb_for_each_root_dev() helper functionHans de Goede2016-07-05-3/+12
|/ | | | | | | | Iterating over usb-root devs and doing something for all of them is a bit tricky with dm, factor out the proven usb_show_tree() for this into a helper function. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* hush: complete renaming CONFIG_SYS_HUSH_PARSER to CONFIG_HUSH_PARSERMasahiro Yamada2016-06-24-8/+2
| | | | | | | There is no more define of CONFIG_SYS_HUSH_PARSER. Rename some remaining references and drop the backward compatible Kconfig entry. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* common: image: minimal android image iminfo supportMichael Trimarchi2016-06-24-0/+6
| | | | | | | | | We already support iminfo for other images. The idea of this patch is start to have a minimal support for android image format. We still need to print id[] array Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* cmd: bootefi: cosmeticSergey Kubushyn2016-06-24-1/+1
| | | | | | | | | | | | | | | | | | Short help (description) in bootefi command has a trailing "\n" that breaks the "help" command output (empty line after "bootefi"). Nothing important, doesn't affect anything but better be fixed in the upcoming release. Still working on i.MX6 and their siblings NAND U-Boot update -- it works here but not ready for a submission yet. Anyway it is for the next cycle, not going to go into this release because it is too big and may affect something else. Also have some thoughts about fastboot (using multiple devices) but this will go into separate email with RFC. Signed-off-by: Sergey Kubushyn <ksi@koi8.net>
* autoboot: add CONFIG_AUTOBOOT to allow to not compile autoboot.cMasahiro Yamada2016-06-20-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Since commit bb597c0eeb7e ("common: bootdelay: move CONFIG_BOOTDELAY into a Kconfig option"), CONFIG_BOOTDELAY is defined for all boards. Prior to that commit, it was allowed to unset CONFIG_BOOTDELAY to not compile common/autoboot.c, as described in common/Makefile: # This option is not just y/n - it can have a numeric value ifdef CONFIG_BOOTDELAY obj-y += autoboot.o endif It was a bit odd to enable/disable code with an integer type option, but it was how this option worked before that commit, and several boards actually unset it to opt out of the autoboot feature. This commit adds a new bool option, CONFIG_AUTOBOOT, and makes CONFIG_BOOTDELAY depend on it. I chose "default y" for this option because most boards use the autoboot. I added "# CONFIG_AUTOBOOT is not set" for the boards that had not set CONFIG_BOOTDELAY prior to the bad commit. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* Merge git://git.denx.de/u-boot-nand-flashTom Rini2016-06-20-6/+35
|\