summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2018-05-11SPDX: Correct SPDX tags from recent xilinx mergeTom Rini
Correct the SPDX tag format. Fixes: 3b52847a451a ("Merge tag 'xilinx-for-v2018.07' of git://www.denx.de/git/u-boot-microblaze") Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-11Merge tag 'xilinx-for-v2018.07' of git://www.denx.de/git/u-boot-microblazeTom Rini
Xilinx changes for v2018.07 microblaze: - Align defconfig zynq: - Rework fpga initialization and cpuinfo handling zynqmp: - Add ZynqMP R5 support - Wire and enable watchdog on zcu100-revC - Setup MMU map for DDR at run time - Show board info based on DT and cleanup IDENT_STRING zynqmp tools: - Add read partition support - Add initial support for Xilinx bif format for boot.bin generation mmc: - Fix get_timer usage on 64bit cpus - Add support for SD3.0 UHS mode nand-zynq: - Add support for 16bit buswidth - Use address cycles from onfi params scsi: - convert ceva sata to UCLASS_AHCI timer: - Add Cadence TTC for ZynqMP r5 watchdog: - Minor cadence driver cleanup
2018-05-11tools: zynqmpimage: Add bif supportAlexander Graf
The officially described way to generate boot.bin files for ZynqMP is to describe the contents of the target binary using a file of the "bif" format. This file then links to other files that all get packed into a bootable image. This patch adds support to read such a .bif file and generate a respective ZynqMP boot.bin file that can include the normal image and pmu files, but also supports image partitions now. This makes it a handy replacement for the proprietary "bootgen" utility that is currently used to generate boot.bin files with FSBL. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-05-11tools: zynqmpimage: Move defines to headerAlexander Graf
We will add support for ZynqMP bif input files later, so let's move all structure definitions into a header file that can be used by that one as well. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-05-11tools: zynqmpimage: Add partition read supportAlexander Graf
The zynqmp image format has support for inline partitions which are used by FSBL to describe payloads that are loaded by FSBL itself. While we can't create images that contain partitions (yet), we should still at least be able to examine them and show the user what's inside when we analyze an image created by bootgen. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-05-10Merge git://git.denx.de/u-boot-socfpgaTom Rini
2018-05-10SPDX: Convert a few files that were missed beforeTom Rini
As part of the main conversion a few files were missed. These files had additional whitespace after the '*' and before the SPDX tag and my previous regex was too strict. This time I did a grep for all SPDX tags and then filtered out anything that matched the correct styles. Fixes: 83d290c56fab ("SPDX: Convert all of our single license tags to Linux Kernel style") Reported-by: Heinrich Schuchardt <xypron.debian@gmx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-10tools/file2include: avoid incorrect commentsHeinrich Schuchardt
Avoid creating incorrect comments like /* ...*/... */ by printing '.' instead of '*' inside comments. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2018-05-10tools/file2include: create Linux style SPDX headerHeinrich Schuchardt
file2include is used to convert a binary file to a C include. With the patch the SPDX header is written to the first line as expected by scripts/checkpatch.pl. Cf. https://www.kernel.org/doc/html/v4.16/process/license-rules.html Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-05-08tools: socfpga: Add SFP image V1 supportMarek Vasut
Add support for the SoCFPGA header v1 , which is used on Arria 10. Thus far the mkimage-socfpga image only supported header format v0 used on Cyclone V and Arria V, but is not supported on Arria 10. The layout of the v0 and v1 header is similar, yet there are a few differences, see the patch body for details. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: Chin Liang See <chin.liang.see@intel.com>
2018-05-08tools: socfpga: Stop using global struct socfpga_imageMarek Vasut
The structure is passed around correctly, create local instances where necessary and zap the global struct socfpga_image instance. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Dinh Nguyen <dinguyen@kernel.org> Cc: Chin Liang See <chin.liang.see@intel.com>
2018-05-07SPDX: Convert all of our multiple license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have multiple licenses (in these cases, dual license) declared in the SPDX-License-Identifier tag. In this case we change from listing "LICENSE-A LICENSE-B" or "LICENSE-A or LICENSE-B" or "(LICENSE-A OR LICENSE-B)" to "LICENSE-A OR LICENSE-B" as per the Linux Kernel style document. Note that parenthesis are allowed so when they were used before we continue to use them. Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-30Merge git://git.denx.de/u-boot-imxTom Rini
2018-04-28tools: mkimage: Check for datafile when type is scriptAlex Kiernan
If generating a script image and no datafile has been passed in, mkimage dies with SIGSEGV: #0 __strchr_sse2 () at ../sysdeps/x86_64/multiarch/../strchr.S:32 #1 0x0000000000403818 in main at tools/mkimage.c:503 Add explicit test for datafile to fix this. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-04-28tools: mkenvimage: Fix possible segfault on stdin inputAlexander Dahl
The size of 'filebuf' was not increased as more and more bytes are read from stdin, but 'filebuf' was always reallocated to the same fix size. This works as long as only less bytes than the initial buffer size come in, for more input this will segfault. (It actually does, I tested that.) So for each loop cycle the buffer size has to be increased by the number of bytes we want to read. Signed-off-by: Alexander Dahl <ada@thorsis.com>
2018-04-28tools: mkenvimage: Fix read() stdin error handlingAlexander Dahl
On success read() returns the number of bytes read or zero for EOF. On error -1 is returned and errno is set, so the right way to test if read had failed is to test the return value instead of errno. Signed-off-by: Alexander Dahl <ada@thorsis.com>
2018-04-26Revert "imximage: Remove failure when no IVT offset is found"Fabio Estevam
This reverts commit b5b0e4e351e20a606de22db6a56ad6bc1e2aa8fd. Commit f916757300c1 ("imx: Create distinct pre-processed mkimage config files") provided a proper fix for the parallel mkimage config files build failure, so the original workaround can be safely reverted now. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Stefano Babic <sbabic@denx.de>
2018-04-26tools/imximage: Fix fruity lack of 0x prefix in DCD BlocksBryan O'Donoghue
commit 8519c9c98ad6 ("tools/imximage: use 0x prefix in HAB Blocks line") adds an 0x prefix to each HAB Block number to make it easier for host tools to process the HAB Block output, however it neglects to apply the same prefix to the DCD Blocks directive. You need the DCD Blocks directive if you are making a u-boot recovery image which the BootROM will accept via the USB upload utility. This disparity results in a fruity output like this with HAB Blocks prefixed but DCD Blocks not prefixed - which is pretty inconsistent. This patch fixes the difference assuming the original commit was a legitimate change. Old: Image Type: Freescale IMX Boot Image Image Ver: 2 (i.MX53/6/7 compatible) Mode: DCD Data Size: 430080 Bytes = 420.00 KiB = 0.41 MiB Load Address: 877ff420 Entry Point: 87800000 HAB Blocks: 0x877ff400 0x00000000 0x00066c00 DCD Blocks: 00910000 0000002c 000001d4 New: Image Type: Freescale IMX Boot Image Image Ver: 2 (i.MX53/6/7 compatible) Mode: DCD Data Size: 430080 Bytes = 420.00 KiB = 0.41 MiB Load Address: 877ff420 Entry Point: 87800000 HAB Blocks: 0x877ff400 0x00000000 0x00066c00 DCD Blocks: 0x00910000 0x0000002c 0x000001d4 Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Breno Lima <breno.lima@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
2018-04-15Merge git://git.denx.de/u-boot-imxTom Rini
Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-15tools/imximage: use 0x prefix in HAB Blocks lineRasmus Villemoes
The u-boot-ivt.img.log file contains 0x prefixes in the HAB Blocks line, while the SPL.log does not. For consistency, and to make it easier to extract and put into a .csf file for use with NXP's code signing tool, add 0x prefixes here. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Tested-by: Breno Lima <breno.lima@nxp.com>
2018-04-10fw_printenv: Fix crash due to incorrect size for malloc'ed string.Kristian Amlie
Using sizeof gives the size of the pointer only, not the string. This could easily lead to crashes when using -l argument. Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
2018-04-10mkimage: do not fail if there is no print_header functionGuillaume GARDET
Commit 253c60a breaks the exit value of 'mkimage -T rkimage' and print the following error: mkimage: Can't print header for Rockchip Boot Image support: Success It is not a failure to not print headers, so just display the warning message, and finish the function properly. Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-04-06tools/mxsimage: Support building with LibreSSLHauke Mehrtens
The mxsimage utility fails to compile against LibreSSL version < 2.7.0 because LibreSSL says it is OpenSSL 2.0, but it does not support the complete OpenSSL 1.1 interface. LibreSSL defines OPENSSL_VERSION_NUMBER with 0x20000000L and therefor claims to have an API compatible with OpenSSL 2.0, but it implements EVP_MD_CTX_new(), EVP_MD_CTX_free() and EVP_CIPHER_CTX_reset() only starting with version 2.7.0, which is not yet released. OpenSSL implements this function since version 1.1.0. This commit will activate the compatibility code meant for OpenSSL < 1.1.0 also for LibreSSL version < 2.7.0. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Reviewed-by: Jonathan Gray <jsg@jsg.id.au>
2018-03-30kwbimage: Fix out of bounds accessAlexander Graf
The kwbimage format is reading beyond its header structure if it misdetects a Xilinx Zynq image and tries to read it. Fix it by sanity checking that the header we want to read fits inside our file size. Signed-off-by: Alexander Graf <agraf@suse.de> Tested-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
2018-03-23tools: xilinx: Fix zynq/zynqmp image recognitionMichal Simek
There is an issue to recognize zynq or zynqmp image because header checking is just the same. That's why zynqmp images are recognized as zynq one. Check unused fields which are initialized to zero in zynq format (__reserved1 0x38 and __reserved2 0x44) which are initialized for zynqmp. This should ensure that images are properly recognized by: ./tools/mkimage -l spl/boot.bin Also show image type as ZynqMP instead of Zynq which is confusing. Reported-by: Alexander Graf <agraf@suse.de> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Tested-by: Alexander Graf <agraf@suse.de>
2018-03-22tools: Make kwboot build if HOST_TOOLS_ALL=yTuomas Tynkkynen
The kwboot tool for Marvell devices isn't currently being built even if HOST_TOOLS_ALL is set. It doesn't appear to depend on any CONFIG_ options, so it seems appropriate to enable building it here. Signed-off-by: Tuomas Tynkkynen <tuomas@tuxera.com>
2018-03-19image: Add IH_OS_TEE for TEE chain-load bootBryan O'Donoghue
This patch adds a new type IH_OS_TEE. This new OS type will be used for chain-loading to Linux via a TEE. With this patch in-place you can generate a bootable OPTEE image like this: mkimage -A arm -T kernel -O tee -C none -d tee.bin uTee.optee where "tee.bin" is the input binary prefixed with an OPTEE header and uTee.optee is the output prefixed with a u-boot wrapper header. This image type "-T kernel -O tee" is differentiated from the existing IH_TYPE_TEE "-T tee" in that the IH_TYPE is installed by u-boot (flow control returns to u-boot) whereas for the new IH_OS_TEE control passes to the OPTEE firmware and the firmware chainloads onto Linux. Andrew Davis gave the following ASCII diagram: IH_OS_TEE: (mkimage -T kernel -O tee) Non-Secure Secure BootROM | ------------- | v SPL | v U-Boot ------> <----- OP-TEE | V Linux IH_TYPE_TEE: (mkimage -T tee) Non-Secure Secure BootROM | ------------- | v SPL -------> <----- OP-TEE | v U-Boot | V Linux Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Suggested-by: Andrew F. Davis <afd@ti.com> Cc: Harinarayan Bhatta <harinarayan@ti.com> Cc: Andrew F. Davis <afd@ti.com> Cc: Tom Rini <trini@konsulko.com> Cc: Kever Yang <kever.yang@rock-chips.com> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: Peng Fan <peng.fan@nxp.com> Link: http://mrvan.github.io/optee-imx6ul
2018-03-19tools/mkimage: add support for STM32 image formatPatrick Delaunay
STM32MP157 bootrom needs a specific header for first boot stage. This patch adds support of this header in mkimage. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-19tools: env: Implement atomic replace for filesystemAlex Kiernan
If the U-Boot environment is stored in a regular file and redundant operation isn't set, then write to a temporary file and perform an atomic rename. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-03-19tools: env: Refactor write path of flash_io()Alex Kiernan
Extract write path of flash_io() into a separate function. This patch should be a functional no-op. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Stefano Babic <sbabic@denx.de>
2018-03-19tools: env: Fix CamelCasing style violationAlex Kiernan
Replace HaveRedundEnv with have_redund_env to fix style violation. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-03-19tools: env: Pass through indentAlex Kiernan
Pass tools/env/fw_env.c through indent to correct style violations. This commit consists of only one non-whitespace change: tools/env/fw_env.c:549: error: do not use assignment in if condition Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-03-09Merge git://git.denx.de/u-boot-imxTom Rini
2018-03-09tools/mkimage: Use proper output parameter in dtc-system callStefan Theil
The system call used by mkimage to run dtc redirects stdout to a temporary file. This can cause problems on Windows (with a MinGW cross-compiled version). Using the "-o" dtc parameter avoids this problem. Signed-off-by: Stefan Theil <stefan.theil@mixed-mode.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-03-09imximage: Remove failure when no IVT offset is foundFabio Estevam
Sometimes imximage throws the following error: CFGS board/freescale/vf610twr/imximage.cfg.cfgtmp CFGS board/freescale/vf610twr/imximage.cfg.cfgtmp MKIMAGE u-boot-dtb.imx Error: No BOOT_FROM tag in board/freescale/vf610twr/imximage.cfg.cfgtmp arch/arm/mach-imx/Makefile:100: recipe for target 'u-boot-dtb.imx' failed Later on, when running mkimage for the u-boot.imx it will succeed in finding the IVT offset. Looks like some race condition happening during parallel build when processing mkimage for u-boot-dtb.imx and u-boot.imx. A proper fix still needs to be implemented, but as a workaround let's remove the error when the IVT offset is not found. It is useful to have such message, especially during bring-up phase, but the build error that it causes is severe, so better avoid the build error for now. The error checking can be re-implemented later when we have a proper fix. Reported-by: Breno Lima <breno.lima@nxp.com> Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
2018-03-05libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>Masahiro Yamada
Thomas reported U-Boot failed to build host tools if libfdt-devel package is installed because tools include libfdt headers from /usr/include/ instead of using internal ones. This commit moves the header code: include/libfdt.h -> include/linux/libfdt.h include/libfdt_env.h -> include/linux/libfdt_env.h and replaces include directives: #include <libfdt.h> -> #include <linux/libfdt.h> #include <libfdt_env.h> -> #include <linux/libfdt_env.h> Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-03-05tools: Include U-Boot libfdt headers from their actual pathPaul Kocialkowski
There are no headers for libfdt in lib/libfdt, as they are instead located in scripts/dtc/libfdt. Specifying lib/libfdt for headers inclusion in host tools results in using the system libfdt headers, which is not what we want. Change this to the proper path. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
2018-03-05tools/env: allow equal sign as key value separationStefan Agner
Treat the first equal sign as a key/value separation too. This makes the script files compatible with mkenvimage input file format. It won't support variables with equal signs anymore, but this seems not really like a loss. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
2018-02-23tools/kwbimage: fix LibreSSL buildJonathan Gray
Fix build after addition of RSA_get0_key() to LibreSSL. Patch from Theo Buehler and Stuart Henderson. Signed-off-by: Theo Buehler <tb@openbsd.org> Signed-off-by: Stuart Henderson <sthen@openbsd.org>
2018-02-14Fix --noheader on fw_printenvAlex Kiernan
The single argument `--noheader' is expecting isn't taken from getopt parsing, but instead from the remaining argv arguments. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-02-04buildman: add option -E for treating compiler warnings as errorsDaniel Schwierzeck
Add a new option '-E' for treating all compiler warnings as errors. Eventually this will pass 'KCFLAGS=-Werror' to Kbuild. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2018-01-29tools/mrvl_uart.sh: Tidy script outputAndreas Färber
Fix a typo in help output (awailable -> available). Tidy the grammar - not the board connects to a port, we do. While at it, be consistent in upper-casing the comments. Fixes: eee4835d22 ("tools: Add Marvell recovery image download script") Cc: Konstantin Porotchkin <kostap@marvell.com> Cc: Stefan Roese <sr@denx.de> Cc: Igal Liberman <igall@marvell.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Konstantin Porotchkin <kostap@marvell.com> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
2018-01-29tools/mrvl_uart.sh: Fix minicom baudrateAndreas Färber
minicom doesn't inherit the baudrate from stty but uses its own defaults, such as for example 57600, whereas we expect 115200 here. Explicitly tell minicom which baudrate to use. Fixes: eee4835d22 ("tools: Add Marvell recovery image download script") Cc: Konstantin Porotchkin <kostap@marvell.com> Cc: Stefan Roese <sr@denx.de> Cc: Igal Liberman <igall@marvell.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Konstantin Porotchkin <kostap@marvell.com> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
2018-01-28libfdt: migrate include/libfdt_env.h to a wrapperMasahiro Yamada
libfdt_env.h is supposed to provide system-dependent defines. scripts/dtc/libfdt/libfdt_env.h from upstream DTC is suitable for user-space, so we should use this for USE_HOSTCC case. For compiling U-Boot, we need to override such system-dependent defines, so use <linux/libfdt_env.h> imported from Linux. <libfdt.h> selects a proper one. Maybe, we should split header inclusion completely, but I do not want too many patches at one. I can rip off the include/libfdt_env.h from HOST_EXTRACFLAGS. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-01-28tools: include necessary headers explicitlyMasahiro Yamada
Several host-tools use "bool" type without including <stdbool.h>. This relies on the crappy header inclusion chain. tools/Makefile has the following line: HOST_EXTRACFLAGS += -include $(srctree)/include/libfdt_env.h \ All host-tools are forced to include libfdt_env.h even if they are totally unrelated to FDT. Then, <stdbool.h> is indirectly included as follows: include/libfdt_env.h -> include/linux/types.h -> <stdbool.h> I am fixing this horrible crap. In advance, I need to add necessary include directives explicitly. tools/fdtgrep.c needs more; <fctl.h> for open() and <errno.h> for errno. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-01-28libfdt: migrate fdt_rw.c to a wrapper of scripts/dtc/libfdt/fdt_rw.cMasahiro Yamada
The only difference between scripts/dtc/libfdt/fdt_rw.c and lib/libfdt/fdt_rw.c is fdt_remove_unused_strings(). It is only used by fdtgrep, so we do not need to compile it for U-Boot image. Move it to tools/libfdt/fdw_rw.c so that lib/libfdt/fdt_rw.c can be a wrapper of scripts/dtc/libfdt/fdt_rw.c. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-01-28host-tools: use python2 explicitly for shebangMasahiro Yamada
All of these host tools are apparently written for Python2, not Python3. Use 'python2' in the shebang line according to PEP 394 (https://www.python.org/dev/peps/pep-0394/). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-01-28tools: remove unused retJelle van der Waa
Remove unused ret from fw_env_flush. Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-01-22tools: provide a tool to convert a binary file to an includeHeinrich Schuchardt
For testing EFI disk management we need an in-memory image of a disk. The tool file2include converts a file to a C include. The file is separated into strings of 8 bytes. Only the non-zero strings are written to the include. The output format has been designed to maintain readability. #define EFI_ST_DISK_IMG { 0x00010000, { \ {0x000001b8, "\x94\x37\x69\xfc\x00\x00\x00\x00"}, /* .7i..... */ \ {0x000001c0, "\x02\x00\x83\x02\x02\x00\x01\x00"}, /* ........ */ \ {0x000001c8, "\x00\x00\x7f\x00\x00\x00\x00\x00"}, /* ........ */ \ {0x000001f8, "\x00\x00\x00\x00\x00\x00\x55\xaa"}, /* ......U. */ \ ... {0x00006000, "\x48\x65\x6c\x6c\x6f\x20\x77\x6f"}, /* Hello wo */ \ {0x00006008, "\x72\x6c\x64\x21\x0a\x00\x00\x00"}, /* rld!.... */ \ {0, NULL} } } As the disk image needed for testing contains mostly zeroes a high compression ratio can be attained. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>