summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2019-06-20fw_env: Add missing write failure checkAlex Kiernan
If flash_write fails, whilst we propagate this up to our caller, we need to avoid swapping in the new file (if we're on a filesystem) in this case. Fixes: dbc34323796b ("tools: env: Implement atomic replace for filesystem") Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2019-06-14tools: add tools/spl_size_limit to ignore listSimon Goldschmidt
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>
2019-06-07spl: add overall SPL size checkSimon Goldschmidt
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>
2019-05-24Merge tag 'u-boot-stm32-20190523' of https://github.com/pchotard/u-bootTom Rini
- 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).
2019-05-23mkimage: change stm32image header to manage binary informationPatrick Delaunay
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>
2019-05-21buildman: Deal more nicely with invalid build-status fileSimon Glass
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>
2019-05-18tools: use read-only mmap in fit_check_signLuca Boccassi
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>
2019-05-09arm: k3: config.mk: Use k3_gen_x509_cert.sh to generate boot imagesLokesh Vutla
Instead of overlading makefile, use the k3_gen_x509_cert.sh script to generate boot images. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2019-05-09tools: k3_get_x509 cert: Add a script to generate x509 certificate for K3 ↵Lokesh Vutla
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>
2019-05-09Make FIT support really optionalFabrice Fontaine
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>
2019-05-08binman: Allow sections to have an offsetSimon Glass
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>
2019-05-08binman: Add a missing comment in Entry_vblockSimon Glass
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>
2019-05-08binman: Don't show image-skip message by defaultSimon Glass
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>
2019-05-08binman: Don't generate an error in 'text' entry constructorSimon Glass
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>
2019-05-05env: add missing newlinePhilip Molloy
Signed-off-by: Philip Molloy <philip@philipmolloy.com>
2019-05-03Merge git://git.denx.de/u-boot-marvellTom Rini
- Fix in kwbimage (return code checking) (Young Xiao) - Misc updates to Turris Omnia (Marek)
2019-05-03tools/Makefile: fix HOSTCFLAGS with CROSS_BUILD_TOOLSFabrice Fontaine
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>
2019-05-03kwbimage: fixing the issue with proper return code checkingYoung Xiao
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>
2019-04-26fw_env: Fix double freeBjörn Stenberg
addr0 is being freed twice, leading to segmentation fault Signed-off-by: Björn Stenberg <bjorn@haxx.se>
2019-04-26dtb_platdata.py: prevent define generation of aliasHeiko Schocher
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>
2019-04-26arm: mach-k3: Add secure device build supportAndrew F. Davis
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>
2019-04-26tools/Makefile: get openssl CFLAGS from pkg-configPierre Bourdon
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>
2019-04-13Merge tag 'pull-12apr19' of git://git.denx.de/u-boot-dmTom Rini
fdtdec tests and improvements for carve-outs pinctrl race-condition fix various other fixes in sandbox, sound, mkimage, etc.
2019-04-12tools: kwbimage: don't adjust for image_header for Armada MSYSChris Packham
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>
2019-04-11fdt: Fix mkimage list to try every header typeJordan Hand
Signed-off-by: Jordan Hand <jorhand@microsoft.com> Tested-by: Vagrant Cascadian <vagrant@debian.org> Tested-by: Alex Kiernan <alex.kiernan@gmail.com>
2019-04-05Merge tag 'u-boot-imx-20190405' of git://git.denx.de/u-boot-imxTom Rini
Fixes for 2019.04 - fix bashism for MX8 - fix ethernet for MX53 - fix docs for i.MX8
2019-04-03tools/Makefile: build host tools with -std=gnu99Thomas Petazzoni
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>
2019-04-01tools/imx8m_image.sh: remove bashismBaruch Siach
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>
2019-03-22tools: fit_image: Add the loadable property to configsAbel Vesa
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>
2019-03-08fdt: Fix FIT header verification in mkimage and conduct same checks as bootmJordan Hand
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>
2019-02-10Merge tag 'dm-pull-10feb19' of git://git.denx.de/u-boot-dmTom Rini
Samsung sound patches (applied for Samsung maintainer) Common sound support buildman environment support of-platdata documentation improvements
2019-02-09buildman: fix typoChris Packham
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>
2019-02-09buildman: Write the environment out to an 'env' fileSimon Glass
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>
2019-02-09armv7R: K3: am654: Fix order of debug elements in x509 templateAndrew F. Davis
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>
2019-02-09moveconfig: add a second pass for empty #if/#endif blocksChris Packham
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>
2019-02-01tools: dumpimage: Clarify helpMartyn Welch
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>
2019-02-01tools: dumpimage: Add help option and make error paths consistentMartyn Welch
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>
2019-02-01tools: dumpimage: Simplify internal logicMartyn Welch
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>
2019-02-01tools: dumpimage: Simplify argumentsMartyn Welch
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>
2019-02-01tools: dumpimage: Provide more feedback on errorMartyn Welch
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>
2019-01-30Merge tag 'u-boot-imx-20190129' of git://git.denx.de/u-boot-imxTom Rini
For 2019.04
2019-01-28Revert "tools: imx8image: set dcd_skip to true"Fabio Estevam
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>
2019-01-28tools: imx8image: use correct printf escape sequenceHeinrich Schuchardt
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>
2019-01-26tests: dtoc: adapt tests to changed dtoc outputSimon Goldschmidt
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>
2019-01-24tools: zynqmpimage: Align image_size/image_stored_sizeMichal Simek
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>
2019-01-24tools: zynqmpimage: round up partition sizeMichael Tretter
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>
2019-01-15Merge tag 'dm-pull-15jan19' of git://git.denx.de/u-boot-dmTom Rini
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
2019-01-15Fix typo: missmatched -> mismatched.Vagrant Cascadian
Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-01-15dtoc: make generated platdata structs constSimon Goldschmidt
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>
2019-01-14buildman: Fix tabs in GetWrapper()Simon Glass
This function has tabs instead of spaces. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>