aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2021-01-05dtoc: Tidy up pylint warnings in testSimon Glass1-71/+85
Tidy up this file to reduce the number of pylint warnings. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dtoc: Convert _drivers to a dictSimon Glass2-4/+32
At present this member holds a simple list of driver names. Update it to be a dict of DriverInfo, with the name being the key. This will allow more information to be added about each driver, in future patches. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dtoc: Output the struct values in a separate functionSimon Glass1-16/+34
Reduce the length of output_node() futher by moving the struct-output functionality into a two separate functions. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dtoc: Output the device in a separate functionSimon Glass1-11/+22
Reduce the length of output_node() by moving the device-output functionality into a separate function. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dtoc: Make _output_list a top-level functionSimon Glass1-40/+40
It is annoying to have this function inside its parent since it makes the parent longer and hard to read. Move it to the top level. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05dtoc: Fix a few pylint warnings in dtb_platdataSimon Glass1-15/+16
These have crept in again. Update the file to fix all but these ones: dtb_platdata.py:143:0: R0902: Too many instance attributes (10/7) (too-many-instance-attributes) dtb_platdata.py:713:0: R0913: Too many arguments (6/5) (too-many-arguments) Signed-off-by: Simon Glass <sjg@chromium.org>
2021-01-05sandbox: Drop unnecessary test nodeSimon Glass2-17/+0
The spl-test4 node deliberately has an invalid compatible string. This causes a warning from dtoc and the check it does is not really necessary. Drop it, to avoid the warning and associated confusion. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-31mkeficapsule: Add support for embedding public key in a dtbSughosh Ganu2-12/+222
Add options for embedding the public key esl(efi signature list) file to the platform's dtb. The esl file is then retrieved and used for authenticating the capsule to be used for updating firmare components on the platform. The esl file can now be embedded in the dtb by invoking the following command mkeficapsule -K <pub_key.esl> -D <dtb> In the scenario where the esl file is to be embedded in an overlay, this can be done through the following command mkeficapsule -O -K <pub_key.esl> -D <dtb> This will create a node named 'signature' in the dtb, and the esl file will be stored as 'capsule-key' Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2020-12-22buildman: Remove output binaries before buildingSimon Glass1-1/+13
Buildman reuses build directories from previous builds to avoid the cost of 'make mrproper' for every build. If the previous build produced an SPL image but the current one does not, the SPL image will remain and buildman will think it is a result of building the current board. Remove these files before building, to avoid this problem. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-22patman: Add project-default for 'gcc'Philipp Tomsich1-1/+6
Add defaults for FSF/GNU projects, such as gcc, that provide sensible settings for those projects. Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-12-22patman: Add --no-signoff to suppress adding signoffsPhilipp Tomsich4-8/+12
To enable use of patman with FSF/GNU projects, such as GCC or Binutils, no Signed-off-by may be added. This adds a command line flag '--no-signoff' to suppress adding signoffs in patman when processing commits. Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu> Reviewed-by: Simon Glass <sjg@chromium.org> Fix patman testBranch() test: Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-13checkpatch: Add warnings for unexpected struct namesSimon Glass1-0/+28
As a way of keeping the driver declarations more consistent, add a warning if the struct used does not end with _priv or _plat. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-13dm: Rename 'platdata_size' to 'plat_size'Simon Glass2-34/+34
Rename this to be consistent with the change from 'platdata'. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-13dm: treewide: Rename 'platdata' variables to just 'plat'Simon Glass2-34/+34
We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-13dtoc: Tidy up more Python style in dtb_platdataSimon Glass1-45/+46
Update this file to reduce the number of pylint warnings. Also add a few missing comments while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-13dtoc: Tidy up Python style in dtb_platdataSimon Glass1-29/+42
Update this, mostly to add comments for argument and return types. It is probably still too early to use type hinting since it was introduced in 3.5. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-13patman: Drop tools.ToChar() and ToChars()Simon Glass3-28/+5
This is useful anymore, since we always want to call chr() in Python 3. Drop it and adjust callers to use chr(). Also drop ToChars() which is no-longer used. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-13patman: Drop tools.ToByte()Simon Glass3-19/+4
This is not needed in Python 3. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-13patman: Drop unicode helper functionsSimon Glass8-63/+17
We don't need these now that everything uses Python 3. Remove them and the extra code in GetBytes() and ToBytes() too. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-13fdt: Use an Enum for the data typeSimon Glass5-59/+77
Use an Enum instead of the current ad-hoc constants, so that there is a data type associated with each 'type' value. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-03test/py: efi_capsule: test for FIT image capsuleAKASHI Takahiro1-1/+2
The test can run on sandbox build and it attempts to execute a firmware update via a capsule-on-disk, using a FIT image capsule, CONFIG_EFI_CAPSULE_FIT. To run this test successfully, you need configure U-Boot specifically; See test_capsule_firmware.py for requirements, and hence it won't run on Travis CI, at least, for now. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-12-03tools: add mkeficapsule command for UEFI capsule updateAKASHI Takahiro2-0/+238
This is a utility mainly for test purpose. mkeficapsule -f: create a test capsule file for FIT image firmware Having said that, you will be able to customize the code to fit your specific requirements for your platform. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2020-11-19tools: dumpimage: Remove remaining mentions of the -i optionTyler Hicks1-3/+3
The -i option of the dumpimage tool has been removed so it should no longer be documented in the README file. Refer readers to the tool's help output rather than maintain a copy of the usage in the README. Finally, adjust the example dumpfile invocation in imagetool.h to use the -o option instead of the removed -i option. Fixes: 12b831879a76 ("tools: dumpimage: Simplify arguments") Signed-off-by: Tyler Hicks <tyhicks@linux.microsoft.com> Cc: Martyn Welch <martyn.welch@collabora.com> Acked-by: Martyn Welch <martyn.welch@collabora.com>
2020-11-19tools: image-host.c: use correct variable for strerrnoPhilippe Reynes1-1/+1
In the function get_random_data, strerrno is called with the variable ret (which is the return of the function clock_gettime). It should be called with errnor. This commit fixes this mistake. Reported-by: Coverity (CID: 312956) Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-11-19tools: image-host.c: use random instead of randPhilippe Reynes1-2/+2
According to the manpage of rand, it is recommended to use random instead of rand. This commit updates the function get_random_data to use random. Reported-by: Coverity (CID: 312953) Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-11-14patman: Add a Series-patchwork-url optionSimon Glass3-2/+13
Add a commit tag to allow the Patchwork URL to be specified in a commit. This can be handy for when you submit code to multiple projects but don't want to use the -p option. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-14patman: Add a setting for the Patchwork URLSimon Glass2-2/+5
Add an argument to allow specifying the the patchwork URL. This also adds this feature to the settings file, either globally, or on a per-project basis. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-14patman: Allow specifying the patchwork URLSimon Glass4-27/+48
Add a new argument to allow the URL of the patchwork server to be speciified. For now this is hard-coded in the main file, but future patches will move it to the settings file. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-14patman: Update defaults in subparsersSimon Glass1-6/+22
At present values from the settings file are only applied to the main parser. With the new parser structure this means that some settings are ignored. Update the implementation to set defaults across the main parser and all subparsers. Also fix up the comments, since ArgumentParser is being used now. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-14patman: Correct Change-Ids error message argsSimon Glass1-2/+2
The arguments of this error are incorrectly formatted. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-14patman: Refactor how the default subcommand worksSimon Glass3-33/+38
At present patman tries to assume a default subcommand of 'send', to maintain backwards compatibility. However it does not cope with arguments added to the default command, so for example 'patman -t' does not work. Update the logic to handle this. Also update the CC command to use 'send' explicitly, since otherwise patman gets confused with the patch-filename argument. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Support listing comments from patchworkSimon Glass6-36/+268
While reviewing feedback it is helpful to see the review comments on the command line to check that each has been addressed. Add an option to support that. Update the workflow documentation to describe the new features. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Support parsing of review snippetsSimon Glass2-0/+168
Add support for parsing the contents of a patchwork 'patch' web page containing comments received from reviewers. This allows patman to show these comments in a simple 'snippets' format. A snippet is some quoted code plus some unquoted comments below it. Each review is from a unique person/email and can produce multiple snippets, one for each part of the code that attracts a comment. Show the file and line-number info at the top of each snippet if available. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Support updating a branch with review tagsSimon Glass6-16/+289
It is tedious to add review tags into the local branch and errors can sometimes be made. Add an option to create a new branch with the review tags obtained from patchwork. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Support checking for review tags in patchworkSimon Glass6-6/+784
Before sending out a new version of a series for review, it is important to add any review tags (e.g. Reviewed-by, Acked-by) collected by patchwork. Otherwise people waste time reviewing the same patch repeatedly, become frustrated and stop reviewing your patches. To help with this, add a new 'status' subcommand that checks patchwork for review tags, showing those which are not present in the local branch. This allows users to see what new review tags have been received and then add them. Sample output: $ patman status 1 Subject 1 Reviewed-by: Joe Bloggs <joe@napierwallies.co.nz> 2 Subject 2 Tested-by: Lord Edmund Blackaddër <weasel@blackadder.org> Reviewed-by: Fred Bloggs <f.bloggs@napier.net> + Reviewed-by: Mary Bloggs <mary@napierwallies.co.nz> 1 new response available in patchwork The '+' indicates a new tag. Colours are used to make it easier to read. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Detect missing upstream in CountCommitsToBranchSimon Glass2-3/+26
At present if we fail to find the upstream then the error output is piped to wc, resulting in bogus results. Avoid the pipe and check the output directly. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Improve handling of filesSimon Glass1-3/+8
Sometimes warnings are associated with a file and sometimes with the patch as a whole. Update the regular expression to handle both cases, even in emacs mode. Also add support for detecting new files. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Allow showing a Commit as a stringSimon Glass1-0/+3
Use the subject of the Commit object when printing it out. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Don't ignore lines starting with hashSimon Glass1-2/+5
These lines can indicate a continuation of an error and should not be ignored. Fix this. Fixes: 666eb15e923 ("patman: Handle checkpatch output with notes and code") Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Fix spelling of plural for warningSimon Glass1-4/+5
Tidy up the extra 's' when there is only a single warning. Fix the empty print statement also. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Convert testBasic() to use an interatorSimon Glass1-28/+27
On balance it is easier to use an iterator here, particularly if we need to insert lines due to new functionality. The only niggle is the need to keep the previous iterator value around in one case. Convert this test to use iter(). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Add some tests for warningsSimon Glass3-13/+116
Add tests that check that warnings are generated when expected. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Add a test for PatchStream tagsSimon Glass2-5/+44
The current functional tests run most of patman. Add a smaller test that just checks tag handling with the PatchStream class. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Drop unused signoff memberSimon Glass2-1/+1
This is not used. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Convert 'Series-xxx' tag errors into warningsSimon Glass2-2/+8
If the Series-xxx tag is not recognised patman currently reports a fatal error. This is inconvenient if a new feature is later added to patman that an earlier version does not support. Report a warning instead, to allow the user to take action if needed, but still allow operation to proceed. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Attach warnings to individual patchesSimon Glass2-4/+13
At present warnings are produced across the whole set of patches when parsing them. It is more useful to associate each warning with the patch (or commit) that generated it. Attach warnings to the Commit object and move them out of PatchStream. Also avoid generating duplicate warnings for the same commit. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Move warning collection to a functionSimon Glass1-13/+23
Add a new function in PatchStream to collect the warnings generated while parsing the stream. This will allow us to adjust the logic, such as dealing with per-commit warnings. Two of the warnings are in fact internal errors, so change them to raise and exception. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Fix up argument/return docs in patchstreamSimon Glass1-32/+50
Add missing documentation and type information. Fix up some missing docs on exceptions also. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Drop unused args in patchstreamSimon Glass1-5/+3
Drop a few arguments that are not used in functions. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-11-05patman: Rename variables in patchstreamSimon Glass1-26/+26
Some variables are too short or shadow other variables or types. Fix these to keep pylint3 happy. Signed-off-by: Simon Glass <sjg@chromium.org>