aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2023-02-12binman: Show the image name for the top-level sectionSimon Glass
At present we show 'main section' as the top-level section name. It may be more helpful to show the actual image name. This is tricky because Image is a parent class of Entry_section, so there is no distinction between an image and a section. Update it to show the image name. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11CI, Docker: Update to Jammy 2023016 tagTom Rini
Move to the latest tag for "Jammy" and rebuild the containers. Signed-off-by: Tom Rini <trini@konsulko.com>
2023-02-11Docker: Support trace-cmdSimon Glass
Build trace-cmd as part of the docker image, so that trace tests can be used. Unfortunately the version provided by distributions is a little old and has bugs. It also does not support specifying the time base for the trace, which is required to convert microseconds to nanaseconds. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Provide a flamegraph that uses timingSimon Glass
Add a second variant of the flame graph that shows records in terms of the number of microseconds used by each call stack. This is a useful way of seeing where time is going within the execution of U-Boot. This requires a call stack that records the start time of each function, as well as a way of subtracting all time consumed by child functions, so that this time is not counted twice by the flamegraph. The time values in the output are just for the function itself, not for its children. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Support output of a flamegraphSimon Glass
It is useful to see how many times each function is called, particularly in the context of its callers. A flamegraph is a way of showing this. Support output in this format which can be used by the flamegraph.pl script, to generate an SVG image for browsing. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Support output of funcgraph recordsSimon Glass
Add support for writing ftrace records in the 'funcgraph' format, which shows function entry and exit points as well as the time taken by each function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Use text_base from the trace headerSimon Glass
Use the information in the trace header instead of reading it from the trace records. Add debugging to check that System.map and the trace header agree on this value. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Drop use of objsectionSimon Glass
This feature was only partly implemented and serves no current purpose. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Update proftool to use new binary formatSimon Glass
The old text format is not much used anymore. Instead a new trace-cmd tool has introduced a binary format for trace records. Add support for generating this format. This involves removing the old text format, adding various helpers for the new format and adjusting the code to use an output file instead of stdout. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11trace: Rename prof to trace and improve commentsSimon Glass
The current use of 'profile' in some places is confusing. Update the code to use the word 'trace' consistently. Change the flags to better match their meaning and add some more comments. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-11Dockerfile: Update QEMU git locationTom Rini
Per https://www.qemu.org/contribute/ the official location of the QEMU sources are https://gitlab.com/qemu-project/qemu.git Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2023-02-10buildman: invalid reference to READMEHeinrich Schuchardt
The readme file for buildman is called buildman.rst. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-02-07tools: Drop xway-swap-bytes toolSimon Glass
This is very old and does not appear to be used. The CONFIG option enabling it is no-longer present. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-07Drop ubsha1 toolSimon Glass
This seems to have been used by ppc4xx which was removed a while back. The Kconfig does not exist so it is never built. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-07imx: Rename CONFIG_MXS to CFG_MXSSimon Glass
This is not a Kconfig option so we should not be setting it in the Makefile. Rename it to use a CFS_ prefix, since this is still used in mxsimage.c In general tools should support all the features without reference to CONFIG options, but this is left to the maintainer to look at. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-07moveconfig: Add an option to compare Kconfig against sourceSimon Glass
Sometimes the Makefile rules or source code refers to Kconfig options which don't exist. Update the moveconfig tool to check this and produce a series of reports about inconsistencies. This can then be used to generate patches to correct the problems. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-06tools: default_image: Accept images with paddingPali Rohár
If image file is stored on flash partition then it contains padding, which is not part of the image itself. Image data size is stored in the image header. So use image size from the header instead of expecting that total image file size is size of the header plus size of the image data. This allows dumpimage to parse image files with padding (e.g. dumped from flash partition). Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-02-06tools: default_image: Verify header sizePali Rohár
Before reading image header, verify that image size is at least size of the image header. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-02-06tools: imagetool: Skip autodetection of gpimage typePali Rohár
gpimage type requires only that two first 32-bit words of data file are non-zero. So basically every random data file can be guessed and verified as gpimage. So completely skip gpimage type from image autodetection code to prevent lot of false positive results. Data file with gpimage type can be still verified and parsed by explicitly specifying -T gpimage. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-02-06tools: imagetool: Show error message when detecting image type failedPali Rohár
Signed-off-by: Pali Rohár <pali@kernel.org>
2023-02-06tools: imagetool: Fix error message when verify_header is undefinedPali Rohár
Signed-off-by: Pali Rohár <pali@kernel.org>
2023-02-04tools: logos: Add TI logo filesNikhil M Jain
The default splashfile name saved is ti.gz. User can use these logo files and use it to test splash screen. Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
2023-01-30tools: imx8image: Fix handle leakMikhail Ilin
The handle "fd" was created in imx8image.c:249 by calling the "fopen" function and is lost in imx8image.c:282. Should close the 'fd' file descriptor before exiting the parse_cfg_file(image_t *param_stack, char *name) function. Fixes: a2b96ece5be1 ("tools: add i.MX8/8X image support") Signed-off-by: Mikhail Ilin <ilin.mikhail.ol@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-30tools: imx8mimage: Fix handle leakMikhail Ilin
The handle "fd" was created in imx8mimage.c:178 by calling the "fopen" function and is lost in imx8mimage.c:210. Should close the 'fd' file descriptor before exiting the parse_cfg_file(char *name) function. Fixes: 6609c2663c9c ("tools: add i.MX8M image support") Signed-off-by: Mikhail Ilin <ilin.mikhail.ol@gmail.com>
2023-01-30tools: imximage: Fix check array indexMikhail Ilin
The struct dcd_v1_t is initialized to MAX_HW_CFG_SIZE_V1 (60) structs 'dcd_type_addr_data_t', so the indexes to use on its elements are [0,59]. But on line 478, the variable 'length' can take on the value 60, which applies to array overflow: cd_v1->addr_data[length].type Thus, it is necessary to tighten the check on the 'size' variable on line 463. Fixes: 0b0c6af38738 ("Prepare v2020.01") Signed-off-by: Mikhail Ilin <ilin.mikhail.ol@gmail.com>
2023-01-27mkimage: fit: Support signed configurations in 'auto' FITsMassimo Pegorer
Extend support for signing in auto-generated (-f auto) FIT. Previously, it was possible to get signed 'images' subnodes in the FIT using options -g and -o together with -f auto. This patch allows signing 'configurations' subnodes instead of 'images' ones (which are hashed), using option -f auto-conf instead of -f auto. Adding also -K <dtb> and -r options, will add public key to <dtb> file with required = "conf" property. Summary: -f auto => FIT with crc32 images -f auto -g ... -o ... => FIT with signed images -f auto-conf -g ... -o ... => FIT with sha1 images and signed confs Example: FIT with kernel, two device tree files, and signed configurations; public key (needed to verify signatures) is added to u-boot.dtb with required = "conf" property. mkimage -f auto-conf -A arm -O linux -T kernel -C none -a 43e00000 \ -e 0 -d vmlinuz -b /path/to/first.dtb -b /path/to/second.dtb \ -k /folder/with/key-files -g keyname -o sha256,rsa4096 \ -K u-boot.dtb -r kernel.itb Example: Add public key with required = "conf" property to u-boot.dtb without needing to sign anything. This will also create a useless FIT named unused.itb. mkimage -f auto-conf -d /dev/null -k /folder/with/key-files \ -g keyname -o sha256,rsa4096 -K u-boot.dtb -r unused.itb Signed-off-by: Massimo Pegorer <massimo.pegorer@vimar.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-27ifwitool: Fix member accessSimon Glass
On a second and third look, a recent patch seems to be writing to the wrong place - updating offsets from the address of the pointer instead of what the pointer points to. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 2d1b2ac13fe ("tool: ifwitool: Fix buffer overflow") Acked-by: Sean Anderson <seanga2@gmail.com>
2023-01-26binman: Fix a test-coverage regressionSimon Glass
Unfortunately a recent patch snuck through without the require test coverage. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 571bc4e67d3 ("binman: Support positioning an entry by and ELF symbol")
2023-01-26binman: Add 'min-size' entry propertySamuel Holland
This property sets the minimum size of an entry, including padding but not alignment. It can be used to reserve space for growth of an entry, or to enforce a minimum offset for later entries in the section. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-26binman: Add support for selecting firmware to use with split-elfJonas Karlman
In some cases it is desired for SPL to start TF-A instead of U-Boot proper. Add support for a new property fit,firmware that picks a valid entry and prepends the remaining valid entries to the loadables list generated by the split-elf generator. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-26binman: Add special subnodes to the nodes generated by split-elfJonas Karlman
Special nodes, hash and signature, is not being added to the nodes generated for each segment in split-elf operation. Copy the subnode logic used in _gen_fdt_nodes to _gen_split_elf to ensure special nodes are added to the generated nodes. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-26binman: Add support for align argument to mkimage toolJonas Karlman
Add support to indicate what alignment to use for the FIT and its external data. Pass the alignment to mkimage via the -B flag. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-18patman: symlink top level .checkpatch.confMaxim Cournoyer
This makes it possible to run the patman test suite simply by invoking 'pytest' from the patman sub-directory: $ cd tools/patman $ pytest Otherwise, the top level .checkpatch.conf would be ignored and multiple test_checkpatch.py tests would fail. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-18Revert "patman: invoke the checkpatch.pl script with '--u-boot' and '--strict'"Maxim Cournoyer
This reverts commit 648d8186dd7f9c444fb07f355090d275dcdd4de4, because it broke usage of patman on Linux, whose check script doesn't know about '--strict' or '--u-boot'. Reported-by: Sjoerd Simons <sjoerd@collabora.com> Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Sjoerd Simons <sjoerd@collabora.com>
2023-01-18binman: Support positioning an entry by and ELF symbolSimon Glass
In some cases it is useful to position an entry over the top of a symbol in an ELF file. For example, if the symbol holds a version string then it allows the string to be accessed from the fdtmap. Add support for this. Suggested-by: Pali Rohár <pali@kernel.org> Suggested-by: Keith Short <keithshort@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18dtoc: Add a way to read a phandle with paramsSimon Glass
Add a function to read a phandle and associated name and offset. This is useful for binman. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18binman: Provide general support for updating ELF symbolsSimon Glass
The current support for updating variables in a binary is hard-coded to work with U-Boot: - It assumes the image starts at __image_copy_start - It uses the existing U-Boot-specific entry types It is useful for other projects to use these feature. Add properties to enable writing symbols for any blob, a way of specifying the base symbol and a way of providing the ELF filename to allow symbol lookup to take place. With this it is possible to update a Zephyr image, such as zephyr.bin after it has been built. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18binman: Support overlapping entriesSimon Glass
In some cases it is useful to have an entry overlap with another in a section, either to update the contents within a blob, or to add an entry to the fdtmap that covers only part of the blob. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18binman: Add a function to check for special section nodesSimon Glass
This appears in two places in the code. Use a shared function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18binman: Add a null entrySimon Glass
It is sometimes useful to define an entry which does not have its own contents but does appear in the image. The contents are set by the section which contains it, even though it appears as an entry in the fdtmap. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18binman: Clarify use of False when obtaining dataSimon Glass
This means that the data is not yet available. Update some comments to make this clearer. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18binman: Add a test for an inner section with a sizeSimon Glass
This is a slightly different scenario from the existing testSections tests. Add a new test for it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18binman: Support optional external blobsSimon Glass
Some blobs are actually not necessary for the board to work correctly. Add a property to allow this to be indicated. Missing optional blobs do not cause a build failure. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18binman: Support new op-tee binary formatSimon Glass
OP-TEE has a format with a binary header that can be used instead of the ELF file. With newer versions of OP-TEE this may be required on some platforms. Add support for this in binman. First, add a method to obtain the ELF sections from an entry, then use that in the FIT support. We then end up with the ability to support both types of OP-TEE files, depending on which one is passed in with the entry argument (TEE=xxx in the U-Boot build). Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18binman: Add a way to check for a valid ELF fileSimon Glass
Add a function which checks whether data is in ELF format or not. This will be used by binman to check this for entries. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18binman: Support optional entriesSimon Glass
Support entries which can be optional depending on their contents. This allows special entry types which appear in the image only when needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18binman: Use a reference for binman symbols docsSimon Glass
Several etypes have this reference in their documentation. Now that we are using rST, link to the section directly. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-01-18binman: Update entry docsSimon Glass
These have got out of data recently. Regenerate them. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18binman: Tidy up comment in fit _gen_nodeSimon Glass
Expand this comment to cover both cases that are supported. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-18binman: Allow writing section contents to a fileSimon Glass
At present only the image (which is a section) has a filename. Move this implementation to the entry_Section class so that any section can have a filename. With this, the section data is written to a file. This allows parts of an image to be written, along with the entire image. Make a note that this can be used to include the contents of a section in one image in another (later) image. Signed-off-by: Simon Glass <sjg@chromium.org>