summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* tools: env: Avoid an uninited warning with was_lockedSimon Glass2020-08-051-1/+1
| | | | | | | Set this variable to 0 to avoid a warning about an unused variable. This happens on gcc 7.5.0 for me. Signed-off-by: Simon Glass <sjg@chromium.org>
* tools: env: Fix printf() warning in fw_envSimon Glass2020-08-051-2/+2
| | | | | | | The printf() string produces a warning about %d not matching size_t. Fix it and put the format string on one line to avoid a checkpatch warning. Signed-off-by: Simon Glass <sjg@chromium.org>
* fit_image: Use calloc() to fix reproducibility issueFabio Estevam2020-08-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | Vagrant Cascadian reported that mx6cuboxi target no longer builds reproducibility on Debian. One example of builds mismatches: 00096680: 696e 6700 736f 756e 642d 6461 6900 6465 ing.sound-dai.de -00096690: 7465 6374 2d67 7069 6f73 0000 tect-gpios.. +00096690: 7465 6374 2d67 7069 6f73 0061 tect-gpios.a This problem happens because all the buffers in fit_image.c are allocated via malloc(), which does not zero out the allocated buffer. Using calloc() fixes this unpredictable behaviour as it guarantees that the allocated buffer are zero initialized. Reported-by: Vagrant Cascadian <vagrant@reproducible-builds.org> Suggested-by: Tom Rini <trini@konsulko.com> Signed-off-by: Fabio Estevam <festevam@gmail.com> Tested-by: Vagrant Cascadian <vagrant@reproducible-builds.org>
* checkpatch: Don't allow common.h and dm.h in headersSimon Glass2020-08-031-0/+7
| | | | | | | These headers should not be included in other header files. Add a checkpatch rule and test for this. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Fix up the test commentsSimon Glass2020-08-031-5/+5
| | | | | | | Many of the tests have the same comment and two have the same name. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
* fw_setenv: lock the flash only if it was locked beforeIvan Mikhaylov2020-07-311-5/+19
| | | | | | | | | | | | | | | | | | | | | With current implementation of fw_setenv, it is always locks u-boot-env region if lock interface is implemented for such mtd device. You can not control lock of this region with fw_setenv, there is no option for it in config or in application itself. Because of this situation may happen problems like in this thread on xilinx forum: https://forums.xilinx.com/t5/Embedded-Linux/Flash-be-locked-after-use-fw-setenv-from-user-space /td-p/1027851 A short summary of that link is: some person has issue with some spi chip which has lock interface but doesn't locks properly which leads to lock of whole flash memory on lock of u-boot-env region. As resulted solution hack was added into spi-nor.c driver for this chip with lock disablement. Instead fix this problem by adding logic to fw_setenv only lock the flash if it was already locked when we attempted to use it. Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
* dtoc: remove compatible string aliases supportWalter Lozano2020-07-282-56/+0
| | | | | | | | | | After latest improvements in dtoc, compatible strings are checked against driver and driver alias list to get a valid driver name. With this new feature the list of compatible string aliases seems not useful any more. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dtoc: look for compatible string aliases in driver listWalter Lozano2020-07-283-26/+44
| | | | | | | | | | | | | | Currently dtoc checks if the first compatible string in a dtb node matches either a driver o driver alias name, without taking into account any other compatible string in the list. In the case that no driver matches the first compatible string a warning is printed and the U_BOOT_DEVICE is not being declared correctly. This patch adds dtoc's support for try all the compatible strings in the dtb node, in an effort to find the correct driver. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Makefile: Rename ALL-y to INPUTS-ySimon Glass2020-07-281-1/+1
| | | | | | | | | | | When binman is in use, most of the targets built by the Makefile are inputs to binman. We then need a final rule to run binman to produce the final outputs. Rename the variable to indicate this, and add a new 'inputs' target. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* buildman: Show the build rate at the endSimon Glass2020-07-282-1/+15
| | | | | | | | It is interesting to note the number of builds completed per second to track machine performance and build speed. Add a 'rate' value at the end of the build to show this. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Correct the testOutputDir() unit testSimon Glass2020-07-281-2/+1
| | | | | | | This current fails with an error. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 7664b03ffc5 ("buildman: Remove _of_#_ from results directory paths")
* buildman: Allow using older versions of genboardscfg.pySimon Glass2020-07-281-2/+8
| | | | | | | | | | | | | Older versions of this script don't support the -q flag. Since buildman runs this script from when it starts, we may get the old version. Fix this in two ways: 1. Use the version from the same tree as buildman is run from, if available 2. Failing that, allow the -q flag to be missing Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: add coverage test for unicode errorWalter Lozano2020-07-283-3/+42
| | | | | | | | Add an additional test to dtoc in order improve the coverage, specifically to take into account the case of unicode error when scanning drivers. Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
* binman: Re-enable concurrent testsSimon Glass2020-07-261-1/+3
| | | | | | | | | | With the change to absolute imports the concurrent tests feature unfortunately broke. Fix it. We cannot easy add a warning, since the output messes up tests which check the output. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Don't change the descriptor in testsSimon Glass2020-07-263-5/+47
| | | | | | | | | | | | | | At present testPackX86RomMeNoDesc removes the contents of the descriptor.bin file and testPackX86RomMeMissingDesc removes the file completely. If a test that relies on this file happens to run after it is removed, it will not work. Since we have no control over the selecting of tests that run in parallel and series, we must avoid changing the files. Update this tests to use separate files instead. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: When no tracking branch is provided, tell the userNicolas Boichat2020-07-251-2/+3
| | | | | | | | The user can either count the number of patches, or provide a tracking branch. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* patman: Make sure sendemail.suppresscc is (un)set correctlyNicolas Boichat2020-07-252-0/+27
| | | | | | | | | Setting sendemail.suppresscc to all or cccmd leads to --cc-cmd parameter being ignored, and emails going either nowhere, or just to the To: line maintainer. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* Add information for skipped commit optionsPatrick Delaunay2020-07-251-0/+3
| | | | | | | | | | | | | | | | | The unsupported Commit-xxx option are silently skipped and removed as 're_remove=Commit-\w*', this patch adds warning message in this case to detect misspelled issue for the 2 supported options: Commit-notes: Commit-changes: For example: the final 's' is missing (Commit-note:) NB: no issue for Series-xxx option as only the supported options are accepted (see valid_series in series.py) Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* patman: Detect unexpected ENDPatrick Delaunay2020-07-251-0/+4
| | | | | | | | | | | | | | | | | Detect unexpected 'END' line when a section is not detected. This patch detect issue when tag name for section start is misspelled, for example 'Commit-note:' for 'Commit-notes:' Commit-note: .... END Then 'Commit-note:' is removed silently by re_remove = "Commit-\w*:" but 'END' is kept in commit message. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* binman: Add support for generating a FITSimon Glass2020-07-255-0/+384
| | | | | | | | | | | | | | | | | FIT (Flat Image Tree) is the main image format used by U-Boot. In some cases scripts are used to create FITs within the U-Boot build system. This is not ideal for various reasons: - Each architecture has its own slightly different script - There are no tests - Some are written in shell, some in Python To help address this, add support for FIT generation to binman. This works by putting the FIT source directly in the binman definition, with the ability to adjust parameters, etc. The contents of each FIT image come from sub-entries of the image, as is normal with binman. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Allow adding variable-sized data to a dtbSimon Glass2020-07-252-2/+19
| | | | | | | Add a method for adding a property containing arbitrary bytes. Make sure that the tree can expand as needed in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
* mkimage: Allow updating the FIT timestampSimon Glass2020-07-253-2/+6
| | | | | | | | | | | | | Normally the FIT timestamp is created the first time mkimage is run on a FIT, when converting the source .its to the binary .fit file. This corresponds to using the -f flag. But if the original input to mkimage is a binary file (already compiled) then the timestamp is assumed to have been set previously. Add a -t flag to allow setting the timestamp in this case. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* binman: Allow zero-length entries to overlapSimon Glass2020-07-253-1/+23
| | | | | | | | | | | | Some binary blobs unfortunately obtain their position in the image from other binary blobs, such as Intel's 'descriptor'. In this case we cannot rely on packing to work. It is not possible to produce a valid image in any case, due to the missing blobs. Allow zero-length overlaps so that this does not cause any problems. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* binman: Allow missing Intel blobsSimon Glass2020-07-254-14/+55
| | | | | | | Update the Intel blob entries to support missing binaries. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* binman: Detect when valid images are not producedSimon Glass2020-07-257-3/+76
| | | | | | | When external blobs are missing, show a message indicating that the images are not functional. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Update errors and warnings to use stderrSimon Glass2020-07-252-2/+5
| | | | | | | | When warnings and errors are produced by tools they should be written to stderr. Update the tout implementation to handle this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* binman: Allow external binaries to be missingSimon Glass2020-07-258-8/+66
| | | | | | | | | | | | | Sometimes it is useful to build an image even though external binaries are not present. This allows the build system to continue to function without these files, albeit not producing valid images. U-Boot does with with ATF (ARM Trusted Firmware) today. Add a new flag to binman to request this behaviour. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* binman: Convert existing binary blobs to blob_extSimon Glass2020-07-2516-39/+29
| | | | | | | | | | | | | Many of the existing blobs rely on external binaries which may not be available. Move them over to use blob_ext to indicate this. Unfortunately cros-ec-rw cannot use this class because it inherits another. So set the 'external' value for that class. While we are here, drop the import of Entry since it is not used (and pylint3 complains). Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add an etype for external binary blobsSimon Glass2020-07-255-0/+83
| | | | | | | | | | | | It is useful to be able to distinguish between ordinary blobs such as u-boot.bin and external blobs that cannot be build by the U-Boot build system. If the external blobs are not available for some reason, then we know that a value image cannot be built. Introduce a new 'blob-ext' entry type for that. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* binman: Use super() instead of specifying parent typeSimon Glass2020-07-2557-87/+86
| | | | | | | | It is easier and less error-prone to use super() when the parent type is needed. Update binman to remove the type names. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* binman: Fix a few typos in the entry docsSimon Glass2020-07-242-2/+2
| | | | | | | Some typos have been fixed in the generated entry docs but the code was not updated. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add support for calling mkimageSimon Glass2020-07-245-0/+120
| | | | | | | | As a first step to integrating mkimage into binman, add a new entry type that feeds data into mkimage for processing and incorporates that output into the image. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Set a default toolpathSimon Glass2020-07-241-0/+5
| | | | | | | | | | | When binman is run from 'make check' it is given a toolpath so that the latest tools (e.g. mkimage) are used. When run manually with no toolpath, it relies on the system mkimage. But this may be missing or old. Make some effort to find the built-from-soruce version by looking in the current directory and in the builds created by 'make check'. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Specify the toolpath when running test coverageSimon Glass2020-07-242-6/+13
| | | | | | | | | | | At present binman's test coverage runs without a toolpath set. This means that the system tools will be used. That may not be correct if they are out of date or missing and this can result in a reduction in test coverage below 100%. Provide the toolpath to binman in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Correct the search patch for pylibfdtSimon Glass2020-07-241-0/+1
| | | | | | | | | Now that binman uses tools/ as its base directory for importing modules, the path to the pylibfdt build by U-Boot is incorrect. Fix it with a new path. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* binman: cbfs: Fix IFWI typoSimon Glass2020-07-241-1/+1
| | | | | | | This comment references the wrong thing. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* binman: Output errors to stderrSimon Glass2020-07-241-1/+1
| | | | | | | | | At present binman outputs errors to stdout which means that fails are effectively silent when printed by buildman, for example. Fix this by outputing errors to stderr. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* patman: Add a -D option to enable debuggingSimon Glass2020-07-241-0/+6
| | | | | | | Most users don't want to see traceback errors. Add an option to enable them for debugging. Disable them by default. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Support collecting response tags in PatchstreamSimon Glass2020-07-242-5/+30
| | | | | | | | | Collect response tags such as 'Reviewed-by' while parsing the stream. This allows us to see what tags are present. Add a new 'Fixes' tag also, since this is now quite common. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Allow disabling 'bright' mode with Print outputSimon Glass2020-07-241-2/+2
| | | | | | | At present all text is marked bright, which makes it stand out on the terminal. Add a way to disable that, as is done with the Color class. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Add a 'test' subcommandSimon Glass2020-07-242-36/+41
| | | | | | | | | | At present we use --test to indicate that tests should be run. It is better to use a subcommand for list, like binman. Change it and adjust the existing code to fit under a 'send' subcommand, the default. Give this subcommand the same default arguments as the others. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Allow different commandsSimon Glass2020-07-241-36/+41
| | | | | | | | At present patman only does one thing so does not have any comments. We want to add a few more command, so create a sub-parser for the default command ('send'). Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Convert to ArgumentParserSimon Glass2020-07-243-64/+65
| | | | | | | Convert from OptionParser to ArgumentParser to match binman. With this we can easily add sub-commands. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Allow skipping patches at the endSimon Glass2020-07-243-5/+18
| | | | | | | | | | | | The -s option allows skipping patches at the top of the branch. Sometimes there are commits at the bottom that need to be skipped. At present it is necessary to count the number of commits and then use -c to tell patman how many to process. Add a -e option to easily skip a number of commits at the bottom of the branch. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Allow creating patches for another branchSimon Glass2020-07-245-15/+40
| | | | | | | Add a -b option to allow patches to be created from a branch other than the current one. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Add a test that uses gitpythonSimon Glass2020-07-242-3/+152
| | | | | | | | It is convenient to use gitpython to create a real git repo for testing patman's operation. Add a test for this. So far it just checks that patman produces the right number of patches for a branch. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Move main code out to a control moduleSimon Glass2020-07-245-57/+182
| | | | | | | | | | To make testing easier, move the code out from main into a separate 'control' module and split it into four parts: setup, preparing patches, checking patches and emailing patches. Add comments and fix a few code-style issues while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Use test_util to show test resultsSimon Glass2020-07-242-9/+5
| | | | | | | This handles skipped tests correctly, so use it instead of the existing code. Signed-off-by: Simon Glass <sjg@chromium.org>
* Revert "Merge tag 'dm-pull-20jul20' of git://git.denx.de/u-boot-dm"Tom Rini2020-07-2490-1501/+307
| | | | | | | | | | This reverts commit 5d3a21df6694ebd66d5c34c9d62a26edc7456fc7, reversing changes made to 56d37f1c564107e27d873181d838571b7d7860e7. Unfortunately this is causing CI failures: https://travis-ci.org/github/trini/u-boot/jobs/711313649 Signed-off-by: Tom Rini <trini@konsulko.com>
* patman: When no tracking branch is provided, tell the userNicolas Boichat2020-07-201-2/+3
| | | | | | | | The user can either count the number of patches, or provide a tracking branch. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>