aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2020-04-24mkimage: fit: Free buf directly in fit_extract_data()Bin Meng
If given ptr to free() is NULL, no operation is performed. Hence we can just free buf directly in fit_extract_data(). Signed-off-by: Bin Meng <bin.meng@windriver.com>
2020-04-24mkimage: fit: Unmmap the memory before closing fd in fit_import_data()Lihua Zhao
Without calling munmap(), the follow-up call to open() the same file with a flag O_TRUNC seems not to cause any issue on Linux, but it fails on Windows with error like below: Can't open kernel_fdt.itb.tmp: Permission denied Fix this by unmapping the memory before closing fd in fit_import_data(). Signed-off-by: Lihua Zhao <lihua.zhao@windriver.com> Signed-off-by: Bin Meng <bin.meng@windriver.com>
2020-04-24tools: Remove the out-of-date MinGW support codesBin Meng
MinGW build for U-Boot tools has been broken for years. The official support of Windows build is now MSYS2. Remove the MinGW support codes. Signed-off-by: Bin Meng <bin.meng@windriver.com>
2020-04-24tools: image-host.c: use correct output formatHeinrich Schuchardt
When building on a 32bit host the following warning occurs: tools/image-host.c: In function ‘fit_image_read_data’: tools/image-host.c:310:42: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘ssize_t’ {aka ‘int’} [-Wformat=] printf("Can't read all file %s (read %ld bytes, expexted %ld)\n", ~~^ %d filename, n, sbuf.st_size); ~ n is of type ssize_t so we should use %zd for printing. Fixes: 7298e422504e ("mkimage: fit: add support to encrypt image with aes") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-04-24mkimage: fit_image: Add option to make fit header alignKever Yang
The image is usually stored in block device like emmc, SD card, make the offset of image data aligned to block(512 byte) can avoid data copy during boot process. eg. SPL boot from FIT image with external data: - SPL read the first block of FIT image, and then parse the header; - SPL read image data separately; - The first image offset is the base_offset which is the header size; - The second image offset is just after the first image; - If the offset of imge does not aligned, SPL will do memcpy; The header size is a ramdon number, which is very possible not aligned, so add '-B size'to specify the align size in hex for better performance. example usage: ./tools/mkimage -E -f u-boot.its -B 0x200 u-boot.itb Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-04-24tool: use ALIGN() to align the sizeKever Yang
Use the ALIGN() for size align so that the code is more readable. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2020-04-24tools: imx8mimage: remove redundant codeKever Yang
The align for fit_size has been done twice, remove the first one for it does not make any sense. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-04-24tools: kwbimage: use common ALIGN to do the size alignKever Yang
The ALIGN() is now available at imagetool.h, migrate to use it. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Stefan Roese <sr@denx.de>
2020-04-24tools: mkimage: use common ALIGN to do the size alignKever Yang
The ALIGN() is now available at imagetool.h, migrate to use it. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-04-24tool: aisimage: use ALIGN instead of self defiend macroKever Yang
The ALIGN() is available at imagetool.h, no need to self define one. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-04-24tool: Move ALIGN_MASK to header as common MACROKever Yang
The ALIGN code is need by many files who need handle structure or image align, so move the macro to imagetool.h file. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-04-21buildman: Change the exit codesSimon Glass
The current exit codes of 128 and 129 are useful in that they do not conflict with those returned by tools, but they are not actually valid. It seems better to pick some codes which work with 'bit bisect run'. Update them to 100 (for errors) and 101 (for warnings). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Update the TODO itemsSimon Glass
A few of these have been done. Drop those and add some new ideas. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Add an option to ignore migration warningsSimon Glass
These are becoming more common now. They cause boards to show warnings which can be mistaking for compiler warnings. Add a buildman option to ignore them. This option works only with the summary option (-s). It does not affect the build process. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Add an option to ignore device-tree warningsSimon Glass
Unfortunately the plague of device-tree warnings has not lifted. These warnings infiltrate almost every build, adding noise and confusion. Add a buildman option to ignore them. This option works only with the summary option (-s). It does not affect the build process. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Make -I the defaultSimon Glass
At present buildman defaults to running 'mrproper' on every thread before it starts building commits for each board. This can add a delay of about 5 seconds to the start of the process, since the tools and other invariants must be rebuilt. In particular, a build without '-b', to build current source, runs much slower without -I, since any existing build is removed, thus losing the possibility of an incremental build. Partly this behaviour was to avoid strange build-system problems caused by running 'make defconfig' for one board and then one with a different architecture. But these problems were fixed quite a while ago. The -I option (which disabled mrproper) was introduced four years ago and does not seem to cause any problems with builds. So make -I the default and deprecate the option. To allow use of 'mrproper', add a new -m flag. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Update workflow documentation with more detailSimon Glass
Make a few additions and change some wording in the workflow documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Add the abbreviation for --boardsSimon Glass
This option may be frequency used, so mention that it can be abbreviated to --bo Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Update the 'theory of operation' a littleSimon Glass
Make a few updates to this important section of the documentation, to make things clearer. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Show a summary of the build resultSimon Glass
When buildman finishes it leaves the last summary line visible, which shows the number of successful builds, builds with warnings and builds with errors. It is useful also to see how many builds were done in total along with the time taken. Show these on a separate line before buildman finishes. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Limit the length of progress messagesSimon Glass
If a progress message is longer than the terminal line it will scroll the terminal. Limit the messages to the terminal width. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Show the number of builds remainingSimon Glass
It is nice to see the actual number of builds remaining to complete. Add this in the progress message, using a different colour. Drop the unnecessary 'name' variable while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Drop unused output codeSimon Glass
The commit counter is a hangover from when buildman processed each board for a commit. Now buildman processes each commit for a board, so this output is never triggered. Delete it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Show a message when fetching a repoSimon Glass
Fetching updated versions of a repo can take time. At present buildman gives no indication that it is doing this. Add a message to explain the delay. Tidy up a few other messages while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Drop the line-clearing code in BuilderSimon Glass
The new feature in terminal can be used by buildman. Update the Builder class accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21patman: Support limiting output to a single lineSimon Glass
When outputing a progress line we don't want it to go past the end of the current terminal line, or it will not be possible to erase it. Add an option to Print() which allows limiting the output to the terminal width. Since ANSI sequences do not take up space on the terminal, these are removed. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21patman: Support erasing a previously unfinished text lineSimon Glass
When printing progress it is useful to print a message and leave the cursor at the end of the line until the operation is finished. When it is finished, the line needs to be erased so a new line can start in its place. Add a function to handle clearing a line previously written by terminal.Print() Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21patman: Update flushing Print() for Python 3Simon Glass
This does not seem to work on Python 3. Update the code to use the built-in support. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Use spaces in the board listSimon Glass
At present the board names shown with -l are separated by commas. This makes it hard to double-click to select a particular board. Also it is not possible to select all boards and paste them as arguments to a subsequent buildman run, since buildman requires spaces to separate the list on the command line, not commas. Change the output format to use spaces instead of commas. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Show the list of boards in magentaSimon Glass
It is quite hard to see the list of board for each error line since the colour is the same as the actual error line. Show the board list in magenta so that it is easier to distinguish them. There is no point in checking the colour of the overall line, since there are now multiple colours. So drop those tests. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Use an object to hold error linesSimon Glass
At present the string for each error line is created in _CalcErrorDelta() and used to create the summary output. This is inflexible since all the information (error/warning character, error line, list of boards with that error line) is munged together in a string. Create an object to hold this information and only convert it to a string when printing the actual output. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Use yellow consistently for warning linesSimon Glass
At present warnings are shown in yellow in the summary (-s) but magenta in the detail listing (-e). Use yellow in both. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Test the output with --list-error-boardsSimon Glass
Add a test to cover this flag, which adds the name of each board to each error/warning line. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Add a test helper for creating a line prefixSimon Glass
The split/join code is repeated in a lot of places. Add a function to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Split out testOutput() into separate functionsSimon Glass
We want to add a few more tests similar to testOutput(). Split its logic into a function which runs buildman to get the output and another which checks the output. This will make it easier to reuse the code. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Create temp directory in test setupSimon Glass
Rather than having a few tests handle this themselves, create the temporary directory in the setUp() method and remove it in tearDown(). This will make it easier to add more tests. Only testOutput and testGit() actually need it, but it doesn't add to the test time noticeably to do this for all tests in this file. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Use an iterator to check test outputSimon Glass
Rather than using the absolute array index, use an interator to work through the expected output lines. This is easier to follow. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Add test coverage for error/warning colourSimon Glass
Buildman should output the right colours for each error/warning line. Some of these checks are missing. Add them. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-21buildman: Refactor error-line output int a functionSimon Glass
Reduce the amount of repeated code by creating an _OutputErrLines() function to hold this code. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-17doc: fix references to driver-modelHeinrich Schuchardt
Fix some errors pointed out by 'make refcheckdocs'. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-04-17mkimage: fit: don't create image with 0700 permissionsThomas Hebb
commit 7298e422504e ("mkimage: fit: add support to encrypt image with aes") added a new copyfile() function as part of the FIT image creation flow. This function as currently written creates the final image with a mode of 0700 (before umask), differing from the old behavior of 0666. Since there doesn't seem to be any reason to make the image executable or non-group, non-other readable, change the mask to 0666 to preserve the old behavior. Fixes: 7298e422504e ("mkimage: fit: add support to encrypt image with aes") Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
2020-04-16patman: Apply the cc limit to the cover letter alsoSimon Glass
Quite often on a series that has clean-up patches, the individual patches may fit within the cc limit but the cover letter does not. Apply the same limit to the cover letter. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Chris Packham <judge.packham@gmail.com>
2020-04-10buildman: Drop the -a optionSimon Glass
There is no point in setting the ARCH environment variable since the U-Boot build system no-longer uses it. It seems safe to drop this feature since it was only recently added. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-04-10buildman: Allow building within a subdir of the current dirSimon Glass
This is useful in some situations, in particular with -w and when building in-tree. Now that we are more careful about what we remove in _PrepareOutputSpace(), it should be safe to relax this restriction. Update the progress information also so it is clear what buildman is doing. Remove files can take a long time. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-10buildman: Be more selective about which directories to removeSimon Glass
At present buildman removes any directory it doesn't intend to write output into. This is overly expansive since if the output directory happens to be somewhere with existing files, they may be removed. Using an existing directory for buildman is not a good practice, but since the result might be catastrophic, it is best to guard against it. A previous commit[1] fixed this by refusing to write to a subdirectory of the current directory, assumed to have U-Boot source code. But we can do better by only removing directories that look like the ones buildman creates. Update the code to do this and add a test. Signed-off-by: Simon Glass <sjg@chromium.org> [1] 409fc029c40 tools: buildman: Don't use the working dir as build dir
2020-04-10buildman: Allow ignoring warnings in the return codeSimon Glass
Sometimes we don't want buildman to return failure if it seems warnings. Add a -W option to support this. If buildman detects warnings (and no errors) it will return an exit code of 0 (success). Note that the definition of 'warnings' includes the migration warnings produced by U-Boot, such as: ===================== WARNING ====================== This board does not use CONFIG_DM_MMC. Please update ... ==================================================== Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2020-04-10buildman: Update help for -dSimon Glass
This help is a bit ambiguous. It only does anything if asked to show size changes with -S. Update the help and the function comments. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-10bulidman: Add support for a simple buildSimon Glass
It is useful to run a simple build and put all the output in a single directory. Add a -w option to support this. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-10buildman: Document the members of BuilderJobSimon Glass
This class has a few more members now. Add documentation for them and fix a nit in the 'commits' comment. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-10buildman: Support fetching gcc 9.2.0Bin Meng
This adds support to fetch gcc 9.2.0 toolchains. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>