summaryrefslogtreecommitdiffstats
path: root/cmd
Commit message (Collapse)AuthorAgeFilesLines
* efi_loader: Put fdt into convenient locationAlexander Graf2016-04-181-4/+26
| | | | | | | | | | | | The uEFI spec doesn't dictate where the device tree should live at, but legacy 32bit ARM grub2 has some assumptions that it may stay at its place when it's already loaded by the firmware. So let's put it somewhere where Linux that comes after would happily find it - around the recommended 128MB line. Signed-off-by: Alexander Graf <agraf@suse.de> Tested-by: Andreas Färber <afaerber@suse.de>
* efi_loader: Use system fdt as fallbackAlexander Graf2016-04-181-6/+31
| | | | | | | | | | | | | | | | When the user did not pass any device tree or the boot script didn't find any, let's use the system device tree as last resort to get something the payload (Linux) may understand. This means that on systems that use the same device tree for U-Boot and Linux we can just share it and there's no need to manually provide a device tree in the target image. While at it, also copy and pad the device tree by 64kb to give us space for modifications. Signed-off-by: Alexander Graf <agraf@suse.de> Tested-by: Andreas Färber <afaerber@suse.de>
* efi_loader: Increase path string to 32 charactersAlexander Graf2016-04-181-1/+1
| | | | | | | | | | | | Whenever we want to tell our payload about a path, we limit ourselves to a reasonable amount of characters. So far we only passed in device names - exceeding 16 chars was unlikely there. However by now we also pass real file path information, so let's increase the limit to 32 characters. That way common paths like "boot/efi/bootaa64.efi" fit just fine. Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: Pass file path to payloadAlexander Graf2016-04-182-8/+27
| | | | | | | | | | | | | | The payload gets information on where it got loaded from. This includes the device as well as file path. So far we've treated both as the same thing and always gave it the device name. However, in some situations grub2 actually wants to find its loading path to find its configuration file. So let's split the two semantically separte bits into separate structs and pass the loaded file name into our payload when we load it using "load". Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: Add el torito supportAlexander Graf2016-04-181-0/+14
| | | | | | | | | | When loading an el torito image, uEFI exposes said image as a raw block device to the payload. Let's do the same by creating new block devices with added offsets for the respective el torito partitions. Signed-off-by: Alexander Graf <agraf@suse.de>
* cmd: fdt: Use separate CMD_FDT Kconfig entry instead of OF_LIBFDTMichal Simek2016-04-182-1/+8
| | | | | | | | | | | Create CMD_FDT Kconfig entry to have an option to disable fdt command which is not required for small configuration which requires libfdt only. Enable it by default for all targets which enables OF_LIBFDT. Signed-off-by: Michal Simek <michal.simek@xilinx.com> [trini: Fixup flea3/sandbox/id8313/siemens-am33xx/smartweb] Signed-off-by: Tom Rini <trini@konsulko.com>
* common: env: support sata devicePeng Fan2016-04-181-1/+2
| | | | | | | | | | | | | | | | | | Introduce env support for sata device. 1. Implement write_env/read_env/env_relocate_spec/saveenv/sata_get_env_dev 2. If want to enable this feature, define CONFIG_ENV_IS_IN_SATA, and define CONFIG_SYS_SATA_ENV_DEV or implement your own sata_get_ev_dev. Signed-off-by: Peng Fan <van.freenix@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Stefan Roese <sr@denx.de> Cc: Heiko Schocher <hs@denx.de> Cc: Stuart Longland <stuartl@vrt.com.au> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* cmd: blkcache: simplify sub-command handlingEric Nelson2016-04-111-4/+2
| | | | | Signed-off-by: Eric Nelson <eric@nelint.com> Acked-by: Stephen Warren <swarren@nvidia.com>
* cmd: blkcache: remove indentation from output of 'show'Eric Nelson2016-04-111-5/+5
| | | | Signed-off-by: Eric Nelson <eric@nelint.com>
* dm: usb: Do not reprobe usb hosts on "usb tree" commandHans de Goede2016-04-101-2/+6
| | | | | | | | | | | | Some usb hosts may have failed to probe on "usb start", i.e. an otg host without an otg-host cable plugged in. "usb tree" would cause the probe method of these hosts to get called again, something which should only happen on "usb reset". This commit fixes this. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* usb: kbd: Do not deregister usbkbd twice when using dmHans de Goede2016-04-101-1/+1
| | | | | | | | | | | | | | The dm usb_kbd_remove function() will deregister the usb keyboard for us on a "usb reset" / "usb stop" so there is no need to manually call usb_kbd_deregister() in the dm case. This commit removes usb_kbd_deregister() in the dm case fixing the following "usb reset" errors: usb_kbd_remove: warning, ret=-6 device_remove: Device 'usb_kbd' failed to remove, but children are gone Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* sata: use block layer for sata commandEric Nelson2016-04-011-2/+4
| | | | | | | | Call blk_dread, blk_dwrite, blk_derase to ensure that the block cache is used if enabled and to remove build breakage when CONFIG_BLK is enabled. Signed-off-by: Eric Nelson <eric@nelint.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* mmc: use block layer in mmc commandEric Nelson2016-04-011-3/+4
| | | | | | | | Call blk_dread, blk_dwrite, blk_derase to ensure that the block cache is used if enabled and to remove build breakage when CONFIG_BLK is enabled. Signed-off-by: Eric Nelson <eric@nelint.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* drivers: block: add block device cacheEric Nelson2016-04-013-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a block device cache to speed up repeated reads of block devices by various filesystems. This small amount of cache can dramatically speed up filesystem operations by skipping repeated reads of common areas of a block device (typically directory structures). This has shown to have some benefit on FAT filesystem operations of loading a kernel and RAM disk, but more dramatic benefits on ext4 filesystems when the kernel and/or RAM disk are spread across multiple extent header structures as described in commit fc0fc50. The cache is implemented through a minimal list (block_cache) maintained in most-recently-used order and count of the current number of entries (cache_count). It uses a maximum block count setting to prevent copies of large block reads and an upper bound on the number of cached areas. The maximum number of entries in the cache defaults to 32 and the maximum number of blocks per cache entry has a default of 2, which has shown to produce the best results on testing of ext4 and FAT filesystems. The 'blkcache' command (enabled through CONFIG_CMD_BLOCK_CACHE) allows changing these values and can be used to tune for a particular filesystem layout. Signed-off-by: Eric Nelson <eric@nelint.com>
* arm64: booti: add missing unmap_sysmem()Masahiro Yamada2016-04-011-0/+5
| | | | | | | | | | | Make sure to call unmap_sysmem() for address allocated by map_sysmem() before leaving the function; however this patch gives no impact on the behavior because map_sysmem()/unmap_sysmem() does nothing except on Sandbox. Sandbox never runs this code because "booti" is a command for booting ARM64 kernel image. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* Drop command-processing code when CONFIG_CMDLINE is disabledSimon Glass2016-04-011-0/+4
| | | | | | | | Command parsing and processing code is not needed when the command line is disabled. Remove this code in that case. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* cmd: spi: check return value of strdupPeng Fan2016-03-271-0/+2
| | | | | | | | | | | | Check return value of strdup. Signed-off-by: Peng Fan <van.freenix@gmail.com> Cc: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Stefan Roese <sr@denx.de> Cc: Tom Rini <trini@konsulko.com>
* efi_loader: Add GOP supportAlexander Graf2016-03-271-0/+3
| | | | | | | | | | | | The EFI standard defines a simple boot protocol that an EFI payload can use to access video output. This patch adds support to expose exactly that one (and the mode already in use) as possible graphical configuration to an EFI payload. With this, I can successfully run grub2 with graphical output. Signed-off-by: Alexander Graf <agraf@suse.de>
* Fix spelling of "transferred".Vagrant Cascadian2016-03-221-1/+1
| | | | | | | Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* cmd: Fix license commandTom Rini2016-03-221-3/+3
| | | | | | | | | | | | The license command isn't usually built and has a few problems: - The rules to generate license.h haven't worked in a long time, re-write these based on the bmp_logo.h rules. - 'tok' is unused and the license text size has increased - bin2header.c wasn't grabbing unistd.h to know the prototype for read(). Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* Add an option to enable the command lineSimon Glass2016-03-221-0/+12
| | | | | | | | Add a new Kconfig option for the command line. This is enabled by default, but when disabled it will remove the command line. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* cbfs: Update a function to be staticSimon Glass2016-03-221-4/+8
| | | | | | | | All command functions should be static. Update the CBFS functions to follow this rule. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* gpio: Report errors when GPIOs cannot be readSimon Glass2016-03-171-7/+27
| | | | | | | Some controllers do not allow the output value to be read. Detect this and report the error in that case. Signed-off-by: Simon Glass <sjg@chromium.org>
* cpu: Add support for microcode version and CPU IDSimon Glass2016-03-171-0/+7
| | | | | | | | | Some CPUs use microcode and each core can have a different version of microcode loaded. Also some CPUs support the concept of an integer ID used for identification purposes. Add support for these in the CPU uclass. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* cmd: scsi: Group the command portion together, guard with !CONFIG_SPL_BUILDTom Rini2016-03-161-21/+22
| | | | | | | | | When we switch to including all linker lists in SPL it is important to not include commands as that may lead to link errors due to other things we have already discarded. In this case, the SCSI code needs a lot of attention so for now just guard the command portions. Signed-off-by: Tom Rini <trini@konsulko.com>
* efi_loader: Pass proper device path in on bootAlexander Graf2016-03-152-9/+27
| | | | | | | | | | | | | | | | | EFI payloads can query for the device they were booted from. Because we have a disconnect between loading binaries and running binaries, we passed in a dummy device path so far. Unfortunately that breaks grub2's logic to find its configuration file from the same device it was booted from. This patch adds logic to have the "load" command call into our efi code to set the device path to the one we last loaded a binary from. With this grub2 properly detects where we got booted from and can find its configuration file, even when searching by-partition. Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: Call fdt preparation functionsAlexander Graf2016-03-151-0/+8
| | | | | | | | | | | We have a nice framework around image fils to prepare a device tree for OS execution. That one patches in missing device tree nodes and fixes up the memory range bits. We need to call that one from the EFI boot path too to get all those nice fixups. This patch adds the call. Signed-off-by: Alexander Graf <agraf@suse.de>
* efi_loader: Add "bootefi" commandAlexander Graf2016-03-153-0/+190
| | | | | | | | | | | | | | | | | | | | | | In order to execute an EFI application, we need to bridge the gap between U-Boot's notion of executing images and EFI's notion of doing the same. The best path forward IMHO here is to stick completely to the way U-Boot deals with payloads. You manually load them using whatever method to RAM and then have a simple boot command to execute them. So in our case, you would do # load mmc 0:1 $loadaddr grub.efi # bootefi $loadaddr which then gets you into a grub shell. Fdt information known to U-boot via the fdt addr command is also passed to the EFI payload. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> [trini: Guard help text with CONFIG_SYS_LONGHELP] Signed-off-by: Tom Rini <trini@konsulko.com>
* Merge git://git.denx.de/u-boot-dmTom Rini2016-03-1420-128/+125
|\
| * Drop CONFIG_CRAMFS_CMDLINESimon Glass2016-03-141-5/+0
| | | | | | | | | | | | | | This option doesn't do anything. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Bin Meng <bmeng.cn@gmail.com>
| * dm: sandbox: Add driver-model block-device support for sandboxSimon Glass2016-03-141-1/+8
| | | | | | | | | | | | | | | | | | Update the host driver to support driver model for block devices. A future commit will remove the old code, but for now it is useful to be able to use it both with and without CONFIG_BLK. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com>
| * dm: block: Adjust device calls to go through helpers functionSimon Glass2016-03-144-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | To ease conversion to driver model, add helper functions which deal with calling each block device method. With driver model we can reimplement these functions with the same arguments. Use inline functions to avoid increasing code size on some boards. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
| * dm: block: Rename device number member dev to devnumSimon Glass2016-03-149-21/+21
| | | | | | | | | | | | | | | | | | This is a device number, and we want to use 'dev' to mean a driver model device. Rename the member. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
| * dm: cbfs: Fix handling of invalid typeSimon Glass2016-03-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | The comment for file_cbfs_type() says that it returns 0 for an invalid type. The code appears to check for -1, except that it uses an unsigned variable to store the type. This results in a warning on 64-bit machines. Adjust it to make the meaning clearer. Continue to handle the -1 case since it may be needed. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com>
| * dm: part: Rename some partition functionsSimon Glass2016-03-147-17/+17
| | | | | | | | | | | | | | | | Rename three partition functions so that they start with part_. This makes it clear what they relate to. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com>
| * dm: blk: Rename get_device_and_partition()Simon Glass2016-03-145-8/+8
| | | | | | | | | | | | | | | | | | | | Rename this function to blk_get_device_part_str(). This is a better name because it makes it clear that the function returns a block device and parses a string. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
| * dm: blk: Rename get_device() to blk_get_device_by_str()Simon Glass2016-03-143-5/+5
| | | | | | | | | | | | | | | | | | | | The current name is too generic. The function returns a block device based on a provided string. Rename it to aid searching and make its purpose clearer. Also add a few comments. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
| * dm: blk: Rename get_dev() to blk_get_dev()Simon Glass2016-03-142-2/+2
| | | | | | | | | | | | | | | | | | The current name is too generic. Add a 'blk_' prefix to aid searching and make its purpose clearer. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
| * dm: Drop the block_dev_desc_t typedefSimon Glass2016-03-1415-47/+47
| | | | | | | | | | | | | | | | | | Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
| * dm: Use uclass_first_device_err() where it is usefulSimon Glass2016-03-142-10/+6
| | | | | | | | | | | | Use this new function in places where it simplifies the code. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Kconfig: Move CONFIG_FIT and related options to KconfigSimon Glass2016-03-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are already two FIT options in Kconfig but the CONFIG options are still in the header files. We need to do a proper move to fix this. Move these options to Kconfig and tidy up board configuration: CONFIG_FIT CONFIG_OF_BOARD_SETUP CONFIG_OF_SYSTEM_SETUP CONFIG_FIT_SIGNATURE CONFIG_FIT_BEST_MATCH CONFIG_FIT_VERBOSE CONFIG_OF_STDOUT_VIA_ALIAS CONFIG_RSA Unfortunately the first one is a little complicated. We need to make sure this option is not enabled in SPL by this change. Also this option is enabled automatically in the host builds by defining CONFIG_FIT in the image.h file. To solve this, add a new IMAGE_USE_FIT #define which can be used in files that are built on the host but must also build for U-Boot and SPL. Note: Masahiro's moveconfig.py script is amazing. Signed-off-by: Simon Glass <sjg@chromium.org> [trini: Add microblaze change, various configs/ re-applies] Signed-off-by: Tom Rini <trini@konsulko.com>
* | common: Add support for environment file in EXT4.Stuart Longland2016-03-141-1/+2
|/ | | | | | This is an enhancement that permits storing the environment file on an EXT4 partition such as the root filesystem. It is based on the existing FAT environment file code.
* trace: Fix compiler warnings in traceSimon Glass2016-02-261-2/+2
| | | | | | | | With min() we must use the same type for each parameter. Fix two problems in trace.c which produce compiler warnings. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini2016-02-241-0/+20
|\
| * dfu: usb: f_dfu: Set deferred call for dfu_flush() functionLukasz Majewski2016-02-241-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes situation when one would like to write large file into medium with the file system (fat, ext4, etc). This change sets file size limitation to the DFU internal buffer size. Since u-boot is not supporting interrupts and seek on file systems, it becomes challenging to store large file appropriately. To reproduce this error - create large file (around 26 MiB) and sent it to the target board. Lets examine the flow of USB transactions: 0. DFU uses EP0 with 64B MPS [Max Packet Size] 1. Send file - OUT (PC->target) - dat_26MiB.img is sent with 4096 B transactions 2. Get status - OUT (PC->target) - wait for DFU_STATE_dfuDNLOAD_IDLE (0x05) sent from target board - IN transaction (target->PC) 3. The whole file content is sent to target - OUT (PC->target) with ZLP [Zero Length Packet] Now the interesting part starts: 4. OUT (PC->target) Setup transaction (request to share DFU state) 5. IN (target->PC) - reply the current DFU state - In the UDC driver the req->completion (with dfu_flush) is called after successful IN transfer. - The dfu_flush() (called from req->completion callback) saves the whole file at once (u-boot doesn't support seek on fs). Such operation takes considerable time. When the file is large - e.g. 26MiB - this time may be more than 5 seconds. 6. OUT (PC->target) - ZLP, is send in the same time when dfu_flush() writes data to eMMC memory. The dfu-util application has hard coded timeout on USB transaction completion set to 5 seconds (it uses libusb calls). When the file to store is large (e.g. 26 MiB) the time needed to write it may excess the dfu-util timeout and following error message will be displayed: "unable to read DFU status" on the HOST PC console. This change is supposed to leverage DFU's part responsible for storing files on file systems. Other DFU operations - i.e. raw/partition write to NAND and eMMC should work as before. The only functional change is the error reporting. When dfu_flush() fails the u-boot prompt will exit with error information and dfu-util application exits afterwards as well. Test HW: - Odroid XU3 (Exynos5433) - test with large file - Trats (Exynos4210) - test for regression - eMMC, raw, Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Reported-by: Alex Gdalevich <agdalevich@axion-biosystems.com> Tested-by: Stephen Warren <swarren@nvidia.com> Tested-by: Heiko Schocher <hs@denx.de>
* | cmd: mem: Show 64bit addresses which are testedMichal Simek2016-02-241-1/+1
| | | | | | | | | | | | Fix print message to show full 64bit addresses. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* | booti: Help text rework.Karsten Merker2016-02-241-7/+7
|/ | | | | | | Fix spelling errors in the "booti" help text and bring it more in line with the bootm/bootz help texts. Signed-off-by: Karsten Merker <merker@debian.org>
* i2c: spd: Extend SPD memory typesMichal Simek2016-02-221-1/+13
| | | | | | Decode DDR, DDR3 and DDR4 memories. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* gpio: Correct handling of 'gpio status'Simon Glass2016-02-151-1/+1
| | | | | | | | | | | | This is broken - we need to look at the first two characters to distinguish 'gpio status' from 'gpio set'. Fixes: 0ffe6ab5 (gpio: Allow 's' as an abbreviation for 'status') Reported-by: Soeren Moch <smoch@web.de> Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Soeren Moch <smoch@web.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
* itest: allow map_physmem to return 0 in limited casesStephen Warren2016-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | On some systems, RAM starts at address 0. If the user executes itest against address 0 on such a system, it will call map_physmem(0, ...) which will return 0 back; mapping only changes the address on sandbox. This causes itest to believe map_physmem() has failed, and hence fails the comparison. Fix itest so that it allows map_physmem() to return 0 /if/ the orignal address passed to it was also 0. This fixes "tegra-uboot-flasher flash" on Tegra20. This has the disadvantage that on sandbox, failed mapping attempts for address 0 are not detected. Instead, should the code only call map_physmem() on sandbox? Or, should map_physmem() return its error status some other way. Or, should the special case only be allowed on systems where the base of RAM is 0 somehow? Fixes: 7861204c9af7 ("itest: make memory access work under sandbox") Signed-off-by: Stephen Warren <swarren@nvidia.com>
OpenPOWER on IntegriCloud