aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2020-07-09dtoc: add test for cd-gpiosWalter Lozano2-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>
2020-07-09dtoc: update dtb_platdata to support cd-gpiosWalter Lozano2-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>
2020-07-09dtoc: extend dtoc to use struct driver_info when linking nodesWalter Lozano2-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>
2020-07-09dtoc: add option to disable warningsWalter Lozano3-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>
2020-07-09dtoc: add support to scan driversWalter Lozano3-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>
2020-07-09dtoc: add missing code commentsWalter Lozano1-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>
2020-07-09checkpatch: Don't warn about PREFER_IF in headers/DT filesSimon Glass1-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>
2020-07-09patman: Add tests for the rest of the checkpatch checksSimon Glass1-4/+43
Finish off the tests for our small collection of checkpatch checks. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-09patman: Decode output from the '--show-types' optionSimon Glass2-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>
2020-07-09patman: Add a test for the 'possible new uclass' checkSimon Glass1-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>
2020-07-09patman: Rename test.py to test_checkpatch.pySimon Glass2-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>
2020-07-09patman: Drop import of test_util in test_utilSimon Glass1-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>
2020-07-09patman: Avoid importing gitutil in settingsSimon Glass2-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>
2020-07-09patman: Pass in maintainer dirs to avoid and importSimon Glass2-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>
2020-07-09patman: Use a dict in gitutil to avoid importing seriesSimon Glass1-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>
2020-07-09patman: Avoid circular dependency between command and toolsSimon Glass1-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>
2020-07-09patman: Drop unnecessary import in gitutilSimon Glass1-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>
2020-07-01kconfiglib: Update to the 14.1.0 releaseTom Rini1-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>
2020-06-30Merge tag 'mips-pull-2020-06-29' of ↵Tom Rini1-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
2020-06-29tools: add script for byte endianness swappingDaniel Schwierzeck1-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>
2020-06-18Merge tag 'ti-v2020.10-next' of ↵Tom Rini1-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.
2020-06-13tools: k3_gen_x509_cert: Set default early HS JTAG access to disabledAndrew F. Davis1-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>
2020-06-13tools: k3_gen_x509_cert: Allow selecting early JTAG debug valueAndrew F. Davis1-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>
2020-06-13Merge tag 'dm-pull-12jun20' of git://git.denx.de/u-boot-dm into nextTom Rini3-18/+43
patman improvements to allow it to work with Zephyr change to how sequence numbers are assigned to devices minor fixes and improvements
2020-06-12Add support for SHA384 and SHA512Reuben Dowle1-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>
2020-06-11buildman: Remove _of_#_ from results directory pathsOvidiu Panait2-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>
2020-06-11patman: Complain if a checkpatch line is not understoodSimon Glass1-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>
2020-06-11patman: Support warnings in the patch subjectSimon Glass1-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>
2020-06-11patman: Handle checkpatch output with notes and codeSimon Glass1-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>
2020-06-11patman: Don't try to process checkpatch lines twiceSimon Glass1-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>
2020-06-11patman: Support emacs mode with checkpatchSimon Glass1-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>
2020-06-11patman: Fix 'warning' typoSimon Glass1-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>
2020-06-02mkimage: Default to adding a crc32 hash with '-f auto'Simon Glass1-2/+16
This option currently does not add any sort of hash to the images in the FIT. Add a hash node requesting a crc32 checksum, which at least provides some protection. The crc32 value is easily ignored (e.g. in SPL) if not needed. and takes up only about 48 bytes per image, including overhead. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Denk <wd@denx.de>
2020-06-02tools: fw_env: Fix warning when reading too littleHarald Seiler1-1/+7
When using CONFIG_ENV_IS_IN_FAT and the config-file specifies a size larger than what U-Boot wrote into the env-file, a confusing error message is shown: $ fw_printenv Read error on /boot/uboot.env: Success Fix this by showing a different error message when read returns too little data. Signed-off-by: Harald Seiler <hws@denx.de>
2020-05-29patman: Modify functional tests for new behaviorSean Anderson4-9/+79
This patch adds or modifies functional tests for the Cover-changes, Commit-changes, and Series-process-log tags in order to account for new behavior added in the previous few patches. The '(no changes since v1)' case is not tested for, since that would need an additional commit to test in addition to testing the existing code paths. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-05-29patman: Support multi-line changes in changelogsSean Anderson2-10/+35
This patch adds support to multi-line changes. That is, if one has a line in a changelog like - Do a thing but it spans multiple lines Using Series-process-log sort would sort as if those lines were unrelated. With this patch, any change line starting with whitespace will be considered part of the change before it. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-05-29patman: Add new tags for finer-grained changelog controlSean Anderson4-32/+83
By default patman generates a combined changelog for the cover letter. This may not always be desirable. Many patches may have the same changes. These can be coalesced with "Series-process-log: uniq", but this is imperfect. Similar changes like "Move foo to patch 7" will not be merged with the similar "Move foo to this patch from patch 6". Changes may not make sense outside of the patch they are written for. For example, a change line of "Add check for bar" does not make sense outside of the context in which bar might be checked for. Some changes like "New" or "Lint" may be repeated many times throughout different change logs, but carry no useful information in a summary. Lastly, I like to summarize the broad strokes of the changes I have made in the cover letter, while documenting all the details in the appropriate patches. I think this makes it easier to get a good feel for what has changed, without making it difficult to wade through every change in the whole series. This patch adds two new tags to add changelog entries which only appear in the cover letter, or only appear in the commit. Changes documented with "Commit-changes" will only appear in the commit, and will not appear in the cover letter. Changes documented with "Cover-changes" will not appear in any commit, and will only appear in the cover letter. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-05-29patman: Suppress empty changelog entriesSean Anderson2-12/+53
Patman outputs a line for every edition of the series in every patch, regardless of whether any changes were made. This can result in many redundant lines in patch changelogs, especially when a patch did not exist before a certain revision. For example, the existing behaviour could result in a changelog of Changes in v7: None Changes in v6: None Changes in v5: - Make a change Changes in v4: None Changes in v3: - New Changes in v2: None With this patch applied and with --no-empty-changes, the same patch would look like (no changes since v5) Changes in v5: - Make a change Changes in v3: - New This is entirely aesthetic, but I think it reduces clutter, especially for patches added later on in a series. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-05-29patman: Add an option to create patches without binary contentsBin Meng3-2/+12
Some mailing lists have size limits and when we add binary contents to our patches it's easy to exceed the size limits. Git supports a command line option "--no-binary" to generate patches without any binary contents. Add an option in patman to handle this. Note with this option patches cannot be applied properly, but they are still useful for code review. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-05-29patman: Sort the command line optionsBin Meng1-6/+6
Sort the existing command line options by: - help comes first - option starts with '-' - option starts with '--' Lower case followed by upper case letters, in alphabetical order. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-05-25tools/env/fw_env.h: remove env.hRomain Naour1-1/+0
As reported by Nicolas Carrier on the Buildroot mailing list [1], there is a new build issue while building a program which interacts with the u-boot environment. This program uses the headers of the ubootenv library provided by uboot-tools. This is a recent change from uboot [2] adding "#include <env.h>" to fw_env.h. Adding env.h require a board configuration to build since it also include compiler.h (and others uboot internal includes). env.h include seems not needed since env_set() is not used in fw_env tool. Nicolas removed env.h from fw_env tool and fixed it's build issue. This problem is present since uboot v2019.10. [1] http://lists.busybox.net/pipermail/buildroot/2020-April/280307.html [2] https://gitlab.denx.de/u-boot/u-boot/-/commit/9fb625ce05539fe6876a59ce1dcadb76b33c6f6e Reported-by: Nicolas Carrier <nicolas.carrier@orolia.com> Signed-off-by: Romain Naour <romain.naour@gmail.com>
2020-05-22tools: value checks in rkcommon_check_params()Heinrich Schuchardt1-7/+7
Building with -Wtype-limits yields tools/rkcommon.c: In function ‘rkcommon_check_params’: tools/rkcommon.c:158:27: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 158 | if (spl_params.init_size < 0) | ^ tools/rkcommon.c:165:28: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] 165 | if (spl_params.boot_size < 0) | Fix the value checks. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2020-05-18command: Remove the cmd_tbl_t typedefSimon Glass1-1/+1
We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-18common: Drop image.h from common headerSimon Glass1-0/+1
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-15tools: ftdgrep: use /* fallthrough */ as neededHeinrich Schuchardt1-4/+7
GCC recognizes /* fallthrough */ if -Wimplicit-fallthrough=3 is enabled. Let's use it consistently. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-05-15tools: mkimage: use /* fallthrough */ as neededHeinrich Schuchardt1-1/+1
GCC recognizes /* fallthrough */ if -Wimplicit-fallthrough=3 is enabled. Let's use it consistently. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-05-15rename symbol: CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOODTrevor Woerner1-2/+2
Have this symbol follow the pattern of all other such symbols. This patch also removes a TODO from the code. Reviewed-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2020-05-07Revert "mkimage: fit: Do not tail-pad fitImage with external data"Tom Rini1-1/+2
This has been reported to break booting of U-Boot from SPL on a number of platforms due to a lack of alignment of the external data. The issues this commit is addressing will need to be resolved another way. Re-introduce a data leak in the padding for now. This reverts commit 20a154f95bfe0a3b5bfba90bea7f001c58217536. Reported-by: Alex Kiernan <alex.kiernan@gmail.com> Reported-by: Michael Walle <michael@walle.cc> Tested-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2020-05-04mkimage: fit: Do not tail-pad fitImage with external dataMarek Vasut1-2/+1
There is no reason to tail-pad fitImage with external data to 4-bytes, while fitImage without external data does not have any such padding and is often unaligned. DT spec also does not mandate any such padding. Moreover, the tail-pad fills the last few bytes with uninitialized data, which could lead to a potential information leak. $ echo -n xy > /tmp/data ; \ ./tools/mkimage -E -f auto -d /tmp/data /tmp/fitImage ; \ hexdump -vC /tmp/fitImage | tail -n 3 before: 00000260 61 2d 6f 66 66 73 65 74 00 64 61 74 61 2d 73 69 |a-offset.data-si| 00000270 7a 65 00 00 78 79 64 64 |ze..xydd| ^^ ^^ ^^ after: 00000260 61 2d 6f 66 66 73 65 74 00 64 61 74 61 2d 73 69 |a-offset.data-si| 00000270 7a 65 00 78 79 |ze.xy| Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Tom Rini <trini@konsulko.com>
2020-05-01tools/fit-image: print a warning when cmd-line for dtc might be truncatedSven Roederer1-0/+4
Signed-off-by: Sven Roederer <devel-sven@geroedel.de>