summaryrefslogtreecommitdiff
path: root/cmd
AgeCommit message (Collapse)Author
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-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-24cmd: bootefi: Fix fdt_size variable type in efi_carve_out_dt_rsv()Bin Meng
Variable fdt_size should be of type 'fdt_size_t', not 'fdt_addr_t'. Fixes 0d7c2913fdf7: ("cmd: bootefi: Honor the address & size cells properties correctly") Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-06-24Merge tag 'mmc-2020-6-24' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmcTom Rini
- Fix fsl_esdhc_imx tunning mask - Disable CMD CRC for normal tuning for fsl_esdhc_imx - Retry CM1 until emmc ready - Fix sdhci HISPD handling - Cache-aligned extcsd reading
2020-06-24cmd: mmc: Cache-align extcsd read targetMarek Vasut
The extcsd read target must be cache aligned in case the controller uses DMA to read the extcsd register, make it so. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
2020-06-23cmd: booti: Fix spelling of "environment".Vagrant Cascadian
Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-06-19cmd: bootefi: Honor the address & size cells properties correctlyAtish Patra
fdtdec_get_addr_size reads the uses a fixed value for address & size cell properties which may not be correct always. Use the auto variant of the function which automatically reads #address-cells & #size-cells from parent and uses to read the "reg" property. Signed-off-by: Atish Patra <atish.patra@wdc.com> On 32 bit systems fdt_addr_t may be 4 bytes long but size is defined as u64. Avoid filling the upper 4 bytes of the sizep parameter of fdtdec_get_addr_size_auto_parent() with random bytes from the stack by defining a separate variable fdt_size. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-06-15trivial: Fix booot occurencesMichal Simek
s/booot/boot/g The first ase is booot instead of boot and second u-booot instead of u-boot. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2020-06-03Merge tag 'efi-2020-07-rc4' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-07-rc4 This patch series addresses the following issues: * allow compiling with clang * add missing function descriptions to the HTML documentation * simplify the validation of UEFI images * validate load options in the UEFI boot manager In a preparatory patch a structure definition is moved.
2020-06-03Merge https://gitlab.denx.de/u-boot/custodians/u-boot-spiTom Rini
- Toshiba spinand (Yoshio) - SPI/SPI Flash cleanup (Jagan) - Remove SH SPI (Jagan)
2020-06-03efi_loader: validate load optionHeinrich Schuchardt
For passing the optional data of the load option to the loaded imaged protocol we need its size. efi_deserialize_load_option() is changed to return the size of the optional data. As a by-product we get a partial validation of the load option. Checking the length of the device path remains to be implemented. Some Coverity defects identified the load options as user input because get_unaligned_le32() and get_unaligned_le16() is called. But non of these Coverity defects can be resolved without marking functions with Coverity specific tags. Reported-by: Coverity (CID 303760) Reported-by: Coverity (CID 303768) Reported-by: Coverity (CID 303776) Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-06-02cmd: fitupd: move config check to KconfigHeinrich Schuchardt
Configuration checks should not be in the C files but in the Kconfig files. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-06-01cmd: sf Drop reassignment of new into flashJagan Teki
The new pointer points to flash found and that would assign it to global 'flash' pointer for further flash operations and also keep track of old flash pointer. This would happen if the probe is successful or even failed, but current code assigning new into flash before and after checking the new. So, drop the assignment after new checks so flash always latest new pointer even if probe failed or succeed. Cc: Simon Glass <sjg@chromium.org> Cc: Vignesh R <vigneshr@ti.com> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2020-05-27cbfs: Return the error code from file_cbfs_init()Simon Glass
We may as well return the error code and use it directly in the command code. CBFS still uses its own error enum which we may be able to remove, but leave it for now. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-05-27x86: mtrr: Drop the mask display when changing an mtrrSimon Glass
We don't need to print this information since it is shown when the MTRRs are displayed. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-05-25cmd: zip: fix implicit declaration warningMichael Walle
Fix the following warning: cmd/zip.c: In function ‘do_zip’: cmd/zip.c:30:6: warning: implicit declaration of function ‘gzip’; did you mean ‘do_zip’? [-Wimplicit-function-declaration] if (gzip((void *) dst, &dst_len, (void *) src, src_len) != 0) ^~~~ do_zip Include gzip.h header which declares the gzip() function. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-05-25cmd: zip: automatically pull in gzip()Michael Walle
Move the CONFIG_GZIP_COMPRESSED from a config.h macro to a Kconfig menu item. It is not selectable by a user because there is no reason to do so. Instead it will be automatically selected by the stuff which uses gzip(), like the zip command. Remove it from the config_whitelist.txt. Also remove CONFIG_GZIP_COMPRESS_DEF_SZ as this was never used on any board. The default seems to be sane, otherwise it should be added as a Kconfig option. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-05-25cmd: unzip: automatically select CONFIG_GZIPMichael Walle
unzip calls gzwrite() which is provided in lib/gunzip.c. Make sure it is automatically pulled in if the user selects CMD_UNZIP. Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Heinrich Schuchardt <xypron.glkp@gmx.de>
2020-05-21efi_loader: add EFI_MEMORY_SP to memory attributesHeinrich Schuchardt
The UEFI 2.8 specification has introduced the EFI_MEMORY_SP memory attribute. Add it to the 'efidebug memmap' and 'efi mem' commands. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-05-19cmd: avb: free partition buffer upon verify completionGary Bisson
Doing the same as the unittests for libavb [1]. Allows to run 'avb verify' multiple times which can be useful after a failure to be able to re-flash the partition and try again. [1] https://android.googlesource.com/platform/external/avb/+/refs/tags/android-9.0.0_r37/test/avb_slot_verify_unittest.cc#156 Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>
2020-05-18common: Drop linux/bitops.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop linux/delay.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18Fix some checkpatch warnings in calls to udelay()Simon Glass
Fix up some incorrect code style in calls to functions in the linux/time.h header, mostly udelay(). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop linux/stringify.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop linux/bug.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop asm/ptrace.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop log.h from common headerSimon Glass
Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18Fix some checkpatch warnings in calls to debug()Simon Glass
Fix up some incorrect code style in calls to functions in the log.h header, mostly debug(). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18command: Remove the cmd_tbl_t typedefSimon Glass
We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop init.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop image.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop bootstage.h from common headerSimon Glass
Move this fairly uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop part.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18part: Drop disk_partition_t typedefSimon Glass
We should not be using typedefs and these make it harder to use forward declarations (to reduce header file inclusions). Drop the typedef. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop net.h from common headerSimon Glass
Move this header out of the common header. Network support is used in quite a few places but it still does not warrant blanket inclusion. Note that this net.h header itself has quite a lot in it. It could be split into the driver-mode support, functions, structures, checksumming, etc. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop flash.h from common headerSimon Glass
Move this uncommon header out of the common header. Fix up some style problems in flash.h while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18flash: Tidy up coding style for flash functionsSimon Glass
Some functions use the wrong code style and generate checkpatch errors. Fix these. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop uuid.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-17cmd: efidebug: Add support for querying UEFI variable storageIlias Apalodimas
With the previous patches that use OP-TEE and StandAloneMM for UEFI variable storage we've added functionality for efi_query_variable_info. So let's add the relevant command to efidebug and retrieve information about the container used to store UEFI variables Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2020-05-17efi_loader: round the memory area in efi_add_memory_map()Michael Walle
Virtually all callers of this function do the rounding on their own. Some do it right, some don't. Instead of doing this in each caller, do the rounding in efi_add_memory_map(). Change the size parameter to bytes instead of pages and remove aligning and size calculation in all callers. There is no more need to make the original efi_add_memory_map() (which takes pages as size) available outside the module. Thus rename it to efi_add_memory_map_pg() and make it static to prevent further misuse outside the module. Signed-off-by: Michael Walle <michael@walle.cc> Add missing comma in sunxi_display.c. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-05-11Merge tag 'efi-2020-07-rc2-4' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-07-rc2-4 This pull request comprises: * bug fixes * documentation fixes * a new function to determine u16 string sizes and its unit test
2020-05-11Nokia RX-51: Update my email addressPali Rohár
I'm using a new email address, so reflect this state also in U-Boot. Signed-off-by: Pali Rohár <pali@kernel.org>
2020-05-10cmd: efidebug: fix -Werror=type-limits warningHeinrich Schuchardt
Compiling with -Wtype-limits yields: cmd/efidebug.c:968:32: error: comparison is always false due to limited range of data type [-Werror=type-limits] 968 | if (*endp != '\0' || bootnext > 0xffff) { | Remove the superfluous check. Fixes: 59df7e7e77e7 ("cmd: add efidebug command") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-05-09cmd: efidebug: add a comment against Coverity check (300329)AKASHI Takahiro
The check here, "Null pointer dereferences," is a false positive. So leave a comment. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reported-by: Coverity (CID 300329)
2020-05-09cmd: efidebug: fix a wrong handling of argumentsAKASHI Takahiro
Coverity detected a dead code, but actually there is a bug in a check against a number of arguments. So simply fix it. Reported-by: Coverity (CID 300330) Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-05-08Merge tag 'efi-2020-07-rc2-3' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-07-rc2-3 This series contains bug fixes and code simplifications. Following clarification in the discussion of the EBBR specification device trees will be passed as EfiACPIReclaimMemory to UEFI applications.
2020-05-08treewide: mem: Move mtest related defines to KconfigAshok Reddy Soma
Move below defines which are used by mtest utility to Kconfig. CONFIG_SYS_MEMTEST_START CONFIG_SYS_MEMTEST_END Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> [trini: Fix kmcoge5ne board, re-run migration as well] Signed-off-by: Tom Rini <trini@konsulko.com>
2020-05-08cmd: mem: Remove CONFIG_SYS_MEMTEST_SCRATCH mappingMichal Simek
There is no real need to exactly define space for saving patterns for alternate memory test. It is much easier to allocate space on the stack and use it instead of trying to find out space where pattern should be saved. For example if you want to test the whole DDR memory you can't save patter to DDR and you need to find it out. On Xilinx devices DDR or OCM addresses were chosen but that means that OCM needs to be mapped and U-Boot has access permission there. It is easier to remove this limitation and simply save it on stack because it is very clear that memory test can't rewrite U-Boot and U-Boot has also full access to memory where runs from. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
2020-05-07efi_loader: put device tree into EfiACPIReclaimMemoryHeinrich Schuchardt
According to the UEFI spec ACPI tables should be placed in EfiACPIReclaimMemory. Let's do the same with the device tree. Suggested-by: Ard Biesheuvel <ardb@kernel.org> Cc: Grant Likely <grant.likely@arm.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-05-07efi_loader: use logical and in do_env_print_efi()Heinrich Schuchardt
If we want to check if two booleans are true, we should use a logical conjunction (&&) and not a bitwise and-operator (&). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>