summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2014-07-06sunxi: mksunxiboot: Fix loading of files with a size which is not a multiple ↵Hans de Goede
of 4 We should not be aligning the amount of bytes which we try to read from the disk, this leads to trying to read more bytes then there are which fails. file_size is already aligned to BLOCK_SIZE before being stored in img.header.length, so there is no need for load_size at all. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
2014-06-23lib, fdt: move fdtdec_get_int() out of lib/fdtdec.cHeiko Schocher
move fdtdec_get_int() out of lib/fdtdec.c into lib/fdtdec_common.c as this function is also used, if CONFIG_OF_CONTROL is not used. Poped up on the ids8313 board using signed FIT images, and activating CONFIG_SYS_GENERIC_BOARD. Without this patch it shows on boot: No valid FDT found - please append one to U-Boot binary, use u-boot-dtb.bin or define CONFIG_OF_EMBED. For sandbox, use -d <file.dtb> With this patch, it boots again with CONFIG_SYS_GENERIC_BOARD enabled. Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@ti.com>
2014-06-19includes: move openssl headers to include/u-bootJeroen Hofstee
commit 18b06652cd "tools: include u-boot version of sha256.h" unconditionally forced the sha256.h from u-boot to be used for tools instead of the host version. This is fragile though as it will also include the host version. Therefore move it to include/u-boot to join u-boot/md5.h etc which were renamed for the same reason. cc: Simon Glass <sjg@chromium.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
2014-06-19Enhance fit_check_sign to check all imagesSimon Glass
At present this tool only checks the configuration signing. Have it also look at each of the images in the configuration and confirm that they verify. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de> (v1)
2014-06-19Allow compiling common/bootm.c on with HOSTCCSimon Glass
We want to use some of the functionality in this file, so make it build on the host. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-19Reverse the meaning of the fit_config_verify() return codeSimon Glass
It is more common to have 0 mean OK, and -ve mean error. Change this function to work the same way to avoid confusion. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-19tools: Check arguments in fit_check_sign/fit_infoSimon Glass
These tools crash if no arguments are provided. Add checks to avoid this. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
2014-06-19mkimage: Automatically expand FDT in more casesSimon Glass
The original code did not cover every case and there was a missing negative sign in one case. Expand the coverage and fix the bug. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-11.gitignore: move *.exe pattern to the top gitignore for CygwinMasahiro Yamada
GCC on Cygwin generates executables with .exe extension, for example: scripts/basic/fixdep.exe scripts/docproc.exe To ignore them, *.exe pattern should be moved from tools/.gitignore to ./.gitignore Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-06-11kbuild: remove unnecessary adjustment for CygwinMasahiro Yamada
"SFX = .exe" was originally added for Cygwin environment. It is true that GCC on Cygwin spits executables with .exe extention. For example, gcc -o foo foo.c will generate "foo.exe", not "foo". But GNU make is also nicely adjusted for Cygwin. For example, foo: foo.c gcc -o $@ $< will compare the timestamp between "foo.exe" and "foo.c". You do not have to tweak Makefiles like this: foo$(SFX): foo.c gcc -o $@ $< And "make clean" works as well without adjustment for Cygwin because the command "rm foo" on Cygwin will delete both "foo" and "foo.exe". In conclusion, makefiles do not need special care for Cygwin. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-06-11kbuild, tools: generate wrapper C sources automatically by MakefileMasahiro Yamada
There are many source files shared between U-boot image and tools. Instead of adding a lot of dummy wrapper files that just include the corresponding file in lib/ or common/ directory, Makefile should automatically generate them. The original inspiration for this came from scripts/Makefile.asm-generic of Linux Kernel. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
2014-06-11mkimage: Automatically make space in FDT when fullSimon Glass
When adding hashes or signatures, the target FDT may be full. Detect this and automatically try again after making 1KB of space. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-11Improve error handling in fit_commonSimon Glass
Make the error handling common, and make sure the file is always closed on error. Rename the parameter to be more description and add comments. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-06-11tools: include u-boot version of sha256.hJeroen Hofstee
When building tools the u-boot specific sha256.h is required, but the host version of sha256.h is used when present. This leads to build errors on FreeBSD which does have a system sha256.h include. Like libfdt_env.h explicitly include u-boot's sha256.h. cc: Simon Glass <sjg@chromium.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-05tools: refactor HOSTLOADLIBES_* optionsMasahiro Yamada
The tools mkimage, dumpimage, fit_info, fit_check_sign always have the common libraries to be linked, so HOSTLOADLIBES_* can be consolidated a little bit. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-05Prevent a stack overflow in fit_check_signMichael van der Westhuizen
It is trivial to crash fit_check_sign by invoking with an absolute path in a deeply nested directory. This is exposed by vboot_test.sh. Signed-off-by: Michael van der Westhuizen <michael@smart-africa.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-06-05tools: Refactor mxsimage to use pbl_crc32Charles Manning
Both pblimage and mxsimage use the same crc algorithm, so refactor. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2014-06-05mkimage : Split out and clean pbl_crc32 for use by other image typesCharles Manning
The crc32 used by pblimgae is NOT the same as zlib crc32. The pbl_crc32 is useful for other purposes in mkimage so split it out. While we are about it, clean up redundant and confusing code. Signed-off-by: Charles Manning <cdhmanning@gmail.com>
2014-05-27arm:at91: enable ROM loadable atmel imageAndreas Bießmann
For sama5d3xek we need to modify the SPL image for correct detection by ROM code. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Tested-by: Bo Shen <voice.shen@atmel.com>
2014-05-27mkimage: add atmelimageAndreas Bießmann
The new atmelimage converts a machine code BLOB to bootable ROM image. Atmel ROM has no sophisticated image format, it only checks the first 7 ARM vectors. The vectors can contain valid B or LDR opcodes, the 6'th vector contains the image size to load. Additionally the PMECC header can be written by the atmelimage target. The parameters must be given via the -n switch as a coma separated list. For example: mkimage -T atmelimage \ -n usePmecc=1,sectorPerPage=4,sectorSize=512,spareSize=64,eccBits=4,eccOffset=36 \ -d spl/u-boot-spl.bin boot.bin A provided image can be checked for correct header setup. It prints out the PMECC header parameters if it has one and the 6'th interrupt vector content. ---8<--- Image Type: ATMEL ROM-Boot Image with PMECC Header PMECC header ==================== eccOffset: 36 sectorSize: 512 eccBitReq: 4 spareSize: 64 nbSectorPerPage: 4 usePmecc: 1 ==================== 6'th vector has 17044 set --->8--- A SPL binary modified with the atmelimage mkimage target was succesfully booted on a sama5d34ek via MMC and NAND. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Cc: Bo Shen <voice.shen@atmel.com> Cc: Heiko Schocher <hs@denx.de> Tested-by: Bo Shen <voice.shen@atmel.com>
2014-05-25sunxi: non-FEL SPL boot support for sun7iIan Campbell
Add support for booting from an MMC card. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Henrik Nordström <henrik@henriknordstrom.net> Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Reviewed-by: Marek Vasut <marex@denx.de> Cc: Tom Cubie <Mr.hipboi@gmail.com> Reviewed-by: Tom Rini <trini@ti.com>
2014-05-16patman: Suppress duplicate signoffs only for real patchesSimon Glass
There is an unfortunate bug in the signoff suppression logic. The first pass is performed with 'git log', and all signoffs are added to the supression set, such that the second time (when processing the real patches) we always suppress the signoffs. Correct this by only suppressing signoffs in the second pass. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Michal Simek <monstr@monstr.eu> Tested-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-05-13Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini
2014-05-12tools: env: Add aes.c placeholderMarek Vasut
Add missing aes.c placeholder which includes lib/aes.c . Without this one, tools/env/ will fail to build. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com> Cc: Masahiro Yamada <yamada.m@jp.panasonic.com> Tested-by: Alexey Brodkin <abrodkin@synopsys.com> Tested-by: Heiko Schocher <hs@denx.de>
2014-05-09Merge branch 'tom' of git://git.denx.de/u-boot-x86Tom Rini
2014-05-09patman: Avoid duplicate sign-offsSimon Glass
Keep track of all Signed-off-by tags in a commit and silently suppress any duplicates. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-05-09patman: Deal with 'git apply' failures correctlySimon Glass
This sort of failure is rare, but the code to deal with it is wrong. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2014-05-09Merge branch 'u-boot/master'Albert ARIBAUD
Conflicts: drivers/net/Makefile (trivial merge)
2014-05-05logos: Update of the syteco company logoThomas Diener
Signed-off-by: Thomas Diener <dietho@gmx.de> Signed-off-by: Anatolij Gustschin <agust@denx.de>
2014-04-18buildman: make output dir configurableDaniel Schwierzeck
Add an option to specify the output directory to override the default path '../'. This is useful for building in a ramdisk. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-04-18tools: fix Makefile to clean-up fit_info and fit_check_signMasahiro Yamada
We should avoid the description in Makefile like this ifdef CONFIG_FIT_SIGNATURE hostprogs-y += fit_info$(SFX) fit_check_sign$(SFX) endif Otherwise, fit_info and fit_check_sign would never be cleaned by "make clean". Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Heiko Schocher <hs@denx.de>
2014-04-17tools: mkimage: add support for gpimage formatKaricheri, Muralidharan
This patch add support for gpimage format as a preparatory patch for porting u-boot for keystone2 devices and is based on omapimage format. It re-uses gph header to store the size and loadaddr as done in omapimage.c Signed-off-by: Vitaly Andrianov <vitalya@ti.com> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Acked-by: Tom Rini <trini@ti.com>
2014-04-17fw_env.c: Switch get_config to use '%ms' in sscanfTom Rini
We currently limit ourself to 16 characters for the device name to read the environment from. This is insufficient for /dev/mmcblk0boot1 to work for example. Switch to '%ms' which gives us a dynamically allocated buffer instead. We're short lived enough to not bother free()ing the buffer. Signed-off-by: Tom Rini <trini@ti.com>
2014-04-17Merge branch 'next'Tom Rini
2014-03-22patman: Use Patch-cc: instead of Cc:Simon Glass
Add a new Patch-cc: tag which performs the service now provided by the Cc: tag. The Cc: tag is interpreted by git send-email but ignored by patman. So now: Cc: patman does nothing. (git send-email can cc patches) Patch-cc: patman Cc's patch and removes this tag from the patch Signed-off-by: Simon Glass <sjg@chromium.org>
2014-03-21env: Implement support for AES encryption into fw_* toolsMarek Vasut
Implement support for encrypting/decrypting the environment block into the tools/env/fw_* tools. The cipher used is AES 128 CBC and the implementation depends solely on components internal to U-Boot. To allow building against the internal AES library, the library did need minor adjustments to not include U-Boot's headers which are not wanted to be included and define missing types. Signed-off-by: Marek Vasut <marex@denx.de>
2014-03-21tools, fit_check_sign: verify a signed fit imageHeiko Schocher
add host tool "fit_check_sign" which verifies, if a fit image is signed correct. Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org>
2014-03-21tools, fit: add fit_info host commandHeiko Schocher
add fit_info command to the host tools. This command prints the name, offset and the len from a property from a node in a fit file. This info can be used to extract a properties data with linux tools, for example "dd". Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Simon Glass <sjg@chromium.org>
2014-03-21fit: add sha256 supportHeiko Schocher
add sha256 support to fit images Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Simon Glass <sjg@chromium.org>
2014-03-21tools/image-host: fix sign-images bugHeiko Schocher
property "sign-images" is never found, fix this. Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Simon Glass <sjg@chromium.org>
2014-03-12kbuild: rename SRCTREE to srctreeMasahiro Yamada
Prior to Kbuild, $(TOPDIR) or $(SRCTREE) was used for pointing to the top of source directory. (No difference between the two.) In Kbuild style, $(srctree) is used for instead. This commit renames SRCTREE to srctree and deletes the defition of SRCTREE. Note that SRCTREE in scripts/kernel-doc, scripts/docproc.c, doc/DocBook/Makefile should be keep. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-03-12fw_env: correct writes to devices with small erase blocksDustin Byford
Some NOR flash devices have a small erase block size. For example, the Micron N25Q512 can erase in 4K blocks. These devices expose a bug in fw_env.c where flash_write_buf() incorrectly calculates bytes written and attempts to write past the environment sectors. Luckily, a range check prevents any real damage, but this does cause fw_setenv to fail with an error. This change corrects the write length calculation. The bug was introduced with commit 56086921 from 2008 and only affects configurations where the erase block size is smaller than the total environment data size. Signed-off-by: Dustin Byford <dustin@cumulusnetworks.com>
2014-03-12fw_env: calculate default number of env sectorsDustin Byford
The assumed number of environment sectors (always 1) leads to an incorrect top_of_range calculation in fw.env.c when a flash device has an erase block size smaller than the environment data size (number of environment sectors > 1). This change updates the default number of environment sectors to at least cover the size of the environment. Also corrected a false statement about the number of sectors column in fw_env.config. Signed-off-by: Dustin Byford <dustin@cumulusnetworks.com>
2014-03-04kbuild: tools: fix a bug that always builds Denx logoMasahiro Yamada
LOGO_BMP was never overwritten by board-specific or vendor-specific logos. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Reported-by: Bo Shen <voice.shen@atmel.com> Tested-by: Bo Shen <voice.shen@atmel.com>
2014-03-04kbuild: add "cross_tools" target to build tools for the targetMasahiro Yamada
Programs in tools/ directory are usually built for the host. But some of them (mkimage, dumpimge, gen_eth_addr, etc.) are useful on the target OS too. Actually, prior to Kbuild, U-Boot could build tools for the target like follows: $ make <target_board>_config $ export CROSS_COMPILE=<cross_gcc_prefix> $ make HOSTCC=${CROSS_COMPILE}gcc HOSTSTRIP=${CROSS_COMPILE}strip tools In Kbuild, we can no longer replace HOSTCC at the command line. In order to get back that feature, this commit adds "cross-tools" target. Usage: Build tools for the host $ make CROSS_COMPILE=<cross_gcc_prefix> tools Build tools for the target $ make CROSS_COMPILE=<cross_gcc_prefix> cross_tools Besides, "make cross_tools" strip tools programs because we generally expect smaller storages on embedded systems. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Reported-by: Heiko Schocher <hs@denx.de> Cc: Wolfgang Denk <wd@denx.de> Cc: Tom Rini <trini@ti.com> Tested-by: Heiko Schocher <hs@denx.de> Acked-by: Heiko Schocher <hs@denx.de>
2014-02-25kbuild: move asm-offsets.h rules to ./KbuildMasahiro Yamada
Generate include/generated/generic-asm-offsets.h and include/generated/asm-offsets.h in ./Kbuild. This commit also changes the include guard. Before this commit, __ASM_OFFSETS_H__ was used for both of them. So we could not include generic-asm-offsets.h and asm-offsets.h at the same time. This commit renames the include guard of the former to __GENERIC_ASM_OFFSETS_H__. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19kernel-doc: move kernel-doc tools to scripts/Masahiro Yamada
tools/kernel-doc/docproc.c and tools/kernel-doc/kernel-doc are files imported from Linux Kernel. They originally resided under scripts/ directory in Linux Kernel. This commit moves them to the original location. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-02-19tools/env: cross-compile fw_printenv without setting HOSTCCMasahiro Yamada
fw_printenv is a program which mostly runs on the target Linux. Before switching to Kbuild, we needed to set HOSTCC at the command line like this: make HOSTCC=<your CC cross-compiler> env Going forward we can cross compile it by specifying CROSS_COMPILE: make CROSS_COMPILE=<your cross-compiler prefix> env This looks more natural. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Tested-by: Gerhard Sittig <gsi@denx.de>
2014-02-19Makefile: refactor tools-all targetsMasahiro Yamada
- Move "easylogo", "gdb" tagets to tools/Makefile - Delete "gdbtools" target (same as "gdb") Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19kbuild: use Linux Kernel build scriptsMasahiro Yamada
Now we are ready to switch over to real Kbuild. This commit disables temporary scripts: scripts/{Makefile.build.tmp, Makefile.host.tmp} and enables real Kbuild scripts: scripts/{Makefile.build,Makefile.host,Makefile.lib}. This switch is triggered by the line in scripts/Kbuild.include -build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj +build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj We need to adjust some build scripts for U-Boot. But smaller amount of modification is preferable. Additionally, we need to fix compiler flags which are locally added or removed. In Kbuild, it is not allowed to change CFLAGS locally. Instead, ccflags-y, asflags-y, cppflags-y, CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o are prepared for that purpose. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Tested-by: Gerhard Sittig <gsi@denx.de>