summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'dm-pull-10feb19' of git://git.denx.de/u-boot-dmTom Rini2019-02-102-1/+4
|\ | | | | | | | | | | | | Samsung sound patches (applied for Samsung maintainer) Common sound support buildman environment support of-platdata documentation improvements
| * buildman: fix typoChris Packham2019-02-091-1/+1
| | | | | | | | | | | | | | Fix a typo in the error message from CheckOutputDir(). Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
| * buildman: Write the environment out to an 'env' fileSimon Glass2019-02-091-0/+3
| | | | | | | | | | | | | | Sometimes it is useful to see the environment that was used to build U-Boot. Write this out to a file in the build directory. Signed-off-by: Simon Glass <sjg@chromium.org>
* | armv7R: K3: am654: Fix order of debug elements in x509 templateAndrew F. Davis2019-02-091-1/+1
| | | | | | | | | | | | | | | | | | The first element in the debug section is expected to be debugUID. ROM will not parse this correctly when out of order, fix this here. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
* | moveconfig: add a second pass for empty #if/#endif blocksChris Packham2019-02-091-2/+25
|/ | | | | | | | Moveconfig already attempts to remove empty #if/#endif blocks when there is a matching CONFIG_ being moved. Add a second pass which covers files without a match. Signed-off-by: Chris Packham <judge.packham@gmail.com>
* tools: dumpimage: Clarify helpMartyn Welch2019-02-011-3/+4
| | | | | | | | | Help message isn't clear over the use of the "-T" option (it's to declare the type of image that the tool is operating on), which also is optional as it defaults to the default image type. It's also missing a description of the "-o" option, so add it. Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
* tools: dumpimage: Add help option and make error paths consistentMartyn Welch2019-02-011-5/+13
| | | | | | | | | The utility dumpimage has error paths that display the usage and others that exit without displaying usage. Add an explicit help option to dumpimage to display the usage and remove it's use in error paths to make the error messages more obvious and errors paths more consistent. Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
* tools: dumpimage: Simplify internal logicMartyn Welch2019-02-011-48/+37
| | | | | | | | | | | | | There are 3 supported modes of operation: 1) Show version 2) List image contents 3) Extract image component Option (1) terminates early, so only options (2) and (3) remain. Remove redundant check for these modes. Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
* tools: dumpimage: Simplify argumentsMartyn Welch2019-02-011-14/+11
| | | | | | | | | | | | | | | The dump image utility has very confusing syntax. If called to list image contents ("-l") it takes the image name as a positional argument. If the utility is called to extract something from the image, the image must be provided via the optional argument "-i" as well as the positional argument but the value passed in the positional argument will be completely ignored. Simplify dumpimage by always providing the image as the first positional argument. Assume we want to dump something from the image if we do not provide the "-l" option for now. Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
* tools: dumpimage: Provide more feedback on errorMartyn Welch2019-02-011-2/+9
| | | | | | | | | The dumpimage utility errors out in a number of places without providing sufficient feedback to allow the user to easily determine what they have done wrong. Add addtional error messages to make the cause of the failure more obvious. Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
* Merge tag 'u-boot-imx-20190129' of git://git.denx.de/u-boot-imxTom Rini2019-01-301-3/+6
|\ | | | | | | For 2019.04
| * Revert "tools: imx8image: set dcd_skip to true"Fabio Estevam2019-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f7e475db4011d18b4ae974154eb022c3af6a4d16. This commit breaks the boot on imx8qxp evk and it should only be re-applied after imx8qxp evk is converted to SPL. Revert it for now, so that imx8qxp evk can be functional. Reported-by: Breno Lima <breno.lima@nxp.com> Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Tested-by: Breno Lima <breno.lima@nxp.com>
| * tools: imx8image: use correct printf escape sequenceHeinrich Schuchardt2019-01-281-2/+5
| | | | | | | | | | | | | | | | core is of type uint64_t. So for printing we need "%"PRIu64 (not "%lu"). Without the patch a warning is issued when building on a 32bit system. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | tests: dtoc: adapt tests to changed dtoc outputSimon Goldschmidt2019-01-261-27/+27
|/ | | | | | | | | | | The dtoc tests need to be adapted to dtoc being changed to output platdata structs as const, which has been introduced in commit 7d05d3a8e35f ("dtoc: make generated platdata structs const"). Fixes: 7d05d3a8e35f ("dtoc: make generated platdata structs const") Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* tools: zynqmpimage: Align image_size/image_stored_sizeMichal Simek2019-01-241-2/+2
| | | | | | | | Bootrom is not capable to work with non aligned bootloader sizes. SPL with OF_SEPARATE generates non-align images quite often that's why this change is required before OF_SEPARATE enableding. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* tools: zynqmpimage: round up partition sizeMichael Tretter2019-01-241-3/+12
| | | | | | | | | | | | | | | The FSBL copies "Total Partition Word Length" * 4 bytes from the boot.bin, which implies that the partition size is 4 byte aligned. When writing the partition, mkimage calculates "Total Partition Word Length" by dividing the size by 4. This implicitly cuts unaligned bytes at the end of the added binary. Instead of rounding down, the size must be round up to 4 bytes and the binary padded accordingly. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* Merge tag 'dm-pull-15jan19' of git://git.denx.de/u-boot-dmTom Rini2019-01-155-10/+56
|\ | | | | | | | | | | | | | | Fix recent changes to serial API for driver model Buildman clang support and a few fixes Small fixes to 'dm tree' and regmap test Improve sandbox build compatibility A few other minor fixes
| * buildman: Fix tabs in GetWrapper()Simon Glass2019-01-141-2/+2
| | | | | | | | | | | | This function has tabs instead of spaces. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * buildman: Add support for building with clangSimon Glass2019-01-145-5/+48
| | | | | | | | | | | | Add a -O option which allows building with clang. Signed-off-by: Simon Glass <sjg@chromium.org>
| * buildman: Deal nicely with invalid build-status fileSimon Glass2019-01-141-1/+6
| | | | | | | | | | | | | | | | | | | | | | The 'done' files created by buildman may end up being empty if buildman runs out of disk space while writing them. This error is then persistent, since even if disk space is reclaimed and the build retries, the empty file causes an exception in the builder thread. Deal with this silently by doing a rebuild. Signed-off-by: Simon Glass <sjg@chromium.org>
| * buildman: Drop comment about Ctrl-C problemSimon Glass2019-01-141-2/+0
| | | | | | | | | | | | This bug is now fixed, so drop this comment. Signed-off-by: Simon Glass <sjg@chromium.org>
* | Fix typo: missmatched -> mismatched.Vagrant Cascadian2019-01-151-1/+1
| | | | | | | | | | Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Reviewed-by: Peng Fan <peng.fan@nxp.com>
* | dtoc: make generated platdata structs constSimon Goldschmidt2019-01-151-1/+1
|/ | | | | | | | The platdata initialization structs are currently generated into .rwdata. Make sure the are put into .rodata by generating them as const. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* tools: imx8image: set dcd_skip to truePeng Fan2019-01-091-1/+1
| | | | | | | | | | To B0[+] chips, dcd_skip needs to be true. For A0 chip, it needs to be false, however A0 chip is no longer being supported anymore. Considering we are moving code from imx-mkimage to uboot mkimage, to make sure we not introduce some surprise, we still keep dcd_skip code there. Signed-off-by: Peng Fan <peng.fan@nxp.com>
* Merge tag 'u-boot-imx-20190101' of git://www.denx.de/git/u-boot-imxTom Rini2019-01-016-1/+676
|\ | | | | | | | | | | | | | | | | imx for 2019.01 - introduce support for i.MX8M - fix size limit for Vhybrid / pico boards - several board fixes - w1 driver for MX2x / MX5x
| * imx: imx8mq: build flash.binPeng Fan2019-01-011-0/+43
| | | | | | | | | | | | | | | | Build flash.bin for i.MX8MQ, it will include signed hdmi firmware, spl, ddr firmware, fit image(bl31.bin, u-boot-nodtb.bin, dtb). Burn it to 33KB offset of SD card. Signed-off-by: Peng Fan <peng.fan@nxp.com>
| * tools: add i.MX8M image supportPeng Fan2019-01-014-0/+632
| | | | | | | | | | | | | | | | | | | | | | i.MX8M bootable image type is like i.MX6/7, but there is signed HDMI firmware image in front of A53 bootable image, which is also has an IVT header. Here we also include fit image to generate a bootable image. Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Stefano Babic <sbabic@denx.de>
| * tools: improve portability of imx_cntr_image.shMartin Husemann2019-01-011-1/+1
| | | | | | | | | | | | | | Replace non-portable operator == with = The operator == in sh(1) / test(1) is non-POSIX and only implemented by some shells (like bash). It is equivalent to the standard defined operator =.
* | tools: mtk_image: replace strncpy(d, s, sizeof(d)) with snprintf()Andy Shevchenko2018-12-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting from version 8 the GCC, i.e. C compiler, starts complaining about possible '\0' terminator loss or, as in this case, garbage copy. In function ‘mtk_image_set_gen_header’, inlined from ‘mtk_image_set_header’ at tools/mtk_image.c:733:3: tools/mtk_image.c:659:2: warning: ‘strncpy’ specified bound 12 equals destination size [-Wstringop-truncation] strncpy(hdr->boot.name, bootname, sizeof(hdr->boot.name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function ‘mtk_brom_parse_imagename’, inlined from ‘mtk_image_check_params’ at tools/mtk_image.c:388:9: tools/mtk_image.c:325:5: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation] strncpy(lk_name, val, sizeof(lk_name)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Replace it with snprintf() to tell compiler how much room we have in the destination buffer for source string. Fixes: 3b975a147c3c ("tools: MediaTek: add MTK boot header generation to mkimage") Cc: Ryder Lee <ryder.lee@mediatek.com> Cc: Weijie Gao <weijie.gao@mediatek.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
* | tools: add a generic config for native tools buildingOtavio Salvador2018-12-151-1/+1
|/ | | | | | | | | | | | | | | | | | | | | The motivation for this is to allow distributions to distribute all possible tools in a generic way, avoiding the need of specific tools building for each machine. Especially on OpenEmbedded / Yocto Project ecosystem, it is very common each BSP to end providing their specific tools when they need to generate images for some SoC (e.g MX23 / MX28 in meta-freescale case). Using this, we can package the tools doing: $: make tools-only_defconfig $: make tools-only Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> [trini: Add MAINTAINERS entry for myself, add to .travis.yml, make U-Boot itself buildable to not trip up other frameworks] Signed-off-by: Tom Rini <trini@konsulko.com>
* Roll CRC16-CCITT into the hash infrastructurePhilipp Tomsich2018-12-081-0/+1
| | | | | | | | | | | | | | | | | The CRC16-CCITT checksum function is useful for space-constrained applications (such as obtaining a checksum across a 2KBit or 4KBit EEPROM) in boot applications. It has not been accessible from boot scripts until now (due to not having a dedicated command and not being supported by the hash infrstructure) limiting its applicability outside of custom commands. This adds the CRC16-CCITT (poly 0x1021, init 0x0) algorithm to the list of available hashes and adds a new crc16_ccitt_wd_buf() to make this possible. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> [trini: Fix building crc16.o for SPL/TPL] Signed-off-by: Tom Rini <trini@konsulko.com>
* buildman/toolchain.py: handle inconsistent tarball namesTrevor Woerner2018-12-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, for some releases the kernel.org toolchain tarball names adhere to the following pattern: <hostarch>-gcc-<ver>-nolib-<targetarch>-<type>.tar.xz e.g.: x86_64-gcc-8.1.0-nolibc-aarch64-linux.tar.xz while others use the following pattern: <hostarch>-gcc-<ver>-nolib_<targetarch>-<type>.tar.xz e.g.: x86_64-gcc-7.3.0-nolibc_aarch64-linux.tar.xz Notice that the first pattern has dashes throughout, while the second has dashes throughout except just before the target architecture which has an underscore. The "dash throughout" versions from kernel.org are: 8.1.0, 6.4.0, 5.5.0, 4.9.4, 4.8.5, 4.6.1 while the "dash and underscore" versions from kernel.org are: 7.3.0, 4.9.0, 4.8.0, 4.7.3, 4.6.3, 4.6.2, 4.5.1, 4.2.4 This tweak allows the code to handle both versions. Note that this tweak also causes the architecture parsing to get confused and find the following two bogus architectures, "2.0" and "64", which are explicitly checked for, and removed. Signed-off-by: Trevor Woerner <trevor@toganlabs.com> Reviewed-by: Simon Glass <sjg@chromium.org> Change single quotes to double quotes: Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman/toolchain.py: fix toolchain directoryTrevor Woerner2018-12-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The hexagon toolchain (4.6.1) from kernel.org, for example, was packaged in a way that is different from most toolchains. The first entry when unpacking most toolchain tarballs is: gcc-<version>-nolib/<targetarch>-<system> e.g.: gcc-8.1.0-nolibc/aarch64-linux/ The first entry of the hexagon toolchain, however, is: gcc-4.6.1-nolibc/ This causes the buildman logic in toolchain.py::ScanPath() to not be able to find the "*gcc" executable since it looks in gcc-4.6.1-nolib/{.|bin|usr/bin} instead of gcc-4.6.1/hexagon-linux/{.|bin|usr/bin}. Therefore when buildman tries to download a set of toolchains that includes hexagon, the script fails. This update takes the second line of the tarball unpacking (which works for all the toolchains I've tested from kernel.org) and parses it to take the first two elements, separated by '/'. It makes this logic a bit more robust. Signed-off-by: Trevor Woerner <trevor@toganlabs.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* rsa: add a structure for the paddingPhilippe Reynes2018-12-031-0/+4
| | | | | | | | | | The rsa signature use a padding algorithm. By default, we use the padding pkcs-1.5. In order to add some new padding algorithm, we add a padding framework to manage several padding algorithm. The choice of the padding is done in the file .its. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* tools: MediaTek: add MTK boot header generation to mkimageRyder Lee2018-11-283-0/+949
| | | | | | | | This patch adds support for MTK boot image generation. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* tools/file2include: don't use malloc.h for mallocJonathan Gray2018-11-261-1/+0
| | | | | | | | | | | | | stdlib.h is the header for malloc since at least c89/c90. Previously this would fail to build on OpenBSD and fallback to the wrong header: In file included from u-boot/tools/file2include.c:21: u-boot/include/malloc.h:875:5: error: function-like macro 'CONFIG_IS_ENABLED' is not defined Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* tools: .gitignore: add prelink-riscvLukas Auer2018-11-261-0/+1
| | | | | | | | Ignore tools/prelink-riscv. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Rick Chen <rick@andestech.com>
* binman: Set the pathname correctly for ELF filesSimon Glass2018-11-201-3/+2
| | | | | | | At present, stripped files don't have the right pathname which means that blob compression cannot be used. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Drop an unnecessary comma in blob handlingSimon Glass2018-11-201-1/+1
| | | | | | This comma is not needed. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add a way to enable debugging from the buildSimon Glass2018-11-201-0/+6
| | | | | | | | | When the build fails due to something wrong in binman it is sometimes useful to get a full backtrace showing the location of the failure. Add a BINMAN_DEBUG environment variable to support this along with some documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Show boards with warning with w+Simon Glass2018-11-202-19/+54
| | | | | | | | At present we should boards with warnings in the same way as those with errors. This is not ideal. Add a new 'warn' state and show these listed in yellow to match the actual warning lines printing with -e. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Rename the good, better, worse variablesSimon Glass2018-11-201-14/+14
| | | | | | | | | | At present we don't distinguish between errors and warnings when printing the architecture summary. Rename the variables to better describe their purpose. 'Worse' at present means we got an error, so use that as the name. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Detect dtc warningsSimon Glass2018-11-202-3/+6
| | | | | | | | | | | | | At present messages from the device-tree compiler like this: arch/arm/dts/socfpga_arria10_socdk_sdmmc.dtb: Warning (avoid_unnecessary_addr_size): /clocks: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property are detected as errors since they don't match the gcc warning regex. Add a new one for dtc to fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
* buildman: Only print toolchain probing with -vSimon Glass2018-11-202-2/+2
| | | | | | | | | At present --list-tool-chains prints a lot of information about the toolchain-probing process. This is generally not very interesting. Update buildman to print this only if --list-tool-chains is given with -v. Signed-off-by: Simon Glass <sjg@chromium.org>
* armv7R: K3: am654: Add support for generating build targetsLokesh Vutla2018-11-161-0/+48
| | | | | | | | | | | | | | | | | | | | | Update Makefiles to generate: - tiboot3.bin: Image format that can be processed by ROM. Below is the tiboot3.bin image format that is required by ROM: _______________________ | X509 | | Certificate | | ____________________ | | | | | | | u-boot-spl.bin | | | | | | | |___________________| | |_______________________| Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
* buildman: Add a --boards option to specify particular boards to buildSimon Glass2018-11-145-23/+72
| | | | | | | | | | | At present 'buildman sandbox' will build all 5 boards for the sandbox architecture rather than the single board 'sandbox'. The only current way to exclude sandbox_spl, sandbox_noblk, etc. is to use -x which is a bit clumbsy. Add a --boards option to allow individual build targets to be specified. Signed-off-by: Simon Glass <sjg@chromium.org>
* tools: imx8image: flatten container header only when creating containerPeng Fan2018-11-061-10/+12
| | | | | | | If there is no CONTAINER entry, there is no need to flatten container header. Signed-off-by: Peng Fan <peng.fan@nxp.com>
* tools: imx8image: fix coverity CID 184233Peng Fan2018-11-061-0/+8
| | | | | | | | | Fix: CID 184233: (NEGATIVE_RETURNS) Using variable "container" as an index to array "imx_header.fhdr". Reported-by: Coverity Signed-off-by: Peng Fan <peng.fan@nxp.com>
* tools: imx8image: fix coverity CID 184234Peng Fan2018-11-061-1/+3
| | | | | | | | | Fix: CID 184234: (TAINTED_SCALAR) Using tainted variable "header.num_images - 1" as an index into an array "header.img". Reported-by: Coverity Signed-off-by: Peng Fan <peng.fan@nxp.com>
* tools: imx8image: check lseek return valuePeng Fan2018-11-061-4/+23
| | | | | | | | | | Check lseek return value. Fix Coverity CID: 184236 184235 184232 Reported-by: Coverity Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>