summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* tools: add tools/spl_size_limit to ignore listSimon Goldschmidt2019-06-141-0/+1
| | | | | | | | This tool has just been added but it seems I forgot to add it to the ignore list. So to prevent the built binary being marked as unversioned, add it to the ignore list. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
* spl: add overall SPL size checkSimon Goldschmidt2019-06-072-0/+34
| | | | | | | | | | | | | This adds a size check for SPL that can dynamically check generated SPL binaries (including devicetree) for a size limit that ensures this image plus global data, heap and stack fit in initial SRAM. Since some of these sizes are not available to make, a new host tool 'spl_size_limit' is added that dumps the resulting maximum size for an SPL binary to stdout. This tool is used in toplevel Makefile to implement the size check on SPL binaries. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
* Merge tag 'u-boot-stm32-20190523' of https://github.com/pchotard/u-bootTom Rini2019-05-241-1/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add various STM32MP1 fixes for serial, env, clk, board, i2c ... - Add STM32MP1 DDR driver update: These update introduce the DDR interactive mode described in: https://wiki.st.com/stm32mpu/index.php/U-Boot_SPL:_DDR_interactive_mode This mode is used by the CubeMX: DDR tuning tool. https://wiki.st.com/stm32mpu/index.php/STM32CubeMX The DDR interactive mode is NOT activated by default because it increase the SPL size and slow down the boot time (200ms wait added).
| * mkimage: change stm32image header to manage binary informationPatrick Delaunay2019-05-231-1/+7
| | | | | | | | | | | | | | | | To get more information from STM32 Header about the generated binary, we will add a new byte with the following field: replace padding byte 255 with 0x00 for "U-Boot" Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* | buildman: Deal more nicely with invalid build-status fileSimon Glass2019-05-211-1/+6
|/ | | | | | | | | | The 'done' files created by buildman may end up being empty if buildman runs out of disk space while writing them. At present buildman dies with an exception when using -s to check the build status. Fix this. Seriesl-cc: trini Signed-off-by: Simon Glass <sjg@chromium.org>
* tools: use read-only mmap in fit_check_signLuca Boccassi2019-05-185-11/+18
| | | | | | | | | | Add an option to open files in read-only mode in mmap_fdt so that fit_check_sign can be used to inspect files on read-only filesystems. For example, this is useful when a key is shipped in a read-only rootfs or squashfs. Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
* arm: k3: config.mk: Use k3_gen_x509_cert.sh to generate boot imagesLokesh Vutla2019-05-091-48/+0
| | | | | | | Instead of overlading makefile, use the k3_gen_x509_cert.sh script to generate boot images. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
* tools: k3_get_x509 cert: Add a script to generate x509 certificate for K3 ↵Lokesh Vutla2019-05-091-0/+244
| | | | | | | | | | | | | | | | | | | | devices TI's K3 boot architecture mandates a x509 certificate for every boot image. While signing the image K3 ROM allows for two types of keys based on which the boot image gets loaded in different ways: - Degenerate RSA keys: This generates a signature which is equal to the digest. When ROM sees this, it does a DMA for copying the images, which significantly improves the boot time. - Any other key: Does a memcpy to load the image. This is introduced as a fallback for DMA copy. Add a script for generating boot images with the above options. Default generates image using rsa degenerate key in order to improve boot time. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
* Make FIT support really optionalFabrice Fontaine2019-05-091-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Due to some mistakes in the source code, it was not possible to really turn FIT support off. This commit fixes the problem by means of the following changes: - Enclose "bootm_host_load_image" and "bootm_host_load_images" between checks for CONFIG_FIT_SIGNATURE, in common/bootm.c. - Enclose the declaration of "bootm_host_load_images" between checks for CONFIG_FIT_SIGNATURE, in common/bootm.h. - Condition the compilation and linking of fit_common.o fit_image.o image-host.o common/image-fit.o to CONFIG_FIT=y, in tools/Makefile. Signed-off-by: Carlos Santos <casantos@datacom.ind.br> [fabio: adapt for 2016.07] Signed-off-by: Fabio Estevam <festevam@gmail.com> [Ricardo: fix conditional compilation and linking of the files mentioned above for 2016.07] Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> [Jörg: adapt for 2019.01] Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks> [Retrieved from: https://git.buildroot.net/buildroot/tree/package/uboot-tools/0003-Make-FIT-support-really-optional.patch] Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
* binman: Allow sections to have an offsetSimon Glass2019-05-085-5/+67
| | | | | | | | | At present sections are always placed automatically. Even if an 'offset' property is provided it is ignored. Update the logic to support an offset for sections. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* binman: Add a missing comment in Entry_vblockSimon Glass2019-05-081-0/+1
| | | | | | | | An important property is missing. Update the entry comment to include this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* binman: Don't show image-skip message by defaultSimon Glass2019-05-082-9/+21
| | | | | | | | | | | | This message is not very important since it is simply indicating that the user's instructions are being followed. Only show it when the verbosity level is above the default. Also drop the unnecessary extra newline on this message, which causes two line breaks. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* binman: Don't generate an error in 'text' entry constructorSimon Glass2019-05-081-2/+2
| | | | | | | | | | | It is not good practice to raise an exception in a constructor. In this case the 'text' entry may not actually be used, if -i is used to filter out the images that get built. Move the exception to where the data is actually used. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* env: add missing newlinePhilip Molloy2019-05-051-1/+1
| | | | Signed-off-by: Philip Molloy <philip@philipmolloy.com>
* Merge git://git.denx.de/u-boot-marvellTom Rini2019-05-031-1/+1
|\ | | | | | | | | - Fix in kwbimage (return code checking) (Young Xiao) - Misc updates to Turris Omnia (Marek)
| * kwbimage: fixing the issue with proper return code checkingYoung Xiao2019-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EVP_VerifyFinal would return one of three values: 1 if the data is verified to be correct; 0 if it is incorrect; -1 if there is any failure in the verification process. The varification in unpatched version is wrong, since it ignored the return value of -1. The bug allows a malformed signature to be treated as a good signature rather than as an error. This issue affects the signature checks on DSA ans ECDSA keys used with SSL/TLS. This issue is similar to CVE-2008-5077, CVE-2009-0021, CVE-2009-0025, CVE-2009-0046 ~ CVE-2009-0049. Signed-off-by: Young Xiao <92siuyang@gmail.com> Signed-off-by: Stefan Roese <sr@denx.de>
* | tools/Makefile: fix HOSTCFLAGS with CROSS_BUILD_TOOLSFabrice Fontaine2019-05-031-0/+1
|/ | | | | | | When CROSS_BUILD_TOOLS is set, set HOSTCFLAGS to CFLAGS otherwise CC will be used with HOSTCFLAGS which seems wrong Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
* fw_env: Fix double freeBjörn Stenberg2019-04-261-1/+1
| | | | | | addr0 is being freed twice, leading to segmentation fault Signed-off-by: Björn Stenberg <bjorn@haxx.se>
* dtb_platdata.py: prevent define generation of aliasHeiko Schocher2019-04-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | generate define for an alias only if the struct is not created already. This prevents compilerwarning: PLAT spl/dts/dt-platdata.o spl/dts/dt-platdata.c:11:46: error: missing braces around initializer [-Werror=missing-braces] static const struct dtd_simple_bus dtv_ahb = { ^ spl/dts/dt-platdata.c:20:46: error: missing braces around initializer [-Werror=missing-braces] static const struct dtd_simple_bus dtv_apb = { ^ cc1: all warnings being treated as errors on the at91 based taurus board. Reason is in at91sam9260.dtsi is defined: ahb { compatible = "simple-bus"; ranges; and later: pinctrl: pinctrl@fffff400 { compatible = "atmel,at91rm9200-pinctrl", "simple-bus"; ranges = <0xfffff400 0xfffff400 0x600>; without this patch dtoc generates: struct dtd_atmel_at91rm9200_pinctrl { fdt32_t atmel_mux_mask[6]; fdt32_t ranges[3]; fdt32_t reg[6]; }; struct dtd_simple_bus { bool ranges; }; "#define dtd_simple_bus dtd_atmel_at91rm9200_pinctrl" and the line with "define dtd_simple_bus..." introduces the warning. This define is not needed. Signed-off-by: Heiko Schocher <hs@denx.de>
* arm: mach-k3: Add secure device build supportAndrew F. Davis2019-04-261-2/+6
| | | | | | | | | K3 HS devices require signed binaries for boot, use the SECDEV tools to sign the boot artifacts during build. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Andreas Dannenberg <dannenberg@ti.com>
* tools/Makefile: get openssl CFLAGS from pkg-configPierre Bourdon2019-04-261-0/+2
| | | | | | | Fixes building mkimage on systems where OpenSSL header files do not live in the standard include path. Signed-off-by: Pierre Bourdon <delroth@gmail.com>
* Merge tag 'pull-12apr19' of git://git.denx.de/u-boot-dmTom Rini2019-04-131-8/+15
|\ | | | | | | | | | | fdtdec tests and improvements for carve-outs pinctrl race-condition fix various other fixes in sandbox, sound, mkimage, etc.
| * fdt: Fix mkimage list to try every header typeJordan Hand2019-04-111-8/+15
| | | | | | | | | | | | Signed-off-by: Jordan Hand <jorhand@microsoft.com> Tested-by: Vagrant Cascadian <vagrant@debian.org> Tested-by: Alex Kiernan <alex.kiernan@gmail.com>
* | tools: kwbimage: don't adjust for image_header for Armada MSYSChris Packham2019-04-121-0/+7
|/ | | | | | | | | | | For the time being the Armada MSYS SoCs need to use the bin_hdr from the Marvell U-Boot. Because of this the binary.0 does not contain the image header that a proper u-boot SPL would so the adjustment introduced by commit 94084eea3bd3 ("tools: kwbimage: Fix dest addr") does not apply. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
* Merge tag 'u-boot-imx-20190405' of git://git.denx.de/u-boot-imxTom Rini2019-04-051-2/+2
|\ | | | | | | | | | | | | | | Fixes for 2019.04 - fix bashism for MX8 - fix ethernet for MX53 - fix docs for i.MX8
| * tools/imx8m_image.sh: remove bashismBaruch Siach2019-04-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a single '=' to test string equality for compatibility with non-bash shells. Otherwise, if /bin/sh is dash, build fails: ./tools/imx8m_image.sh: 15: [: signed_hdmi_imx8m.bin: unexpected operator ./tools/imx8m_image.sh: 15: [: signed_hdmi_imx8m.bin: unexpected operator ./tools/imx8m_image.sh: 15: [: spl/u-boot-spl-ddr.bin: unexpected operator ./tools/imx8m_image.sh: 15: [: spl/u-boot-spl-ddr.bin: unexpected operator WARNING './spl/u-boot-spl-ddr.bin' not found, resulting binary is not-functional Signed-off-by: Baruch Siach <baruch@tkos.co.il> Tested-by: Chris Spencer <christopher.spencer@sea.co.uk>
* | tools/Makefile: build host tools with -std=gnu99Thomas Petazzoni2019-04-031-1/+2
|/ | | | | | | | | | | | | | | | | | | | Parts of the code are using C99 constructs (such as variables declared inside loops), but also GNU extensions (such as typeof), so using -std=gnu99 is necessary to build with older versions of gcc that don't default to building with gnu99. It fixes the following build failure: ./tools/../lib/crc16.c: In function "crc16_ccitt": ./tools/../lib/crc16.c:70:2: error: "for" loop initial declarations are only allowed in C99 mode for (int i = 0; i < len; i++) ^ ./tools/../lib/crc16.c:70:2: note: use option -std=c99 or -std=gnu99 to compile your code when building the host tools with gcc 4.7. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
* tools: fit_image: Add the loadable property to configsAbel Vesa2019-03-221-0/+1
| | | | | | | | When running mkimage with "-f auto", the loadable property needs to be set in order to allow SPL FIT support to boot. Signed-off-by: Abel Vesa <abel.vesa@nxp.com> Tested-by: Fabio Estevam <festevam@gmail.com>
* fdt: Fix FIT header verification in mkimage and conduct same checks as bootmJordan Hand2019-03-085-3/+65
| | | | | | | | | | | | | | FIT header verification in mkimage was treating a return code as a boolean, which meant that failures in validating the fit were seen as successes. Additionally, mkimage was checking all formats to find a header which passes validation, rather than using the image type specified to mkimage. checkpatch.pl checks for lines ending with '(' and alignment matching open parentheses are ignored to keep with existing coding style. Signed-off-by: Jordan Hand <jorhand@microsoft.com>
* 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>