summaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)AuthorFilesLines
2020-08-24Merge tag 'u-boot-clk-24Aug2020' of ↵Tom Rini1-17/+18
https://gitlab.denx.de/u-boot/custodians/u-boot-clk - Add CCF clocks definitions for iMX6Q enet (ETH) - Several fixes for CCF framework - the most notable is the one, which adds get_rate helper to clk-mux.c - Improvements for clk command - better visibility and alignment.
2020-08-24cmd: clk: correctly handle depth for clk dumpPatrick Delaunay1-1/+2
Update depth only when clock uclass is found to have correct display of command "clk dump". Without this patch, the displayed depth is the binding depth for all the uclass and that can be strange as only clock uclass nodes are displayed. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-24cmd: clk: cosmetic: correct code alignment in show_clksPatrick Delaunay1-16/+16
Correct code alignment in show_clks() function. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-22cmd: bind: allow to bind driver with driver dataPatrice Chotard1-2/+3
Initial implementation invokes device_bind_with_driver_data() with driver_data parameter equal to 0. For driver with driver data, the bind command can't bind correctly this driver or even worse causes data abort as shown below: As example, for debug purpose on STM32MP1 platform, ethernet (dwc_eth_qos.c) driver needed to be unbinded/binded. This driver is using driver data: static const struct udevice_id eqos_ids[] = { { .compatible = "nvidia,tegra186-eqos", .data = (ulong)&eqos_tegra186_config }, { .compatible = "snps,dwmac-4.20a", .data = (ulong)&eqos_stm32_config }, { } }; After unbinding/binding this driver and probing it (with the dhcp command), we got a prefetch abort as below: STM32MP> unbind eth ethernet@5800a000 STM32MP> bind /soc/ethernet@5800a000 eth_eqos STM32MP> dhcp prefetch abort pc : [<4310801c>] lr : [<ffc8f4ad>] reloc pc : [<035ba01c>] lr : [<c01414ad>] sp : fdaf19b0 ip : ffcea83c fp : 00000001 r10: ffcfd4a0 r9 : fdaffed0 r8 : 00000000 r7 : ffcff304 r6 : fdc63220 r5 : 00000000 r4 : fdc5b108 r3 : 43108020 r2 : 00003d39 r1 : ffcea544 r0 : fdc63220 Flags: nZCv IRQs off FIQs off Mode SVC_32 Code: data abort pc : [<ffc4f9c0>] lr : [<ffc4f9ad>] reloc pc : [<c01019c0>] lr : [<c01019ad>] sp : fdaf18b8 ip : 00000000 fp : 00000001 r10: ffcd69b2 r9 : fdaffed0 r8 : ffcd69aa r7 : 00000000 r6 : 00000008 r5 : 4310801c r4 : fffffffc r3 : 00000001 r2 : 00000028 r1 : 00000000 r0 : 00000006 Flags: NzCv IRQs on FIQs on Mode SVC_32 (T) Code: 2f00 d1e9 2c00 dce9 (f855) 2024 Resetting CPU ... Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Cc: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-15Merge tag 'efi-2020-10-rc3-2' of ↵Tom Rini1-1/+1
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-10-rc3 (2) This series includes bug fixes for: * UEFI secure boot - images with multiple signatures * UEFI secure boot - support for intermediate certificates * corrections for UEFI unit tests * missing loadaddr on MAIX board
2020-08-14cmd: demo: Remove duplicated help message for list subcommandMichal Simek1-1/+0
There is no need to show demo list description twice when help demo is performed. The patch removes duplicated entry. Current state: => help demo demo - Driver model (dm) demo operations Usage: demo list List available demo devices demo hello <num> [<char>] Say hello demo light [<num>] Set or get the lights demo status <num> Get demo device status demo list List available demo devices Fixes: a02af4aeece4 ("dm: demo: Add a simple GPIO demonstration") Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-08-14xen: pvblock: Add initial support for para-virtualized block driverAnastasiia Lukianenko3-0/+38
Add initial infrastructure for Xen para-virtualized block device. This includes compile-time configuration and the skeleton for the future driver implementation. Add new class UCLASS_PVBLOCK which is going to be a parent for virtual block devices. Add new interface type IF_TYPE_PVBLOCK. Implement basic driver setup by reading XenStore configuration. Signed-off-by: Andrii Anisov <andrii_anisov@epam.com> Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
2020-08-14cmd: exception: unaligned data access on RISC-VHeinrich Schuchardt1-1/+16
The command 'exception' can be used to test the handling of exceptions. Currently the exception command only allows to create an illegal instruction exception on RISC-V. Provide a sub-command 'exception unaligned' to cause a misaligned load address exception. Adjust the online help for 'exception undefined'. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Rick Chen <rick@andestech.com>
2020-08-13cmd/efidebug: missing initialization of load_optionsHeinrich Schuchardt1-1/+1
Variable load_options must be initialized to NULL to avoid a segmentation fault when freeing the memory this variable points to. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-08-11Merge tag 'efi-2020-10-rc3' of ↵Tom Rini2-46/+33
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-10-rc3 Bugs in the UEFI sub-system are fixed: * use the optional data of the BootXXXX variables as load options * simplify function public_key_verify_signature() * amend a copyright notice
2020-08-08efi_loader: set load options in boot managerHeinrich Schuchardt2-11/+15
Up to now we used the value of the bootargs environment variable as load options in the boot manager. This is not correct. The data has to be taken from the Boot#### variable. Let the boot manager copy the optional data of the EFI_LOAD_OPTION as load options to the loaded image protocol. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-08-08efi_loader: factor out efi_set_load_options()Heinrich Schuchardt1-36/+19
The bootefi bootmgr command has to set the load options for a loaded image from the value of BootXXXX variable. If the boot manager is not used, the value is set from the environment variable bootargs (or efi_selftest). Factor out a common function efi_set_load_options(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-08-08Convert CONFIG_SYS_MMC_ENV_DEV et al to KconfigTom Rini1-4/+0
This converts the following to Kconfig: CONFIG_SYS_MMC_ENV_DEV CONFIG_SYS_MMC_ENV_PART Note that with this conversion we now have consistent behavior with respect to ensuring that we have always selected the correct MMC device and hardware partition. Signed-off-by: Tom Rini <trini@konsulko.com>
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>