summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2023-02-14dm: treewide: Complete migration to new driver model schemaSimon Glass2-6/+5
Update various build and test components to use the new schema. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-13binman: Show the image name for the top-level sectionSimon Glass2-39/+31
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 Rini1-1/+1
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 Glass1-0/+16
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 Glass1-11/+97
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 Glass1-1/+271
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 Glass1-32/+150
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 Glass1-1/+6
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 Glass1-28/+1
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 Glass2-45/+854
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 Glass1-39/+157
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 Rini1-1/+1
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 Schuchardt1-1/+1
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 Glass2-42/+0
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 Glass3-90/+0
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 Glass2-3/+3
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 Glass1-0/+334
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-07tools: default_image: Accept images with paddingPali Rohár1-1/+11
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ár1-0/+6
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ár1-0/+6
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ár1-0/+5
Signed-off-by: Pali Rohár <pali@kernel.org>
2023-02-06tools: imagetool: Fix error message when verify_header is undefinedPali Rohár1-1/+1
Signed-off-by: Pali Rohár <pali@kernel.org>
2023-02-04tools: logos: Add TI logo filesNikhil M Jain2-0/+0
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-31tools: imx8image: Fix handle leakMikhail Ilin1-0/+1
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-31tools: imx8mimage: Fix handle leakMikhail Ilin1-0/+1
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-31tools: imximage: Fix check array indexMikhail Ilin1-1/+1
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 Pegorer3-31/+75
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 Glass1-20/+20
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 Glass3-1/+32
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 Holland4-4/+36
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 Karlman4-13/+205
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 Karlman4-2/+53
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 Karlman5-1/+92
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-19patman: symlink top level .checkpatch.confMaxim Cournoyer1-0/+1
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-19Revert "patman: invoke the checkpatch.pl script with '--u-boot' and '--strict'"Maxim Cournoyer1-1/+1
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-19binman: Support positioning an entry by and ELF symbolSimon Glass5-1/+106
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-19dtoc: Add a way to read a phandle with paramsSimon Glass4-0/+43
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-19binman: Provide general support for updating ELF symbolsSimon Glass10-5/+140
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-19binman: Support overlapping entriesSimon Glass8-10/+183
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-19binman: Add a function to check for special section nodesSimon Glass2-3/+13
This appears in two places in the code. Use a shared function instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-19binman: Add a null entrySimon Glass6-2/+71
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-19binman: Clarify use of False when obtaining dataSimon Glass2-2/+4
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-19binman: Add a test for an inner section with a sizeSimon Glass2-0/+22
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 Glass8-11/+92
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 Glass9-33/+352
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 Glass2-0/+25
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 Glass7-0/+67
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 Glass9-50/+15
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 Glass2-30/+169
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 Glass1-5/+11
Expand this comment to cover both cases that are supported. Signed-off-by: Simon Glass <sjg@chromium.org>