summaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)AuthorFilesLines
2021-07-28i2c: Rename CONFIG_SYS_I2C to CONFIG_SYS_I2C_LEGACYSimon Glass3-15/+15
It is quite confusing that CONFIG_SYS_I2C selects the legacy I2C and CONFIG_DM_I2C selects the current I2C. The deadline to migrate I2C is less than a year away. Also we want to have a CONFIG_I2C for U-Boot proper just like we have CONFIG_SPL_I2C for SPL, so we can simplify the Makefile rules. Rename this symbol so it is clear it is going away. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2021-07-28Rename DRIVERS_MISC_SUPPORT to DRIVERS_MISCSimon Glass1-1/+1
Rename these options so that CONFIG_IS_ENABLED can be used with them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-27cmd: setexpr: add format string handlingRoland Gaudig5-178/+295
Add format string handling operator to the setexpr command. It allows to use C or Bash like format string expressions to be evaluated with the result being stored inside the environment variable name. setexpr <name> fmt <format> [value]... The following example setexpr foo fmt "%d, 0x%x" 0x100 ff will result in $foo being set to "256, 0xff". Signed-off-by: Roland Gaudig <roland.gaudig@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-27cmd: printf: add helper functions from busyboxRoland Gaudig1-0/+121
Import the following helper functions from Busybox-1.33.1 which are required by printf.c: process_escape_sequence from libbb/process_escape_sequence.c, skip_whitespace from libbb/skip_whitespace.c, overlapping_strcpy from libbb/safe_strncpy.c src-url: https://git.busybox.net/busybox/ commit bcc5b0e6caca6c7602a6a41f "Bump version to 1.33.1" version: 1.33.1 Signed-off-by: Roland Gaudig <roland.gaudig@weidmueller.com>
2021-07-27cmd: printf: import busybox-1.33.1 printf.cRoland Gaudig1-0/+455
Import printf.c from the Busybox project, which provides Bash like format string handling. src-url: https://git.busybox.net/busybox/ commit bcc5b0e6caca6c7602a6a41f "Bump version to 1.33.1" version: 1.33.1 Signed-off-by: Roland Gaudig <roland.gaudig@weidmueller.com>
2021-07-24command: Fix SMC and HVC maximum number of argumentsSiew Chin Lim1-3/+3
smc and hvc commands take upto 8 user input arguments, the maximum number of arguments of the U_BOOT_CMD macro should set to 9. Besides, fix the typo (arg7 -> arg6) in hvc command's help message. Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-23cmd: part: Correct error handlingAnders Dellien1-1/+1
As 'part_get_info_by_name' now returns more status codes than just -1 to indicate failure, we need to update the return value check. Signed-off-by: Anders Dellien <anders.dellien@arm.com> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2021-07-23cmd: pinmux: support pin name in status commandPatrick Delaunay1-9/+37
Allow pin name parameter for pimux staus command, as gpio command to get status of one pin. The possible usage of the command is: > pinmux dev pinctrl > pinmux status > pinmux status -a > pinmux status <pin-name> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-23cmd: pinmux: update result of do_statusPatrick Delaunay1-14/+17
Update the result of do_status and always returns a CMD_RET_ value (-ENOSYS was a possible result of show_pinmux). This patch also adds pincontrol name in error messages (dev->name) and treats correctly the status sub command when pin-controller device is not selected. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-19treewide: Test on CONFIG_USB_HOST (or CONFIG_CMD_USB) not CONFIG_USBTom Rini1-1/+1
As the logic here is only used when we have a USB host controller, test on CONFIG_USB_HOST rather than CONFIG_USB in general. This lets us move towards using CONFIG_USB only as a menu symbol to say that we have some form of USB, and then USB_HOST or USB_GADGET depending on the role that USB plays within the build. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-08usb: Add correct depends for CMD_USB_MASS_STORAGETom Rini1-0/+1
We cannot build this without USB_GADGET_DOWNLOAD support enabled, add the appropriate depends line. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-06cmd: net: add a 'net list' command to list network devsTim Harvey1-0/+46
In a system with multiple network controllers it can be difficult to know the names of the various devices available. This is especially true for USB ether devices as they do not display device names upon detection. This is being added as a net sub-system in case other commands may want to be added or moved here. Note that this is only enabled for DM_ETH Example: U-Boot > net net - NET sub-system Usage: net list - list available devices U-Boot > net list eth0 : ethernet@2188000 00:d0:12:98:f5:47 active eth1 : e1000#0 00:d0:12:98:f5:48 eth2 : asix_eth 8c:ae:4c:f5:84:9d eth3 : asix_eth 8c:ae:4c:f9:41:e3 Signed-off-by: Tim Harvey <tharvey@gateworks.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-07-05env: efi: fix a wrong address dereferenceAKASHI Takahiro1-2/+1
Probably, a pointer to a variable in an inner block should not be exposed to an outer block. Fixes: c70f44817d46 ("efi_loader: simplify 'printenv -e'") Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> [trini: Don't make guid const now] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-07-05Merge branch 'next'Tom Rini5-11/+272
2021-06-30Revert "TEST: USB_HOST not USB"Tom Rini1-1/+1
This reverts commit 4e1903a645453deab5ec5dd1cf4f0061469b99c3. This local commit was not intended to be pushed out. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-06-30TEST: USB_HOST not USBTom Rini1-1/+1
Signed-off-by: Tom Rini <trini@konsulko.com>
2021-06-28Merge tag 'v2021.07-rc5' into nextTom Rini3-6/+21
Prepare v2021.07-rc5 # gpg: Signature made Mon 28 Jun 2021 03:39:36 PM EDT # gpg: using RSA key 1A3C7F70E08FAB1707809BBF147C39FF9634B72C # gpg: Good signature from "Thomas Rini <trini@konsulko.com>" [ultimate] # Conflicts: # configs/am64x_evm_r5_defconfig
2021-06-28efidebug: correct display of BootOrderHeinrich Schuchardt1-1/+1
Display the number of the boot option and not its index. Fixes: 2ecee31017bf ("efi_loader: use efi_create_indexed_name()") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-06-24cmd: mtd: expand <name> argument definition in command helpMarek Behún1-1/+1
The <name> argument can now also be MTD's DM device name or OF path. Mention this is command help. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Cc: Priyanka Jain <priyanka.jain@nxp.com> Cc: Simon Glass <sjg@chromium.org> Cc: Heiko Schocher <hs@denx.de> Cc: Patrick Delaunay <patrick.delaunay@st.com>
2021-06-24cmd: mtd: print device OF path in listingMarek Behún1-0/+7
Print MTD's device OF path in the output of `mtd list` command. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Cc: Priyanka Jain <priyanka.jain@nxp.com> Cc: Simon Glass <sjg@chromium.org> Cc: Heiko Schocher <hs@denx.de> Cc: Patrick Delaunay <patrick.delaunay@st.com>
2021-06-22mmc: Update environment variable with active partitionReuben Dowle1-5/+9
This patch allows uboot scripts make choices about where to boot from based on the active mmc boot partition. This allows having two copies of kernel, filesystems etc, and choosing which to boot from based off of the active bootloader partition. Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-06-18cmd: pxe_utils: sysboot: fix crash if either board or soc are not set.Dimitri John Ledkov1-0/+8
If the environment does not have "soc" or "board" set, and fdtdir option is specified in extlinux.conf, the bootloader will crash whilst dereferencing a null pointer. Add a guard against null soc or board. Fixes a crash of qemu-riscv64_smode configuration, which does not have CONFIG_SYS_SOC defined. Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-06-11cmd: ti: pd: Add debug command for K3 power domainsTero Kristo3-0/+194
Add support command for debugging K3 power domains. This is useful with the HSM rearch setup, where power domains are directly controlled by SPL instead of going through the TI SCI layer. The debugging support is only available in the u-boot codebase though, so the raw register access power domain layer must be enabled on u-boot side for this to work. By default, u-boot side uses the TI SCI layer, and R5 SPL only uses the direct access methods. Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Tero Kristo <kristo@kernel.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-06-11clk: add support for setting clk rate from cmdlineTero Kristo1-2/+51
Add new clk subcommand "clk setfreq", for setting up a clock rate directly from u-boot cmdline. This is handy for any debugging purposes towards clocks. Acked-by: Lukasz Majewski <lukma@denx.de> Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Tero Kristo <kristo@kernel.org>
2021-06-11clk: fix clock tree dump to properly dump out every registered clockTero Kristo1-8/+19
Some clocks are not associated to a DM node, so just parsing the DM is not enough. This is especially true for root clocks, which typically don't have any parents. Instead, fetch every registered UCLASS_CLK instance, and dump these out. Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Tero Kristo <kristo@kernel.org>
2021-06-09cmd: Add dependency for ums commandPatrick Delaunay1-1/+4
Add the missing dependency for the command ums: - CONFIG_BLK: call of blk_* functions in usb_mass_storage.c - CONFIG_USB_GADGET: required to select CONFIG_USB_FUNCTION_MASS_STORAGE Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-05-25efi_loader: simplify accessing variablesHeinrich Schuchardt1-15/+18
Use efi_get_variable_int() instead of EFI_CALL(RT->get_variable()). Use efi_set_variable_int() instead of EFI_CALL(efi_set_variable()). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-05-25efi_loader: use efi_create_indexed_name()Heinrich Schuchardt1-23/+14
Simplify the creation of indexed variable names like 'Boot0000' by using function efi_create_indexed_name(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-05-25efi_loader: simplify show_efi_boot_order()Heinrich Schuchardt1-14/+1
To print a UTF-16 string use %ls instead of converting string to UTF-8. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-05-25efi_loader: simplify show_efi_boot_opt_data()Heinrich Schuchardt1-12/+1
To print a UTF-16 string use %ls instead of converting string to UTF-8. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-05-24stackprot: Make our test a bit more complexTom Rini1-0/+7
With better compiler optimizations available, a compiler may see we do nothing with our buffer after calling memset and omit the call, thus causing us to not smash the stack. Add a comment to explain why we now also have a printf call, so that the test will pass as the memset will not be omitted. Reported-by: Marek Behún <marek.behun@nic.cz> Signed-off-by: Tom Rini <trini@konsulko.com>
2021-05-16cmd: mvebu: Rename rx_training to mvebu_comphy_rx_trainingStefan Roese3-11/+10
Rename the misleading cmd "rx_training" to "mvebu_comphy_rx_training" to avoid confusion and mixup with DDR3/4 training. This makes it clear, that this command is platform specific and handles the COMPHY RX training. Also depend this cmd on ARMADA_8K and not TARGET_MVEBU_ARMADA_8K to make is available for OcteonTX2 CN913x. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Pali Rohár <pali@kernel.org> Cc: Marek Behun <marek.behun@nic.cz> Cc: Kostya Porotchkin <kostap@marvell.com> Cc: Nadav Haklai <nadavh@marvell.com> Acked-by: Marek Behún <marek.behun@nic.cz> Acked-by: Pali Rohár <pali@kernel.org>
2021-05-13cmd: add support for a new "extension" commandKory Maincent3-0/+180
This patch adds a new "extension" command, which aims at detecting extension boards connected to the hardware platform, and apply the Device Tree overlays that describe the hardware present on those extension boards. In order to enable this mechanism, board-specific code must implement the extension_board_scan() function that fills in a linked list of "struct extension", each describing one extension board. In addition, the board-specific code must select the SUPPORT_EXTENSION_SCAN Kconfig boolean. Based on this: - "extension scan" makes the generic code call the board-specific extension_board_scan() function to retrieve the list of detected extension boards. - "extension list" allows to list the detected extension boards. - "extension apply <number>|all" allows to apply the Device Tree overlay(s) corresponding to one, or all, extension boards The latter requires two environment variables to exist and set one variable to run: - extension_overlay_addr: the RAM address where to load the Device Tree overlays - extension_overlay_cmd: the U-Boot command to load one overlay. Indeed, the location and mechanism to load DT overlays is very setup specific. - extension_overlay_name: set by the command: the name of the DT which will be load during the execution. When calling the command described in the extension_overlay_cmd variable, the variable extension_overlay_name will be defined. So a typical extension_overlay_cmd will look like this: extension_overlay_cmd=load mmc 0:1 $extension_overlay_addr /boot/$extension_overlay_name Here is an example on how to use it: => run loadfdt => fdt addr $fdtaddr => setenv extension_overlay_addr 0x1000 => setenv extension_overlay_cmd 'load mmc 0:1 ${extension_overlay_addr} /boot/${extension_overlay_name}' => extension scan Found 1 extension board(s). => extension apply 0 519 bytes read in 3 ms (168.9 KiB/s) Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Reviewed-by: Maxime Ripard <maxime@cerno.tech>
2021-05-13fdt_support: move fdt_valid from cmd_fdt.c to fdt_support.cKory Maincent1-49/+0
Move the fdt_valid function to fdt_support. This changes allow to be able to test the validity of a devicetree in other c files. Update code syntax. Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Maxime Ripard <maxime@cerno.tech>
2021-05-10x86: Correct regwidth prompt in cbsysinfoSimon Glass1-1/+1
This should be 'regwidth', not 'baud'. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2021-05-07Merge https://source.denx.de/u-boot/custodians/u-boot-riscvTom Rini1-0/+10
2021-05-05cmd/exception: support ebreak exception on RISC-VHeinrich Schuchardt1-0/+10
The ebreak instruction should generate a breakpoint exception. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Rick Chen <rick@andestech.com>
2021-05-04cmd: gpt: Add option to write GPT partitions to environment variableFarhan Ali1-8/+38
This change would enhance the existing 'gpt read' command to allow (optionally) writing of the read GPT partitions to an environment variable in the UBOOT partitions layout format. This would allow users to easily change the overall partition settings by editing said variable and then using the variable in the 'gpt write' and 'gpt verify' commands. Signed-off-by: Farhan Ali <farhan.ali@broadcom.com> Cc: Simon Glass <sjg@chromium.org> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Corneliu Doban <cdoban@broadcom.com> Cc: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com> Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-29Merge tag 'xilinx-for-v2021.07-rc2' of ↵Tom Rini1-1/+1
https://source.denx.de/u-boot/custodians/u-boot-microblaze Xilinx changes for v2021.07-rc2 xilinx: - Enable saving variables based on bootmode - Cleanup usb dfu setup and wire it up with usb bootmode - Fix bootscript address logic - Remove GD references (spi, Versal) - Enable capsule update clk: - Small Kconfig fix net: - Fix gmii2rgmii bridge binding usb: - Propagate error (dfu gadget)
2021-04-29phy: marvell: add RX training commandIgal Liberman3-1/+65
This patch adds support for running RX training using new command called "rx_training" Usage: rx_training - rx_training <cp id> <comphy id> RX training allows to improve link quality (for SFI mode) by running training sequence between us and the link partner, this allows to reach better link quality then using static configuration. Change-Id: I818fe67ccaf19a87af50d4c34a9db7d6802049a5 Signed-off-by: Igal Liberman <igall@marvell.com> Signed-off-by: Marcin Wojtas <mw@semihalf.com>
2021-04-29cmd/mvebu: fix the bubt commandKonstantin Porotchkin2-2/+2
- fix the dependency for MMC boot (add XENON to MVEBU_MMC) - fix the bubt destination assignment (missing # in "else" case) Signed-off-by: Konstantin Porotchkin <kostap@marvell.com> Signed-off-by: Stefan Roese <sr@denx.de>
2021-04-23cmd: dfu: Propagate error if dfu gadget failsMichal Simek1-1/+1
On systems without usb gadget dfu core fails which was reported by error but command itself returns pass which breaks any usage in a script. That's why propagate error from run_usb_dnl_gadget(). Fixes: 16297cfb2a20 ("usb: new board-specific USB init interface") Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2021-04-20Add support for stack-protectorJoel Peshkin3-0/+29
Add support for stack protector for UBOOT, SPL, and TPL as well as new pytest for stackprotector Signed-off-by: Joel Peshkin <joel.peshkin@broadcom.com> Adjust UEFI build flags. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-04-20sysreset: provide type of reset in do_reset cmdIgor Opaniuk1-1/+1
Add additional param for reset cmd, which provides type of reset. Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
2021-04-20cmd: CONFIG_CMD_MMC depends on CONFIG_MMCHeinrich Schuchardt1-0/+1
Trying to compile with CONFIG_CMD_MMC=y and CONFIG_MMC=n leads to errors: riscv64-linux-gnu-ld.bfd: cmd/built-in.o: in function `do_mmcops': cmd/mmc.c:984: undefined reference to `get_mmc_num' riscv64-linux-gnu-ld.bfd: cmd/built-in.o: in function `do_mmc_setdsr': cmd/mmc.c:873: undefined reference to `find_mmc_device' Add missing dependency. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-04-13cmd: exit: Fix return valueMarek Vasut1-5/+2
In case exit is called in a script without parameter, the command returns -2 ; in case exit is called with a numerical parameter, the command returns -2 and lower. This leads to the following problem: => setenv foo 'echo bar ; exit 1' ; run foo ; echo $? bar 0 => setenv foo 'echo bar ; exit 0' ; run foo ; echo $? bar 0 => setenv foo 'echo bar ; exit -2' ; run foo ; echo $? bar 0 That is, no matter what the 'exit' command argument is, the return value is always 0 and so it is not possible to use script return value in subsequent tests. Fix this and simplify the exit command such that if exit is called with no argument, the command returns 0, just like 'true' in cmd/test.c. In case the command is called with any argument that is positive integer, the argument is set as return value. => setenv foo 'echo bar ; exit 1' ; run foo ; echo $? bar 1 => setenv foo 'echo bar ; exit 0' ; run foo ; echo $? bar 0 => setenv foo 'echo bar ; exit -2' ; run foo ; echo $? bar 0 Note that this does change ABI established in 2004 , although it is unclear whether that ABI was originally OK or not. Fixes: c26e454dfc6 Signed-off-by: Marek Vasut <marex@denx.de> Cc: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Cc: Tom Rini <trini@konsulko.com>
2021-04-13x86: qemu: move QFW to its own uclassAsherah Connor1-30/+26
We move qfw into its own uclass and split the PIO functions into a specific driver for that uclass. The PIO driver is selected in the qemu-x86 board config (this covers x86 and x86_64). include/qfw.h is cleaned up and documentation added. Signed-off-by: Asherah Connor <ashe@kivikakk.ee> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2021-04-13terminal: only serial_reinit_all if availableAsherah Connor1-1/+3
serial_reinit_all() is only available if CONFIG_SERIAL is defined (i.e. !CONFIG_DM_SERIAL). Signed-off-by: Asherah Connor <ashe@kivikakk.ee> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-13terminal: correct stdio_dev invocationsAsherah Connor1-6/+6
stdio_dev methods have taken a pointer to themselves since 709ea543 (nearly 7 years ago). Signed-off-by: Asherah Connor <ashe@kivikakk.ee> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-13cmd: xtrace: Convert to boolSean Anderson1-1/+1
This variable is a boolean, not a string. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>