summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-02-06tools: imagetool: Show error message when detecting image type failedPali Rohár
Signed-off-by: Pali Rohár <[email protected]>
2023-02-06tools: imagetool: Fix error message when verify_header is undefinedPali Rohár
Signed-off-by: Pali Rohár <[email protected]>
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 <[email protected]>
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]> Fixes: 2d1b2ac13fe ("tool: ifwitool: Fix buffer overflow") Acked-by: Sean Anderson <[email protected]>
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 <[email protected]> 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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]> Reviewed-by: Simon Glass <[email protected]>
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 <[email protected]> Signed-off-by: Maxim Cournoyer <[email protected]> Reviewed-by: Simon Glass <[email protected]> Tested-by: Sjoerd Simons <[email protected]>
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 <[email protected]> Suggested-by: Keith Short <[email protected]> Signed-off-by: Simon Glass <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]> Suggested-by: Quentin Schulz <[email protected]>
2023-01-18binman: Update entry docsSimon Glass
These have got out of data recently. Regenerate them. Signed-off-by: Simon Glass <[email protected]>
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 <[email protected]>
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 <[email protected]>
2023-01-18trace: Update trace-format generator for newer versionSimon Glass
This now includes flags and the layout has changed slightly in recent versions of Linux. Update the generator accordingly. Signed-off-by: Simon Glass <[email protected]>
2023-01-18trace: Adjust flags in proftoolSimon Glass
The flags in this tool don't match the comments or help. Also the variable names are quite confusing. Update them for consistency. Signed-off-by: Simon Glass <[email protected]>
2023-01-18mkimage: Add a few more messages for FIT failuresSimon Glass
Add messages to make it clearer which part of the FIT creation is failing. This can happen when an invalid 'algo' property is provided in the .its file. Signed-off-by: Simon Glass <[email protected]>
2023-01-16rockchip: mkimage: Add rv1126 supportJagan Teki
Add support for rv1126 package header in mkimage tool. Signed-off-by: Jagan Teki <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-01-16rockchip: mkimage: make RC4 key constJohn Keeping
This is read-only data, so mark it as such. Signed-off-by: John Keeping <[email protected]> Reviewed-by: Philipp Tomsich <[email protected]> Reviewed-by: Kever Yang <[email protected]>
2023-01-11CI/Docker: Update to jammy-20221130 tagTom Rini
Update to the latest "jammy" tag. This requires us to list libc6-i386 as a required package to install (for nokia_rx51 tests) that was previously implicit. Signed-off-by: Tom Rini <[email protected]>
2023-01-11Dockerfile: add package texinfoHeinrich Schuchardt
In preparation of adding the infodocs target to our CI install the prerequisite texinfo software package. Signed-off-by: Heinrich Schuchardt <[email protected]>
2023-01-05patman: add '--get-maintainer-script' argumentMaxim Cournoyer
This makes it possible to configure a project to use some other location or script than the default scripts/get_maintainer.pl one used in the U-Boot and Linux projects. It can be configured via a .patman configuration file and accepts arguments, as documented. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Maxim Cournoyer <[email protected]>
2023-01-05patman: additionally honor a local .patman config fileMaxim Cournoyer
This enables versioning a project specific patman configuration file. It also makes it possible to declare the project name, which is not a useful thing to do in $HOME/.patman. A new test is added, along updated documentation. Signed-off-by: Maxim Cournoyer <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-01-05patman: fail early in Setup when provided config file does not existMaxim Cournoyer
Rationale: if the user explicitly provide this argument, they probably intend for it to be used. Signed-off-by: Maxim Cournoyer <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-01-05patman: set the default config_fname argument value to NoneMaxim Cournoyer
This better matches Python conventions, allowing to easily test whether the optional argument is provided. Signed-off-by: Maxim Cournoyer <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-01-05patman: import gitutil module where it is neededMaxim Cournoyer
Instead of propagating it from the module entry point (main script). Signed-off-by: Maxim Cournoyer <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-01-05patman: replace deprecated SafeConfigParser with ConfigParserMaxim Cournoyer
The SafeConfigParser class has been renamed in Python 3.2 to ConfigParser, and the old alias has been deprecated since. Signed-off-by: Maxim Cournoyer <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-01-05patman: fix pep8 warnings in settings moduleMaxim Cournoyer
Remove extraneous imports, variables and comply to PEP 8 maximum line width, among other PEP 8 changes suggested by Pyflake. Signed-off-by: Maxim Cournoyer <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-01-05patman: document default 'send' commandMaxim Cournoyer
Document that this command is the default and what it's intended for. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Maxim Cournoyer <[email protected]>
2023-01-05patman: document how to run test suite via pytestMaxim Cournoyer
Pytest offers useful features such as selecting tests by means of a regular expression, or running the pdb debugger upon encountering a test failure. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Maxim Cournoyer <[email protected]>