summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
...
| * patman: Don't return the series in FixPatches()Simon Glass2017-06-082-3/+2
| | | | | | | | | | | | | | | | There is no need for this function to return the same object that was passed in. Drop the return value. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
| * patman: Don't report unicode characterSimon Glass2017-06-081-9/+0
| | | | | | | | | | | | | | | | Unicode characters may appear in input patches so we should not warn about them. Drop this warning. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
| * patman: Rename 'str' variable in EmailPatches()Simon Glass2017-06-081-3/+3
| | | | | | | | | | | | | | | | This is not a good variable name in Python because 'str' is a type. It shows up highlighted in some editors. Rename it. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
| * patman: Don't convert input data to unicodeSimon Glass2017-06-081-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The communication filter reads data in blocks and converts each block to unicode (if necessary) one at a time. In the unlikely event that a unicode character in the input spans a block this will not work. We get an error like: UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1022-1023: unexpected end of data There is no need to change the input to unicode, so the easiest fix is to drop this feature. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
| * patman: Adjust handling of unicode email addressSimon Glass2017-06-082-3/+9
| | | | | | | | | | | | | | | | Don't mess with the email address when outputting them. Just make sure they are encoded with utf-8. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
| * patman: encode CC list to UTF-8Philipp Tomsich2017-06-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change encodes the CC list to UTF-8 to avoid failures on maintainer-addresses that include non-ASCII characters (observed on Debian 7.11 with Python 2.7.3). Without this, I get the following failure: Traceback (most recent call last): File "tools/patman/patman", line 159, in <module> options.add_maintainers) File "[snip]/u-boot/tools/patman/series.py", line 234, in MakeCcFile print(commit.patch, ', '.join(set(list)), file=fd) UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 81: ordinal not in range(128) from Heiko's email address: [..., u'"Heiko St\xfcbner" <heiko@sntech.de>', ...] While with this change added this encodes to: "=?UTF-8?q?Heiko=20St=C3=BCbner?= <heiko@sntech.de>" Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
| * buildman: Fix bloat option when 'new' only drops functionsTom Rini2017-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | In the case where a new build only decreases sizes and does not increase any size we still want to report what functions have been dropped when doing a bloat comparison. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | tools/kwbimage: Support building with LibreSSLMarek BehĂșn2017-06-091-1/+1
|/ | | | | | | | The kwbimage utility fails to compile when LibreSSL is present on the host system instead of OpenSSL. This one-line patch resolves this. Signed-off-by: Marek Behun <marek.behun@nic.cz>
* rockchip: mkimage: Add support for RV1108Andy Yan2017-06-071-0/+1
| | | | | | | | | | | Add support to mkimage for rv1108 soc, the max spl code size for rv1108 is 6kb, and the spl code should be packed by rksd, wether boot from emmc or spi nor flash. Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* rockchip: mkimage: set init_boot_size to avoid confusing the boot ROMPhilipp Tomsich2017-06-071-4/+7
| | | | | | | | | | | | | | | | | | This change restores the earlier setting of init_boot_size to include the maximum area covered by the the boot ROM of each chip for resolve issues with back-to-bootrom functionality reported by Kever and Heiko. To ensure that we don't run into the same issue again in the future, I have updated the comments accordingly and added a reference to the mailing list archive (there's some very helpful info from Andy Yan that provides background on the BootROM requirements regarding these fields). See https://lists.denx.de/pipermail/u-boot/2017-May/293267.html for some background (by Andy Yan) of how the BootROM processes this field. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* rockchip: mkimage: force 2KB alignment for init_sizePhilipp Tomsich2017-06-073-4/+5
| | | | | | | | | | | The Rockchip BootROM relies on init_size being aligned to 2KB (see https://lists.denx.de/pipermail/u-boot/2017-May/293268.html). This pads the image to 2KB both for SD card images and SPI images and uses a common symbolic constant for the alignment. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* rockchip: mkimage: add support for verify_header/print_headerPhilipp Tomsich2017-06-074-42/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The rockchip image generation was previously missing the ability to verify the generated header (and dump the image-type) without having to resort to hexdump or od. Experience in our testing has showed it to be very easy to get the rkspi and rksd images mixed up and the lab... so we add the necessary support to have dumpimage tell us what image type we're dealing with. This change set adds the verify_header and print_header capability to the rksd/rkspi image drivers (through shared code in rkcommon). As of now, we only support images fully that are not RC4-encoded for the SPL payload (i.e. header1 and payload). For RC4-encoded payloads, the outer header (header0) is checked, but no detection of whether this is a SD/MMC or SPI formatted payload takes place. The output of dumpsys now prints the image type (spl_hdr), whether it is a SD/MMC or SPI image, and the (padded) size of the image: $ ./tools/dumpimage -l ./spl.img Image Type: Rockchip RK33 (SD/MMC) boot image ^^^^^^ SD/MMC vs. SPI indication ^^^^ spl_hdr indicated by the image Data Size: 79872 bytes Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Simon Glass <sjg@chromium.org>
* fdt: Drop fdt_select.pySimon Glass2017-06-027-24/+13
| | | | | | | | | This file was used to select between the normal and fallback libfdt implementations. Now that we only have one, it is not needed. Drop it and fix up all users. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Rename fdt variable to dtbSimon Glass2017-06-023-12/+11
| | | | | | | Since fdt is the name of a module, use a different name for variables to avoid a conflict. Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: Merge fdt_normal with its base classSimon Glass2017-06-023-253/+157
| | | | | | | Since we only have one Fdt implementation now we don't need to have a base class. Merge the implementation and the base class together. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Drop a special case related to fdt_fallbackSimon Glass2017-06-021-9/+4
| | | | | | | | | Previously we were sometimes forced to collate x86 microcode due to not having access to the offset of each individual piece. Now that we never use fdt_fallback, we don't have this problem. Drop this special case from the code. Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: Drop fdt_fallback librarySimon Glass2017-06-025-243/+18
| | | | | | Drop this now-unused library and associated tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: Drop use of the legacy libfdt python moduleSimon Glass2017-06-021-24/+8
| | | | | | | Now that this is no-longer available, stop looking for it. The new module will be used if available. Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: Stop building the old python libfdt moduleSimon Glass2017-06-021-18/+0
| | | | | | This is no-longer needed, so stop building it. Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: Support use of the new python libfdt librarySimon Glass2017-06-023-9/+30
| | | | | | | Use the new library if available, while retaining backwards compatibility with the old library for now. Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: dtoc: Add a full set of property testsSimon Glass2017-06-022-0/+69
| | | | | | | | The tests don't currently cover all the different property types. Add a new test which checks each property type in turn, to make sure each has the correct type and value. Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: Update fdt_test to use 'dt' instead of 'fdt'Simon Glass2017-06-021-9/+9
| | | | | | | Since fdt is a module it conflicts with this variable name and prevents it being used in tests. Rename the variable. Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: Build the new python libfdt moduleSimon Glass2017-06-021-0/+31
| | | | | | | | Build the upstream python libfdt module. At present the legacy module is still built and is the one that it used. Future work will switch this over. Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: Rename existing python libfdt moduleSimon Glass2017-06-022-6/+7
| | | | | | | | Now that this module has been accepted upstream we should stop using the local U-Boot one. In preparation for this, rename it to indicate it is for legacy use. Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: Add all source files to the libfdt buildSimon Glass2017-06-021-3/+5
| | | | | | | | At present only a subset of source files are build. Add the rest and refactor this so that a source file list is available also. This will be used in later commit. Signed-off-by: Simon Glass <sjg@chromium.org>
* arm: mvebu: kwbimage: inline function to fix use-after-freePatrick Wildt2017-05-311-45/+48
| | | | | | | | | | | | | | | | | | | image_version_file()'s only use is to return the version number of the specified image, and it's only called by kwbimage_generate(). This version function mallocs "image_cfg" and reads the contents of the image into that buffer. Before return to its caller it frees the buffer. After extracting the version, kwb_image_generate() tries to calculate the header size by calling image_headersz_v1(). This function now accesses "image_cfg", which has already been freed. Since image_version_file() is only used by a single function, inline it into kwbimage_generate() and only free the buffer after it is no longer needed. This also improves code readability since the code is mostly equal to kwbimage_set_header(). Signed-off-by: Patrick Wildt <patrick@blueri.se> Signed-off-by: Stefan Roese <sr@denx.de>
* sunxi: Store the device tree name in the SPL headerSiarhei Siamashka2017-05-171-4/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch updates the mksunxiboot tool to optionally add the default device tree name string to the SPL header. This information can be used by the firmware upgrade tools to protect users from harming themselves by trying to upgrade to an incompatible bootloader. The primary use case here is a non-removable bootable media (such as NAND, eMMC or SPI flash), which already may have a properly working, but a little bit outdated bootloader installed. For example, the user may download or build a new U-Boot image for "Cubieboard", and then attemept to install it on a "Cubieboard2" hardware by mistake as a replacement for the already existing bootloader. If this happens, the flash programming tool can identify this problem and warn the user. The size of the SPL header is also increased from 64 bytes to 96 bytes to provide enough space for the device tree name string. [Andre: split patch to remove OF_LIST hash feature] Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* tools: mksunxiboot: allow larger SPL binariesAndre Przywara2017-05-171-2/+2
| | | | | | | | | | | | | mksunxiboot limits the size of the resulting SPL binaries to pretty conservative values to cover all SoCs and all boot media (NAND). It turns out that we have limit checks in place in the build process, so mksunxiboot can be relaxed and allow packaging binaries up to the actual 32KB the mask boot ROM actually imposes. This allows to have a bigger SPL, which is crucial for AArch64 builds. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@openedev.com>
* tools/genboardscfg.py: Make 'Supported' as known statusLokesh Vutla2017-05-121-0/+2
| | | | | | | | | | | | | | As per MAINTAINERS[1] file description, 'Supported' is a valid status for a board. But buildman thinks 'Maintained' is the only valid state and complains about boards with 'Supported' status. Update buildman to accept 'Supported' as valid state. [1] http://git.denx.de/?p=u-boot.git;a=blob;f=MAINTAINERS;h=0962b47bf9057b22e93624e070c0204b893790dc;hb=HEAD#l10 Reported-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* tools: kwbimage fix build with OpenSSL 1.1.xJelle van der Waa2017-05-121-6/+30
| | | | | | | | | | The rsa_st struct has been made opaque in 1.1.x, add forward compatible code to access the n, e, d members of rsa_struct. EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be called to reinitialise an already created structure. Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
* dtoc: Handle nodes with phandles that depend on the sameSimon Glass2017-05-101-14/+41
| | | | | | | | | | | | | | | | At present dtoc assumes that nodes which are phandles do not themselves reference other phandle nodes. Unfortunately this is not necessarilly true. As a result we can currently output C code which does not compile because a node declaration can be referenced before it is declared. Adjust the code to explicitly output all phandle nodes needed by node before the node itself is output. This fixes building with the latest rk3399-firefly.dts from Linux, which has reordered the nodes. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Kever Yang <kever.yang@rock-chips.com>
* dtoc: Move the output code into its own functionSimon Glass2017-05-101-44/+52
| | | | | | | | The code to generate the tables is quite long. Move the node-output code into its own function. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Kever Yang <kever.yang@rock-chips.com>
* rockchip: mkimage: remove placeholder functions from rkimagePhilipp Tomsich2017-05-101-18/+3
| | | | | | | | | | | | | | | The imagetool framework checks whether function pointer for the verify, print and extract actions are available and will will handle their absence appropriately. This change removes the unnecessary functions and uses the driver structure to convey available functionality to imagetool. This is in fact better than having verify just return 0 (which previously broke dumpimage, as dumpimage assumed that we had handled the image and did not continue to probe further). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Simon Glass <sjg@chromium.org>
* rockchip: mkimage: play nice with dumpimagePhilipp Tomsich2017-05-101-3/+13
| | | | | | | | | Dumpimage (it invoked with "-T rkspi" or "-T rksd") would not work due to check_params failing. These changes ensure that we can both be called with an empty imagename. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Simon Glass <sjg@chromium.org>
* rockchip: mkimage: clarify header0 initialisationPhilipp Tomsich2017-05-101-3/+17
| | | | | | | | | | | This change set adds documentation to the header0 initialisation and improves readability for the calculations of various offsets/lengths. As the U-Boot SPL stage doesn't use any payload beyond what is covered by init_size, we no longer add RK_MAX_BOOT_SIZE to init_boot_size. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Simon Glass <sjg@chromium.org>
* rockchip: mkimage: rksd: pad SD/MMC images to a full blocksizePhilipp Tomsich2017-05-101-2/+5
| | | | | Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Simon Glass <sjg@chromium.org>
* rockchip: mkimage: Update comments for header sizePhilipp Tomsich2017-05-101-9/+13
| | | | | | | | | | | | | | The calculation of the variable header size in rkcommon_vrec_header had been update twice in the earlier series (introducing boot0-style images to deal with the alignment of the first instruction in 64bit binaries). Unfortunately, I didn't update the comment twice (so it remained out-of-date). This change brings the comment back in-sync with what the code is doing. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Simon Glass <sjg@chromium.org>
* rockchip: mkimage: rewrite padding calculation for SD/MMC and SPI imagesPhilipp Tomsich2017-05-104-29/+66
| | | | | | | | | | | | | | In (first) breaking and (then) fixing the rkspi tool, I realised that the calculation of the required padding (for the header-size and the 2K-in-every-4K SPI layout) was not as self-explainatory as it could have been. This change rewrites the code (using new, common functions in rkcommon.c) and adds verbose in-line comments to ensure that we won't fall into the same pit in the future... Tested on the RK3399 (with has a boot0-style payload) with SD/MMC and SPI. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Simon Glass <sjg@chromium.org>
* rockchip: mkimage: rkspi: include the header sector in the SPI size calculationPhilipp Tomsich2017-05-101-2/+2
| | | | | | | | | | | | Our earlier change broke the generation of SPI images, by excluding the 2K used for header0 from the size-calculation. This commit makes sure that these are included before calculating the required total size (including the padding from the 2K-from-every-4K conversion). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Acked-by: Simon Glass <sjg@chromium.org>
* mkimage: rockchip: add support for rk3328Kever Yang2017-05-101-0/+1
| | | | | | | Add support for rk3328 package header in mkimage tool. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* tools: moveconfig: cleanup README entiresChris Packham2017-05-081-0/+41
| | | | | | | | The Kconfig description replaces the description in the README file so as options are migrated they can be removed from the README. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* tools: moveconfig: cleanup whitelist entriesChris Packham2017-05-081-0/+20
| | | | | | | | | | After moving to KConfig and removing from all headers options should be removed from config_whitelist.txt so the build starts complaining if someone adds them back. Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* tools: moveconfig: extract helper function for user confirmationChris Packham2017-05-081-19/+18
| | | | | | | Avoid repetitive code dealing with asking the user for confirmation. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* tools: sunxi: avoid read after end of stringxypron.glpk@gmx.de2017-05-051-1/+1
| | | | | | | | | | | | | | The evaluation of option -c is incorrect: According to the C99 standard endptr in the first strtol is always set as &endptr is not NULL. So the first part of the or condition is always true. If all digits in optarg are valid endptr will point to the closing \0 and the second strtol will read beyond the end of the string optarg points to. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
* relocate-rela: add missing va_end()xypron.glpk@gmx.de2017-05-051-2/+4
| | | | | | | | va_start must always be matched by va_end. The problem was indicated by cppcheck. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* rockchip: mkimage: remove (left-over) assignment w/o effect [coverity]Philipp Tomsich2017-04-271-1/+0
| | | | | | | | | | | | | An assignment (of a value to itself) was left over (after removing and addition from the line) from moving the common padding code into rkcommon_vrec_header. This change removes this to avoid a spurious warning in static code analysis (i.e. Coverity). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reported-by: Coverity (CID: 161418) Reviewed-by: Tom Rini <trini@konsulko.com>
* tools/env: avoid memory leak in fw_setenvxypron.glpk@gmx.de2017-04-181-0/+3
| | | | | | | | If realloc fails we should release the old buffer. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* buildman: Allow 'gnueabihf' toolchains for ARMTom Rini2017-04-181-2/+3
| | | | | | | | | | Many toolchains for ARM use the 'gnueabihf' suffix rather than just 'gnueabi', so allow these to be used, but with a lower priority than 'gnueabi' ones. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* tools: moveconfig: remove GCC prefix of obsolete architectureMasahiro Yamada2017-04-181-7/+0
| | | | | | Recently, U-Boot removed support for these architectures. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* buildman: Translate more strings to latin-1Tom Rini2017-04-141-2/+2
| | | | | | | | | | When writing out some of our results we may now have UTF-8 characters in there as well. Translate these to latin-1 and ignore any errors (as this is for diagnostic and given the githash anything else can be reconstructed by the user. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>