summaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)Author
2020-07-31cmd: env: add env select commandPatrick Delaunay
Add the new command 'env select' to force the persistent storage of environment, saved in gd->env_load_prio. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-07-31cmd: env: add env load commandPatrick Delaunay
Add the new command env load to load the environment from the current location gd->env_load_prio. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2020-07-28cmd: button: add a new 'button' commandPhilippe Reynes
Adds a command 'button' that provides the list of buttons supported by the board, and the state of a button. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-07-28cmd: host: return value of do_host_bind()Heinrich Schuchardt
When trying to bind to a non-existent file the following output is displayed: => host bind 0 non_existent Failed to access host backing file 'non_existent' exit not allowed from main input shell. The last line is quite unexpected and due to an incorrect return value. If do_host_bind() fails, return CMD_RET_FAILURE (= 1). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-26cmd: env: check real location for env info commandPatrick Delaunay
Check the current ENV location, dynamically provided by the weak function env_get_location to be sure that the environment can be persistent. The compilation flag ENV_IS_IN_DEVICE is not enough when the board dynamically select the available storage location (according boot device for example). This patch solves issue for stm32mp1 platform, when the boot device is USB. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-07-26cmd: env: add option for quiet output on env infoPatrick Delaunay
The "env info" can be use for test with -d and -p parameter, in scripting case the output of the command is not needed. This patch allows to deactivate this output with a new option "-q". For example, we can save the environment if default environment is used and persistent storage is managed with: if env info -p -d -q; then env save; fi Without the quiet option, I have the unnecessary traces First boot: Default environment is used Environment can be persisted Saving Environment to EXT4... File System is consistent Next boot: Environment was loaded from persistent storage Environment can be persisted Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-07-22efi_loader: use logging for bootefi commandHeinrich Schuchardt
Log messages of the bootefi command instead of simply printing them to the console. Do not show "## Application terminated" message when the UEFI binary completed successfully. Adjust the python tests testing for '## Application terminated'. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-20x86: mtrr: Enhance 'mtrr' command to list MTRRs on any CPUSimon Glass
Update this command so it can list the MTRRs on a selected CPU. If '-c all' is used, then all CPUs are listed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20x86: mtrr: Update 'mtrr' to allow setting MTRRs on any CPUSimon Glass
Add a -c option to mtrr to allow any CPU to be updated with this command. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20x86: mtrr: Restructure so command execution is in one placeSimon Glass
At present do_mtrr() does the 'list' subcommand at the top and the rest below. Update it to do them all in the same place so we can (in a later patch) add parsing of the CPU number for all subcommands. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20x86: mtrr: Update the command to use the new mtrr callsSimon Glass
Use the multi-CPU calls to set the MTRR values. This still supports only the boot CPU for now. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20x86: mtrr: Add support for writing to MTRRs on any CPUSimon Glass
To enable support for the 'mtrr' command, add a way to perform MTRR operations on selected CPUs. This works by setting up a little 'operation' structure and sending it around the CPUs for action. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
2020-07-20x86: mtrr: Use MP calls to list the MTRRsSimon Glass
Update the mtrr command to use mp_run_on_cpus() to obtain its information. Since the selected CPU is the boot CPU this does not change the result, but it sets the stage for supporting other CPUs. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20x86: mtrr: Fix 'ensable' typoSimon Glass
Fix a typo in the command help. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-17treewide: convert bd_t to struct bd_info manuallyMasahiro Yamada
Some code was not converted by coccinelle, somehow. I manually fixed up the remaining, and comments, README docs. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> [trini: Add arch/arm/mach-davinci/include/mach/sdmmc_defs.h and include/fdt_support.h] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-07-17treewide: convert bd_t to struct bd_info by coccinelleMasahiro Yamada
The Linux coding style guide (Documentation/process/coding-style.rst) clearly says: It's a **mistake** to use typedef for structures and pointers. Besides, using typedef for structures is annoying when you try to make headers self-contained. Let's say you have the following function declaration in a header: void foo(bd_t *bd); This is not self-contained since bd_t is not defined. To tell the compiler what 'bd_t' is, you need to include <asm/u-boot.h> #include <asm/u-boot.h> void foo(bd_t *bd); Then, the include direcective pulls in more bloat needlessly. If you use 'struct bd_info' instead, it is enough to put a forward declaration as follows: struct bd_info; void foo(struct bd_info *bd); Right, typedef'ing bd_t is a mistake. I used coccinelle to generate this commit. The semantic patch that makes this change is as follows: <smpl> @@ typedef bd_t; @@ -bd_t +struct bd_info </smpl> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-07-17cmd: booti: convert the debug print about image move to printfTero Kristo
Moving of the OS image may have some nasty side effects like corrupting DTB. Convert the current debug print to printf so that the relocation of the OS is always obvious to the user. Signed-off-by: Tero Kristo <t-kristo@ti.com>
2020-07-17common: bootm: add checks to verify if ramdisk / fdtimage overlaps OS imageTero Kristo
These cases are typically fatal and are difficult to debug for random users. Add checks for detecting overlapping images and abort if overlap is detected. Signed-off-by: Tero Kristo <t-kristo@ti.com>
2020-07-17acpi: Add an acpi command to list/dump generated ACPI itemsSimon Glass
Add a command that shows the individual blocks of data generated by each device, effectively splitting the full table into its component parts. This can be helpful for debugging. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-16efi_loader: simplify 'printenv -e'Heinrich Schuchardt
Currently default output of 'printenv -e' is restricted to variables with GUID EFI_GLOBAL_VARIABLE. This excludes db and dbx. As the number of variables is small there is no need for this restriction. If no GUID is provided, print all matching variables irrespective of GUID. Always show the numeric value of the GUID. If the GUID provided to 'setenv -e' is invalid, return CMD_RET_USAGE. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-16efi_selftest: enable 'bootefi hello'Heinrich Schuchardt
In our Python tests we want to run 'bootefi hello'. Enable it by default when compiling with CMD_BOOTEFI_SELFTEST. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-16cmd: fix lsblk commandHeinrich Schuchardt
Add missing includes. Add CMD_LSBLK to sandbox_defconfig. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-16cmd: drop fitupd commandHeinrich Schuchardt
The `fitupd' command is not used by any board. The `dfu tftp' command provides the same capabilities. So let's drop the `fitupd' command. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-11efi_loader: display RO attribute in printenv -eHeinrich Schuchardt
Let the 'printenv -e' command display the read only flag. If the variable is time authenticated write the time stamp. Avoid EFI_CALL() when calling SetVariable() and GetVariable(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-09cmd: fdt: remove CMD_FDT_MAX_DUMPHeinrich Schuchardt
When printing the device tree we want to get an output that can be used as input for the device tree compiler. This requires that we do not write bogus lines like pcie@10000000 { interrupt-map = * 0x4000127c [0x00000280]; For instance the QEMU virt device has a property interrupt-map with 640 bytes which exceeds CMD_FDT_MAX_DUMP=64. So lets do away with the artificial limitation to 64 bytes. As indicated in commit f0a29d43313c ("fdt: Limit printed hex in fdt print and list commands") if a device tree contains binary blobs, it may still be desirable to limit the output length. Provide environment variable fdt_max_dump for this purpose. Fixes: 5d927b428622 ("Kconfig: Drop CONFIG_CMD_FDT_MAX_DUMP") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-09log: don't show function by defaultHeinrich Schuchardt
The name of the function emitting a log message may be of interest for a developer but is distracting for normal users. See the example below: try_load_entry() Booting: Debian Make the default format for log messages customizable. By default show only the message text. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-09rtc: add rtc commandRasmus Villemoes
Mostly as an aid for debugging RTC drivers, provide a command that can be used to read/write arbitrary registers (assuming the driver provides the read/write methods or their single-register-at-a-time variants). Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2020-07-08cmd: Add a memory-search commandSimon Glass
It is useful to be able to find hex values and strings in a memory range. Add a command to support this. cmd: Fix 'md' and add a memory-search command At present 'md.q' is broken. This series provides a fix for this. It also implements a new memory-search command called 'ms'. It allows searching memory for hex and string data. END Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-08cmd: mem: Drop #ifdef for MEM_SUPPORT_64BIT_DATASimon Glass
This is defined only when __lp64__ is defined. That means that ulong is 64 bits long. Therefore we don't need to use a separate u64 type on those architectures. Fix up the code to take advantage of that, removing the preprocessor conditions. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
2020-07-08cmd: mem: Use a macro to avoid #ifdef in helpSimon Glass
It is a bit painful to have #ifdefs in the middle of the help for each command. Add a macro to avoid this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
2020-07-08Update MEM_SUPPORT_64BIT_DATA to be always definedSimon Glass
Define this macro always so we don't need the preprocessor to check it. Convert the users to #if instead of #ifdef. Note that '#if MEM_SUPPORT_64BIT_DATA' does not give an error if the macro is not define. It just assumes zero. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
2020-07-08cmd: add a panic commandHeiko Stuebner
Even in boot scripts it may be needed to "panic" when all options are exhausted and the device specification specifies hanging instead of resetting the board. So add a new panic command that just wraps around the core panic call in U-Boot and can take an optional message. Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-07-07cmd: blkls: Add blkls commandNiel Fourie
Add a command to print a list of available block device drivers, and for each, the list of known block devices. Signed-off-by: Niel Fourie <lusus@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
2020-07-07cmd: dm: Fixed/Added DM driver listing subcommandsNiel Fourie
Renamed dm "drivers" subcommand to "compat" (as it listed compatibility strings) and prevent it from segfaulting when drivers have no of_match populated. Added a new "drivers" subcommand to dump a list of all known DM drivers and for each, their uclass id, uclass driver and names of attached devices. Added a new "static" subcommand to dump a list of DM drivers with statically defined platform data. Signed-off-by: Niel Fourie <lusus@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-07cmd: fs: Add command to list supported fs typesNiel Fourie
Added command "fstypes" to list supported/included filesystems. Signed-off-by: Niel Fourie <lusus@denx.de> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Limit to sandbox] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-07-07cmd: part: Add subcommand to list supported partition tablesNiel Fourie
Add a subcommand "types" to the part command, which lists the supported partition table types. Signed-off-by: Niel Fourie <lusus@denx.de> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-07cmd: env: use ENV_IS_IN_DEVICE in env infoPatrick Delaunay
Use the define ENV_IS_IN_DEVICE to test if one the CONFIG_ENV_IS_IN_... is defined and correct the detection of persistent storage support in the command "env info" if CONFIG_ENV_IS_NOWHERE is activated. Since commit 60d5ed2593c9 ("env: allow ENV_IS_NOWHERE with other storage target") test CONFIG_ENV_IS_NOWHERE is not enough; see also commit 953db29a1e9c6 ("env: enable saveenv command when one CONFIG_ENV_IS_IN is activated"). This patch avoids issue for this command in stm32mp1 platform. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2020-07-05Merge tag 'efi-2020-10-rc1' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-efi into next Pull request for UEFI sub-system for efi-2020-10-rc1 This series comprises error corrections for the UEFI subsystem: * correct consideration of timestamps for variable authentication * correct collection of data regions for code authentication * correct unit tests to test loading dbx * enable FAT_WRITE as required by the UEFI spec The boot manager uses log functions instead of printf() and debug(). The UEFI intialization state is exported.
2020-06-30Merge tag 'mips-pull-2020-06-29' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-mips into next - net: pcnet: cleanup and add DM support - Makefile: add rule to build an endian-swapped U-Boot image used by MIPS Malta EL variants - CI: add Qemu tests for MIPS Malta
2020-06-30efi_loader: incorrect check against FDT_ADDR_T_NONEHeinrich Schuchardt
With commit 0d7c2913fdf7 ("cmd: bootefi: Honor the address & size cells properties correctly") addr was replaced by fdt_addr. But not in the check against FDT_ADDR_T_NONE. Fixes: 0d7c2913fdf7 ("cmd: bootefi: Honor the address & size cells properties correctly") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-06-29spi: Convert CONFIG_DM_SPI* to CONFIG_$(SPL_TPL_)DM_SPI*Lukasz Majewski
This change allows more fine tuning of driver model based SPI support in SPL and TPL. It is now possible to explicitly enable/disable the DM_SPI support in SPL and TPL via Kconfig option. Before this change it was necessary to use: /* SPI Flash Configs */ #if defined(CONFIG_SPL_BUILD) #undef CONFIG_DM_SPI #undef CONFIG_DM_SPI_FLASH #undef CONFIG_SPI_FLASH_MTD #endif in the ./include/configs/<board>.h, which is error prone and shall be avoided when we strive to switch to Kconfig. The goal of this patch: Provide distinction for DM_SPI support in both U-Boot proper and SPL (TPL). Valid use case is when U-Boot proper wants to use DM_SPI, but SPL must still support non DM driver. Another use case is the conversion of non DM/DTS SPI driver to support DM/DTS. When such driver needs to work in both SPL and U-Boot proper, the distinction is needed in Kconfig (also if SPL version of the driver supports OF_PLATDATA). In the end of the day one would have to support following use cases (in single driver file - e.g. mxs_spi.c): - U-Boot proper driver supporting DT/DTS - U-Boot proper driver without DT/DTS support (deprecated) - SPL driver without DT/DTS support - SPL (and TPL) driver with DT/DTS (when the SoC has enough resources to run full blown DT/DTS) - SPL driver with DT/DTS and SPL_OF_PLATDATA (when one have constrained environment with no fitImage and OF_LIBFDT support). Some boards do require SPI support (with DM) in SPL (TPL) and some only have DM_SPI{_FLASH} defined to allow compiling SPL. This patch converts #ifdef CONFIG_DM_SPI* to #if CONFIG_IS_ENABLED(DM_SPI) and provides corresponding defines in Kconfig. Signed-off-by: Lukasz Majewski <lukma@denx.de> Tested-by: Adam Ford <aford173@gmail.com> #da850-evm Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com> [trini: Fixup a few platforms] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-06-25Merge tag 'efi-2020-07-rc6' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-07-rc6 Corrections for variable definitions are provided: * Correct size of secure boot related UEFI variables. * Do not use int for storing an enum. * Replace fdt_addr by fdt_size where needed.
2020-06-25bdinfo: Update the file commentsSimon Glass
Update the comment at the top of the file to indicate what this file does. Also drop the line at the bottom and an unnecessary header include. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: m68k: ppc: Move arch-specific code from bdinfoSimon Glass
We don't have an easy way to share these three lines of code with two architectures. We also want to make it clear that this code is actually arch-specific. So just duplicate it in each arch-specific file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-06-25bdinfo: m68k: Move m68k-specific info into its own fileSimon Glass
We don't really want to have m68k-specific code in a generic file. Create a new arch-specific function to hold it, and move it into that. Make the function weak so that any arch can implement it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Angelo Dureghello <angelo.dureghello@timesys.com> Tested-by: Angelo Dureghello <angelo.dureghello@timesys.com>
2020-06-25bdinfo: ppc: Move PPC-specific info into its own fileSimon Glass
We don't really want to have PPC-specific code in a generic file. Create a new arch-specific function to hold it, and move it into that. Make the function weak so that any arch can implement it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-06-25bdinfo: arm: Move ARM-specific info into its own fileSimon Glass
We don't really want to have ARM-specific code in a generic file. Create a new arch-specific function to hold it, and move it into that. Make the function weak so that any arch can implement it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: Export some basic printing functionsSimon Glass
At present the functions to print a number and a frequency are static. We want to move some of the code in here to an arch-specific file. For consistency that code should use these same functions. So export them with an appropriate name. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: net: Inline print_eth_ip_addr()Simon Glass
This function only has two lines of code now, so inline it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-06-25bdinfo: net: Drop legacy ethernet bdinfoSimon Glass
This code pre-dates driver model and the migration date is nearly upon us. Pare the print_eths() function down and enable it for driver model, since it works correctly. The IP address is already printed in print_eth_ip_addr() so we can remove that. Since this results in a one-line print_eths() function, inline it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>