aboutsummaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)AuthorFilesLines
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-22efi_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-22efi_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-22efi_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-22fs: 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-14Merge 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-05Merge 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-29cmd: 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>
2017-11-19Merge git://git.denx.de/u-boot-dmTom Rini1-1/+1
2017-11-16cmd/fdt.c align data buffer to avoid unaligned word accessBernhard Messerklinger1-1/+1
Since the compiler is free to place a char array to any address in memory (in this case the stack), also to a non word aligned address the function "fdt_prop_parse" runs into troubles upon it wants to write some (fdt32_t *) to such a variable (if it has been placed to a none word aligned address). To avoid this we tell the compiler to always align this scratchpad to a word aligned address. Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com> Reviewed-by: Hannes Schmelzer <oe5hpm@oevsv.at> Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-15cmd: mac: Update description of helpPrabhakar Kushwaha1-14/+14
Update help message for "mac" command to reflect correct descriptions and parameters. Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com> Reviewed-by: York Sun <york.sun@nxp.com>
2017-11-05Kconfig: Migrate MTDIDS_DEFAULT / MTDPARTS_DEFAULTTom Rini1-3/+4
We move all instances of CONFIG_MTDIDS_DEFAULT and CONFIG_MTDPARTS_DEFAULT from the header files to the defconfig files. There's a few cases here where we need to expand upon what was in the header file. Tested-by: Adam Ford <aford173@gmail.com> #omap3_logic Signed-off-by: Tom Rini <trini@konsulko.com>
2017-10-25cmd: fastboot: Enable FASTBOOT_FLASH_NAND for SUNXI_NAND devicesBenjamin Young1-0/+10
Encountered an issue where fastboot can't write to NAND on a CHIP_pro, the symbol was neither present in the board's config header, nor the Kconfig, this patch puts it in the Kconfig and defaults on when SUNXI_NAND is selected. Signed-off-by: Ben Young <computermouth@crunchbangplusplus.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2017-10-23cmd: gpt: solve issue for swap and rename commandPatrick Delaunay1-6/+6
don't use prettyprint_part_size() in create_gpt_partitions_list() that avoid to align offset and size to 1 MiB and increase precision for start and size. This patch avoid the risk to change partition size and lost data during rename or swap. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Acked-by: Stephen Warren <swarren@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2017-10-16cmd/pxe.c: Rework bootargs construction to clarify string checksTom Rini1-9/+10
As the code currently stands, we first check that the length of the given command line, along with ip_str/mac_str along with an additional 1 for the NULL termination will fit within the buffer we have, and if not, we return an error. The way this code was originally written however left Coverity "unhappy" due to using strcat rather than strncat. Switching this to strncat however causes clang to be unhappy that we aren't enforcing the "1" portion within strncat. Rather than further re-work the code to include a "- 1" in this case as well, make the strcat code only be done within the else side of the length test. This keeps both clang and Coverity happy. Fixes: 48ee0a87bc46 ("cmd/pxe.c: Rework initrd and bootargs handling slightly") Signed-off-by: Tom Rini <trini@konsulko.com>
2017-10-16Drop CONFIG_HAS_DATAFLASHTuomas Tynkkynen2-128/+11
Last user of this option went away in commit: fdc7718999 ("board: usb_a9263: Update to support DT and DM") Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-10-16env: Drop CONFIG_ENV_IS_IN_DATAFLASHTuomas Tynkkynen1-2/+1
Last user of this option went away in commit: fdc7718999 ("board: usb_a9263: Update to support DT and DM") Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
2017-10-13Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini1-0/+23
Patch queue for efi - 2017-10-13 This is the second batch of amazing improvements for efi_loader in 2017.11: - New self tests to verify our own code - A few bug fixes - colored text support - event and SNP improvements, should get us close to iPXE working
2017-10-12Merge git://git.denx.de/u-boot-fsl-qoriqTom Rini1-0/+2
2017-10-12efi_loader: Add mem-mapped for fallbackRob Clark1-0/+23
When we don't have a real device/image path, such as 'bootefi hello', construct a mem-mapped device-path. This fixes 'bootefi hello' after devicepath refactoring. Fixes: 95c5553ea2 ("efi_loader: refactor boot device and loaded_image handling") Signed-off-by: Rob Clark <robdclark@gmail.com> Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-10-10cmd: Toggle the default value of CONFIG_CMD_IMLSTuomas Tynkkynen1-1/+0
Having this as a 'default y' is rather annoying because it doesn't actually compile unless other options are defined in the board header: ../cmd/bootm.c: In function 'do_imls_nor': ../cmd/bootm.c:330:7: error: 'CONFIG_SYS_MAX_FLASH_BANKS' undeclared (first use in this function); did you mean 'CONFIG_SYS_MAX_FLASH_SECT'? i < CONFIG_SYS_MAX_FLASH_BANKS; ++i, ++info) { Make it 'default n' so people who develop new boards that start from a blank defconfig have one less compilation failure to debug. Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>