summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2022-01-19doc: replace @return by Return:Heinrich Schuchardt
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-14tools: kwbimage: Fix mkimage/dumpimage -l argumentPali Rohár
Do not check for kwbimage configuration file when just showing information about existing kwbimage file. The check for kwbimage configuration file is required only when creating kwbimage, not when showing information about image or when extracting data from image. With this change, it is possible to call mkimage -l and dumpimage -l also for existing kwbimage file. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage: Extract main data image without -p arg for dumpimagePali Rohár
When there is no -p argument for dumpimage tool specified, extract the main data image from kwbimage file. This makes dumpimage consistent with other image formats. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage/kwboot: Check ext field for non-zero valuePali Rohár
Despite the official specification, BootROM does not look at the lowest bit of ext field but rather checks if ext field is non-zero. Moreover original Marvell doimage tool puts into the mhdr->ext field the number of extended headers, so basically it sets ext filed to non-zero value if some extended header is present. Fix U-Boot dumpimage and kwboot tools to parse correctly also kwbimage files created by Marvell doimage tool, in the same way as the BootROM is doing it when booting these images. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage: Do not cast const pointers to non-const pointersPali Rohár
Avoid casting const to non-const. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage: Dump kwbimage config file on '-p -1' optionPali Rohár
To regenerate kwbimage from existing image, it is needed to have kwbimage config file. Add a new option to generate kwbimage config file from existing kwbimage when '-p 1' option is given. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage: Show binary image offset in mkimage -l, in addition to sizePali Rohár
For debugging purposes it is good to know where the binary image would be loaded and also it is needed to know if printed size is image size or the size of header together with image. Make it unambiguous by showing that printed size is not the size of the whole header, but only the size of executable code, and print also the executable offset of this binary image. Load/execute address is the offset relative to the base address (either 0x40004000 or 0x40000000). Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage: Add missing check for maximal value for DATA_DELAYPali Rohár
Data delay is stored as 8-bit number in kwbimage structure. Ensure the given value is at most 255. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage: Enforce 128-bit boundary alignment only for Sheeva CPUPali Rohár
This alignment is required only for platforms based on Sheeva CPU core which are A370 and AXP. Now when U-Boot build system correctly propagates LOAD_ADDRESS there is no need to have enabled 128-bit boundary alignment on platforms which do not need it. Previously it was required because load address was implicitly rounded to 128-bit boundary and U-Boot build system expected it and misused it. Now with explicit setting of LOAD_ADDRESS there is no guessing for load address anymore. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage: Check for maximal kwbimage header sizePali Rohár
BootROM loads kwbimage header to L2-SRAM and BootROM reserve only 192 kB for it. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage: Check the return value of image_headersz_v1()Pali Rohár
Function image_headersz_v1() may return zero on fatal errors. In this case the function already printed an error message. Check the return value of image_headersz_v1() in kwbimage_generate(), and exit on zero value with EXIT_FAILURE. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage: Add support for specifying LOAD_ADDRESS for BINARY commandPali Rohár
ARM executable code included in kwbimage binary header, which is not position independent, needs to be loaded and executed by BootROM at the correct fixed address. Armada BootROMs load kwbimage header (in which the executable code is also stored) at fixed address 0x40004000 or 0x40000000 which is mapped to L2-SRAM (L2 Cache as SRAM). Address 0x40004000 is used on Armada platforms with Sheeva CPU core (A370 and AXP) where BootROM uses MMU with 0x4000 bytes for MMU translation table. Address 0x40000000 is used on all other platforms. Thus the only way to specify load and execute address of this executable code in binary kwbimage header is by filling dummy arguments into the binary header, using the same mechanism we already have for achieving 128-bit boundary alignment on A370 and AXP SoCs. Extend kwbimage config file parser to allow to specify load address as part of BINARY command with syntax: BINARY path_to_binary arg1 arg2 ... argN LOAD_ADDRESS address If the specified load address is invalid or cannot be used, mkimage will throw fatal error and exit. This will prevent generating kwbimage with invalid load address for non-position independent binary code. If no load address is specified, kwbimage will not fill any the dummy arguments, thus it will behave the same as before this change. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage: Add support for specifying CPU corePali Rohár
For other changes it is required to know if CPU core is Sheeva or not. Therefore add a new command CPU for specifying CPU. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage: Preserve order of BINARY, DATA and DATA_DELAY commandsPali Rohár
Preserve the order of BINARY, DATA and DATA_DELAY commands as they appear in the input file. They may depend on each other. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage: Fix generating image with multiple DATA_DELAY commandsPali Rohár
Register set header consists of sequence of DATA commands followed by exactly one DATA_DELAY command. Thus if we are generating image with multiple DATA_DELAY commands, we need to create more register set headers. Fix calculation of image size with multiple DATA_DELAY commands and correctly set pointer to struct register_set_hdr_v1 when initializing new register set header. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage: Deduplicate v1 regtype header finishingPali Rohár
Deduplicate code that finishes OPT_HDR_V1_REGISTER_TYPE header by extracing it into separate function. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-14tools: kwbimage: Mark all local functions as staticPali Rohár
Mark all local functions as static. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2022-01-13genboardscfg: limit to 240 jobsAndre Przywara
When genboardscfg.py is run on machines with 255 or more cores, the process will consume more than 1024 file descriptors, which is a common standard ulimit for user processes. As a consequence it will fail with a lenghty Python trace, with the almost hidden message: OSError: [Errno 24] Too many open files It's somewhat questionable whether that level of parallelity is actually useful for genboardscfg, so we limit the *default* number of jobs to the safe number of 240, to avoid the problem. If a user persists, she can still force a higher number via the -j parameter - hopefully having raised the ulimit accordingly beforehand. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-01-13patman: Support absolute and ~user-relative alias filesBrian Norris
Python doesn't naturally support tilde (~) as a user-home marker in paths, but git-config does. So we need to resolve it before continuing. We also shouldn't blindly join the top-level tree with the aliasesfile path, because it might be an absolute path. This resolves warnings like the following: Warning: Cannot find alias file '/path/to/source/tree/~/.git-email' Seen when git-config is like: $ git config sendemail.aliasesfile ~/.git-email Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Otavio Salvador <otavio@ossystems.com.br>
2022-01-12binman: Write fake blobs to the output directorySimon Glass
At present binman writes fake blobs to the current directory. This is not very helpful, since the files serve no useful purpose once binman has finished. They clutter up the source directory and affect future runs, since the files in the current directory are often used in preference to those in the board directory. To avoid these problems, write them to the output directory instead. Move the file-creation code to the Entry base class, so it can be used by any entry type that needs it. This is required since some entry types, such as Entry_blob_ext_list, are not subclasses of Entry_blob. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-12binman: Renumber the fake blob dtsSimon Glass
Use a unique number instead of the current 203, which is used by 203_fip as well. Reformat the code to avoid a long line. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-12CI, Dockerfile: Update to latest "focal" tagTom Rini
Bring us to the focal-20220105 tag and rebuild our images on top of this. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-01-10Merge branch 'next'Tom Rini
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-01-09Merge tag 'u-boot-amlogic-20220107' of ↵Tom Rini
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
2022-01-07binman: add support for creating dummy files for external blobsHeiko Thiery
While converting to binman for an imx8mq board, it has been found that building in the u-boot CI fails. This is because an imx8mq requires an external binary (signed_hdmi_imx8m.bin). If this file cannot be found mkimage fails. To be able to build this board in the u-boot CI a binman option (--fake-ext-blobs) is introduced that can be switched on via the u-boot makefile option BINMAN_FAKE_EXT_BLOBS. With that the needed dummy files are created. Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-01-05tools: kwbimage: Fix checksum calculation for v1 imagesPierre Bourdon
Recent changes caused fields in the image main header to be modified after the header checksum had already been computed. Move the checksum computation to once again be the last operation performed on the header. Fixes: 2b0980c24027 ("tools: kwbimage: Fill the real header size into the main header") Signed-off-by: Pierre Bourdon <delroth@gmail.com> Reviewed-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-12-28Merge tag 'efi-2022-01-rc4-4' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-01-rc4-4 UEFI: * allow for more than 16 KiB UEFI variable size when using StMM Others: * make watchdog sysreset compatible with separate poweroff driver * avoid OpenSSL deprecation warnings
2021-12-26video: theadorable: Use RGB565 for BMP blittingSimon Glass
At present this uses RGB555 format for blitting to a display. Sandbox uses 565 and that seems to be more normal for BMP as well. Update the code accordingly and add a test. Note that this likely breaks the theadorable board so we may need to discuss supporting both formats. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-26video: Add a test for 16bpp BMP filesSimon Glass
Add a compressed 16bpp BMP file and a test to cover this. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-26tools: avoid OpenSSL deprecation warningsHeinrich Schuchardt
Our Gitlab CI buildsystem is set up to treat warnings as errors. With OpenSSL 3.0 a lot of deprecation warnings occur. With the patch compatibility with OpenSSL 1.1.1 is declared. In the long run we should upgrade our code to use the current API. A -Wdiscarded-qualifiers warning is muted by casting. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-12-24rockchip: mkimage: Add support for rk3568 SoCKever Yang
rk3568 is the first SoC which supports idb header v2. Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2021-12-24rockchip: mkimage: Add support for idb header V2Yi Liu
Rockchip BootRom supports new idb header v2 instead of legacy version. Add support for it so that we can generate image for new SoCs. Signed-off-by: Yi Liu <liuyi@rock-chips.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2021-12-24rockchip: mkimage: Add image header versionKever Yang
We are going to have more than one version header, add the version in the header info. Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2021-12-24rockchip: mkimage: rename RK_SIGNATURE to RK_MAGICKever Yang
The first 4byte of idbimage is a magic number instead of signature, correct it. Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2021-12-23fdt: Make it easier to debug u-boot.dtsi filesSimon Glass
At present one must hack the Makefile to see what is going on with these files. Also it doesn't quite work correctly. Fix this by using an environment variable for debugging. Update the docs also. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-23fdt: Drop CONFIG_BINMAN_STANDALONE_FDTSimon Glass
This was added as a hack to work around not having an in-tree devicetree. Now that this is fixed it is not needed. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-20Merge tag 'v2022.01-rc4' into nextTom Rini
Prepare v2022.01-rc4
2021-12-20fw_setenv: Unbreak fw_setenv caused by buggy MEMISLOCKED useJoakim Tjernlund
Commit "fw_setenv: lock the flash only if it was locked before" checks for Locked status with uninitialized erase data. Address by moving the test for MEMISLOCKED. Fixes: 8a726b852502 ("fw_setenv: lock the flash only if it was locked before") Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
2021-12-17fdtgrep: Correct alignment of struct sectionSimon Glass
When outputting a devicetree we should not align the struct section to a 16-byte boundary. The normal position is fine, which is 8-byte aligned. This avoids leaving adding 8 extra zero bytes in the output tree in the case where the reserved section is empty (i.e has 16 zero bytes). Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-17iot2050: binman: add missing-msg for blobsIvan Mikhaylov
Add the 'missing-msg' for blobs for more detailed output on missing system firmware and SEBoot blobs. Signed-off-by: Ivan Mikhaylov <ivan.mikhaylov@siemens.com> Reviewed-by: Simon Glass <sjg@chromium.org> Fix minor typos: Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-17binman: Use less hard coded magic when inserting new PATHAndy Shevchenko
Instead of joining hard coded '..' to the run-time path of the executable, take just a dirname out of it. Besides that, use $(srctree) where it makes sense. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-12-17binman: Do not pollute source tree when build with `make O=...`Andy Shevchenko
Importing libraries in Python caches the bytecode by default. Since we run scripts in source tree it ignores the current directory settings, which is $(srctree), and creates cache just in the middle of the source tree. Move cache to the current directory. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2021-12-17binman: Add support for ATF FIPSimon Glass
This format is used in firmware binaries so we may as well supported it. With this patch binman supports creating, listing and updating FIPs, as well as extracting files from one, provided that an FDTMAP is also present somewhere in the image. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-17binman: Add a utility module for ATF FIPSimon Glass
Add support for this format which is used by ARM Trusted Firmware to find firmware binaries to load. FIP is like a simpler version of FMAP but uses a UUID instead of a name, for each entry. It supports reading a FIP, writing a FIP and parsing the ATF source code to get a list of supported UUIDs. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-05binman: Rename _ReadSubnodes() to ReadEntries()Simon Glass
This method name is more commonly used for this function. Use it consistently. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-05binman: Support lists of external blobsSimon Glass
Sometimes it is useful to have a list of related external blobs in a single entry. An example is the DDR binaries used by meson. There are 9 files in total. Add support for this, so we don't have to have a separate entry for each. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-05dtoc: Add support for reading string-list propertiesSimon Glass
Add a function to read a list of strings from the devicetree. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-05binman: Allow extracting a file in an alternative formatSimon Glass
In some cases entries encapsulate other data and it is useful to access the data within. An example is the fdtmap which consists of a 16-byte header, followed by a devicetree. Provide an option to specify an alternative format when extracting files. In the case of fdtmap, this is 'fdt', which produces an FDT file which can be viewed with fdtdump. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-05binman: Allow listing an image created by a newer versionSimon Glass
If an older version of binman is used to list images created by a newer one, it is possible that it will contain entry types that are not supported. At present this produces an error. Adjust binman to use a plain 'blob' entry type to cope with this, so the image can at least be listed. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-12-05binman: Allow providing tools and blob directoriesSimon Glass
At present it is necessary to symlink files containing external blobs into the U-Boot tree in order for binman to find them. This is not very convenient. Add two new environment/Makefile variables to help with this. Add documentation as well, fixing a related nit. Signed-off-by: Simon Glass <sjg@chromium.org>