summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAgeLines
* mkimage: Don't close the file if it wasn't openedSimon Glass2016-03-22-2/+2
| | | | | | | | | The error path for fit_import_data() is incorrect if the second open() call fails. Reported-by: Coverity (CID: 138489) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Ensure file is closed in fdt_property_file()Simon Glass2016-03-22-1/+2
| | | | | | | | The file that is opened is not closed in all cases. Fix it. Reported-by: Coverity (CID: 138490) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Fix missing free() and close() in fit_build()Simon Glass2016-03-22-1/+4
| | | | | | | | | Make sure that both the error path and normal return free the buffer and close the file. Reported-by: Coverity (CID: 138491) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Fix missing free() in fit_extract_data()Simon Glass2016-03-22-0/+2
| | | | | | | | The 'buf' variable is not freed. Fix it. Reported-by: Coverity (CID: 138492) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Fix error path in fit_extract_data()Simon Glass2016-03-22-4/+7
| | | | | | | | | The 'fdt' variable is not unmapped in all error cases. Fix this. Reported-by: Coverity (CID: 138493) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Add a missing free() to fit_import_data()Simon Glass2016-03-22-0/+1
| | | | | | | | | The space allocated to fdt is not freed on error. Fix it. Reported-by: Coverity (CID: 138494) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Close the file when unable to get its sizeSimon Glass2016-03-22-0/+1
| | | | | | | | There is a missing close() on the error path. Add it. Reported-by: Coverity (CID: 138496) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Correct file being closed twice in fit_extract_data()Simon Glass2016-03-22-2/+0
| | | | | | | | | | The code flows through to the end of the function, so we don't need another close() before this. Remove it. Reported-by: Coverity (CID: 138503) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Correct file being closed twice in fit_import_data()Simon Glass2016-03-22-1/+1
| | | | | | | | | | The code flows through to the end of the function, so we don't need another close() before this. Remove it. Reported-by: Coverity (CID: 138504) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mkimage: Fix munmap() call when importing dataSimon Glass2016-03-22-1/+1
| | | | | | | | | The munmap() call unmaps the wrong memory buffer. Fix it. Reported-by: Coverity (CID: 138505) Reported-by: Coverity (CID: 138495) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* Fix spelling of "comment".Vagrant Cascadian2016-03-22-1/+1
| | | | | Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* cmd: Fix license commandTom Rini2016-03-22-2/+10
| | | | | | | | | | | | The license command isn't usually built and has a few problems: - The rules to generate license.h haven't worked in a long time, re-write these based on the bmp_logo.h rules. - 'tok' is unused and the license text size has increased - bin2header.c wasn't grabbing unistd.h to know the prototype for read(). Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* buildman: Clarify the use of -VSimon Glass2016-03-17-2/+3
| | | | | | | | | This option outputs to the log file, not to the terminal. Clarify that in the help, and add a mention of it in the README. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Stephen Warren <swarren@wwwdotorg.org> Reviewed-by: Stephen Warren <swarren@nvidia.com>
* buildman: Add a way to specific a full toolchain prefixSimon Glass2016-03-17-110/+226
| | | | | | | | | | | | | | | | At present buildman allows you to specify the directory containing the toolchain, but not the actual toolchain prefix. If there are multiple toolchains in a single directory, this can be inconvenient. Add a new 'toolchain-prefix' setting to the settings file, which allows the full prefix (or path to the C compiler) to be specified. Update the documentation to match. Suggested-by: Stephen Warren <swarren@wwwdotorg.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com>
* buildman: Allow branch names which conflict with directoriesSimon Glass2016-03-17-0/+7
| | | | | | | | | | At present if you try to use buildman with the branch 'test' it will complain that it is unsure whether you mean the branch or the directory. This is a feature of the 'git log' command that buildman uses. Fix it by resolving the ambiguity. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* Merge git://git.denx.de/u-boot-dmTom Rini2016-03-14-21/+51
|\
| * buildman: Allow the toolchain architecture to be specifiedSimon Glass2016-03-14-5/+12
| | | | | | | | | | | | | | | | At present the architecture is deduced from the toolchain filename. Allow it to be specified by the caller. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com
| * buildman: Allow the toolchain priority to be specifiedSimon Glass2016-03-14-8/+22
| | | | | | | | | | | | | | | | | | | | At present the priority of a toolchain is calculated from its filename based on hard-coded rules. Allow it to be specified by the caller. We will use this in a later patch. Also display the priority and provide a message when it is overriden by another toolchain of higher priority. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
| * buildman: Fix up a few code inconsistencies in toolchain.pySimon Glass2016-03-14-5/+6
| | | | | | | | | | | | | | | | | | Normally we use a single quote for strings unless there is a reason not to (such as an embedded single quote). Fix a few counter-examples in this file. Also add a missing function-argument comment. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
| * buildman: patman: Fix -H when installed as a symlinkSimon Glass2016-03-14-2/+4
| | | | | | | | | | | | | | | | | | | | It is convenient to install symlinks to buildman and patman in the search patch, such as /usr/local/bin. But when this is done, the -H option fails to work because it looks in the directory containing the symlink instead of its target. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
| * patman: Add a missing space in GetMetaDataForList()Simon Glass2016-03-14-1/+1
| | | | | | | | | | | | | | Fix this nit to keep the code consistent. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
| * fdtgrep: Improve error handling with invalid device treeSimon Glass2016-03-14-4/+10
| | | | | | | | | | | | | | | | | | | | This tool requires that the aliases node be the first node in the tree. But when it is not, it does not handle things gracefully. In fact it crashes. Fix this, and add a more helpful error message. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* | mkimage: Bring data into the FIT before processingSimon Glass2016-03-14-0/+97
| | | | | | | | | | | | | | | | Since we now support data outside the FIT image, bring it into the FIT image first before we do any processing. This avoids adding new functionality to the core FIT code for now. Signed-off-by: Simon Glass <sjg@chromium.org>
* | mkimage: Support placing data outside the FITSimon Glass2016-03-14-1/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One limitation of FIT is that all the data is 'inline' within it, using a 'data' property in each image node. This means that to find out what is in the FIT it is necessary to scan the entire file. Once loaded it can be scanned and then the images can be copied to the correct place in memory. In SPL it can take a significant amount of time to copy images around in memory. Also loading data that does not end up being used is wasteful. It would be useful if the FIT were small, acting as a directory, with the actual data stored elsewhere. This allows SPL to load the entire FIT, without the images, then load the images it wants later. Add a -E option to mkimage to request that it output an 'external' FIT. Signed-off-by: Simon Glass <sjg@chromium.org>
* | mkimage: Support adding device tree files to a FITSimon Glass2016-03-14-10/+133
| | | | | | | | | | | | | | | | | | | | | | To make the auto-FIT feature useful we need to be able to provide a list of device tree files on the command line for mkimage to add into the FIT. Add support for this feature. So far there is no support for hashing or verified boot using this method. For those cases, a .its file must still be provided. Signed-off-by: Simon Glass <sjg@chromium.org>
* | mkimage: Support automatic creating of a FIT without a .itsSimon Glass2016-03-14-5/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present, when generating a FIT, mkimage requires a .its file containing the structure of the FIT and referring to the images to be included. Creating the .its file is a separate step that makes it harder to use FIT. This is not required for creating legacy images. Often the FIT is pretty standard, consisting of an OS image, some device tree files and a single configuration. We can handle this case automatically and avoid needing a .its file at all. To start with, support automatically generate the FIT using a new '-f auto' option. Initially this only supports adding a single image (e.g. a linux kernel) and a single configuration. Signed-off-by: Simon Glass <sjg@chromium.org>
* | tools: Add a function to obtain the size of a fileSimon Glass2016-03-14-0/+34
| | | | | | | | | | | | | | This will be used in mkimage when working out the required size of the FIT based on the files to be placed into it. Signed-off-by: Simon Glass <sjg@chromium.org>
* | mkimage: Allow a FIT to include an image of any typeSimon Glass2016-03-14-5/+29
| | | | | | | | | | | | | | | | | | | | At present FIT images are set up by providing a device tree source file which is a file with a .its extension. We want to support automatically creating this file based on the image supplied to mkimage. This means that even though the final file type is always IH_TYPE_FLATDT, the image inside may be something else. Signed-off-by: Simon Glass <sjg@chromium.org>
* | tools: Include fdt_sw.o in libfdt for mkimageSimon Glass2016-03-14-1/+1
| | | | | | | | | | | | | | At present this file is omitted. It is used to build up a binary device tree. We plan to do this in mkimage, so include this file in the build. Signed-off-by: Simon Glass <sjg@chromium.org>
* | mkimage: Make 'params' staticSimon Glass2016-03-14-1/+1
| | | | | | | | | | | | This is not used outside mkimage.c, so make this variable static. Signed-off-by: Simon Glass <sjg@chromium.org>
* | mkimage: Show an error message when usage() is calledSimon Glass2016-03-14-8/+9
| | | | | | | | | | | | | | Sometimes incorrect arguments are supplied but the reason is not obvious to the user. Add some helpful messages. Signed-off-by: Simon Glass <sjg@chromium.org>
* | mkimage: Move usage() up to the topSimon Glass2016-03-14-39/+42
| | | | | | | | | | | | | | To avoid a forward declaration, move the usage() function higher in the file. Signed-off-by: Simon Glass <sjg@chromium.org>
* | mkimage: Sort the option processing code by optionSimon Glass2016-03-14-25/+25
| | | | | | | | | | | | | | Adjust the code so that option alphabetical order matches the order in the switch() statement. This makes it easier to find options. Signed-off-by: Simon Glass <sjg@chromium.org>
* | mkimage: Convert to use getopt()Simon Glass2016-03-14-132/+101
| | | | | | | | | | | | | | | | | | The current way of parsing arguments is a bit clumsy. It seems better to use getopt() which is commonly used for this purpose. Convert the code to use getopt() and make a few minor adjustments as needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* | mkimage: Move argument processing into its own functionSimon Glass2016-03-14-24/+32
|/ | | | | | | At present main() is very long. Split out the argument processing to make it easier to follow. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge git://git.denx.de/u-boot-dmTom Rini2016-02-25-1/+4
|\
| * patman: fix series-notes handling for buildmanAlbert ARIBAUD2016-02-24-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A patman series with a 'Series-notes' section causes buildman to crash with: self.series.notes += self.section TypeError: cannot concatenate 'str' and 'list' objects Fix by initializing series.notes as a one-element array rather than a scalar. Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* | tools: Update openrisc toolchain informationBin Meng2016-02-24-2/+9
| | | | | | | | | | | | | | | | | | Since commit 87da2690ab81b5f29f83dc85c55f933e6ef414bc "openrisc: updating build tools naming convention", openrisc kernel.org toolchain is out of date and cannot build U-Boot. Update buildman and moveconfig tools to refer to the new one. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
* | tools: -Wno-deprecated-declarations for OpenSSL on darwinAndreas Bießmann2016-02-24-0/+8
| | | | | | | | | | | | | | | | | | | | | | Since OpenSSL is deprecated on OS X in favour of Common Crypto API disable the warning for this host OS. Another solution would be to add some glue layer for crypto stuff, but I think this is not worth the effort. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | Gracefully handle 64-bit signed-extended 32-bit Load addressesWilliam Cohen2016-02-24-2/+2
|/ | | | | | | | | | | | | | | | | | | | | To follow the MIPS 32-bit and 64-bit memory map conventions (*) recent MIPS Linux kernels are using a 64-bit sign extended value (0xffffffff80010000) for the 32-bit load address (0x80010000) of the Creator CI20 board kernel. When this 64-bit argument was passed to mkimage running on a 32-bit machine such as the Creator CI20 board the load address was incorrectly formed from the upper 32-bit sign-extend bits (0xffffffff) by the strtoul instead of from the lower 32-bits (0x80010000). The mkimage should be able to tolerate the longer sign-extended 64-bit version of the 32-bit arguments with the use of strtoull. Use of the strtoll in place of the strtol in mkimage.c resolves the issue of self hosted kernel builds for the Creator CI20 board (+) and (++). (*) http://techpubs.sgi.com/library/dynaweb_docs/0620/SGI_Developer/books/DevDriver_PG/sgi_html/ch01.html (+) https://github.com/MIPS/CI20_linux/issues/23 (++) https://github.com/MIPS/CI20_linux/issues/22 Signed-off-by: William Cohen <wcohen@redhat.com>
* Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini2016-02-21-1/+0
|\
| * mxsboot: remove unused includeAndreas Bießmann2016-02-21-1/+0
| | | | | | | | | | | | | | | | | | | | Commit 276d3ebb883024d753cd9c69ab2fd243ffa1262e removed htole32() but missed to remove the corresponding header. This is annoying, since BSD systems do not have endian.h. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Michael Heimpold <mhei@heimpold.de>
* | test, tools: introduce tbot READMEHeiko Schocher2016-02-08-0/+734
| | | | | | | | | | | | | | introduce a README how to use tbot for testing U-Boot and/or linux kernels. Signed-off-by: Heiko Schocher <hs@denx.de>
* | tools: env: update usage stringsAndreas Fenkart2016-02-08-42/+75
| | | | | | | | Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* | tools: env: factor out parse_common_argsAndreas Fenkart2016-02-08-25/+37
| | | | | | | | Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* | tools: env: shift optind arguments and fix argument indicesAndreas Fenkart2016-02-08-43/+15
| | | | | | | | Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* | tools: env: parse aes key / suppress flag into argument structAndreas Fenkart2016-02-08-57/+53
| | | | | | | | | | | | | | disabled original parsing, but not yet removed since the argument indexing needs to be fixed Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* | tools: env: introduce setenv/printenv argument structsAndreas Fenkart2016-02-08-38/+84
| | | | | | | | | | | | | | goal is to use getopt for all argument parsing instead of adhoc parsing in fw_getenv/fw_setenv functions Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* | tools: env: make parse_aes_key statelessAndreas Fenkart2016-02-08-6/+6
| | | | | | | | Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* | tools: env validate: pass values as 0-based arrayAndreas Fenkart2016-02-08-4/+7
| | | | | | | | | | | | passing argv/argc can produce off-by-one errors Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>