summaryrefslogtreecommitdiff
path: root/cmd
Commit message (Collapse)AuthorAgeFilesLines
* efi_loader: memory leak in efi_dump_single_var()Heinrich Schuchardt2019-03-201-1/+0
| | | | | | | | 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>
* cmd: fastboot: handle watchdog while waiting for fastboot commands.Sean Nyekjaer2019-03-161-0/+2
| | | | | | | | 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>
* cmd: thordown: Fix spelling of download.Vagrant Cascadian2019-03-081-1/+1
| | | | | | Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
* efi_loader: error handling for `efidebug boot add`Heinrich Schuchardt2019-03-021-1/+1
| | | | | | | | | 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>
* cmd: efidebug: add memmap commandAKASHI Takahiro2019-02-251-1/+126
| | | | | | | | | | | | | | | | | | | "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>
* cmd: efidebug: add images commandAKASHI Takahiro2019-02-251-1/+25
| | | | | | | "images" command prints loaded images-related information. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* cmd: efidebug: add dh commandAKASHI Takahiro2019-02-251-1/+141
| | | | | | | | | | | | | | | | | | "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>
* cmd: efidebug: add drivers commandAKASHI Takahiro2019-02-251-1/+94
| | | | | | | | | | | | "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>
* cmd: efidebug: add devices commandAKASHI Takahiro2019-02-251-1/+78
| | | | | | | | | | | | | | | | | | | "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>
* cmd: add efidebug commandAKASHI Takahiro2019-02-253-0/+598
| | | | | | | | | | | | | | | | | | 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>
* cmd: env: add "-e" option for handling UEFI variablesAKASHI Takahiro2019-02-254-1/+437
| | | | | | | | "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>
* cmd: Kconfig: LED command depends on LED subsystemsJan Kiszka2019-02-221-0/+1
| | | | | | | | | | | | 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>
* gpio: Use case-insentive matching on the GPIO nameSimon Glass2019-02-201-1/+1
| | | | | | | | | 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>
* gpio: Show inactive GPIOs when explicitly requestedSimon Glass2019-02-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* cmd: pcmcia: Build only if CONFIG_CMD_PCMCIA=yIsmael Luceno Cortes2019-02-191-1/+1
| | | | Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
* cmd/fs: fix build if CMD_BOOTEFI is not setGervais, Francois2019-02-191-0/+2
| | | | | | | Fixes: cmd/fs.c:29: undefined reference to `efi_set_bootdev' Signed-off-by: Francois Gervais <fgervais@distech-controls.com>
* cmd: date: Do not overwrite argumentsRoman Kapl2019-02-191-4/+4
| | | | | | | 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>
* elf: fix cache flushing in 'bootelf -p' commandKurban Mallachiev2019-02-191-2/+4
| | | | | | | | | | | | | | | | | 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>
* efi_loader: clean up bootefi_test_prepare()Heinrich Schuchardt2019-02-161-25/+33
| | | | | | | | | | | 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>
* efi_loader: fix EFI entry countingHeinrich Schuchardt2019-02-161-1/+1
| | | | | | | | | | | | | `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>
* efi_loader: use efi_start_image() for bootefiHeinrich Schuchardt2019-02-161-21/+1
| | | | | | | 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>
* efi_loader: set entry point in efi_load_pe()Heinrich Schuchardt2019-02-161-9/+4
| | | | | | | | | | 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>
* Merge tag '2019.01-next' of https://github.com/mbgg/u-bootTom Rini2019-02-151-1/+1
|\ | | | | | | | | - add compute module 3+ - fix 64 bit warning in bmp command
| * cmd: bmp: Make integer-to-pointer cast platform, independentAdam Heinrich2019-02-151-1/+1
| | | | | | | | | | | | | | | | 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>
* | efi_loader: refactor switch to non-secure modeHeinrich Schuchardt2019-02-131-67/+4
| | | | | | | | | | | | | | | | 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>
* | efi_loader: move efi_init_obj_list() to a new efi_setup.cAKASHI Takahiro2019-02-131-77/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | efi_loader: avoid unnecessary pointer to long conversionHeinrich Schuchardt2019-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
* | efi_loader: CMD_BOOTEFI_HELLO_COMPILE in configsHeinrich Schuchardt2019-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | efi_loader: use named constant for efi_dp_from_mem()Heinrich Schuchardt2019-02-131-1/+1
| | | | | | | | | | | | | | 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>
* | cmd: sata: add null pointer check for devMarcel Ziswiler2019-02-091-0/+4
|/ | | | | | | 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>
* gpio: Use more command-specific enums valuesSimon Glass2019-02-011-14/+23
| | | | | | | | | 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>
* cmd: ximg: Invert check for fit image compressionStefan Theil2019-01-251-1/+1
| | | | | | | | 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.
* cmd: mtd: fix compilation warning for help when SYS_LONGHELP=nQuentin Schulz2019-01-181-3/+2
| | | | | | | | | | | | | | | | 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>
* cmd: adc: Use the sub-command infrastructureBoris Brezillon2019-01-151-28/+5
| | | | | | | 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>
* cmd: mtd: Use the subcmd infrastructure to declare mtd sub-commandsBoris Brezillon2019-01-151-181/+267
| | | | | | | | 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>
* common: command: Rework the 'cmd is repeatable' logicBoris Brezillon2019-01-153-4/+4
| | | | | | | | | | | | | | | | | | | | 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>
* cmd: zip: use correct format codeHeinrich Schuchardt2019-01-151-1/+1
| | | | | | dst_len is defined as unsigned long. So use %lu for printf(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* cmd: unzip: use correct format codeHeinrich Schuchardt2019-01-151-1/+1
| | | | | | src_len is defined as unsigned long. So use %lu for printf(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* cmd: ubi: remove unreachable codeHeinrich Schuchardt2019-01-151-5/+1
| | | | | | | It does not make sense to check if argc < 2 a second time, especially after accessing argv[1]. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* cmd: tpm-v2: use correct format codeHeinrich Schuchardt2019-01-151-1/+1
| | | | | | updates is defined as unsigned int. So use %u for printf(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* cmd: sf: use correct printf codeHeinrich Schuchardt2019-01-151-1/+1
| | | | | | | test->time_ms[] is defined as unsigned. So use %u for printf(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* cmd: nvedit: use correct format codeHeinrich Schuchardt2019-01-151-2/+2
| | | | | | len is defined as unsigned. So use %u for printf(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* cmd: gpio: use correct printf codeHeinrich Schuchardt2019-01-151-1/+1
| | | | | | | gpio is defined as unsigned int. So we should use %u when calling printf(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* cmd: mmc: Invalidate MMC block cache after initMarek Vasut2019-01-151-0/+6
| | | | | | | | | Make sure the block cache is cleared for the MMC device after it was reinitialized to avoid having any stale data in the cache, like e.g. partition tables or such. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com>
* cmd: mmc: Force mmc reinit when no card presentMarek Vasut2019-01-151-0/+3
| | | | | | | | In case the card is removed, force-init the MMC to start the internal machinery which deregisters and invalidate the MMC device. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com>
* fs: cbfs: Add missing standard CBFS component typesBin Meng2018-12-311-0/+30
| | | | | | | Current CBFS component type list is incomplete. Add missing ones. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* fs: cbfs: Make all CBFS_TYPE_xxx macros consistentBin Meng2018-12-311-2/+2
| | | | | | | | At present there are 2 macros that are named as CBFS_COMPONENT_xxx. Change them to CBFS_TYPE_xxx for consistency. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* cmd: Move the "dm" command from test/dm/ to cmd/Tom Rini2018-12-152-0/+89
| | | | | | | The "dm" command under CONFIG_CMD_DM should live under cmd/ rather than test/dm/ so move it. Signed-off-by: Tom Rini <trini@konsulko.com>
* dm: sound: Complete migration to driver modelSimon Glass2018-12-131-12/+0
| | | | | | | All users of sound are converted to use driver model. Drop the old code and the CONFIG_DM_SOUND option. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sound: Create a uclass for soundSimon Glass2018-12-131-2/+21
| | | | | | | | | | | The sound driver pulls together the audio codec and i2s drivers in order to actually make sounds. It supports setup() and play() methods. The sound_find_codec_i2s() function allows locating the linked codec and i2s devices. They can be referred to from uclass-private data. Add a uclass and a test for sound. Signed-off-by: Simon Glass <sjg@chromium.org>