summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* binman: Set a default toolpathSimon Glass2020-07-201-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-202-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-201-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-201-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-201-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-201-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-202-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-201-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-202-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-201-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-203-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-203-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-205-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-202-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-205-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-202-9/+5
| | | | | | | This handles skipped tests correctly, so use it instead of the existing code. Signed-off-by: Simon Glass <sjg@chromium.org>
* mkimage: Fix error message if write less data then expectedMylène Josserand2020-07-171-4/+11
| | | | | | | | | | | | | | | | | Add a new error message in case the size of data written are shorter than the one expected. Currently, it will lead to the following error message: "mkimage: Write error on uImage: Success" This is not explicit when the error is because the device doesn't have enough space. Let's use a more understandable message: "mkimage: Write only 4202432/4682240 bytes, probably no space left on the device" Signed-off-by: Mylène Josserand <mylene.josserand@collabora.com> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
* dtoc: Support ACPI paths in of-platdataSimon Glass2020-07-173-1/+7
| | | | | | | | | | | The start of an ACPI path typically has backslashes in it. These are not preserved during the translation from device tree to C code, since dtc (correctly) uses the first backslash as an escape character, and dtoc therefore leaves it out of the C string. Fix this with special-case handling. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: add test for cd-gpiosWalter Lozano2020-07-092-0/+109
| | | | | | | Add a test for dtoc taking into account the cd-gpios property. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dtoc: update dtb_platdata to support cd-gpiosWalter Lozano2020-07-092-7/+11
| | | | | | | | | | Currently dtoc does not support the property cd-gpios used to declare the gpios for card detect in mmc. This patch adds support to cd-gpios property. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dtoc: extend dtoc to use struct driver_info when linking nodesWalter Lozano2020-07-092-46/+84
| | | | | | | | | | | | | | | | In the current implementation, when dtoc parses a dtb to generate a struct platdata it converts the information related to linked nodes as pointers to struct platdata of destination nodes. By doing this, it makes difficult to get pointer to udevices created based on these information. This patch extends dtoc to use struct driver_info when populating information about linked nodes, which makes it easier to later get the devices created. In this context, reimplement functions like clk_get_by_index_platdata() which made use of the previous approach. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dtoc: add option to disable warningsWalter Lozano2020-07-093-34/+85
| | | | | | | | | | | | As dtoc now performs checks for valid driver names, when running dtoc tests several warnings arise as these tests don't use valid driver names. This patch adds an option to disable those warning, which is only intended for running tests. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dtoc: add support to scan driversWalter Lozano2020-07-093-4/+145
| | | | | | | | | | | | | | | | | | | Currently dtoc scans dtbs to convert them to struct platdata and to generate U_BOOT_DEVICE entries. These entries need to be filled with the driver name, but at this moment the information used is the compatible name present in the dtb. This causes that only nodes with a compatible name that matches a driver name generate a working entry. In order to improve this behaviour, this patch adds to dtoc the capability of scan drivers source code to generate a list of valid driver names and aliases. This allows to generate U_BOOT_DEVICE entries using valid driver names and rise a warning in the case a name is not valid. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org> Open files in utf-8 mode: Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: add missing code commentsWalter Lozano2020-07-091-0/+3
| | | | | | | | Add missing information about internal class members in order to make the code easier to follow. Signed-off-by: Walter Lozano <walter.lozano@collabora.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* checkpatch: Don't warn about PREFER_IF in headers/DT filesSimon Glass2020-07-091-0/+2
| | | | | | | This warning should only be displayed for C files. Fix it and update the test. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Add tests for the rest of the checkpatch checksSimon Glass2020-07-091-4/+43
| | | | | | Finish off the tests for our small collection of checkpatch checks. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Decode output from the '--show-types' optionSimon Glass2020-07-092-11/+17
| | | | | | | Collect the 'checkpatch type' from each error, warning and check. Provide this to patman and update the uclass test to use it. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Add a test for the 'possible new uclass' checkSimon Glass2020-07-091-0/+77
| | | | | | | | | | | | It is quite likely that the number of U-Boot-specific tests in checkpatch.pl will increase over time. We should have tests for these to avoid undefined behaviour and bugs being introduced, which might cause people to ignore the warnings. Add a simple new class that can generate a patch with a single-line addition in it. Use that to add a test for one of the checkpatch checks. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Rename test.py to test_checkpatch.pySimon Glass2020-07-092-6/+5
| | | | | | | | These tests check checkpatch.pl operation and can server as our tests for the U-Boot-specific updates to that script. Rename the file and update comments to indicate this. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Drop import of test_util in test_utilSimon Glass2020-07-091-1/+0
| | | | | | | This module doesn't need to import itself. It causes problems on very old Python 3 (e.g. 3.4.0). Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Avoid importing gitutil in settingsSimon Glass2020-07-092-5/+4
| | | | | | | Pass this module in so that settings does not need to import it. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Stefan Bosch <stefan_b@posteo.net>
* patman: Pass in maintainer dirs to avoid and importSimon Glass2020-07-092-8/+9
| | | | | | | | Adjust the get_maintainer module to accept a list of directories to search for the script. This avoids needing to import gitutil. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Stefan Bosch <stefan_b@posteo.net>
* patman: Use a dict in gitutil to avoid importing seriesSimon Glass2020-07-091-5/+4
| | | | | | | | Only a few members of this class are used and only in a test. To avoid importing the module, convert the test to use a dict. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Stefan Bosch <stefan_b@posteo.net>
* patman: Avoid circular dependency between command and toolsSimon Glass2020-07-091-4/+3
| | | | | | | | This seems to cause problems in some cases. Split the dependency by copying the code to command. Reported-by: Stefan Bosch <stefan_b@posteo.net> Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Drop unnecessary import in gitutilSimon Glass2020-07-091-1/+0
| | | | | | | The checkpatch module is not used, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Stefan Bosch <stefan_b@posteo.net>
* kconfiglib: Update to the 14.1.0 releaseTom Rini2020-07-011-242/+372
| | | | | | | | | | | A large number of changes have happened upstream since our last sync in commit 65e05ddc1ae2 ("kconfiglib: Update to the 12.14.0 release"). The big motivation for this sync is support for user defined macros within Kconfig. Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* Merge tag 'mips-pull-2020-06-29' of ↵Tom Rini2020-06-301-0/+55
|\ | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-mips into next - net: pcnet: cleanup and add DM support - Makefile: add rule to build an endian-swapped U-Boot image used by MIPS Malta EL variants - CI: add Qemu tests for MIPS Malta
| * tools: add script for byte endianness swappingDaniel Schwierzeck2020-06-291-0/+55
| | | | | | | | | | | | | | This can be used to swap the byte endianness of a binary file from Little-Endian to Big-Endian or vice-versa. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
* | Merge tag 'ti-v2020.10-next' of ↵Tom Rini2020-06-181-3/+11
|\ \ | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-ti into next - DM conversion for OMAP4, OMAP5 platforms. - Other minor fixes for Nokia RX51, am33, am57, am654.
| * | tools: k3_gen_x509_cert: Set default early HS JTAG access to disabledAndrew F. Davis2020-06-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When authenticating the initial boot binary the ROM will check a debug type value in the certificate and based on that open JTAG access to that core. This only effects HS devices as non-HS device ROM allows JTAG by default. This can be useful for HS developers working in the early boot stage, before SYSFW is loaded. After that point the JTAG access can be changed based on board configurations passed to SYSFW. This access can also be a large security problem as JTAG access on HS devices can be used to circumvent the chain-of-trust controls. Accidentally leaving this open defeats the security on HS, due to this change the default to disabled. This should only effect those working on early HS boot code, which is a limited crowd who will already know how to re-enable this access as needed. Signed-off-by: Andrew F. Davis <afd@ti.com>
| * | tools: k3_gen_x509_cert: Allow selecting early JTAG debug valueAndrew F. Davis2020-06-131-3/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | When authenticating the initial boot binary the ROM will check a debug type value in the certificate and based on that open JTAG access to that core. Make this selectable in the signing tool to allow it to be enabled or disabled based on user command line input. This does not change the default behavior. Signed-off-by: Andrew F. Davis <afd@ti.com>
* | Merge tag 'dm-pull-12jun20' of git://git.denx.de/u-boot-dm into nextTom Rini2020-06-133-18/+43
|\ \ | | | | | | | | | | | | | | | patman improvements to allow it to work with Zephyr change to how sequence numbers are assigned to devices minor fixes and improvements
| * | buildman: Remove _of_#_ from results directory pathsOvidiu Panait2020-06-112-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the following scenario will rebuild the first commit even though it is not really necessary - the commit sha or the position in the patchset did not change: $ git am <local-patch-0001> $ tools/buildman/buildman -P -E -W -b master mx6 <do some more development work> $ git am <local-patch-0002> $ tools/buildman/buildman -P -E -W -b master mx6 <- will rebuild the first commit as well, even though nothing has changed about it. This is due to the fact that previous results directories get removed when the number of commits change. By removing the _of_#_ part of the directory path, the commits will be rebuilt only if the commit sha or the position in the patchset changes. Also, update the testcase to reflect this change. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
| * | patman: Complain if a checkpatch line is not understoodSimon Glass2020-06-111-0/+2
| | | | | | | | | | | | | | | | | | | | | Rather than suffering in silence, output a warning if something about the checkpatch output cannot be understood. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | patman: Support warnings in the patch subjectSimon Glass2020-06-111-1/+6
| | | | | | | | | | | | | | | | | | | | | Sometimes checkpatch outputs problems in the patch subject. Add support for parsing this output and reporting it correctly. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | patman: Handle checkpatch output with notes and codeSimon Glass2020-06-111-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | If checkpatch is configured to output code we should ignore it. Similarly, notes should be ignored. Update the logic to handle these situations. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | patman: Don't try to process checkpatch lines twiceSimon Glass2020-06-111-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | Once we have determined what the line refers to there is no point in processing it further. Update the logic to continue to the next line in these cases. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | patman: Support emacs mode with checkpatchSimon Glass2020-06-111-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | If checkpatch is run in 'emacs' mode it shows the filename at the start of each line. Add support for this so that the warnings and errors are correctly detected. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | patman: Fix 'warning' typoSimon Glass2020-06-111-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | If no warnings are detected due to checkpatch having unexpected options, patman currently shows an error: TypeError: unsupported operand type(s) for +=: 'int' and 'property' Fix this by initing the variable correctly. Signed-off-by: Simon Glass <sjg@chromium.org>
* / Add support for SHA384 and SHA512Reuben Dowle2020-06-121-0/+2
|/ | | | | | | | | | | | | | | | The current recommendation for best security practice from the US government is to use SHA384 for TOP SECRET [1]. This patch adds support for SHA384 and SHA512 in the hash command, and also allows FIT images to be hashed with these algorithms, and signed with sha384,rsaXXXX and sha512,rsaXXXX The SHA implementation is adapted from the linux kernel implementation. [1] Commercial National Security Algorithm Suite http://www.iad.gov/iad/programs/iad-initiatives/cnsa-suite.cfm Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>