aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-20binman: Select compression bintools in cbfs_util classStefan Herbrechtsmeier
Select the lz4 and lzma_alone bintools in cbfs_util class to centralize the supported compression algorithm evaluation inside the class and over multiple classes. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Move compression bintools creation into test setupStefan Herbrechtsmeier
Move compression bintools (packer) creation into test setup to reuse bintool objects between tests. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org> Put comp_util import back in, since it is still needed here: Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Remove obsolete compressed data header handlingStefan Herbrechtsmeier
Remove the obsolete compressed data header handling from the utilities to compress and decompress data. The header is uncommon, not supported by U-Boot and incompatible with external compressed artifacts. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Disable compressed data headerStefan Herbrechtsmeier
Disable the compressed data header of the utilities to compress and decompress data. The header is uncommon, not supported by U-Boot and incompatible with external compressed artifacts. The header was introduced as part of commit eb0f4a4cb402 ("binman: Support replacing data in a cbfs") to allow device tree entries to be larger than the compressed contents. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Add length header attribute to dtb entryStefan Herbrechtsmeier
Add an optional length header attribute to the device tree blob entry class based on the compressed data header from the utilities to compress and decompress data. If needed the header could be enabled with the following attribute beside the compress attribute: prepend = "length"; The header was introduced as part of commit eb0f4a4cb402 ("binman: Support replacing data in a cbfs") to allow device tree entries to be larger than the compressed contents. Regarding the commit "this is necessary to cope with a compressed device tree being updated in such a way that it shrinks after the entry size is already set (an obscure case)". This case need to be fixed without influence any compressed data by itself. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Add DecompressData function to entry classStefan Herbrechtsmeier
Add a DecompressData function to entry class to allow override in child classes and to centralize the compress and decompress in a single class. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Check only section data in multi section testStefan Herbrechtsmeier
Check only section data instead of the rest of the image in multi section test. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Collect bintools before usageStefan Herbrechtsmeier
Collect and thereby initialize bintools before any usage but after generation of entries. This is needed to handle bintools for compress and decompress like other bintools. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Forward AddBintools calls to base classStefan Herbrechtsmeier
Forward AddBintools calls to base class to collect bintools of base class. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Forward AddBintools calls to sub entries in cbfs_utilStefan Herbrechtsmeier
Forward AddBintools calls to sub entries in cbfs_util to collect bintools of sub entries. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Avoid duplicates in bintool listsStefan Herbrechtsmeier
Avoid duplicate entries in the list of bintools used by the image and the list of missing bintools. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Skip elf tests if python elftools is not availableStefan Herbrechtsmeier
Skip tests which requires python elftools if the tool is not available. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Allow collection to use entries from other sectionsSimon Glass
At present the collections etype only works with entries in the same section. This can be limiting, since in some cases the data may be inside a subsection, e.g. if there are alignment constraints. Add a function to find the entries in an etype and have it search recursively. Make use of this for mkimage also. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Allow passing entries using -nSimon Glass
Also control over what goes in the file passed with -n using a separate imagename subnode. This can include a section or any other entry type. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Allow the image name to be the data fileSimon Glass
Some image types use the -n parameter to pass in the data file. Add support for this, with a new property. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Improve mkimage documentationSimon Glass
Expand this a little to make things clearer. Also drop the invalid entry arg. Series-changes 2 - Make it clear that -d data is concatenated/collected by binman - Fix mulitple typoe - Reword a sentence for grammar Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Avoid use of expected failureSimon Glass
The testReplaceSectionSimple() test is the only one which expects failure. It looks odd in the output and takes time to glance at it to see that all is in fact well. Also it does not check that the right exception is generated. Use the more common (in binman) approach of checking for an exception. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Adjust mkimage etype node readingSimon Glass
Since this is implemented as a section, it should really be split into several functions, one to read the node and one to read the entries. Do this so that it matches how Entry_section works. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Add a way to check for missing propertiesSimon Glass
Some new entries are likely to have required properties. Support this in a standard way, with a list of required properties which can be set up by base classes. Check for missing properties when the entry is read. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Fix up the entry-docs for Entry_pre_loadSimon Glass
This has got out of sync and needs a line wrap. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20patman: Don't buffer test output with a single testSimon Glass
When a single test is run we don't need to buffer the test output. This has the unfortunate side effect of suppressing test output, in particular the binman output directory normally printed with the -X option. This is a huge problem since it blocks debugging of tests. We don't actually know how many tests will be run when we set up the suite, so as a work-around, assume that test_name being specified indicates that there is likely only one. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20patman: Put the coverage command-line lastSimon Glass
Put this at the end so it is easier to copy it from the terminal. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20bootstage: Show func name for bootstage_mark/errorMichal Simek
bootstage_mark() and bootstate_error() are not recording any name and in report it is showing as id=<value>. That's not useful and it is better to show function name which calls it. That's why use macros with passing __func__ as recorded name for bootstage. Origin report looks like this: ZynqMP> bootstage report Timer summary in microseconds (10 records): Mark Elapsed Stage 0 0 reset 2,482,383 2,482,383 board_init_f 4,278,821 1,796,438 board_init_r 4,825,331 546,510 id=64 4,858,409 33,078 id=65 4,862,382 3,973 main_loop 4,921,713 59,331 usb_start 9,345,345 4,423,632 id=175 When this patch is applied. ZynqMP> bootstage report Timer summary in microseconds (31 records): Mark Elapsed Stage 0 0 reset 2,465,624 2,465,624 board_init_f 4,278,628 1,813,004 board_init_r 4,825,139 546,511 eth_common_init 4,858,228 33,089 eth_initialize 4,862,201 3,973 main_loop 4,921,530 59,329 usb_start 8,885,334 3,963,804 cli_loop Signed-off-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20log: Drop log_nop() functionsSimon Glass
These functions are not needed anymore since we now have logic which can output to the console if logging is disabled. Drop the declarations. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20binman: Put fake files in a subdirectorySimon Glass
At present fake files from a previous build appear to be real files for a subsequent build, since they sit in the output directory. This can cause problems, since binman may need to parse the file, e.g. with the Intel description.bin files. Fix this by putting them in a 'binman-fake' subdirectory. Keep a track of the fake filename so we only create it once. Subsequent builds will still see that the file is missing and mark it as fake. Update a few tests to check the behaviour. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20Merge branch '2022-08-20-assorted-updates'Tom Rini
- Assorted updates including some updates to the rx_51 platform
2022-08-20gpio: aspeed: port Linux dt-bindings header fileDhananjay Phadke
Makes it easier to add readable GPIO definitions in DTS files for Aspeed SOC based boards. Ported with small edits to add IBM copyright statement and fix for checkpatch warning. Signed-off-by: Dhananjay Phadke <dphadke@linux.microsoft.com> Reviewed-by: Billy Tsai <billy_tsai@aspeedtech.com> Acked-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2022-08-20hwconfig: Allow to use restricted envPali Rohár
During early boot phase GD_FLG_ENV_READY is not set but env_get() may work when env is ready in restricted mode. Do not fail with error message "WARNING: Calling __hwconfig without a buffer and before environment is ready" when env is already working by checking for ENV_VALID flag. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-08-20arm: k3: Correct an awk warningSimon Glass
The k3_gen_x509_cert.sh script produced this warning on gitlab and also on my machine, e.g. with j7200_evm_r5: awk: cmd. line:1: warning: regexp escape sequence `\ ' is not a known regexp operator There is no need to escape spaces, so drop the backslashes. Also split the line so it is a more reasonable length. This script should really be deleted and binman used instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-20arm64: explicitly disable pointer authentication instructionsRasmus Villemoes
The Yocto project builds their aarch64 cross-compiler with the configure knob --enable-standard-branch-protection, which means that their gcc behaves as if -mbranch-protection=standard is passed; the default (lacking that configure knob) is -mbranch-protection=none. This means that when building U-Boot using the Yocto toolchain, most functions end up containing paciasp/autiasp/bti instructions. However, since U-Boot is not an ordinary userspace application, there's no OS kernel which has set up the required authentication keys, so these instructions do nothing at all (even on arm64 hardware that does have the pointer authentication capability). They do however make the image larger. It is theoretically possible for U-Boot to make use of the pointer authentication protection - cf. the linux kernel's CONFIG_ARM64_PTR_AUTH_KERNEL - but it is far from trivial, and it's hard to see just what threat model it would protect against in a bootloader context. Regardless, we certainly have none of the required infrastructure now, so explicitly pass -mbranch-protection=none to ensure those useless instructions do not get emitted. For a toolchain not configured with --enable-standard-branch-protection, this changes nothing. For the Yocto toolchain, this reduces the size of both SPL and U-Boot proper by about 3% for my imx8mp target. If you don't have a Yocto toolchain, the effect can easily be reproduced by applying this patch and changing =none to =standard. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-20Restore pcm051_rev3_defconfig configMatwey V. Kornilov
pcm051_rev3_defconfig config (Phytec Wega board) has been dropped in 64efd11d ("arm: Remove pcm051 board") due to expired migration deadlines. Here, pcm051_rev3_defconfig support is reintroduced. Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2022-08-20Nokia RX-51: Move board required options from defconfig to KconfigPali Rohár
Some of config options are board specific and should be set in into their default values automatically. So move them from defconfig file to Kconfig definitions to ensure that possible user custom defconfig files would have these required options also enabled. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-08-20Nokia RX-51: Simplify calculation of attached kernel image addressPali Rohár
Now when board starup code does not copy image to CONFIG_SYS_TEXT_BASE address there is no need to calculate all addresses from base address at runtime. The only address which needs to be calculated is attached kernel image address which can be simplified at compile time without need to know CONFIG_SYS_TEXT_BASE address or relocation address at the runtime. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-08-20Nokia RX-51: Simplify copy kernel codePali Rohár
Expression (r + (r0 - r1)) produce same result as (r - (r1 - r0)). So it does not matter which one is called. Always call the first option and remove second one. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-08-20Nokia RX-51: Use U-Boot generic position independent codePali Rohár
Switch from custom board specific fixup/copy code to U-Boot generic position independent code provided by config option POSITION_INDEPENDENT. This also slightly decrease size of u-boot.bin binary (by 52 bytes). Note that option POSITION_INDEPENDENT increase size but not more than custom board fixup/copy code which is being deleted (as it is not needed anymore). Signed-off-by: Pali Rohár <pali@kernel.org>
2022-08-20Nokia RX-51: Fix invalidating zImage kernel formatPali Rohár
Prior starting copy of kernel image to target location, invalidate also zImage magic header. This ensures that on target location would be image with valid header only in the case valid header was also in the source location and copy from source to target finished successfully. Copy is always skipped when kernel image in source location is invalid. Add also comment to the code which explain what is the code doing. Fixes: cc434fccba4c ("Nokia RX-51: Add support for booting kernel in zImage format") Signed-off-by: Pali Rohár <pali@kernel.org>
2022-08-20arm: Set default MACH_TYPE in KconfigPali Rohár
For boards which requires correct MACH_TYPE, set their correct default values directly in Kconfig. Signed-off-by: Pali Rohár <pali@kernel.org>
2022-08-20MAINTAINERS: Update email of Neil ArmstrongNeil Armstrong
My professional e-mail will change and the BayLibre one will bounce after mid-september of 2022. This updates the MAINTAINERS files and adds an entry in the .mailmap file. Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2022-08-20Merge tag 'efi-2022-10-rc3-2' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-10-rc3-2 Documentation: * improve description of device probing * describe booting RISC-V with KVM and QEMU UEFI * fix Makefile for mkeficapsule
2022-08-20tools: mkeficapsule: use pkg-config for each lib separatHeiko Thiery
Call pkg-config for each library individually. This improves fallback handling. Suggested-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Fixes: 31a7688cbe0e ("tools: mkeficapsule: use pkg-config to get -luuid and -lgnutls") Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-08-20efi_loader: disk: remove unused fieldAKASHI Takahiro
The field, ifname, in efi_disk_obj is set but never used anywhere. Just remove it. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-08-20doc: dm: clarify activation.Michal Suchanek
Explain when devices should get activated. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-08-20doc: qemu-riscv: describe booting with QEMU and KVMHeinrich Schuchardt
The ELF U-Boot image produced by qemu-riscv64_smode_defconfig can be used to boot with QEMU and KVM. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-08-17Merge tag 'fsl-qoriq-2022-8-17' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq Enable SPL authentication for ls1021atwr Fdt fixups for ls1043ardb v7.0 board
2022-08-16board: ls1043ardb: fdt fixups for revision v7.0 boardsCamelia Groza
The LS1043ARDB rev v7.0 board replaces the AQR105 PHY on MAC9 with an AQR113C PHY. The address of the PHY on the MDIO bus changes from 0x1 to 0x8. Enable CONFIG_OF_BOARD_FIXUP and update both u-boot and Linux device trees to reflect this change. Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
2022-08-16ls1021atwr: caam: Enable Uboot validaion in SPL.Gaurav Jain
caam driver model enabled in spl for secure boot. fsl_rsa_mod_exp driver enabled in spl for validating uboot image. Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
2022-08-13Merge tag 'efi-2022-10-rc3' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-10-rc3 Documentation: * Add HTML documentation for patman * Improve binman documentation * Man-page for gpio UEFI: * move udevice pointer into struct efi_object * fix efi_convert_device_path_to_text() Other: * fs/erofs: silence messages from erofs_probe()
2022-08-13cmd: efidebug: Add missing \n at the end of messageMichal Simek
Currently message is not intended that prompt end up at the end of debug line. For example like this: DFU alt info setting: done DFU entities configuration failed! (partition table does not match dfu_alt_info?) Firmware update failed: <NULL> Cannot handle a capsule at 10000000Zynq> Signed-off-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-08-13efi_loader: move udevice pointer into struct efi_objectMasahisa Kojima
This is a preparation patch to provide the unified method to access udevice pointer associated with the EFI handle by adding udevice pointer into struct efi_object. The patch also introduces a helper function efi_link_dev() to link the udevice and EFI handle. The EFI handles of both EFI block io driver implemented in lib/efi_loader/efi_disk.c and EFI block io driver implemented as EFI payload can access the udevice pointer in the struct efi_object. We can use this udevice pointer to get the U-Boot friendly block device name(e.g. mmc 0:1, nvme 0:1) through EFI handle. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-08-13efi_loader: fix efi_convert_device_path_to_text()Heinrich Schuchardt
Ensure that the string we convert to UTF-16 is NUL terminated even if the device path only contains end nodes. Fixes: bd3d75bb0c58 ("efi_loader: multi part device paths to text") Addresses-Coverity: 350434 ("Uninitialized scalar variable") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>