summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2017-03-15tools: fix cross-compiling tools when HOSTCC is overriddenMasahiro Yamada
Richard reported U-Boot tools issues in OpenEmbedded/Yocto project. OE needs to be able to change the default compiler. If we pass in HOSTCC through the make command, it overwrites all HOSTCC instances, including ones in tools/Makefile and tools/env/Makefile, which breaks "make cross_tools" and "make env", respectively. Add "override" directives to avoid overriding HOSTCC instances that really need to point to the cross-compiler. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reported-by: Richard Purdie <richard.purdie@linuxfoundation.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-03-15tools: omapimage: Fix size in headerLokesh Vutla
The size field in GP header that is expected by ROM is size of the image + size of the header. But omapimage generates a gp header only with size of the image as size field. Fix it Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2017-03-12tools: binman: change shebang from python into python2Jörg Krause
This tool does not work with Python 3. Change the shebang to make sure the script is run by a Python 2 interpreter. Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
2017-03-10kconfiglib.py: Kludge in 'imply' supportTom Rini
Currently upstream does not yet understand the imply keyword. For what we use kconfiglib.py for today, this is OK. We only need to be able to evaluate in order to make boards.cfg and none of those choices will depend on how imply evaluates out. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-03-09tools: Remove CONFIG_SYS_TEXT_BASE in MakefilePatrick Delaunay
This define is not used in tools sources and can be removed to avoid unnecessary link between tools and defconfig Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-02-17tools: kwboot: don't adjust destaddr when patching the imageChris Packham
Commit 94084eea3bd3 ("tools: kwbimage: Fix dest addr") changed kwbimage to do this adjustment. So now the adjustment in kwboot is not needed (and would prevent UART booting for images generated by the new kwbimage). Remove the destaddr adjustment in kwboot. Signed-off-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Stefan Roese <sr@denx.de>
2017-02-17tools: kwbimage: Fix unchecked return value and fd leakMario Six
The return value of fstat was not checked in kwbimage, and in the case of an error, the already open file was not closed. Fix both errors. Reported-by: Coverity (CID: 155971) Reported-by: Coverity (CID: 155969) Signed-off-by: Mario Six <mario.six@gdsys.cc> Signed-off-by: Stefan Roese <sr@denx.de>
2017-02-09Merge branch 'master' of git://git.denx.de/u-boot-netTom Rini
2017-02-08Merge git://git.denx.de/u-boot-dmTom Rini
2017-02-08cmd: rework "license" commandMasahiro Yamada
The previous commit ("add a new command to show .config contents") improves the basic infrastructure of "embed a compressed file into the U-Boot image, and print it by a command". The same pattern for the "license" command. This commit reworks the command to improve the following: [1] Improve log style Kbuild style log GZIP cmd/license_data.gz CHK cmd/license_data_gz.h UPD cmd/license_data_gz.h CHK cmd/license_data_size.h UPD cmd/license_data_size.h instead of the bare Make log: cat ./Licenses/gpl-2.0.txt | gzip -9 -c | \ tools/bin2header license_gzip > ./include/license.h [2] Collect related code into the "cmd" directory Prior to this commit, the license.h was created by tools/Makefile, placed under the "include" directory, included from cmd/license.c, and deleted by the top-level Makefile. It is not a good idea to scatter related code. [3] Drop the fixed-malloc size LICENSE_MAX Just allocate the minimum required size of buffer because we know the size of the original gpl-2.0.txt. [4] Fix more issues Terminate the buffer with zero to prevent puts() from over-running. Add "static" to do_license. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-02-08patman: Handle non-ascii characters in namesChris Packham
When gathering addresses for the Cc list patman would encounter a UnicodeDecodeError due to non-ascii characters in the author name. Address this by explicitly using utf-8 when building the Cc list. Signed-off-by: Chris Packham <judge.packham@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
2017-02-08buildman: Allow showing the list of boards with -nSimon Glass
As well as showing the number of boards, allow showing the actual list of boards that would be built, if -v is provided. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-02-08patman: Format checkpatch messages for IDE throwbackSimon Glass
It is convenient to be able to deal with checkpatch warnings in the same way as build warnings. Tools such as emacs and kate can quickly locate the source file and line automatically. To achieve this, adjust the format to match the C compiler, and output to stderr. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-02-08dtoc: Replace dot with underscore to avoid compiler errorsSimon Glass
If there is a '.' in a compatible string, then dtoc will produce a struct with a name containing a '.'. This won't work, so replace it with '_'. Also add a suitable test to the sandbox device tree to catch this. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-02-07tools: Add tool to add crc8 to a mac addressoliver@schinagl.nl
This patch adds a little tool that takes a generic MAC address and generates a CRC byte for it. The output is the full MAC address without any separators, ready written into an EEPROM. Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com> Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2017-02-07tools: Allow crc8 to be usedoliver@schinagl.nl
This patch enables crc8 to be used from within the tools directory using u-boot/crc.h. Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2017-02-07tools: binman: Handle optional microcode case in SPL imageBin Meng
On platforms which do not require microcode in SPL, handle such case like U-Boot proper. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-02-07tools: binman: Call correct init for Entry_u_boot_spl_with_ucode_ptrBin Meng
u_boot_spl_with_ucode_ptr is derived from u_boot_with_ucode_ptr, hence it should call its parent's init. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-02-01Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini
2017-02-01arm: mvebu: Implement secure bootMario Six
The patch implements secure booting for the mvebu architecture. This includes: - The addition of secure headers and all needed signatures and keys in mkimage - Commands capable of writing the board's efuses to both write the needed cryptographic data and enable the secure booting mechanism - The creation of convenience text files containing the necessary commands to write the efuses The KAK and CSK keys are expected to reside in the files kwb_kak.key and kwb_csk.key (OpenSSL 2048 bit private keys) in the top-level directory. Signed-off-by: Reinhard Pfau <reinhard.pfau@gdsys.cc> Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Stefan Roese <sr@denx.de>
2017-02-01tools: kwbimage: Refactor line parsing and fix errorMario Six
The function image_create_config_parse_oneline is pretty complex, and since more parameters will be added to support secure booting, we refactor the function to make it more readable. Also, when a line contained just a keyword without any parameters, strtok_r returned NULL, which was then indiscriminately fed into atoi, causing a segfault. To correct this, we add a NULL check before feeding the extracted token to atoi, and print an error message in case the token is NULL. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
2017-02-01tools: kwbimage: Factor out add_binary_header_v1Mario Six
In preparation of adding the creation of secure headers, we factor the add_binary_header_v1 function out of the image_create_v1 function. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
2017-02-01tools: kwbimage: Remove unused parameterMario Six
The parameter 'params' of the image_headersz_v1 function is never used by the function. Hence, remove it. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
2017-02-01tools: kwbimage: Reduce scope of variablesMario Six
This patch reduces the scope of some variables. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
2017-02-01tools: kwbimage: Fix arithmetic with void pointersMario Six
Arithmetic with void pointers, e.g. a - b where both a and b are void pointers, is undefined in the C standard. Since we are operating with byte data here, we switch the void pointers to uint8_t pointers, and add the necessary casts. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
2017-02-01tools: kwbimage: Fix style violationsMario Six
Fix some style violations: - nine instances of missing blank lines after declarations - one overly long line - one split string (which also rewords an error message more concisely) - two superfluous else Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
2017-02-01tools: kwbimage: Fix dest addrMario Six
To enable secure boot, we need to jump back into the BootROM to continue the SoC's boot process instead of letting the SPL load and run the main U-Boot image. But, since the u-boot-spl.img (including the 64 byte header) is loaded by the SoC as the main image, we need to compensate for the header length to get a correct entry point. Thus, we subtract the header size from the destination address, so that the execution address points at the actual entry point of the image. The current boards ignore both parameters anyway, so this change shouldn't concern them. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
2017-01-28buildman: Update link to the most recent prebuilt ARC toolachinAlexey Brodkin
To troubleshoot unexpected bhavior during building and what's more important during execution it is strongly recommended to use recent ARC toolchain, and so we're now referring to arc-2016.09 which is the latest as of today. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-01-27tools: imximage: refactor header length calculations for imximage v1Martin Kaiser
We can use the same header length calculations for both imximage v1 and v2. This addresses TODO comments about imximage v1 in the current code. With this patch applied, *header_size_ptr in imximage_set_header() will have the correct value for both imximage v1 and v2. This is necessary for people wanting to add proprietary data behind the created imximage. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Cc: sbabic@denx.de
2017-01-24tools: Correct python building host toolsTom Rini
When we have python building tools for the host it will not check HOSTXX variables but only XX variables, for example LDFLAGS and not HOSTLDFLAGS. Cc: Simon Glass <sjg@chromium.org> Reported-by: Heiko Schocher <hs@denx.de> Fixes: 1905c8fc711a ("build: Always build the libfdt python module") Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Tested-by: Heiko Schocher <hs@denx.de>
2017-01-20tools: mkimage: fix sizeof_mismatch found by coveritySven Ebenfeld
Reported-by: Coverity (CID: 155214) Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
2017-01-20binman: add tools directory to the python pathEmmanuel Vadot
The built _libfdt.so is placed in the /tools dir and need to say here as it contains relative paths. Add the directory to the python path so binman can use this module. Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
2017-01-20build: Always build the libfdt python moduleEmmanuel Vadot
Do not rely on CONFIG_SPL_OF_PLATDATA to build the libfdt python module. If swig is present, this will be build Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
2017-01-14mkimage: Add support for signing with pkcs11George McCollister
Add support for signing with the pkcs11 engine. This allows FIT images to be signed with keys securely stored on a smartcard, hardware security module, etc without exposing the keys. Support for other engines can be added in the future by modifying rsa_engine_get_pub_key() and rsa_engine_get_priv_key() to construct correct key_id strings. Signed-off-by: George McCollister <george.mccollister@gmail.com>
2017-01-02Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini
2017-01-02tools: binman: Use /usr/bin/env to find python executableEmmanuel Vadot
Some OS (all BSD and probably others) do not have python in /usr/bin but in another directory. It is a common usage to use /usr/bin/env python as shebang for python scripts so use this for binman. Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com>
2017-01-02tools: mkimage: add firmware-ivt image type for HAB verificationSven Ebenfeld
When we want to use Secure Boot with HAB from SPL over U-Boot.img, we need to append the IVT to the image and leave space for the CSF. Images generated as firmware_ivt can directly be signed using the Freescale code signing tool. For creation of a CSF, mkimage outputs the correct HAB Blocks for the image. The changes to the usual firmware image class are quite small, that is why I implemented that directly into the default_image. Cc: sbabic@denx.de v2-Changes: None Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com> Reviewed-by: George McCollister <george.mccollister@gmail.com> Tested-by: George McCollister <george.mccollister@gmail.com>
2016-12-27tools: mkimage: Call fclose in error pathMichal Simek
This patch is fixing missing fclose() calls in error patch introduced by: "tools: mkimage: Use fstat instead of stat to avoid malicious hacks" (sha1: ebe0f53f48e8f9ecc823e533a85b05c13638c350) Reported-by: Coverity (CID: 155064, 155065) Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-12-27relocate-rela: use compiler.h endian macrosJonathan Gray
Use the endian macros from u-boot's compiler.h instead of duplicating the definitions. This also avoids a build error on OpenBSD by removing swap64 which collides with a system definition in endian.h pulled in by inttypes.h. Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
2016-12-26binman: Remove hard-coded file name for x86 CMC/FSP/VGABin Meng
Now that we have added file names from Kconfig in x86 u-boot.dtsi, update binman to avoid using hard-coded names. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-12-20Merge git://git.denx.de/u-boot-dmTom Rini
2016-12-19binman: Drop microcode features from ifdtoolSimon Glass
Now that binman supports creating images with microcode, drop the code from ifdtool. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2016-12-19binman: Automatically include a U-Boot .dtsi fileSimon Glass
For boards that need U-Boot-specific additions to the device tree, it is a minor annoyance to have to add these each time the tree is synced with upstream. Add a means to include a file (e.g. u-boot.dtsi) automatically into the .dts file before it is compiled. The file uses is the first one that exists in this list: arch/<arch>/dts/<board.dts>-u-boot.dtsi arch/<arch>/dts/<soc>-u-boot.dtsi arch/<arch>/dts/<cpu>-u-boot.dtsi arch/<arch>/dts/<vendor>-u-boot.dtsi arch/<arch>/dts/u-boot.dtsi Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Tom Rini <trini@konsulko.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2016-12-19binman: Add support for building x86 images with FSP/CMCSimon Glass
Add support for two more from the inexhaustible supply of x86 binary blob types. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2016-12-19binman: Add support for building x86 ROMs with SPLSimon Glass
When building for 64-bit x86 we need an SPL binary in the ROM. Add support for this. Also increase entry test code coverage to 100%. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2016-12-19binman: Add support for u-boot.img as an input binarySimon Glass
Add an entry type for u-boot.img (a legacy U-Boot image) and a simple test. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2016-12-19binman: Add support for building x86 ROMsSimon Glass
The structure of x86 ROMs is pretty complex. There are various binary blobs to place in the image. Microcode requires special handling so that it is available to very early code and can be used without any memory whatsoever. Add support for the various entry types that are currently needed, along with some tests. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2016-12-19binman: Add basic entry types for U-BootSimon Glass
Add entries to support some standard U-Boot binaries, such as u-boot.bin, u-boot.dtb, etc. Also add some tests for these. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2016-12-19binman: Introduce binman, a tool for building binary imagesSimon Glass
This adds the basic code for binman, including command parsing, processing of entries and generation of images. So far no entry types are supported. These will be added in future commits as examples of how to add new types. See the README for documentation. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2016-12-19tools: mxsimage: Fix build with OpenSSL 1.1.xMarek Vasut
The EVP_MD_CTX and EVP_CIPHER_CTX are made opaque since 1.1.x , so instead of embedding them directly into struct sb_image_ctx and initializing them using EVP_*_CTX_init(), we use pointers and allocate the crypto contexts using EVP_*_CTX_new(). Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com>