summaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)AuthorFilesLines
2018-02-01cmd: nvedit: env_get_f must check for env_get_char error codesSimon Goldschmidt1-3/+8
env_get_f calls env_get_char to load single characters from the environment. However, the return value of env_get_char was not checked for errors. Now if the env driver does not support the .get_char call, env_get_f did not notice this and looped over the whole size of the environment, calling env_get_char over 8000 times with the default settings, just to return an error in the end. Fix this by checking if env_get_char returns < 0. Signed-off-by: Simon Goldschmidt <sgoldschmidt@de.pepperl-fuchs.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2018-01-30cmd/bdinfo: print relocation info on X86Heinrich Schuchardt1-0/+2
For debugging U-Boot in qemu-x86 the relocation address is needed. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2018-01-29aes: Allow non-zero initialization vectorАндрей Мозжухин1-19/+25
AES encryption in CBC mode, in most cases, must be used with random initialization vector. Using the same key and initialization vector several times is weak and must be avoided. Added iv parameter to the aes_cbc_encrypt_blocks and aes_cbc_decrypt_blocks functions for passing initialization vector. Command 'aes' now also require the initialization vector parameter. Signed-off-by: Andrey Mozzhuhin <amozzhuhin@yandex.ru>
2018-01-28efi_loader: catch misspelled bootefi subcommandHeinrich Schuchardt1-0/+3
If 'bootefi hello' or 'bootefi selftest' can be executed depends on the configuration. If an invalid non-numeric 1st argument is passed to bootefi, e.g. 'bootefi hola', this string is converted to 0 and U-Boot jumps to this typically invalid address. With the patch the online help is shown instead. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-28efi_loader: Always use EFIAPI instead of asmlinkageAlexander Graf1-5/+6
EFI calls are usually defined as asmlinkage. That means we pass all parameters to functions via the stack x86_32. On x86_64 however, we need to also stick to the MS ABI calling conventions, which the EFIAPI define conveniently handles for us. Most EFI functions were also marked with EFIAPI, except for the entry call. So this patch adjusts all entry calls to use EFIAPI instead of the manual asmlinkage attribute. While at it, we also change the prototype of the entry point to return efi_status_t instead of ulong, as this is the correct prototype definition. Signed-off-by: Alexander Graf <agraf@suse.de> --- v1 -> v2: - Use efi_status_t in all occurences
2018-01-28powerpc: Drop CONFIG_WALNUT and other related dead codeTuomas Tynkkynen1-5/+1
CONFIG_WALNUT was dropped in June 2017 in: commit 98f705c9cefdfd ("powerpc: remove 4xx support") While at it, the related CONFIG_MACH_SPECIFIC and the have_of and _machine variables are unused as well, so drop them too. Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
2018-01-27cmd: nvedit: Get rid of the env lookupMaxime Ripard1-4/+0
The nvedit command is the only user of env_driver_lookup_default outside of the environment code itself, and it uses it only to print the environment it's about to save to during env save. As we're about to rework the environment to be able to handle multiple environment sources, we might not have an idea of what environment backend is going to be used before trying (and possibly failing for some). Therefore, it makes sense to remove that message and move it to the env_save function itself. As a side effect, we also can get rid of the call to env_driver_lookup_default that is also about to get refactored. Reviewed-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2018-01-26Merge git://git.denx.de/u-boot-sunxiTom Rini1-0/+5
2018-01-26cmd: misc: Disable by default on sunXiMaxime Ripard1-0/+1
The sunXi arm64 build has overflown, leading to the main U-boot binary overwriting the environment when flashing the new image, or even worse, overwriting itself when we're calling saveenv. Disable this command that is not critical until we can adress the issue properly. Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2018-01-26cmd: loads: Disable by default on sunXiMaxime Ripard1-0/+1
The sunXi arm64 build has overflown, leading to the main U-boot binary overwriting the environment when flashing the new image, or even worse, overwriting itself when we're calling saveenv. Disable this command that is not critical until we can adress the issue properly. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2018-01-26cmd: loadb: Disable by default on sunXiMaxime Ripard1-0/+1
The sunXi arm64 build has overflown, leading to the main U-boot binary overwriting the environment when flashing the new image, or even worse, overwriting itself when we're calling saveenv. Disable this command that is not critical until we can adress the issue properly. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2018-01-26cmd: unzip: Disable by default on sunXiMaxime Ripard1-0/+1
The sunXi arm64 build has overflown, leading to the main U-boot binary overwriting the environment when flashing the new image, or even worse, overwriting itself when we're calling saveenv. Disable this command that is not critical until we can adress the issue properly. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2018-01-26cmd: crc32: Disable by default on sunXiMaxime Ripard1-0/+1
The sunXi arm64 build has overflown, leading to the main U-boot binary overwriting the environment when flashing the new image, or even worse, overwriting itself when we're calling saveenv. Disable this command that is not critical until we can adress the issue properly. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2018-01-23Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini1-7/+10
Patch queue for efi - 2018-01-23 This time around we have a lot of EFI patches from Heinrich. Highlights are: - Allow EFI applications to register as drivers - Allow exposure of U-Boot block devices from an EFI payload - Compatibility improvements
2018-01-23efi_driver: EFI block driverHeinrich Schuchardt1-0/+3
This patch provides * a uclass for EFI drivers * a EFI driver for block devices For each EFI driver the uclass * creates a handle * adds the driver binding protocol The uclass provides the bind, start, and stop entry points for the driver binding protocol. In bind() and stop() it checks if the controller implements the protocol supported by the EFI driver. In the start() function it calls the bind() function of the EFI driver. In the stop() function it destroys the child controllers. The EFI block driver binds to controllers implementing the block io protocol. When the bind function of the EFI block driver is called it creates a new U-Boot block device. It installs child handles for all partitions and installs the simple file protocol on these. The read and write functions of the EFI block driver delegate calls to the controller that it is bound to. A usage example is as following: U-Boot loads the iPXE snp.efi executable. iPXE connects an iSCSI drive and exposes a handle with the block IO protocol. It calls ConnectController. Now the EFI block driver installs the partitions with the simple file protocol. iPXE uses the simple file protocol to load Grub or the Linux Kernel. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> [agraf: add comment on calloc len] Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-23efi_loader: store DT in EFI_RUNTIME_SERVICES_DATA memoryHeinrich Schuchardt1-2/+2
The device tree is needed at runtime. So we have to store it in EFI_RUNTIME_SERVICES_DATA memory. The UEFI spec recommends to store all configuration tables in EFI_RUNTIME_SERVICES_DATA memory. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-23efi_loader: consistently use efi_handle_t for handlesHeinrich Schuchardt1-5/+5
We should consistently use the efi_handle_t typedef when referring to handles. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-23fs: Migrate ext4 to KconfigTuomas Tynkkynen1-0/+3
Migrate the following symbols to Kconfig: CONFIG_FS_EXT4 CONFIG_EXT4_WRITE The definitions in config_fallbacks.h can now be expressed in Kconfig. Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
2018-01-19cmd: pmic: update help descriptionKlaus Goger1-1/+1
Change help description to match the style of the other U-Boot commands and get rid of the leading whitespace. Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2018-01-19cmd: ti: Generalize cmd_ddr3 commandLokesh Vutla1-30/+120
Keystone and DRA7 based TI platforms uses same EMIF memory controller. cmd_ddr3 command is customized for keystone platforms, make it generic so that it can be re used for DRA7 platforms. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2018-01-19arm: keystone: Move cmd_ddr3 to a common placeLokesh Vutla5-0/+271
Move cmd_ddr3 to cmd/ti in order to make it build for non-keystone TI platforms. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> [trini: Rename to ddr3.c not cmd_ddr3.c] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-01-15Merge git://git.denx.de/u-boot-mmcTom Rini2-2/+21
2018-01-12riscv: Modify generic codes to support RISC-VRick Chen1-0/+15
Support common commands bdinfo and image format, also modify common generic flow for RISC-V. Signed-off-by: Rick Chen <rick@andestech.com> Signed-off-by: Rick Chen <rickchen36@gmail.com> Signed-off-by: Greentime Hu <green.hu@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-01-12mmc: remove hc_wp_grp_size from struct mmc if not neededJean-Jacques Hiblot1-0/+2
hc_wp_grp_size is needed only if hardware partitionning is used. On ARM removing it saves about 30 bytes of code space. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-01-12mmc: compile out erase and write mmc commands if write operations are not ↵Jean-Jacques Hiblot1-0/+8
enabled Also remove erase_grp_size and write_bl_len from struct mmc as they are not used anymore. On ARM, removing them saves about 100 bytes of code space in SPL. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-01-12mmc: add a Kconfig option to enable the support for MMC write operationsJean-Jacques Hiblot1-1/+1
This allows using CONFIG_IS_ENABLED(MMC_WRITE) to compile out code needed only if write support is required. The option is added for u-boot and for SPL Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-01-12mmc: make optional the support for eMMC hardware partitioningJean-Jacques Hiblot1-0/+4
Not all boards have an eMMC and not all users have a need for this. Allow to compile it out. By default it is still included. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-01-12mmc: dump card and host capabilities if debug is enabledJean-Jacques Hiblot1-0/+4
This is a useful information while debugging the initialization process or performance issues. Also dump this information with the other mmc info if the verbose option is selected Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
2018-01-12cmd: mmc: display the mode name and current bus speed in the mmc infoJean-Jacques Hiblot1-1/+2
Display the mode name when the user execute 'mmc info'. Also instead of displaying tran_speed, display the actual bus speed. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-01-10usb: rockchip: add rockusb commandEddie Cai3-0/+83
this patch add rockusb command. the usage is rockusb <USB_controller> <devtype> <dev[:part]> e.g. rockusb 0 mmc 0 Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-01-08x86: Move commands from under arch/x86 to cmd/x86/Tom Rini4-0/+299
We only need to compile and link these files when building for full U-Boot. Move them to under cmd/x86/ to make sure they aren't linked in and undiscarded due to u_boot_list_2_cmd_* being included). Cc: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-12-19Merge git://git.denx.de/u-boot-sunxiTom Rini1-0/+1
2017-12-07log: Add a test commandSimon Glass2-1/+8
Add a command which exercises the logging system. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-12-07log: Add a 'log level' commandSimon Glass3-0/+63
Add a command for adjusting the log level. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-12-07Drop the log bufferSimon Glass2-314/+0
This does not appear to be used by any boards. Before introducing a new log system, remove this old one. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-12-07mtdparts: Correct use of debug()Simon Glass1-3/+0
The debug() macro now evaluates its expression so does not need #ifdef protection. In fact the current code causes a warning with the new log implementation. Adjust the code to fix this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-12-07fastboot: Enable flashing by default on sunxiMaxime Ripard1-0/+1
Now that more and more devices are built using eMMC, providing a way to easily flash the system without too much hassle seems like a right thing to do. Since fastboot is the most deployed tool to do that these days, we can just rely on it to provide a way to flash the various components in the system (SPL, U-Boot and the system itself) easily, especially since you can upload the U-Boot hosting the fastboot "server" through FEL. Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-12-07cmd: i2c: Fix use sdram sub command with CONFIG_DM_I2CNobuhiro Iwamatsu1-2/+12
sdram sub command of i2c command does not support Drivers Model. This adds Drivers Model support to sdram sub command. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2017-12-06Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini1-12/+61
Patch queue for efi - 2017-12-05 Highlights for this release: - Dynamic EFI object creation (lists instead of static arrays) - EFI selftest improvements - Minor fixes
2017-12-04mtd: nand: Rename nand.h into rawnand.hMasahiro Yamada2-2/+2
This header was renamed to rawnand.h in Linux. The following is the corresponding commit in Linux. commit d4092d76a4a4e57b65910899948a83cc8646c5a5 Author: Boris Brezillon <boris.brezillon@free-electrons.com> Date: Fri Aug 4 17:29:10 2017 +0200 mtd: nand: Rename nand.h into rawnand.h We are planning to share more code between different NAND based devices (SPI NAND, OneNAND and raw NANDs), but before doing that we need to move the existing include/linux/mtd/nand.h file into include/linux/mtd/rawnand.h so we can later create a nand.h header containing all common structure and function prototypes. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-12-01efi_loader: pass handle of loaded imageHeinrich Schuchardt1-3/+4
The handle of a loaded image is the value of the handle member of the loaded image info object and not the address of the loaded image info. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-12-01efi_loader: Exit in efi_set_bootdev() upon invalid "desc"Stefan Roese1-0/+2
When trying to load an image from a non-existent USB key, U-Boot v2017.11 crashes on my x86 platform: => load usb 0:1 03000000 abc General Protection EIP: 0010:[<7b59030d>] EFLAGS: 00010286 Original EIP :[<fff4330d>] ... This used to work in v2017.09. Testing has shown, that this bug was introduced with patch 95c5553e [efi_loader: refactor boot device and loaded_image handling]. This patch now checks if a valid "desc" is returned from blk_get_dev() and only continues when "desc" is available. Resulting in this cmd output (again): => load usb 0:1 03000000 abc ** Bad device usb 0 ** Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-12-01efi_loader: use bootargs as load optionsHeinrich Schuchardt1-0/+2
Use environment variable bootargs used as load options for bootefi payloads. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-12-01efi_selftest: correctly cleanup after selftestHeinrich Schuchardt1-1/+3
After executing bootefi selftest * restore GD * unlink the load image handle * return 0 or 1 and not a truncated efi_status_t. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-12-01efi_selftest: allow to select a single test for executionHeinrich Schuchardt1-1/+36
Environment variable efi_selftest is passed as load options to the selftest application. It is used to select a single test to be executed. The load options are an UTF8 string. Yet I decided to keep the name propertiy of the tests as char[] to reduce code size. Special value 'list' displays a list of all available tests. Tests get an on_request property. If this property is set the tests are only executed if explicitly requested. The invocation of efi_selftest is changed to reflect that bootefi selftest with efi_selftest = 'list' will call the Exit bootservice. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-12-01efi_selftest: provide a dummy device pathHeinrich Schuchardt1-0/+6
Currently we pass bootefi_device_path and bootefi_image_path as device and image path without initializing them. They may carry values from previous calls to bootefi. With the patch the variables are initialized valid dummy values. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-12-01efi_loader: consistently use efi_status_t in bootefiHeinrich Schuchardt1-9/+9
Where ulong or unsigned long are used to hold an EFI status code we should consistenly use efi_status_t. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-12-01efi_loader: implement SetWatchdogTimerHeinrich Schuchardt1-0/+1
The watchdog is initialized with a 5 minute timeout period. It can be reset by SetWatchdogTimer. It is stopped by ExitBoottimeServices. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-11-30cmd: blk: remove unreachable codeHeinrich Schuchardt1-2/+0
Remove an unreachable return statement. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-11-26cmd: usb: ignore blk, emulation devices in usb tree/info displaySuneel Garapati1-3/+19
Usb tree/info commands iterate over all usb uclass devices recursively. Blk uclass devices based on struct blk_desc are created for mass storage device, treating them as usb uclass devices based on struct usb_device and referencing usb config interface descriptors cause crash. To fix, ignore blk and usb_emul uclass devices in usb_show_info and usb_tree_graph. Also avoid addition of preamble for blk uclass child devices, otherwise tree dump gets messed up. Signed-off-by: Suneel Garapati <suneelglinux@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>