summaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)AuthorFilesLines
2022-02-18cmd: fuse: Add a command to read fuses to memoryAngus Ainslie1-0/+27
With the fuse values in memory we can use some of the other u-boot shell conditonal operators to do tests. Signed-off-by: Angus Ainslie <angus@akkea.ca>
2022-02-18cmd: fuse: add a fuse comparison functionAngus Ainslie1-1/+21
Compare a hexval to the fuse value and return pass or fail. Signed-off-by: Angus Ainslie <angus@akkea.ca>
2022-02-14pstore: Support already existing reserved-memory nodeDetlev Casanova1-5/+34
The pstore command tries to create a reserved-memory node but fails if it is already present with: Add 'reserved-memory' node failed: FDT_ERR_EXISTS This patch creates the node only if it does not exist and adapts the reg values sizes depending on already present #address-cells and #size-cells values. Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
2022-02-11cmd/dfu: Enable 'dfu list' command without DFU_OVER_USBMasami Hiramatsu1-5/+3
Since dfu is not only used for USB, and some platform only supports DFU_OVER_TFTP or EFI capsule update, dfu_alt_info is defined on such platforms too. For such platform, 'dfu list' command is useful to check how the current dfu_alt_info setting is parsed. Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
2022-02-11cmd: wrong printf() code in do_test_stackprot_fail()Heinrich Schuchardt1-1/+2
strlen() returns size_t. So we should use %zu to print it. This avoids incorrect output on 32bit systems. Fixes: 2fc62f299174 ("stackprot: Make our test a bit more complex") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-02-09cmd: mmc: Consider GP partitions in mmc hwpartition user enh start -Marek Vasut1-2/+20
In case the eMMC contains any GP partitions or user sets up new GP partitions, the size of these GP partitions reduce the size of the USER partition. Subtract the size of those GP partitions from the calculated size of USER partition when using `user enh start -`. The following test used to fail before: ``` u-boot=> mmc hwpartition gp1 524288 enh user enh 0 - wrrel on check Partition configuration: User Enhanced Start: 0 Bytes User Enhanced Size: 1.8 GiB User partition write reliability: on GP1 Capacity: 256 MiB ENH No GP2 partition No GP3 partition No GP4 partition Total enhanced size exceeds maximum (261 > 229) Failed! ``` The test now passes: ``` u-boot=> mmc hwpartition gp1 524288 enh user enh 0 - wrrel on check Partition configuration: User Enhanced Start: 0 Bytes User Enhanced Size: 1.5 GiB User partition write reliability: on GP1 Capacity: 256 MiB ENH No GP2 partition No GP3 partition No GP4 partition ``` Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Reviewed-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-02-07Merge tag 'u-boot-imx-20220207' of ↵Tom Rini1-1/+2
https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20211022 ------------------- CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/10887 - imx8 : Toradex Verdin MX8M Plus Kontron pitx-imx8m - imx8ulp: several fixes and improvements - imx6ull fixes - switching to binman
2022-02-05efi: Add debugging to efi_set_bootdev()Simon Glass1-11/+21
The operation of this function can be confusing. Add some debugging so we can see what it is doing and when it is called. Also drop the preprocessor usage. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: heinrich Schuchardt <xypron.glpk@gmx.de>
2022-02-05cmd: bcb: fix bcb struct alignment issueGary Bisson1-1/+2
Without this patch the bcb struct could be located at an odd address which resulted in data not being copied to the buffer. Here was the repro steps (from Mattijs): => mmc dev 1 => bcb load 1 misc => bcb dump command 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 => part start mmc 1 misc misc_start => mmc read ${loadaddr} ${misc_start} 4 => bcb load 1 misc => bcb dump command 00000000: 62 6f 6f 74 6f 6e 63 65 2d 62 6f 6f 74 6c 6f 61 00000010: 64 65 72 00 00 00 00 00 00 00 00 00 00 00 00 00 This behavior was observed on an Amlogic A311D (ARM64) platform with a recent GCC toolchain (11.2.0) but is most likely affecting other platforms. To avoid issues the structure is aligned on DMA minimum alignment value as it is passed directly to the read function. Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # on khadas vim3
2022-02-03efi: Use 16-bit unicode stringsSimon Glass1-14/+14
At present we use wide characters for unicode but this is not necessary. Change the code to use the 'u' literal instead. This helps to fix build warnings for sandbox on rpi. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2022-01-29pci: Extend 'pci' command with bus option '*'Pali Rohár1-10/+35
Allow to call 'pci' and 'pci regions' commands with bus option '*' which cause pci to process all buses. PCIe is point-to-point HW and so on each bus is maximally one physical device. Therefore for PCIe it is common to have multiple buses. This change allows to easily print all available PCIe devices in system. Make '*' as default option when no bus argument is specified. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-29pci: Add checks for valid cmdline argumentsPali Rohár1-0/+5
Currently pci command ignores invalid cmdline arguments and do something. Add checks that all passed arguments were processed. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-29pci: Extend 'pci regions' command with bus numberPali Rohár1-4/+6
'pci regions' currently prints only region information from bus 0 which belongs to controller 0. Parser for 'pci regions' cmdline currently ignores any additional arguments and so U-Boot always uses bus 0. Regions are stored in controller (not on the bus) and therefore to retrieve controller from the bus, it is needed to call pci_get_controller() which returns root bus. Because bus 0 is root bus, current code worked fine for controller 0. Extend cmdline parser for 'pci regions' to allows specifying bus number, extend pci_show_regions() code to accept also non-zero bus number and print bus ranges for which is regions configuration assigned. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-25acpi: Tidy up the table listSimon Glass1-4/+5
At present this is really just a debugging aid, but it is a bit untidy. Add proper columns so it is easier to read. Sample output for coral: => acpi list Name Base Size Detail ---- -------- ----- ------ RSDP 79925000 24 v02 U-BOOT RSDT 79925030 48 v01 U-BOOT U-BOOTBL 20220101 INTL 0 XSDT 799250e0 6c v01 U-BOOT U-BOOTBL 20220101 INTL 0 FACP 79929570 f4 v04 U-BOOT U-BOOTBL 20220101 INTL 1 DSDT 79925280 32ea v02 U-BOOT U-BOOTBL 20110725 INTL 20180105 FACS 79925240 40 MCFG 79929670 2c v01 U-BOOT U-BOOTBL 20220101 INTL 0 SPCR 799296a0 50 v02 U-BOOT U-BOOTBL 20220101 INTL 0 TPM2 799296f0 4c v04 U-BOOT U-BOOTBL 20220101 INTL 0 APIC 79929740 6c v02 U-BOOT U-BOOTBL 20220101 INTL 0 SSDT 799297b0 1523 v02 U-BOOT U-BOOTBL 20220101 INTL 1 NHLT 7992ace0 e60 v05 coral coral 3 INTL 0 DBG2 7992db40 61 v00 U-BOOT U-BOOTBL 20220101 INTL 0 HPET 7992dbb0 38 v01 U-BOOT U-BOOTBL 20220101 INTL 0 Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25x86: Move the acpi table to generic global_dataSimon Glass1-3/+3
Allow this to be used on any arch. Also convert to using macros so that we can check the CONFIG option in C code. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-24cmd: Add Kconfig option for multiprocessor cmdsAshok Reddy Soma2-6/+7
Add Kconfig option(CONFIG_CMD_MP) to enable or disable multiprocessor commands. Compile cmd/mp.c based on CONFIG_CMD_MP. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2022-01-22Merge tag 'efi-2022-04-rc1-2' of ↵Tom Rini2-193/+6
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-04-rc1-2 Documentation: * describe printf() format codes UEFI * enable more algorithms for UEFI image verification, e.g. SHA256-RSA2048 General * simplify printing short texts for GUIDs * provide a unit test for printing GUIDs
2022-01-21mtd: cfi: introduce CFI_FLASH_BANKSPatrick Delaunay2-18/+18
Replace CONFIG_SYS_MAX_FLASH_BANKS by CFI_FLASH_BANKS to prepare Kconfig migration and avoid to redefine CONFIG_SYS_MAX_FLASH_BANKS in cfi_flash.h. After this patch CONFIG_SYS_MAX_FLASH_BANKS should be never used in the cfi code: use CFI_MAX_FLASH_BANKS for struct size or CFI_FLASH_BANKS for number of CFI banks which can be dynamic. This patch modify all the files which include mtd/cfi_flash.h. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-21cmd: Fix up warnings in flash.cPatrick Delaunay1-122/+117
Tidy up the warnings reported by checkpatch.pl to prepare next patches Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-21net: Drop #ifdefs with CONFIG_BOOTP_SERVERIPSimon Glass1-3/+1
Use IS_ENABLED() instead, to reduce the number of build paths. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2022-01-19doc: replace @return by Return:Heinrich Schuchardt11-61/+61
Sphinx expects Return: and not @return to indicate a return value. find . -name '*.c' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; find . -name '*.h' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-01-19cmd: printenv: simplify printing GUIDsHeinrich Schuchardt1-37/+2
Use "%pS" to print text representations of GUIDs. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-01-19cmd: efidebug: simplify printing GUIDsHeinrich Schuchardt1-156/+4
Use "%pS" to print text representations of GUIDs. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-01-18common: remove bedbug debugger supportOvidiu Panait3-418/+0
Commit 98f705c9cefd ("powerpc: remove 4xx support") removed (in 2017) the last code that made use of bedbug debugger support. Since there aren't any boards left that define either CONFIG_CMD_BEDBUG or a real bedbug_init(), drop this feature from u-boot. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-01-15Merge tag 'efi-2022-04-rc1' of ↵Tom Rini4-32/+54
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-04-rc1 Documentation: * Fix building HTML documentation of readthedocs.io * Add ARM Juno board documentation * Build requirements for Alpine Linux * Include DM headers in API documentation UEFI: * Fix section alignment of EFI binaries * Fix header length of RISC-V EFI binaries allowing to run them on EDK II * Remove kaslr-seed from device tree if the EFI_RNG_PROTOCOL is provided Other: * Let 'part list' show all 128 GPT partitions
2022-01-15efi: Support the efi command in the appSimon Glass2-16/+34
At present the 'efi' command only works in the EFI payload. Update it to work in the app too, so the memory map can be examined. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-01-15x86: efi: Update efi_get_next_mem_desc() to avoid needing a mapSimon Glass1-16/+18
At present this function requires a pointer to struct efi_entry_memmap but the only field used in there is the desc_size. We want to be able to use it from the app, so update it to use desc_size directly. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-15efi_loader: Get rid of kaslr-seed if EFI_RNG_PROTOCOL is installedIlias Apalodimas1-0/+2
U-Boot, in some occasions, injects a 'kaslr-seed' property on the /chosen node. That would be problematic in case we want to measure the DTB we install in the configuration table, since it would change across reboots. The Linux kernel EFI-stub completely ignores it and only relies on EFI_RNG_PROTOCOL for it's own randomness needs (i.e the randomization of the physical placement of the kernel). In fact it (blindly) overwrites the existing seed if the protocol is installed. However it still uses it for randomizing it's virtual placement. So let's get rid of it in the presence of the RNG protocol. It's worth noting that TPMs also provide an RNG. So if we tweak our EFI_RNG_PROTOCOL slightly and install the protocol when a TPM device is present the 'kaslr-seed' property will always be removed, allowing us to reliably measure our DTB. Acked-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2022-01-15cmd: part: list all 128 GPT partitionsHeinrich Schuchardt1-2/+2
A GPT partition table typically has 128 entries. If a partition table contains a partition 128 'part list' should be able to list it. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-01-14cmd: adc: Report return value on errorSamuel Dionne-Riel1-2/+2
Reporting the return value should always be done on error conditions, this way the developer can start debugging issues with more knowledge in-hand. Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
2022-01-13cmd/Kconfig: Fix spelling of "resetting".Vagrant Cascadian1-1/+1
2022-01-09Merge tag 'u-boot-amlogic-20220107' of ↵Tom Rini3-0/+89
https://source.denx.de/u-boot/custodians/u-boot-amlogic into next - disable CONFIG_NET_RANDOM_ETHADDR when unnecessary on amlogic based configs - meson64_android: add board specific env settings, in order to support VIM3/L for android - add changes to support VIM3/L android boot by using meson64_android.h config
2021-12-28Merge tag 'video-next-20211228' of ↵Tom Rini1-1/+3
https://source.denx.de/u-boot/custodians/u-boot-video into next - various fixes to the sandbox display support - support for showing a logo without splash screen config - support for BMP drawing to depths other than 16bpp - tests for the different types of supported BMP images - support showing a logo when running coreboot via qemu
2021-12-28Convert CONFIG_JFFS2_DEV et al to KconfigTom Rini2-12/+21
This converts the following to Kconfig: CONFIG_JFFS2_DEV CONFIG_JFFS2_LZO CONFIG_JFFS2_NAND CONFIG_JFFS2_PART_OFFSET CONFIG_JFFS2_PART_SIZE Signed-off-by: Tom Rini <trini@konsulko.com>
2021-12-27Convert CONFIG_SYS_MEMTEST_START et al to KconfigTom Rini1-1/+1
This converts the following to Kconfig: CONFIG_SYS_MEMTEST_START CONFIG_SYS_MEMTEST_END This is removing unused defines and correcting the default value to be 0x0 as we are a hex symbol. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-12-27Convert CONFIG_ENV_SPI_BUS et al to KconfigTom Rini1-2/+2
This converts the following to Kconfig: CONFIG_ENV_SPI_BUS CONFIG_ENV_SPI_CS CONFIG_ENV_SPI_MAX_HZ CONFIG_ENV_SPI_MODE As part of this, we use Kconfig to provide the defaults now that were done in include/spi_flash.h. We also in some cases change from using CONFIG_ENV_SPI_FOO to CONFIG_SF_DEFAULT_FOO as those were the values in use anyhow as ENV was not enabled. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-12-27sandbox: Enable support for the gzip commandSimon Glass1-1/+3
This does not work with sandbox at present. Fix it up to use map_sysmem() to convert an address to a pointer. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-24cmd: kaslrseed: add command to generate value from hwrngChris Morgan3-0/+89
Allow the kaslr-seed value in the chosen node to be set from a hardware rng source. Tested on a Rockchip PX30 (Odroid Go Advance), you must have loaded the devicetree first and prepared it for editing. On my device the workflow goes as follows: setenv dtb_loadaddr "0x01f00000" load mmc 0:1 ${dtb_loadaddr} rk3326-odroid-go2.dtb fdt addr ${dtb_loadaddr} fdt resize kaslrseed and the output can be seen here: fdt print /chosen chosen { kaslr-seed = <0x6f61df74 0x6f7b996c>; stdout-path = "serial2:115200n8"; }; Signed-off-by: Chris Morgan <macromorgan@hotmail.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-12-23fdt: Report the devicetree sourceSimon Glass1-0/+2
It can be confusing to figure out where the devicetree came from. It seems important enough to warrant a message during boot. Add information about the number of devices and uclasses too since it is helpful to have some idea what is going on with driver model. Report the devicetree source in bdinfo too. This looks something like this, with > marking the new line. U-Boot 2021.10-00190 (Oct 30 2021 - 09:01:29 -0600) DRAM: 128 MiB > Core: 42 devices, 11 uclasses, devicetree: passage Flash: 64 MiB Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-21Merge tag 'v2022.01-rc4' into nextTom Rini1-1/+2
Prepare v2022.01-rc4
2021-12-05sandbox: Drop CONFIG_HOST_MAX_DEVICESSimon Glass1-1/+1
This can go in the related header file. Drop the CONFIG option. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-12-05trace: sandbox: Use only the Kconfig optionsSimon Glass1-0/+2
At present there are Kconfig options for tracing, but sandbox uses plain #defines to set them. Correct this and make the tracing command default to enabled so that this is not needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-11-30tpm: use more algorithms than sha256 on pcr_readRuchika Gupta1-1/+2
The current tpm2_pcr_read is hardcoded using SHA256. Make the actual command to TPM configurable to use wider range of algorithms. The current command line is kept as is i.e limited to SHA-256 only. Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-29Merge tag 'v2022.01-rc3' into nextTom Rini1-6/+11
Prepare v2022.01-rc3 Signed-off-by: Tom Rini <trini@konsulko.com>
2021-11-29mbr: Correct verification checkSimon Glass1-4/+4
At present this command considers the partitions to be identical if the start and size are smaller than expected. It should check that they are the same. Fix this and tidy up the code style a little. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-29sf: Tidy up code to avoid #ifdefSimon Glass1-17/+13
Update this code to use IS_ENABLED() instead. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Pratyush Yadav <p.yadav@ti.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2021-11-29sf: Use const for the stage nameSimon Glass1-1/+1
This is not updated at runtime so should be marked const. Update the code accordingly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2021-11-17cmd: tpm-v1: fix load_key_by_sha1 compile errorsMathew McBride1-5/+5
This command is not compiled by default and has not been updated alongside changes to the tpmv1 API, such as passing the TPM udevice to the relevant functions. Signed-off-by: Mathew McBride <matt@traverse.com.au> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-17cmd: tpm-v1: fix compile error in TPMv1 list resources commandMathew McBride1-1/+6
This command is not compiled by default and was not updated to pass the udevice to tpm_get_capability. Signed-off-by: Mathew McBride <matt@traverse.com.au> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2021-11-16bootm: Tidy up use of autostart env varSimon Glass2-5/+2
This has different semantics in different places. Go with the bootm method and put it in a common function so that the behaviour is consistent in U-Boot. Update the docs. To be clear, this changes the way that 'bootelf' and standalone boot work. Before, if autostart was set to "fred" or "YES", for example, they would consider that a "yes". This may change behaviour for some boards, but the only in-tree boards which mention autostart use "no" to disable it, which will still work. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Wolfgang Denk <wd@denx.de>