aboutsummaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)Author
2019-04-21usb: reload watchdog during ums commandPatrick Delaunay
Reload the watchdog in the mass storage command ums to avoid reboot during the usb waiting loop when the host doesn't send any request. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-04-21dfu: Avoid declaring unused variables and absent parametersAndy Shevchenko
The compiler is not happy when neither USB nor TFTP transport for DFU defined: cmd/dfu.c: In function ‘do_dfu’: cmd/dfu.c:31:8: warning: unused variable ‘devstring’ [-Wunused-variable] char *devstring = argv[3]; ^~~~~~~~~ cmd/dfu.c:30:8: warning: unused variable ‘interface’ [-Wunused-variable] char *interface = argv[2]; ^~~~~~~~~ Surround those variables by #ifdef expression. More serious, that comes under same circumstances, is a compilation error due to absence of macro parameter: In file included from include/image.h:45, from include/common.h:35, from cmd/dfu.c:13: include/command.h:207:24: error: expected expression before ‘,’ token # define _CMD_HELP(x) x, ^ include/command.h:286:18: note: in expansion of macro ‘_CMD_HELP’ _cmd, _usage, _CMD_HELP(_help) _CMD_COMPLETE(_comp) } ^~~~~~~~~ include/command.h:290:3: note: in expansion of macro ‘U_BOOT_CMD_MKENT_COMPLETE’ U_BOOT_CMD_MKENT_COMPLETE(_name, _maxargs, _rep, _cmd, \ ^~~~~~~~~~~~~~~~~~~~~~~~~ include/command.h:332:2: note: in expansion of macro ‘U_BOOT_CMD_COMPLETE’ U_BOOT_CMD_COMPLETE(_name, _maxargs, _rep, _cmd, _usage, _help, NULL) ^~~~~~~~~~~~~~~~~~~ cmd/dfu.c:70:1: note: in expansion of macro ‘U_BOOT_CMD’ U_BOOT_CMD(dfu, CONFIG_SYS_MAXARGS, 1, do_dfu, ^~~~~~~~~~ make[1]: *** [scripts/Makefile.build:279: cmd/dfu.o] Error 1 make: *** [Makefile:1518: cmd] Error 2 Put empty string unconditionally to have macro parameter present. Fixes: 0f44d33536a5 ("dfu: Fix up the Kconfig mess") Cc: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Lukasz Majewski <lukma@denx.de>
2019-04-17Merge tag 'xilinx-for-v2019.07' of git://git.denx.de/u-boot-microblazeTom Rini
Xilinx/FPGA changes for v2019.07 fpga: - Add support for external data in FIT - Extend testing for external data case - Inform user about a need to run post config on Zynq arm: - Tune zynq command functions - Fix internal variable setting arm64: - Add support for zc39dr decoding - Disable WDT for zcu100 - Small changes in reset_reason() - Some DT changes (spi) - Tune qspi-mini configuration - Remove useless eeprom setting - Fix two sdhci boot case spi: - Fix tap delay programming clk: - Enable i2c in SPL net: - Fix gem phydev handling - Remove phy detection code from gem driver general: - Correct EXT_DTB usage for MULTI_DTB_FIT configuration
2019-04-16fpga: Add support for getting external data address and lengthTien Fong Chee
This function supports getting both data address and length for existing FPGA subimage and FPGA external data. Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2019-04-15Merge tag 'efi-2019-07-rc1-2' of git://git.denx.de/u-boot-efiTom Rini
Pull request for UEFI sub-system for v2019.07-rc1 (2) In the aarch64 crash dump information about the loaded EFI images is added. In README.uefi the development target is for the UEFI subsystem is described as "Embedded Base Boot Requirements (EBBR) Specification" compliance. Several bug fixes are supplied.
2019-04-14Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini
Conflicts: arch/arm/dts/armada-385-amc.dts arch/arm/dts/armada-xp-theadorable.dts arch/arm/dts/stm32mp157c-ev1-u-boot.dtsi Signed-off-by: Tom Rini <trini@konsulko.com>
2019-04-12Change FDT memory type from runtime data to boot services dataIlias Apalodimas
Following Ard's suggestion: Runtime data sections are intended for data that is used by the runtime services implementation. Let's change the type to EFI_BOOT_SERVICES_DATA. This also fixes booting of armv7 using efi and fdtcontroladdr. Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-12dm: spi: Read default speed and mode values from DTPatrick Delaunay
This patch update the behavior introduced by commit 96907c0fe50a ("dm: spi: Read default speed and mode values from DT") In case of DT boot, don't read default speed and mode for SPI from CONFIG_* but 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. Remove also use in boards of the value speed=0 (no more supported) for ENV in SPI by using CONFIG_ENV_SPI_MAX_HZ=0. DT values will be always used when available (full DM support of SPI slave with available DT node) even if speed and mode are requested; for example in splash screen support (in splash_sf_read_raw) or in SPL boot (in spl_spi_load_image). The caller of spi_get_bus_and_cs() no more need to force speed=0. But the current behavior don't change if the SPI slave is not present (device with generic driver is created automatically) or if platdata is used (CONFIG_OF_PLATDATA). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Acked-by: Jagan Teki <jagan@amarulasolutions.com>
2019-04-12cmd: add wdt commandMichael Walle
Add a command to control the watchdog devices. This is useful if the watchdog is rather long running (eg. seconds) and it should be controlled by scripts. It is also handy during debugging. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Stefan Roese <sr@denx.de>
2019-04-11Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini
2019-04-09fs: Add a new command to create symbolic linksJean-Jacques Hiblot
The command line is: ln <interface> <dev[:part]> target linkname Currently symbolic links are supported only in ext4 and only if the option CMD_EXT4_WRITE is enabled. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-04-09usb: Make portspeed return a read-only stringIsmael Luceno Cortes
Current code is plain wrong, and there's no need to have a mutable string, so fix function type and remove the intermediate variable. Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
2019-03-25Convert CONFIG_DEFAULT_SPI_* to KconfigPatrick Delaunay
This converts the following to Kconfig: CONFIG_DEFAULT_SPI_BUS CONFIG_DEFAULT_SPI_MODE Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-03-20efi_loader: memory leak in efi_dump_single_var()Heinrich Schuchardt
A misplaced return statement lead to a memory leak in efi_dump_single_var(). Reported-by: Coverity (CID 185829) Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-03-16cmd: fastboot: handle watchdog while waiting for fastboot commands.Sean Nyekjaer
Watchdog is not handled while waiting for fastboot commands. Tested on a i.MX6 ULL EVK board. Signed-off-by: Sean Nyekjaer <sean@geanix.com>
2019-03-08cmd: thordown: Fix spelling of download.Vagrant Cascadian
Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-03-02efi_loader: error handling for `efidebug boot add`Heinrich Schuchardt
In `efidebug boot add iPXE scsi 0:1 snp-arm64.efi --foo` a parameter is missing. Hence the command should not silently return as if everything were ok but should display the usage info. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Alexander Graf <agraf@csgraf.de>
2019-02-25cmd: efidebug: add memmap commandAKASHI Takahiro
"memmap" command prints uefi-specific memory map information. => efi memmap Type Start End Attributes ================ ================ ================ ========== CONVENTIONAL 0000000040000000-000000007de27000 WB RUNTIME DATA 000000007de27000-000000007de28000 WB|RT RESERVED 000000007de28000-000000007de2a000 WB RUNTIME DATA 000000007de2a000-000000007de2b000 WB|RT RESERVED 000000007de2b000-000000007de2c000 WB RUNTIME DATA 000000007de2c000-000000007de2d000 WB|RT LOADER DATA 000000007de2d000-000000007ff37000 WB RUNTIME CODE 000000007ff37000-000000007ff38000 WB|RT LOADER DATA 000000007ff38000-0000000080000000 WB Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-25cmd: efidebug: add images commandAKASHI Takahiro
"images" command prints loaded images-related information. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-25cmd: efidebug: add dh commandAKASHI Takahiro
"dh" command prints all the uefi handles used in the system. => efi dh 7ef3bfa0: Device Path, Device Path To Text, Device Path Utilities, Unicode Collation 2 7ef31d30: Driver Binding 7ef31da0: Simple Text Output 7ef31e10: Simple Text Input, Simple Text Input Ex 7ef3cca0: Block IO, Device Path 7ef3d070: Block IO, Device Path 7ef3d1b0: Block IO, Device Path, Simple File System 7ef3d3e0: Block IO, Device Path, Simple File System Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-25cmd: efidebug: add drivers commandAKASHI Takahiro
"drivers" command prints all the uefi drivers on the system. => efi drivers Driver Name Image Path ================ ==================== ==================== 000000007ef003d0 <NULL> <built-in> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-25cmd: efidebug: add devices commandAKASHI Takahiro
"devices" command prints all the uefi variables on the system. => efi devices Scanning disk ahci_scsi.id0lun0... Scanning disk ahci_scsi.id1lun0... Found 4 disks Device Device Path ================ ==================== 000000007ef07ea0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b) 000000007ef00c10 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(0,0) 000000007ef00dd0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(1,0) 000000007ef07be0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(1,0)/HD(1,MBR,0x086246ba,0x800,0x40000) 000000007ef07510 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(1,0)/HD(2,MBR,0x086246ba,0x40800,0x3f800) Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-25cmd: add efidebug commandAKASHI Takahiro
Currently, there is no easy way to add or modify UEFI variables. In particular, bootmgr supports BootOrder/BootXXXX variables, it is quite hard to define them as u-boot variables because they are represented in a complicated and encoded format. The new command, efidebug, helps address these issues and give us more friendly interfaces: * efidebug boot add: add BootXXXX variable * efidebug boot rm: remove BootXXXX variable * efidebug boot dump: display all BootXXXX variables * efidebug boot next: set BootNext variable * efidebug boot order: set/display a boot order (BootOrder) Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-25cmd: env: add "-e" option for handling UEFI variablesAKASHI Takahiro
"env [print|set] -e" allows for handling uefi variables without knowing details about mapping to corresponding u-boot variables. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-22cmd: Kconfig: LED command depends on LED subsystemsJan Kiszka
Without CONFIG_LED, we get cmd/built-in.o: In function `show_led_state': cmd/led.c:40: undefined reference to `led_get_state' cmd/built-in.o: In function `do_led': cmd/led.c:99: undefined reference to `led_get_by_label' cmd/led.c:108: undefined reference to `led_set_state' Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2019-02-20gpio: Use case-insentive matching on the GPIO nameSimon Glass
Allow the 'gpio' command to match GPIO bank names regardless of the case of each. While these are generally in upper case, it is useful to be able to provide lower case with the command. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-02-20gpio: Show inactive GPIOs when explicitly requestedSimon Glass
At present the gpio command only shows GPIOs which are marked as in use. This makes sense with 'gpio status' since we already have the '-a' flag to indicate that all GPIOs should be shown. But when a particular GPIO is requested, it seems better to always display it. At present the request is simply ignored. For example if GPIO a10 is not in use, then: > gpio status a10 shows nothing, not even the function being used for that GPIO. With this change, it shows the pin status: > gpio status a10 a10: input: 0 [ ] Add an extra parameter for this to avoid changing the existing flag parameter. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: correct the 'gpio' command in the commit message] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-02-19cmd: pcmcia: Build only if CONFIG_CMD_PCMCIA=yIsmael Luceno Cortes
Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
2019-02-19cmd/fs: fix build if CMD_BOOTEFI is not setGervais, Francois
Fixes: cmd/fs.c:29: undefined reference to `efi_set_bootdev' Signed-off-by: Francois Gervais <fgervais@distech-controls.com>
2019-02-19cmd: date: Do not overwrite argumentsRoman Kapl
Arguments are const and belong to the caller. Calling date in a hush loop will yield different results from the second invocation. Signed-off-by: Roman Kapl <rka@sysgo.com>
2019-02-19elf: fix cache flushing in 'bootelf -p' commandKurban Mallachiev
Currently there are two problems in 'bootelf -p' (load elf by segments) command: - bss section is not flushed, so booted elf can have non zero values in bss; - at least on ARM there are 'CACHE: Misaligned operation at range...' warnings Use p_memsz instead of p_filesz during cache flushing for elf segment. p_filesz doesn't include zero initialized memory (e.g. bss section), which also should be flushed. Align these cache flushes to line boundaries. Signed-off-by: Kurban Mallachiev <mallachiev@ispras.ru>
2019-02-16efi_loader: clean up bootefi_test_prepare()Heinrich Schuchardt
Free resources upon failure. Correct the function description. As there is no need for any special address in the dummy memory device path passed via the EFI_LOADED_IMAGE_PROTOCOL simply use 0 as address. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16efi_loader: fix EFI entry countingHeinrich Schuchardt
`bootefi selftest` fails on qemu-x86_defconfig if efi_selftest() is not invoked using EFI_CALL(). Likewise we call the entry point of EFI payloads with EFI_CALL(efi_start_image()). entry_count indicates if we are in U-Boot (1) or in EFI payload code (0). As we start in U-Boot code the initial value has to be 1. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16efi_loader: use efi_start_image() for bootefiHeinrich Schuchardt
Remove the duplicate code in efi_do_enter() and use efi_start_image() to start the image invoked by the bootefi command. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-16efi_loader: set entry point in efi_load_pe()Heinrich Schuchardt
Up to now efi_load_pe() returns the entry point or NULL in case of an error. This does not allow to return correct error codes from LoadImage(). Let efi_load_pe() return a status code and fill in the entry point in the corresponding field of the image object. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-15Merge tag '2019.01-next' of https://github.com/mbgg/u-bootTom Rini
- add compute module 3+ - fix 64 bit warning in bmp command
2019-02-15cmd: bmp: Make integer-to-pointer cast platform, independentAdam Heinrich
This patch fixes the int-to-pointer-cast warning on aarch64. Signed-off-by: Adam Heinrich <adam@adamh.cz> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Matthias Brugger <mbrugger@suse.com>
2019-02-13efi_loader: refactor switch to non-secure modeHeinrich Schuchardt
Refactor the switch from supervisor to hypervisor to a new function called at the beginning of do_bootefi(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: move efi_init_obj_list() to a new efi_setup.cAKASHI Takahiro
The function, efi_init_obj_list(), can be shared in different pseudo efi applications, like bootefi/bootmgr as well as my efishell. Moreover, it will be utilized to extend efi initialization, for example, my "removable disk support" patch and "capsule-on-disk support" patch in the future. So with this patch, it will be moved to a new file, efi_setup.c, under lib/efi_loader and exported, making no changes in functionality. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Remove lines deactivated by #if 1 #else Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: avoid unnecessary pointer to long conversionHeinrich Schuchardt
debug() support supports %p to print pointers. The debug message is unique. So there is not need to write a possibly distracting line number. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: CMD_BOOTEFI_HELLO_COMPILE in configsHeinrich Schuchardt
It should not be necessary to adjust CMD_BOOTEFI_HELLO_COMPILE in config files. arch/arm/lib/crt0_arm_efi.S cannot be compiled in thumbs mode. We can disable CMD_BOOTEFI_HELLO_COMPILE for CONFIG_CPU_V7M. So there is no longer a need to disable it in stm32 configs. helloworld.efi can be built without problems on x86_64. So there is no need to disable it in chromebook_link64_defconfig and qemu-x86_64_defconfig. Same is true for ARM V7A. So do not disable CMD_BOOTEFI_HELLO_COMPILE in kp_imx6q_tpc_defconfig. Some architecture checks are already make for EFI_LOADER. There is no need to repeat them for CMD_BOOTEFI_HELLO_COMPILE Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrice.Chotard@st.com Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: use named constant for efi_dp_from_mem()Heinrich Schuchardt
When calling efi_dp_from_mem() use a named constant for the memory type. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-09cmd: sata: add null pointer check for devMarcel Ziswiler
Calling sata_scan() with a null pointer probably won't make much sense. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-02-01gpio: Use more command-specific enums valuesSimon Glass
At present this file uses GPIO_OUTPUT and GPIO_INPUT as its sub-command values. These are pretty generic names. Add a 'C' suffix to avoid possible conflicts. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2019-01-25cmd: ximg: Invert check for fit image compressionStefan Theil
The imgextract command runs a number of checks of the specified fit. Where it checks for a load address for compressed images the logic in the expression is inverted as fit_image_check_comp returns 1 on success and not 0.
2019-01-18cmd: mtd: fix compilation warning for help when SYS_LONGHELP=nQuentin Schulz
cmd/mtd.c:447:13: warning: ‘mtd_help_text’ defined but not used [-Wunused-variable] static char mtd_help_text[] = ^~~~~~~~~~~~~ When SYS_LONGHELP is not defined. After looking at how other commands work, we should surround the whole help text (even its declaration) with an #ifdef CONFIG_SYS_LONGHELP, since it's compiled out when calling _CMD_HELP[1] on the help text variable argument to U_BOOT_CMD. [1] https://elixir.bootlin.com/u-boot/latest/source/include/command.h#L181 Signed-off-by: Quentin Schulz <quentin.schulz@bootlin.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
2019-01-15cmd: adc: Use the sub-command infrastructureBoris Brezillon
And you get sub-command auto-completion for free. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-01-15cmd: mtd: Use the subcmd infrastructure to declare mtd sub-commandsBoris Brezillon
It's way simpler this way, and we also gain auto-completion support for free (MTD name auto-completion has been added with mtd_name_complete()) Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-01-15common: command: Rework the 'cmd is repeatable' logicBoris Brezillon
The repeatable property is currently attached to the main command and sub-commands have no way to change the repeatable value (the ->repeatable field in sub-command entries is ignored). Replace the ->repeatable field by an extended ->cmd() hook (called ->cmd_rep()) which takes a new int pointer to store the repeatable cap of the command being executed. With this trick, we can let sub-commands decide whether they are repeatable or not. We also patch mmc and dtimg who are testing the ->repeatable field directly (they now use cmd_is_repeatable() instead), and fix the help entry manually since it doesn't use the U_BOOT_CMD() macro. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-01-15cmd: zip: use correct format codeHeinrich Schuchardt
dst_len is defined as unsigned long. So use %lu for printf(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>