summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2023-04-04CI: Move to clang-16Tom Rini
As this is now the stable release, move to using that now for our tests. Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-04Dockerfile: Populate a pip cacheTom Rini
Given the number of jobs in CI we have which use python and pip install packages, we should do this once in the Dockerfile, in order to populate the cache. We let each job continue to create and use the virtual environments they need to facilitate making updates to these environments easier. Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-04-03Merge branch 'next'Tom Rini
Signed-off-by: Tom Rini <[email protected]>
2023-03-31buildman: Correct overwriting of settings fileSimon Glass
The toolchain test causes the settings file to be overwritten, which is annoying for local development. Fix it by passing None as the filename. Signed-off-by: Simon Glass <[email protected]>
2023-03-29arm: dts: iot2050: Optionally embed OTP programming data into imageJan Kiszka
Use external blob otpcmd.bin to replace the 0xff filled OTP programming command block to create a firmware image that provisions the OTP on first boot. This otpcmd.bin is generated from the customer keys using steps described in the meta-iot2050 integration layer for the device. Based on original patch by Baocheng Su. Signed-off-by: Jan Kiszka <[email protected]>
2023-03-29iot2050: Add script for signing artifactsJan Kiszka
There are many ways to get a signed firmware for the IOT2050 devices, namely for the parts under user-control. This script documents one way of doing it, given a signing key. Augment the board documentation with the required procedure around it. Signed-off-by: Jan Kiszka <[email protected]>
2023-03-29tools: Add script for converting public key into device tree includeJan Kiszka
Allows to create a public key device tree dtsi for inclusion into U-Boot SPL and proper during first build already. This can be achieved via CONFIG_DEVICE_TREE_INCLUDES. Signed-off-by: Jan Kiszka <[email protected]>
2023-03-29iot2050: Update firmware layoutJan Kiszka
The latest version of the binary-only firmware parts come in a combined form of FSBL and sysfw containers. This implies some layout changes to the generated firmware image but also makes handling of artifacts much simpler (4 files less). The env locations will not change, just the space reserved for U-Boot will shrink from 4 to 3 MB - still plenty of space left in practice. Adjust configuration and documentation accordingly. Along this change, add a new reservation for update commands of the user-controlled OTP part. A specific userspace tool will fill it, and the FSBL will evaluate it during boot. This reservation will use 64K of the former sysfw section. Signed-off-by: Jan Kiszka <[email protected]>
2023-03-24tools: kwboot: Document information about NOR XIPPali Rohár
Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2023-03-24tools: kwboot: Workaround A38x BootROM bug for images with a gapPali Rohár
A38x BootROM has a bug which cause that BootROM loads data part of UART image into RAM target address increased by one byte when source address and header size stored in the image header are not same. Workaround this bug by completely removing a gap between header and data part of the UART image. Without gap, this BootROM bug is not triggered. This gap can be present in SDIO or SATA image types which have aligned start of the data part to the media sector size. With this workaround kwboot should be able to convert and send SDIO or SATA images for UART booting. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2023-03-24tools: kwboot: Fix sending very small imagesPali Rohár
Sending of very small images (smaller than 128 bytes = xmodem block size) cause out-of-bound memory read access. Fix this issue by ensuring that hdrsz when sending image is not larger than total size of the image. Issue was introduced in commit f8017c37799c ("tools: kwboot: Fix sending Kirkwood v0 images"). Special case when total image is smaller than header size aligned to multiply of xmodem size is already handled since that commit. Fixes: f8017c37799c ("tools: kwboot: Fix sending Kirkwood v0 images") Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2023-03-24tools: kwboot: Fix inserting UART data checksum without -B optionPali Rohár
Commit 7665ed2fa04e ("tools: kwboot: Fix parsing UART image without data checksum") added fixup code to insert place for data checksum if UART image does not have it. Together with option -B (change baudrate), kwboot calculates this checksum. Without option -B, it inserts only place for checksum but does not calculate it. This commit fix above logic and calculate data checksum also when kwboot is used without -B option. Fixes: 7665ed2fa04e ("tools: kwboot: Fix parsing UART image without data checksum") Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2023-03-24tools: kwboot: Fix invalid UART kwbimage v1 headerszPali Rohár
Ensure that UART aligned header size is always stored into kwbimage v1 header. It is needed for proper UART booting. Calculation of headersz field was broken in commit d656f5a0ee22 ("tools: kwboot: Calculate real used space in kwbimage header when calling kwboot_img_grow_hdr()") which introduced optimization of kwboot_img_grow_hdr() function. Fixes: d656f5a0ee22 ("tools: kwboot: Calculate real used space in kwbimage header when calling kwboot_img_grow_hdr()") Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2023-03-24tools: kwbimage: Fix invalid UART kwbimage v1 headerszPali Rohár
Armada 385 BootROM ignores low 7 bits of headersz when parsing kwbimage header of UART type, which effectively means that headersz is rounded down to multiply of 128 bytes. For all other image types BootROM reads and use all bits of headersz. Therefore fill into UART type of kwbimage v1 headersz aligned to 128 bytes. Fixes: 2b0980c24027 ("tools: kwbimage: Fill the real header size into the main header") Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2023-03-22proftool: Remove unused variables in make_flame_treeTom Rini
With clang-15 we now get reported that in the make_flame_tree function, neither the missing_count nor depth variables are used, only incremenete/decremented. Remove these. Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-03-22imx8image: Remove unused cont_img_count variableTom Rini
With clang-15, it is now reported that cont_img_count is unused. This is true as the code will increment / reset this counter, but never functionally use it. Remove it. Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Fabio Estevam <[email protected]> Reviewed-by: Peng Fan <[email protected]>
2023-03-21Dockerfile: Update to latest "Jammy" tagTom Rini
Update to using the latest "Jammy" tag as our base. Signed-off-by: Tom Rini <[email protected]>
2023-03-21Dockerfile: Add m68k-softmmu to qemuTom Rini
Given efforts to add an m68k target to CI, build qemu for it. Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
2023-03-16Merge tag 'xilinx-for-v2023.07-rc1' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-microblaze into next Xilinx changes for v2023.07-rc1 cmd: - Print results in hex instead of dec in smc command firmware: - Cover missing ZYNQMP_FIRMWARE dependencies fpga: - fix loads for unencrypted use case relocation - Add support for BE systems spi: - Fix xilinx_spi init reset sequence arasan nand: - Remove hardcoded bbt option - Set ofnode value xilinx: - Enable SMC command - Fix some sparse issues zynqmp: - Remove cdns,zynq-gem compatible string - Add optee node - Some DT cleanups zynq: - Some DT cleanups microblaze - Remove MANUAL_RELOC option
2023-03-16Merge tag 'dm-next-12mar23a' of git://git.denx.de/u-boot-dm into nextTom Rini
More tests and fixes for fdt command binman signing feature fix buildman -A bug introduced recently Signed-off-by: Tom Rini <[email protected]>
2023-03-14buildman: Fix CROSS_COMPILE output for sandboxSimon Glass
The previous attempt at fixing this broke the normal usage of the -A flag. At present, 'buildman -A sandbox' adds the path containing the toolchain. We can assume that this is in the path and we don't want to set CROSS_COMPILE=/bin/ Change this to align with what MakeEnvironment() does, but only for sandbox boards. Signed-off-by: Simon Glass <[email protected]>
2023-03-14Revert "buildman: Correct CROSS_COMPILE output for sandbox"Simon Glass
This reverts commit bd0a548ad4a155fec29473d4cc8e135832926973. Signed-off-by: Simon Glass <[email protected]>
2023-03-14tools: add fdt_add_pubkeyRoman Kopytin
Having to use the -K option to mkimage to populate U-Boot's .dtb with the public key while signing the kernel FIT image is often a little awkward. In particular, when using a meta-build system such as bitbake/Yocto, having the tasks of the kernel and U-Boot recipes intertwined, modifying deployed artifacts and rebuilding U-Boot with an updated .dtb is quite cumbersome. Also, in some scenarios one may wish to build U-Boot complete with the public key(s) embedded in the .dtb without the corresponding private keys being present on the same build host. So this adds a simple tool that allows one to disentangle the kernel and U-Boot builds, by simply copy-pasting just enough of the mkimage code to allow one to add a public key to a .dtb. When using mkimage, some of the information is taken from the .its used to build the kernel (algorithm and key name), so that of course needs to be supplied on the command line. Signed-off-by: Roman Kopytin <[email protected]> Signed-off-by: Ivan Mikhaylov <[email protected]> Signed-off-by: Jan Kiszka <[email protected]> Cc: Rasmus Villemoes <[email protected]>
2023-03-14binman: add tests for sign optionIvan Mikhaylov
Add the test which provides sequence of actions: 1. create the image from binman dts 2. create public and private keys 3. add public key into dtb with fdt_add_pubkey 4. 1. sign FIT container with new sign option with extracting from image 2. sign exact FIT container with replacing of it in image 5. check with fit_check_sign Signed-off-by: Ivan Mikhaylov <[email protected]> Renumber test file from 277 to 280; Move UpdateSignatures() to Entry base class; Don't allow missing mkimage as it doesn't make sense; Propagate --toolpath for CI; Call mark_build_done() to avoid regenerating FIT: Signed-off-by: Simon Glass <[email protected]>
2023-03-14binman: add sign option for binmanIvan Mikhaylov
Introduce proof of concept for binman's new option which provides sign and replace FIT containers in binary images. Usage as example: from: mkimage -G privateky -r -o sha256,rsa4096 -F fit binman replace -i flash.bin -f fit.fit fit to: binman sign -i flash.bin -k privatekey -a sha256,rsa4096 -f fit.fit fit and to this one if it's need to be extracted, signed with key and put it back in image: binman sign -i flash.bin -k privatekey -a sha256,rsa4096 fit Signed-off-by: Ivan Mikhaylov <[email protected]>
2023-03-14binman: add documentation for binman sign optionIvan Mikhaylov
Add the documentation about binman sign option and providing an example. Signed-off-by: Ivan Mikhaylov <[email protected]> Add a section about 'binman sign' at the bottom: Signed-off-by: Simon Glass <[email protected]>
2023-03-14Merge tag 'v2023.04-rc4' into nextTom Rini
Prepare v2023.04-rc4 Signed-off-by: Tom Rini <[email protected]>
2023-03-13tools: relocate-rela: add support for handling 32-bit big endian filesOvidiu Panait
Currently, a microblaze build with CONFIG_SYS_BIG_ENDIAN=y and CONFIG_STATIC_RELA=y fails with: tools/relocate-rela: Not supported machine type ELF decoding failed make[2]: *** [u-boot/Makefile:1306: u-boot-nodtb.bin] Error 1 To fix this, convert the 32-bit codepath to use the previously added elf{16,32}_to_cpu() functions. The aarch64 codepath is left untouched. This commit ensures that CI doesn't fail for the next patches which enable runtime relocation by default for microblaze. Reviewed-by: Michal Simek <[email protected]> Signed-off-by: Ovidiu Panait <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2023-03-13tools: relocate-rela: introduce elf16_to_cpu() and elf32_to_cpu()Ovidiu Panait
Add elf16_to_cpu() and elf32_to_cpu() functions that allow to read data in both big-endian and little-endian formats. Reviewed-by: Michal Simek <[email protected]> Signed-off-by: Ovidiu Panait <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2023-03-13tools: relocate-rela: adjust le64_to_cpu -> le32_to_cpu in decode_elf32()Ovidiu Panait
The sh_addr/sh_offset/sh_size fields in Elf32_Shdr are 32-bits wide, so use le32_to_cpu() instead of the 64-bit variant. Fixes: 5e0e1a86d327 ("tools: relocate-rela: Fix ELF decoding on big-endian hosts") Reviewed-by: Michal Simek <[email protected]> Signed-off-by: Ovidiu Panait <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2023-03-08binman: Support generation of x509 certificatesSimon Glass
And a new entry type which supports generation of x509 certificates. This uses a new 'openssl' btool with just one operation so far. Signed-off-by: Simon Glass <[email protected]>
2023-03-08binman: Support updating section contentsSimon Glass
Implement this feature since it is useful for updating FITs within an image. Signed-off-by: Simon Glass <[email protected]>
2023-03-08binman: Handle missing bintools correctly in fitSimon Glass
At present these are handled as if they are allowed to be missing, but this is only true if the -M flag is provided. Fix this and add a test. Signed-off-by: Simon Glass <[email protected]>
2023-03-08binman: Allow preserving the output dir when replacingSimon Glass
Add these flags for the 'replace' subcommand too, to aid debugging. Signed-off-by: Simon Glass <[email protected]> 44 2023 -0700
2023-03-08buildman: Correct CROSS_COMPILE output for sandboxSimon Glass
At present, 'buildman -A sandbox' adds the path containing the toolchain at present. We can assume that this is in the path and we don't want to set CROSS_COMPILE=/bin/ so change this to align with what MakeEnvironment() does. Signed-off-by: Simon Glass <[email protected]>
2023-03-08patman: Check patches in parallelSimon Glass
For large series this can take a while. Run checkpatch in parallel to try to reduce the time. The checkpatch information is still reported in sequential order, so a very slow patch at the start can still slow things down. But overall this gives good results. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Douglas Anderson <[email protected]>
2023-03-08patman: Run get_maintainer.pl in parallelSimon Glass
This script can take ages on some series. Try to limit the time by using threads. If a few stubborn patches remain, show progress so the user has some idea what is going on. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Douglas Anderson <[email protected]>
2023-03-08patman: Refactor MakeCcFile() into two functionsSimon Glass
This function is quite long. Moving the handling of a commit into a separate function. This will make it easier to do the work in parallel. Update function comments while we are here. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Douglas Anderson <[email protected]>
2023-03-08patman: Drop an incorrect comment about git amSimon Glass
Patman does not do this anymore, as of this commit: 7428dc14b0f ("patman: Remove the -a option") Drop the comment. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Douglas Anderson <[email protected]>
2023-03-08doc: Add notes on how to install patman and binmanSimon Glass
These can be installed with 'pip' now. Add the details for those who are interested. Signed-off-by: Simon Glass <[email protected]>
2023-03-08binman: Add support for building a binmanu PyPi packageSimon Glass
Create the necessary files to build this new package. It is not actually clear whether this is useful, since buildman has no purpose outside U-Boot. Move the main program into a function so that it can easily be called by the PyPi-created script. Signed-off-by: Simon Glass <[email protected]>
2023-03-08binman: Use importlib to find the helpSimon Glass
Use this function so that the help can be found even when binman is running from a package. Signed-off-by: Simon Glass <[email protected]>
2023-03-08binman: Hide the 'test' command unless test code is availableSimon Glass
It doesn't make much sense to expose tests when dtoc is running outside of the U-Boot git checkout. Hide the option in this case. Fix a long line while we are here. Signed-off-by: Simon Glass <[email protected]>
2023-03-08binman: Move the main code into a functionSimon Glass
Put this code into a function so it is easy for it be run when packaged. Signed-off-by: Simon Glass <[email protected]>
2023-03-08dtoc: Add support for building a dtoc PyPi packageSimon Glass
Create the necessary files to build this new package. This is needed for binman. Move the main program into a function so that it can easily be called by the PyPi-created script. Signed-off-by: Simon Glass <[email protected]>
2023-03-08dtoc: Use pathlib to find the test directorySimon Glass
Update this so that the directory being used is declared at the top of the file. Use pathlib as it seems to be more modern. Signed-off-by: Simon Glass <[email protected]>
2023-03-08dtoc: Move the main code into a functionSimon Glass
Put this code into a function so it is easy for it be run when packaged. Signed-off-by: Simon Glass <[email protected]>
2023-03-08dtoc: Hide the test options unless test code is availableSimon Glass
It doesn't make much sense to expose tests when dtoc is running outside of the U-Boot git checkout. Hide the option in this case. Signed-off-by: Simon Glass <[email protected]>
2023-03-08buildman: Add support for building a buildman PyPi packageSimon Glass
Create the necessary files to build this new package. It is not actually clear whether this is useful, since buildman has no purpose outside U-Boot. It is included for completeness, since adding this later would be more trouble. Move the main program into a function so that it can easily be called by the PyPi-created script. Signed-off-by: Simon Glass <[email protected]>
2023-03-08buildman: Use importlib to find the helpSimon Glass
Use this function so that the help can be found even when buildman is running from a package. Signed-off-by: Simon Glass <[email protected]>