summaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)AuthorFilesLines
2020-08-08fs/squashfs: add filesystem commandsJoao Marcos Costa3-0/+49
Add 'ls' and 'load' commands. Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
2020-08-08cmd: Update the memory-search commandSimon Glass2-13/+19
Add various fixes and improvements to this command that were missed in the original version. Unfortunately I forgot to send v2. - Fix Kconfig name - Use a separate variable for the remaining search length - Correct a minor bug - Move into a separate test suite - Add -q flag to the 'quiet' test to test operation when console is enabled - Enable the feature for sandbox Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-06cmd: bdinfo: Move sram info prints to generic codeOvidiu Panait1-0/+4
bi_sramstart and bi_sramsize are generic members of the bd_info structure, so move the m68k/powerpc-specific prints to generic code. Also, print them only if SRAM support is enabled via CONFIG_SYS_HAS_SRAM. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
2020-08-06mvebu: bubt: Drop dead codeTom Rini1-15/+0
The code around CONFIG_SYS_MMC_ENV_PART has been untested since merge. This can be seen by it referencing 'mmc->part_num' which was migrated elsewhere prior to this code being merged. Cc: Joel Johnson <mrjoel@lixil.net> Cc: Stefan Roese <sr@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com> Acked-by: Stefan Roese <sr@denx.de> Reviewed-by: Stefan Roese <sr@denx.de>
2020-08-06cmd: mvebu/bubt: Drop unused SPI_FLASH_PROTECTIONJagan Teki1-7/+0
SPI_FLASH_PROTECTION config item is never used in anywhere in the U-Boot tree. Drop it. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-08-05cmd: bdinfo: cleanup phys_addr_t outputHeinrich Schuchardt1-3/+4
We currently print the memory size with at least 8 hexadecimal digits. This creates a ragged output on 64 bit boards, e.g. on a Kendryte K210: DRAM bank = 0x0000000000000002 -> start = 0x0000000080600000 -> size = 0x0000000000200000 memstart = 0x0000000000000000 memsize = 0x00000000 flashstart = 0x0000000000000000 flashsize = 0x0000000000000000 flashoffset = 0x0000000000000000 All other numbers are printed with the number of digits needed for the type ulong. So use this value as minimum number of digits (precision) for printing physical addresses. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Heiko Schocher <hs@denx.de> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-05cmd: bootz: fix device-tree overlap testBaruch Siach1-1/+1
The address of the kernel image is stored in images->ep. zi_start is the offset of execution entry in the image, which is usually 0 for ARM zImage. Fixes boot error when ftd is stored near RAM address 0x0: ERROR: FDT image overlaps OS image (OS=0x0..0x5fd608) Fixes: fbde7589ce30 ("common: bootm: add checks to verify if ramdisk / fdtimage overlaps OS image") Cc: Tero Kristo <t-kristo@ti.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2020-08-05lmb/bdinfo: dump lmb info via bdinfoTero Kristo1-0/+7
Dump lmb status from the bdinfo command. This is useful for seeing the reserved memory regions from the u-boot cmdline. Signed-off-by: Tero Kristo <t-kristo@ti.com>
2020-08-05cmd: add clone commandJohn Chau3-0/+135
This patch adds a feature for block device cloning similar to dd command, this should be useful for boot-strapping a device where usb gadget or networking is not available. For instance one can clone a factory image into a blank emmc from an external sd card. Signed-off-by: John Chau <john@harmon.hk>
2020-08-04w1: Drop dm.h header fileSimon Glass1-0/+1
This header file should not be included in other header files. Remove it and use a forward declaration instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-04net: Drop dm.h header file from phy.hSimon Glass2-0/+2
This header file should not be included in other header files. Remove it and use other headers and C inclusions instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-08-04dm: core: Drop dm.h header file from dm-demo.hSimon Glass1-0/+1
This header file should not be included in other header files. Remove it and add it to the cmd file instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-31cmd: env: add env select commandPatrick Delaunay2-0/+20
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 Delaunay2-0/+20
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-29cmd: button: add a new 'button' commandPhilippe Reynes3-0/+98
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-29cmd: host: return value of do_host_bind()Heinrich Schuchardt1-1/+1
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 Delaunay1-3/+12
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 Delaunay2-7/+20
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 Schuchardt1-18/+24
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 Glass1-1/+21
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 Glass1-2/+16
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 Glass1-19/+36
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 Glass1-26/+8
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 Glass1-3/+3
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 Glass1-4/+21
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 Glass1-1/+1
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 Yamada1-1/+1
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 Yamada1-2/+2
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 Kristo1-1/+2
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 Kristo2-2/+2
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 Glass1-2/+13
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 Schuchardt2-90/+23
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 Schuchardt1-0/+1
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 Schuchardt1-0/+2
Add missing includes. Add CMD_LSBLK to sandbox_defconfig. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-07-16cmd: drop fitupd commandHeinrich Schuchardt3-38/+0
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-12efi_loader: display RO attribute in printenv -eHeinrich Schuchardt1-8/+16
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-10cmd: fdt: remove CMD_FDT_MAX_DUMPHeinrich Schuchardt1-3/+8
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-10log: don't show function by defaultHeinrich Schuchardt1-2/+2
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 Villemoes3-0/+174
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-09cmd: Add a memory-search commandSimon Glass2-0/+165
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-09cmd: mem: Drop #ifdef for MEM_SUPPORT_64BIT_DATASimon Glass1-79/+38
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-09cmd: mem: Use a macro to avoid #ifdef in helpSimon Glass1-51/+17
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-09Update MEM_SUPPORT_64BIT_DATA to be always definedSimon Glass1-27/+27
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-09cmd: add a panic commandHeiko Stuebner2-0/+24
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 Fourie3-0/+59
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 Fourie1-1/+21
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 Fourie1-0/+11
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 Fourie1-2/+25
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 Delaunay1-1/+1
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-06Merge tag 'efi-2020-10-rc1' of ↵Tom Rini1-1/+1
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.