Commit Graph

905 Commits

Author SHA1 Message Date
Peter Robinson
0b367380a5 tools/env/fw_env.h: Correct include order
When building tools-only (or env) we need to be sure that we do use
<linux/kconfig.h> and do not use <generated/autoconf.h>.  This will fix
problems such as running 'make defconfig' or 'make sandbox_config' and
then 'make tools-only'.

Based on the responses below to the thread add linux/kconfig.h higher in
the includes and drop the now unneeded autoconf.h lower down to ensure
the default environment is included correctly

http://lists.denx.de/pipermail/u-boot/2015-June/216849.html

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2015-06-18 16:11:42 -04:00
Tom Rini
b48b69ba10 Merge git://git.denx.de/u-boot-marvell 2015-06-15 10:57:29 -04:00
Stefan Roese
1c0df9ef6e tools/kwboot: Add parameters to set delay and timeout via cmdline
To support the Armada 38x, new values for the request-delay and the
response-timeout are needed. As the values already implemented in
this tool (for Kirkwood and Armada XP) don't seem to work here.
To make this more flexible, lets add make those 2 parameters
configurable via the cmdline. Here the new parameters:

-q <req-delay>:  use specific request-delay
-s <resp-timeo>: use specific response-timeout

For the Marvell DB-88F6820 these values are known to work:

One board:
-q 2 -s 1

2nd board:
-q 5 -s 5

So this seems to be even board specific. But with this patch now
those values can be specified and tested via the cmdline.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Kevin Smith <kevin.smith@elecsyscorp.com>
Cc: Dirk Eibach <dirk.eibach@gdsys.cc>
Cc: Luka Perkov <luka.perkov@sartura.hr>
2015-06-14 17:48:28 +02:00
Kevin Smith
a0aad12346 tools/kwbimage.c: Correct header size for SPI boot
If defined, the macro CONFIG_SYS_SPI_U_BOOT_OFFS allows a board
to specify the offset of the payload image into the kwb image
file.  This value was being used to locate the image, but was not
used in the "header size" field of the main header.  Move the
use of this macro into the function that returns the header size
so that the same value is used in all places.

Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
Tested-by: Stefan Roese <sr@denx.de>
2015-06-14 17:48:28 +02:00
Masahiro Yamada
9d01b7872e kconfiglib: sync with the latest in Kconfiglib project
This commit imports some updates of kconfiglib.py from
https://github.com/ulfalizer/Kconfiglib

 - Warn about and ignore the "allnoconfig_y" Kconfig option
 - Statements in choices inherit menu/if deps
 - Add Symbol.is_allnoconfig_y()
 - Hint that modules are still supported despite warnings.
 - Add warning related to get_defconfig_filename().
 - Fix typo in docs.
 - Allow digits in $-references to symbols.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Philip Craig <philipjcraig@gmail.com>
Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-06-12 12:43:06 -04:00
Bin Meng
6c4247e98e tools: ifdtool: Do not write region while its size is negative
We should ignore those regions whose size is negative. These are
typically optional and unused regions (like GbE and platform data).

Change-Id: I65ad01746144604a1dc0588b617af21f2722ebbf
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-06-04 03:02:57 -06:00
Daniel Kochmański
1f6f61fe4c sunxi/nand: change BLOCK_SIZE in mksunxiboot to match NAND block size
This change is necessary to calculate correct checksum for NAND
boot. Works both for MMC and NAND. Without it BROM rejects boot image
as invalid (bad checksum). (Changes block size from 0x200 to 0x2000).

Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
Signed-off-by: Roy Spliet <r.spliet@ultimaker.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-05-29 13:46:36 +02:00
Thomas Petazzoni
4839836a12 tools: use pkg-config when available to get SSL flags
Instead of hardcoding -lssl -lcrypto as the flags needed to build
mkimage with FIT signature enabled, use pkg-config when
available. This allows to properly support cases where static linking
is used, which requires linking with -lz, since OpenSSL uses zlib
internally.

We gracefully fallback on the previous behavior of hardcoding -lssl
-lcrypto if pkg-config is not available or fails with an error.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-05-28 08:18:19 -04:00
Joe Hershberger
2e2ce6c0c8 moveconfig: Print status about the processed defconfigs
This gives a basic idea about progress.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-05-27 08:39:16 +09:00
Joe Hershberger
95bf9c7e34 moveconfig: Add a switch to enable printing errors
In some cases the build for the autoconf breaks. This outputs the errors
following the status so that action can be taken without building again
manually.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-05-27 08:39:16 +09:00
Joe Hershberger
25400090b1 moveconfig: Print a message for missing compiler
A common case for failed builds is a missing compiler. Print a message
for that case to tell the user concisely which compiler was expected
that was not found.

This patch also has the effect of not printing build errors any longer.
The next patch will add a switch to optionally bring that back.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-05-27 08:39:16 +09:00
Joe Hershberger
2559cd8961 moveconfig: Output a list of failed boards
If boards fail, output that list to a file so that it can easily be
passed back into moveconfig.py using the -d option.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-05-27 08:39:16 +09:00
Joe Hershberger
60727f5149 moveconfig: Cleanup headers in arch and board
Some config.h files live in arch and board directories. They will need
to be cleaned up as well, so run the same filters there.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-05-27 08:39:16 +09:00
Joe Hershberger
2144f88044 moveconfig: Add a switch to only cleanup headers
In some case you may want to only cleanup the headers. Make it possible
without waiting for all boards to compile.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-05-27 08:39:16 +09:00
Joe Hershberger
91040e8530 moveconfig: Add a parameter to accept a list to build
This is helpful to re-attempt to move failed boards from a previous run
without starting over.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-05-27 08:39:16 +09:00
Joe Hershberger
7740f653e6 moveconfig: Ignore duplicate configs when moving
When moving configs, it is important to know what was defined in the
config header even if it duplicates the configs coming from Kconfig.

This is specifically needed for the case where a config is set to
default 'y' in the Kconfig. This would previously cause the actual value
from the include config to be filtered out, and moveconfig.py would
think that it was 'n'... This means that the value that should be 'y'
is now (in every defconfig) set to 'not set'.

tools/moveconfig.py now defines KCONFIG_IGNORE_DUPLICATES to prevent the
filtering from happening and selecting wrong values for the defconfig.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-05-27 08:39:15 +09:00
Joe Hershberger
96464badc7 moveconfig: Always run savedefconfig on the moved config
This will ensure that the order of the defconfig entries will always
match that of the Kconfig files. After one slightly painful (but
still early in the process) pass over all boards, this should keep
the defconfigs clean from here on.

Users must edit the Kconfig first to add the menu entries and then run
moveconfig.py to update the defconfig files and the include configs.

As such, moveconfig.py cannot compare against the '.config' contents.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2015-05-27 08:39:15 +09:00
Masahiro Yamada
5a27c73433 tools: moveconfig: a tool to move CONFIGs from headers to defconfigs
This tool was originally written for my local use to ease the task
of tons of CONFIG moves, but there have been some requests for
mainlining it.
So, I have tidied up the code with nicer comments, and here it is.

See the comment block of the script for usage.

The first draft was
http://patchwork.ozlabs.org/patch/430422/

Main updates are:
  - Adapted to the single .config configuration
  - Support colored log
  - Support moving multiple options at once
    (and take configs via input file only)
  - Continue even if some boards fail
    (Idea provided by Joe Hershberger)
  - Add more options
  - More comments and code cleanups

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2015-05-27 08:39:15 +09:00
Jörg Krause
6121560d77 tools: mxsboot: Calculate ECC strength dynamically
Calculating the ECC strength dynamically to be aligned with the mxs NAND
driver and the Linux Kernel.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Reviewed-by: Marek Vasut <marex@denx.de>
2015-05-24 14:26:54 -05:00
Jörg Krause
1fbdb70610 mtd: nand: mxs: Replace magic number for bits per ECC level with macro
Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Reviewed-by: Marek Vasut <marex@denx.de>
2015-05-24 14:26:54 -05:00
Fabio Estevam
d0285e0797 logos: Add Solidrun's logo
Let Solidrun's logo appear on Cuboxi and Hummingboard by default.

Signed-off-by: Rabeeh Khoury <rabeeh@solid-run.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2015-05-15 19:20:47 +02:00
Jörg Krause
26e355d131 Fix musl build
This patch fixes cross-compiling U-Boot tools with the musl C library:
  * including <sys/types.h> is needed for ulong
  * defining _GNU_SOURCE is needed for loff_t

Tested for target at91sam9261ek_dataflash_cs3.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Cc: Tom Rini <trini@konsulko.com>
2015-05-08 17:24:17 -04:00
Max Krummenacher
1bfb9222ae fw_env.h: include autoconf.h
Without this, when CONFIG_ENV_VARS_UBOOT_CONFIG is active we get
a compile time error when doing 'make env'.
In file included from tools/env/fw_env.c:117:0:
include/env_default.h:110:11: error: expected ‘}’ before ‘CONFIG_SYS_ARCH’

When building U-Boot this is included indirectly by the compiler switch
-include
/home/trdx/git.toradex.com/u-boot-2014.10-toradex/include/linux/kconfig.h

Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2015-05-05 19:52:07 -04:00
Wu, Josh
3871cd858f patman: check git format.subjectprefix setting when generate patches prefix
For the local project, we may specified format.subjectprefix setting.
Then the patch will be formated as [Project_prefix][PATCH].
But patman will not check this setting. It will remove the
format.subjectprefix.

So This patch will let patman check this setting and add it as a
project prefix.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2015-04-23 12:35:50 -06:00
Michal Simek
1246231c48 buildman: Add gcc 4.9.0 with Microblaze toolchain
Also read gcc 4.9.0 at kernel.org which also have Microblaze toolchain.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>

Fixed unit test failure by updating the test:
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-23 12:31:54 -06:00
Wu, Josh
35ce2dc4d1 patman: cover letter shows like 00/xx if more than 10 patches
Make cover letter shows like 0/x, 00/xx and 000/xxx etc.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-04-18 16:24:25 -06:00
Tom Rini
f5e5ece0b7 buildman: Make -V (verbose_build) really be verbose
The help text for -V says we will pass V=1 but all it really did was not
pass in -s.  Change the logic to pass make V=1 with given to buildman -V or
-s to make otherwise.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-04-18 16:24:25 -06:00
Tom Rini
0eb4c04503 buildman: Keep more outputs with the --keep-outputs flag
When told to keep outputs, be much more liberal in what files we keep.
In addition to adding 'MLO', keep anything that matches u-boot-spl.* (so
that we keep the map file as well) and anything we generate about
'u-boot itself.  A large number of bootable formats now match this and
thus it's easier to build many targets and then boot them afterwards
using buildman.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-04-18 16:24:25 -06:00
Simon Glass
843312dcdd buildman: Allow comparison of build configuration
It is useful to be able to see CONFIG changes made by commits. Add this
feature to buildman using the -K flag so that all CONFIG changes are
reported.

The CONFIG options exist in a number of files. Each is reported
individually as well as a summary that covers all files. The output
shows three parts: green for additions, red for removals and yellow for
changes.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-18 16:24:25 -06:00
Simon Glass
970f932a68 buildman: Store build config files
Store all config file output so that we can compare changes if requested.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-18 16:24:24 -06:00
Simon Glass
88c8dcf949 buildman: Adjust the 'aborted' heuristic for writing output
At present buildman tries to detect an aborted build and doesn't record a
result in that case. This is to make sure that an abort (e.g. with Ctrl-C)
does not mark the build as done. Without this option, buildman would never
retry the build unless -f/-F are provided. The effect is that aborting the
build creates 'fake errors' on whatever builds buildman happens to be
working on at the time.

Unfortunately the current test is not reliable and this detection can
trigger if a required toolchain tool is missing. In this case the toolchain
problem is never reported.

Adjust the logic to continue processing the build result, mark the build as
done (and failed), but with a return code which indicates that it should be
retried.

The correct fix is to fully and correctly detect an aborted build, quit
buildman immediately and not write any partial build results in this case.
Unfortunately this is currently beyond my powers and is left as an exercise
for the reader (and patches are welcome).

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-18 16:24:24 -06:00
Simon Glass
40f11fce7c buildman: Show 'make' command line when -V is used
When a verbose build it selected, show the make command before the output of
that command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-04-18 16:24:24 -06:00
Albert ARIBAUD \(3ADEV\)
39f520bb62 lpc32xx: add lpc32xx-spl.bin boot image target
Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
2015-04-10 14:23:26 +02:00
Tom Rini
692e5c4e7e Merge branch 'master' of git://git.denx.de/u-boot-tegra
Conflicts:
	board/armltd/vexpress64/vexpress64.c

Signed-off-by: Tom Rini <trini@konsulko.com>
2015-04-03 09:14:38 -04:00
Marcel Ziswiler
e57c6e5b50 ARM: tegra: rename colibri_t20 board/configuration/device-tree
In accordance with our other modules supported by U-Boot and as agreed
upon for Apalis/Colibri T30 get rid of the carrier board in the board/
configuration/device-tree naming.

While at it also bring the prompt more in line with our other products.

Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
2015-03-30 10:04:43 -07:00
Brian McFarland
80ee0196a6 Patch to mkenvimage to handle text files with length that exceed env size
The current head revision of mkenvimage
(e72be8947e) will prevent you from creating
an env image from a text file that is larger than the env length specified
by the '-s' option.  That doesn't make sense given that the tool now allows
comments and blank lines.  This patch removes that limitation and allows
longer text files to be used.

I don't have time / desire at the moment to figure out "patman" and could
really care less if this is adopted up stream.  Just figured I would share
in case anybody else finds it useful enough to take time to do a proper
patch.

>From 39ff30190c2bf687861f4b4b33230f1944fb64f9 Mon Sep 17 00:00:00 2001
From: Brian McFarland <bmcfarland@rldrake.com>
Date: Thu, 12 Mar 2015 11:37:19 -0400
Subject: [PATCH] In mkenvimage, removed the check that prevented using a
 source text file larger than the output environment image.  Instead, the main
 parsing loop checks to see if the environment buffer is full, and quits if it
 is.  After the main parse loop, a second loop swallows comments and
 whitespace until either the EOF is reached or more env vars are found, in
 which case an error will be thrown.
2015-03-28 12:07:47 -04:00
Tom Rini
62f3aaf89d Merge branch 'buildman' of git://git.denx.de/u-boot-x86 2015-03-05 20:50:31 -05:00
Simon Glass
63c619eefd buildman: Add a space before the list of boards
Tweak the output slightly so we don't get things like:

   - board1 board2+  board3 board4

There should be a space before the '+'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-03-05 16:14:32 -07:00
Simon Glass
2a76a64981 buildman: Correct toolchain download feature
Commit d908898 updated the ScanPath() function but not its documentation
and not all its callers.

This breaks the toolchain check after it is downloaded. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher <hs@denx.de>
2015-03-05 16:14:01 -07:00
Chris Packham
c250ce0f57 kwbimage: align v1 binary header to 4B
According to the Armada-XP documentation the binary header format
requires the header length to be aligned to 4B.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Prafulla Wadaskar <prafulla@marvell.com>
2015-03-05 22:08:59 +01:00
Waldemar Brodkorb
de19eddf6c add example for file on VFAT filesystem usage
For example on a raspberry pi the u-boot environment can be
saved in a file on the first VFAT partition.
This example illustrates how to use it with fw_printenv/fw_setenv.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
2015-02-17 06:27:44 -05:00
Tom Rini
a851604ca3 Merge branch 'master' of http://git.denx.de/u-boot-sunxi 2015-02-17 06:27:44 -05:00
Siarhei Siamashka
c924e2a803 tools: mksunxiboot: Fix problems on big endian systems
Now my PS3 can be also used to build u-boot for sunxi devices.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-02-16 20:14:01 +01:00
Andreas Bießmann
1fddd7b63c tools/imagetool: remove linker script
Commit a93648d197 introduced linker generated
lists for imagetool which is the base for some host tools (mkimage, dumpimage,
et al.).  Unfortunately some host tool chains do not support the used type of
linker scripts. Therefore this commit broke these host-tools for them, namely
FreeBSD and Darwin (OS/X).

This commit tries to fix this. In order to have a clean distinction between host
and embedded code space we need to introduce our own linker generated list
instead of re-using the available linker_lists.h provided functionality.  So we
copy the implementation used in linux kernel script/mod/file2alias.c which has
the very same problem (cause it is a host tool). This code also comes with an
abstraction for Mach-O binary format used in Darwin systems.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Cc: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
2015-02-16 12:41:41 -05:00
Albert ARIBAUD
d908898333 buildman: allow multiple toolchains in a single path
When buildman scans a toolchain path, it stops at the
first toolchain found. However, a single path can contains
several toolchains, each with its own prefix.

This patch lets buildman scan all toolchains in the path.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
Acked-by: Simon Glass <sjg@chromium.org>
2015-02-15 14:34:06 -07:00
Simon Glass
8895b3e16c patman: Read in the git-mailrc alias file
We should read this file to obtain a set of aliases. This reduces the need
to create them in the ~/.patman file.

This feature did exist in some version of patman, and is mentioned in the
help but it did not find its way upstream.

Reported-by: Graeme Russ <gruss@tss-engineering.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-02-15 14:34:06 -07:00
Simon Glass
71edbe5cda buildman: Fix incorrect arguemnt in GetUpstream()
This causes an error when trying to build a local branch which has a local
branch as its upstream.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2015-02-15 14:34:06 -07:00
Tom Rini
db7a7dee68 Merge branch 'master' of git://git.denx.de/u-boot-x86 2015-02-10 10:42:56 -05:00
Tom Rini
307367eaff Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2015-02-10 10:40:43 -05:00
Ye.Li
9598f8c30c imx: imximage: Add QuadSPI boot support
Add QuadSPI boot support to imximage tool.

Note: The QuadSPI configuration parameters at offset 0x400 are not
included in this patch. Need other tools to generate the parameters
part.

Signed-off-by: Ye.Li <B37916@freescale.com>
2015-02-10 12:48:49 +01:00
Tom Rini
e35c6c7978 kwbimage: Make the Makefile pass in CONFIG_SYS_SPI_U_BOOT_OFFS
We can't use config.h directly as some platforms include headers that
aren't safe to use in normal Linux userland.

Signed-off-by: Tom Rini <trini@ti.com>
2015-02-07 07:03:00 -05:00
Stefan Roese
5632e580c6 tools: kwbimage: Support u-boot.img padding to CONFIG_SYS_SPI_U_BOOT_OFFS
This is used on the AXP boards, to pad u-boot.img to the desired offset in
SPI flash (only this boot target supported right now). This offset is
used by the SPL then to load u-boot.img into SDRAM and execute it there.

Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Luka Perkov <luka.perkov@sartura.hr>
2015-02-06 17:24:51 +01:00
Simon Glass
cfcf8ea2d7 x86: Enhance the microcode tool to support header files as input
Sometimes microcode is delivered as a header file. Allow the tool to
support this as well as collecting multiple microcode blocks into a
single update.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
2015-02-05 22:16:42 -07:00
Tom Rini
358b8bc204 Merge branch 'patman' of git://git.denx.de/u-boot-x86 2015-01-31 12:40:48 -05:00
Simon Glass
3d4de98696 patman: Explain how to make doc/git-mailrc work
Add an explanation for how to set up git so that patman can find the alias
file. Fix up the get_maintainers message too.

Reported-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-30 15:55:30 -07:00
Scott Wood
4b89b8135f patman: Check commit_match before stripping leading whitespace
True commit lines start at column zero.  Anything that is indented
is part of the commit message instead.  I noticed this by trying to
run buildman with commit e3a4facdfc
as master, which contained a reference to a Linux commit inside
the commit message.  ProcessLine saw that as a genuite commit
line, and thus buildman tried to build it, and died with an
exception because that SHA is not present in the U-Boot tree.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: Simon Glass <sjg@chromium.org>
2015-01-30 15:55:26 -07:00
Peter Tyser
2181830f11 patman: Make dry-run output match real functionality
When run with the --dry-run argument patman prints out information
showing what it would do.  This information currently doesn't line up
with what patman/git send-email really do.  Some basic examples:
- If an email address is addressed via "Series-cc" and "Patch-cc" patman
  shows that email address would be CC-ed two times.
- If an email address is addressed via "Series-to" and "Patch-cc" patman
  shows that email address would be sent TO and CC-ed.
- If an email address is addressed from a combination of tag aliases,
  get_maintainer.pl output, "Series-cc", "Patch-cc", etc patman shows
  that the email address would be CC-ed multiple times.

Patman currently does try to send duplicate emails like the --dry-run
output shows, but "git send-email" intelligently removes duplicate
addresses so this patch shouldn't change the non-dry-run functionality.

Change patman's output and email addressing to line up with the
"git send-email" logic.  This trims down patman's dry-run output and
prevents confusion about what patman will do when emails are actually
sent.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2015-01-30 15:52:29 -07:00
Tom Rini
8e3da9dd11 Merge branch 'master' of git://git.denx.de/u-boot-dm 2015-01-30 09:24:42 -05:00
Ruchika Gupta
2dd9002719 Use hash.c in mkimage
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
CC: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2015-01-29 17:09:59 -07:00
Ruchika Gupta
fc2f4246b4 rsa: Split the rsa-verify to separate the modular exponentiation
Public exponentiation which is required in rsa verify functionality is
tightly integrated with verification code in rsa_verify.c. The patch
splits the file into twp separating the modular exponentiation.

1. rsa-verify.c
- The file parses device tree keys node to fill a keyprop structure.
The keyprop structure can then be converted to implementation specific
format.
(struct rsa_pub_key for sw implementation)
- The parsed device tree node is then passed to a generic rsa_mod_exp
function.

2. rsa-mod-exp.c
Move the software specific functions related to modular exponentiation
from rsa-verify.c to this file.

Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
CC: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2015-01-29 17:09:58 -07:00
Guilherme Maciel Ferreira
2662179998 tools: do not print error messages in verify_header() functions
default_image.c and socfpgaimage.c are the only image modules that print error
messages during header verification. The verify_header() is used to query if a
given image file is processed by the image format. Thus, if the image format
can't handle the file, it must simply return an error. Otherwise we pollute the
screen with errors messages until we find the image format that handle a given
image file.

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
2015-01-29 13:38:41 -05:00
Guilherme Maciel Ferreira
39931f966a dumpimage: fit: extract FIT images
The dumpimage is able to extract components contained in a FIT image:

  $ ./dumpimage -T flat_dt -i CONTAINER.ITB -p INDEX FILE

The CONTAINER.ITB is a regular FIT container file. The INDEX is the poisition
of the sub-image to be retrieved, and FILE is the file (path+name) to save the
extracted sub-image.

For example, given the following kernel.its to build a kernel.itb:

  /dts-v1/;
  / {
      ...
      images {
        kernel@1 {
          description = "Kernel 2.6.32-34";
          data = /incbin/("/boot/vmlinuz-2.6.32-34-generic");
          type = "kernel";
          arch = "ppc";
          os = "linux";
          compression = "gzip";
          load = <00000000>;
          entry = <00000000>;
          hash@1 {
            algo = "md5";
          };
        };
        ...
      };
      ...
    };

The dumpimage can extract the 'kernel@1' node through the following command:

  $ ./dumpimage -T flat_dt -i kernel.itb -p 0 kernel
  Extracted:
   Image 0 (kernel@1)
    Description:  Kernel 2.6.32-34
    Created:      Wed Oct 22 15:50:26 2014
    Type:         Kernel Image
    Compression:  gzip compressed
    Data Size:    4040128 Bytes = 3945.44 kB = 3.85 MB
    Architecture: PowerPC
    OS:           Linux
    Load Address: 0x00000000
    Entry Point:  0x00000000
    Hash algo:    md5
    Hash value:   22352ad39bdc03e2e50f9cc28c1c3652

Which results in the file 'kernel' being exactly the same as '/boot/vmlinuz-2.6.32-34-generic'.

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
2015-01-29 13:38:41 -05:00
Guilherme Maciel Ferreira
67f946cd18 dumpimage: replace the term "datafile" by "subimage"
Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
2015-01-29 13:38:41 -05:00
Guilherme Maciel Ferreira
f41f5b7c05 dumpimage: add 'T' option to explicitly set the image type
Some image types, like "KeyStone GP", do not have magic numbers to
distinguish them from other image types. Thus, the automatic image
type discovery does not work correctly.

This patch also fix some integer type mismatches.

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
2015-01-29 13:38:41 -05:00
Guilherme Maciel Ferreira
a93648d197 imagetool: replace image registration function by linker_lists feature
The registration was introduced in commit f86ed6a8d5

This commit also removes all registration functions, and the member "next"
from image_type_params struct

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
2015-01-29 13:38:41 -05:00
Guilherme Maciel Ferreira
067d156075 imagetool: make the image_save_datafile() available to all image types
Move the image_save_datafile() function from an U-Multi specific file
(default_image.c) to a file common to all image types (image.c). And rename it
to genimg_save_datafile(), to make clear it is useful for any image type.

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
2015-01-29 13:38:41 -05:00
Guilherme Maciel Ferreira
0ca6691c2e imagetool: move common code to imagetool module
The get_type() and verify_print_header() functions have the
same code on both dumpimage.c and mkimage.c modules.

Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
2015-01-29 13:38:41 -05:00
Nikita Kiryanov
8015dde878 arm: mx6: cm-fx6: display compulab logo
Add compulab logo and display it on boot.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
2015-01-29 17:42:29 +01:00
Alexandre Coffignal
ca6dc4f81c mxsboot : Support of 224-bytes OOB area length
Add support for the NAND Flash chip with page size of 4096+224-bytes OOB area length

For example Micron MT29F4G08 NAND flash device defines a OOB area which is
224 bytes long (oobsize).

Signed-off-by: Alexandre Coffignal <acoffignal@geral.com>
2015-01-19 09:10:52 +01:00
Simon Glass
d2ce658de5 buildman: Add an option to write the full build output
Normally buildman runs with 'make -s' meaning that only errors and warnings
appear in the log file. Add a -V option to run make in verbose mode, and
with V=1, causing a full build log to be created.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 21:16:54 -08:00
Simon Glass
827e37b558 buildman: Add the option to download toolchains from kernel.org
The site at https://www.kernel.org/pub/tools/crosstool/ is a convenient
repository of toolchains which can be used for U-Boot. Add a feature to
download and install a toolchain for a selected architecture automatically.

It isn't clear how long this site will stay in the current place and
format, but we should be able to rely on bug reports if it changes.

Suggested-by: Marek Vašut <marex@denx.de>
Suggested-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 21:16:54 -08:00
Simon Glass
9b83bfdcb0 buildman: Allow architecture to alias to multiple toolchains
Some archs have need than one alias, so support a list of alises in the
..buildman file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 21:16:54 -08:00
Simon Glass
cc935295f2 buildman: Don't use the local settings when running tests
We should create a test setting file when running testes, not use whatever
happens to be on the local machine.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 21:16:54 -08:00
Simon Glass
7024ab6316 buildman: Don't complain about missing sections in ~/.buildman
Silently ignore this since it is valid to have missing sections.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 21:16:54 -08:00
Simon Glass
620053421c buildman: Add documentation about the .buildman file
This file is only partially documented. Add some more details.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Wolfgang Denk <wd@denx.de>
2015-01-14 21:16:53 -08:00
Simon Glass
346996969d buildman: Add a note about Python pre-requisites
Since we need a few modules which might not be available in a bare-bones
distribution, add a note about that to the README.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Wolfgang Denk <wd@denx.de>
2015-01-14 21:16:53 -08:00
Simon Glass
bb1501f2c2 buildman: Add an option to use the full tool chain path
In some cases there may be multiple toolchains with the same name in the
path. Provide an option to use the full path in the CROSS_COMPILE
environment variable.

Note: Wolfgang mentioned that this is dangerous since in some cases there
may be other tools on the path that are needed. So this is set up as an
option, not the default. I will need test confirmation (i.e. that this
commit fixes a real problem) before merging it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Steve Rae <srae@broadcom.com>
2015-01-14 21:16:53 -08:00
Simon Glass
f210b58734 buildman: Put the toolchain path first instead of last in PATH
If:

1. Toolchains A and B have the same filename
2. Toolchain A is in the PATH
3. Toolchain B is given in ~/.buildman and buildman uses it to build

then buildman will add toolchain B to the end of its path but will not
necessarily use it since U-Boot will find toolchain A first in the PATH.

Try to fix this by putting the toolchain first in the path instead of
last.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 21:16:53 -08:00
Simon Glass
b53241230d buildman: Try to avoid hard-coded string parsing
The assumption that the compiler name will always end in gcc is incorrect
for clang and apparently on BSD.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 21:16:53 -08:00
Simon Glass
5abab20dfb buildman: Allow specifying a range of commits to build
Adjust the -b flag to permit a range expression as well as a branch.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Tested-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2015-01-14 21:16:53 -08:00
Simon Glass
0740127f4d buildman: Don't remove entire output directory when testing
When running tests the output directory is often wiped. This is only safe if
a branch is being built. The output directory may contain other things
besides the buildman test output.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 21:16:52 -08:00
Simon Glass
5971ab5c44 buildman: Add an option to flatten output directory trees
When building current source for a single board, buildman puts the output
in <output_dir>/current/current/<board>. Add an option to make it use
<output_dir>/<board> instead. This removes the unnecessary directories
in that case, controlled by the --no-subdirs/-N option.

Suggested-by: Tom Rini <trini@ti.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 21:16:52 -08:00
Simon Glass
2a9e2c6a09 buildman: Try to guess the upstream commit
Buildman normally obtains the upstream commit by asking git. Provided that
the branch was created with 'git checkout -b <branch> <some_upstream>' then
this normally works.

When there is no upstream, we can try to guess one, by looking up through
the commits until we find a branch. Add a function to try this and print
a warning if buildman ends up relying on it.

Also update the documentation to match.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Wolfgang Denk <wd@denx.de>
2015-01-14 21:16:52 -08:00
Simon Glass
1a91567510 buildman: Don't prune output space for 'current source' build
This is not needed since we always do a full (non-incremental) build. Also
it might be dangerous since it will try to delete everything below the
base directory.

Fix this potentially nasty bug.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 21:16:52 -08:00
Simon Glass
05c96b187a buildman: Put build in 'current', not 'current/current'
Buildman currently puts current-source builds in a current/current
subdirectory, but there is no need for the extra depth.

Suggested-by: Albert Aribaud <albert.u.boot@aribaud.net>
Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 21:16:52 -08:00
Simon Glass
4466c1f943 buildman: Add tests that check the correct output directory is used
Add a few tests of the output directory logic.

Signed-off-by: Simon Glass <sjg@chromium.org>
2015-01-14 21:16:52 -08:00
Tom Rini
bd5053ffa5 Merge branch 'buildman' of git://git.denx.de/u-boot-x86
Conflicts:
	tools/buildman/control.py

Signed-off-by: Tom Rini <trini@ti.com>
2015-01-14 11:00:38 -05:00
Simon Glass
8a388085c7 x86: Correct ifdtool microcode calculation
This currently assumes that U-Boot resides at the start of ROM. Update
it to remove this assumption.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
2015-01-13 07:24:58 -08:00
Andreas Bießmann
f411b8f227 tools/kwbimage.c: fix parser error handling
The two error checks for image_boot_mode_id and image_nand_ecc_mode_id where
wrong and would never fail, fix that!

This was detected by Apple's clang compiler:
---8<---
  HOSTCC  tools/kwbimage.o
tools/kwbimage.c:553:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                if (el->bootfrom < 0) {
                    ~~~~~~~~~~~~ ^ ~
tools/kwbimage.c:571:23: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                if (el->nandeccmode < 0) {
                    ~~~~~~~~~~~~~~~ ^ ~
2 warnings generated.
--->8---

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Acked-By: Jeroen Hofstee <jeroen@myspectrum.nl>
2015-01-11 09:05:03 -05:00
Łukasz Majewski
93e9371f00 fix: tools: kwbimage.c: Initialize headersz to suppress warning
When building with my toolchain (4.8.2):
CROSS_COMPILE=/home/lukma/work/ptxdist/toolchains/arm/OSELAS.Toolchain-2013.12.0/arm-v7a-linux-gnueabi/gcc-4.8.2-glibc-2.18-binutils-2.24-kernel-3.12-sanitized/bin/arm-v7a-linux-gnueabi-

I see following WARNING:
tools/kwbimage.c: In function "kwbimage_set_header":
tools/kwbimage.c:803:8: warning: "headersz" may be used uninitialized in this function [-Wmaybe-uninitialized]
  memcpy(ptr, image, headersz);
        ^
This fix aims to suppress it.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Acked-by: Stefan Roese <sr@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
2015-01-10 14:09:55 -05:00
Dirk Behme
3e1ded1fff buildman: Fix some typos in README
Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-12-29 16:31:24 -05:00
Simon Glass
d2c6181d2d x86: Add a script to process Intel microcode files
Intel delivers microcode updates in a microcode.dat file which must be
split up into individual files for each CPU. Add a tool which performs
this task. It can list available microcode updates for each model and
produce a new microcode update in U-Boot's .dtsi format.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
2014-12-18 17:26:08 -07:00
Simon Glass
31eca69727 x86: ifdtool: Add support for early microcode access
Some Intel CPUs use an 'FSP' binary blob which provides an inflexible
means of starting up the CPU. One result is that microcode updates can only
be done before RAM is available and therefore parsing of the device tree
is impracticle.

Worse, the addess of the microcode update must be stored in ROM since a
pointer to its start address and size is passed to the 'FSP' blob. It is
not possible to perform any calculations to obtain the address and size.

To work around this, ifdtool is enhanced to work out the address and size of
the first microcode update it finds in the supplied device tree. It then
writes these into the correct place in the ROM. U-Boot can then start up
the FSP correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-12-18 17:26:05 -07:00
Simon Glass
65851fcec3 x86: ifdtool: Use a structure for the file/address list
Rather than two independent arrays, use a single array of a suitable
structure. Also add a 'type' member since we will shortly add additional
types.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-12-18 17:26:04 -07:00
Simon Glass
fa8d3b00f9 x86: ifdtool: Display filename when file errors are reported
When a file is missing it helps to know which file. Update the error message
to print this information.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-12-18 17:26:04 -07:00
Simon Glass
7e8ffa4ed8 x86: ifdtool: Correct a debug() missing parameter
This is missing a parameter. Fix it to avoid a warning when debug is
enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2014-12-18 17:26:04 -07:00
Simon Glass
7dfb172d67 x86: ifdtool: Separate out filenames for -D and -i
To allow these options to be specified together, separate them out.

Change-Id: Ib93f11cd51eb3302127f4c82936ff2b44c88d5a2
Signed-off-by: Simon Glass <sjg@chromium.org>
2014-12-13 22:32:04 -07:00
Bin Meng
673ed2f8c2 tools/ifdtool: Support writing multiple files (-w) simultaneously
Currently ifdtool only supports writing one file (-w) at a time.
This looks verbose when generating u-boot.rom for x86 targets.
This change allows at most 16 files to be written simultaneously.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-12-13 22:32:04 -07:00
Alison Wang
94cb17d078 ls102xa: pblimage: Add pblimage tool support for LS102xA
For LS102xA, the size of spl/u-boot-spl.bin is variable.
This patch adds the support to deal with the variable
u-boot size in pblimage tool. It will be padded to 64
byte boundary.

Use pblimage_check_params() to add the specific operations
for ARM, such as PBI CRC and END command and the calculation
of pbl_cmd_initaddr.

Signed-off-by: Alison Wang <alison.wang@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
2014-12-11 09:36:34 -08:00
Tom Rini
97cdf64026 Merge branch 'sandbox' of git://git.denx.de/u-boot-x86 2014-12-04 09:24:05 -05:00
Simon Glass
1d8104fe88 buildman: Don't default to -e when building current source
We probably don't need to enable this option by default. It is useful to
display only failure boards (not errors) and it is easy to add -e if it
is required. Also update the docs.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Albert Aribaud <albert.u.boot@aribaud.net>
2014-11-26 20:25:40 -07:00
Simon Glass
f66153be19 buildman: Fix repeating board list with -l
Ensure that we don't print duplicate board names when -l is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Albert Aribaud <albert.u.boot@aribaud.net>
2014-11-26 20:25:40 -07:00
Simon Glass
0b5b409acc patman: Use the full commit hash for 'git checkout'
Even with the initial 8 characeters of the hash we will sometimes get a
collision. Use the full hash.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-26 20:25:39 -07:00
Tom Rini
ce267335c3 buildman: Save *.img files too
When saving binary files we likely want to keep any .img files that have
been generated as well.

Signed-off-by: Tom Rini <trini@ti.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-11-26 20:25:39 -07:00
Bin Meng
908ec6e4d1 tools: Add ifdtool to .gitignore
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-11-25 07:11:17 -07:00
Tom Rini
dee332ffb7 Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2014-11-24 12:02:12 -05:00
Simon Glass
c03c951b06 x86: ifdtool: Allow creation of an empty ROM
Allow an empty ROM to be created, without needing to provide a descriptor.
The descriptor is not needed on some x86 boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-21 07:34:05 +01:00
Simon Glass
cd392fe8a0 x86: Add ifdtool for working with Intel Flash Descriptor ROM images
Newer Intel chips require a Management Engine which requires a particular
format for the SPI flash that contains the boot loader. Add a tool that
supports creating and modifying these ROM images.

This tool is from Chrome OS but has been cleaned up to use U-Boot style
and to add comments. A few features have been added also.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-21 07:24:11 +01:00
Albert ARIBAUD
3cb4b713e1 tools/msximage.c: fix warning about nptr possibly uninitialized
Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
2014-11-20 10:30:19 +01:00
Alexey Ignatov
7a139959d0 ARM: mxs: tools: Add support for boot progress display flag
mkimage -T mxs now support new flag in config file:
DISPLAYPROGRESS - makes boot process print HTLLC characters for each BootROM
instruction.

Signed-off-by: Alexey Ignatov <lexszero@gmail.com>
2014-11-20 10:13:45 +01:00
Dominik Muth
e72be8947e Added support for comments in input to mkenvimage.
This patch adds support for comments in the input to mkenvimage, i.e. in
the environment source: All lines starting with a # in the firs column
will be ignored.

Additionally empty lines will also be ignored.

Signed-off-by: Dominik Muth <dominik.muth@bkvibro.com>
2014-11-10 16:25:28 -05:00
Dominic Sacré
ea19527c20 tools/env: Fix environment size and CRC on 64-bit hosts
On architectures where 'long' is 64 bit, the u-boot environment
as seen by the fw_env tools was missing 4 bytes.
This patch fixes getenvsize(), and thus also ensures that the
environment's CRC32 checksum is calculated correctly.

Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Tom Rini <trini@ti.com>
2014-11-07 16:27:07 -05:00
Masahiro Yamada
ffe29ebc07 kbuild: sync top Makefile with Linux 3.18-rc1
Since Linux 3.15, relative path feature and related fixes,
cleanups have been merged to the top Makefile.

The relative path feature looks stable enough, so let's import it
to U-Boot along with various cleanups.

Commits imported from Linux (some need adjustment) are:

[1] commit 7e1c04779efd by Michal Marek
  kbuild: Use relative path for $(objtree)

[2] commit 890676c65d69 by Michal Marek
  kbuild: Use relative path when building in the source tree

[3] commit 9da0763bdd82 by Michal Marek
  kbuild: Use relative path when building in a subdir of the source tree

[4] commit c2e28dc975ea by Michal Marek
  kbuild: Print the name of the build directory

[5] commit 066b7ed95580 by Michal Marek
  kbuild: Do not print the build directory with make -s

[6] commit 3f1d9a6cec01 by Michal Marek
  kbuild: make -s should be used with kernelrelease/kernelversion/image_name

[7] commit 7ff525712acf by Masahiro Yamada
  kbuild: fake the "Entering directory ..." message more simply

[8] commit 745a254322c8 by Masahiro Yamada
  kbuild: use $(Q) for sub-make target

[9] commit aa55c8e2f7a3 by Masahiro Yamada
  kbuild: handle C=... and M=... after entering into build directory

[10] commit ab7474ea5361 by Borislav Petkov
  Kbuild: Ignore GREP_OPTIONS env variable

To use relative path feature, tools/Makefile and scripts/Makefile.autoconf
must be tweaked.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-11-07 16:27:06 -05:00
Tom Rini
625509ab0e Merge branch 'master' of git://www.denx.de/git/u-boot-imx 2014-11-05 12:48:09 -05:00
Gerald Kerma
26f195c712 ARM: kwimage: fix v0 format
This patch fix the kwimage tools for version 0 fileformat used for kirkwood
Tested on sheevaplug

Signed-off-by: Gerald Kerma <drEagle@doukki.net>
Tested-by: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
Acked-By: Prafulla Wadaskar <prafulla@marvell.com>
2014-11-04 15:03:07 -05:00
Simon Glass
1ddda1b321 patman: Use the full commit hash for 'git checkout'
Even with the initial 8 characeters of the hash we will sometimes get a
collision. Use the full hash.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-11-03 14:12:39 -07:00
Simon Glass
58d818f19f buildman: Don't default to -e when using -s
When using summary mode (-s) we don't always want to display errors.
Allow this option to be omitted.

Series-to: u-boot
Series-cc: albert
Change-Id: I6b37754d55eb920ecae114fceba55834b43ea3b9
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Albert Aribaud <albert.u.boot@aribaud.net>
2014-11-03 14:10:53 -07:00
Simon Glass
be338a5149 buildman: Fix repeating board list with -l
Ensure that we don't print duplicate board names when -l is used.

Change-Id: I56adb138fc18f772ba61eba0fa194cdd7bc7efc6
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Albert Aribaud <albert.u.boot@aribaud.net>
2014-11-03 14:10:52 -07:00
Ye.Li
de97980478 imximage: Fix the bootdata.size calculation
In system boot chapter of i.MX6 reference manual, the "Image Vector Table"
figure shows the bootdata.start points to the beginning of the destination
memory. It means the bootdata.size should contain the IVT offset part,
but the calculation in imximage tool does not have.

We found this issue when booting from QuadSPI NOR on i.MX6SX. The u-boot
runs into abnormal (crash or stop) after booting. After checked the destination
memory where the image is loaded to, there are hundreds of bytes at
the image end are not loaded into memory. Since there is a 4096 bytes
round in the calculation, for the booting devices using smaller IVT offset,
such as SD and SPI booting, they are not easy to reproduce.

Signed-off-by: Ye.Li <B37916@freescale.com>
2014-11-03 10:33:01 +01:00
Stefan Roese
934a529f94 tools/kwbimage: Fix compilation warning
This patch fixes a compilation warning of kwbimage.c:

tools/kwbimage.c: In function ‘kwbimage_set_header’:
tools/kwbimage.c:784:8: warning: ‘headersz’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  memcpy(ptr, image, headersz);
        ^
Instead of using multiple if statements, use a switch statement with
a default entry. And return with error if an unsupported version
is configured in the cfg file.

Signed-off-by: Stefan Roese <sr@denx.de>
Acked-By: Wolfgang Denk <wd@denx.de>
2014-10-31 00:29:29 +01:00
Andreas Bießmann
e5f1a586a7 tools/kwbimage.c: fix build on darwin
kwbimage uses get_current_dir_name(3) which is a gnu extension and not
available on darwin host. Fix this by converting to portable getcwd(3)
function.

This patch fixes the following error:
---8<---
  HOSTCC  tools/kwbimage.o
tools/kwbimage.c:399:16: warning: implicit declaration of function 'get_current_dir_name' is invalid in C99 [-Wimplicit-function-declaration]
                        char *cwd = get_current_dir_name();
                                    ^
tools/kwbimage.c:399:10: warning: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion]
                        char *cwd = get_current_dir_name();
                              ^     ~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
...
Undefined symbols for architecture x86_64:
  "_get_current_dir_name", referenced from:
      _image_headersz_v1 in kwbimage.o
ld: symbol(s) not found for architecture x86_64
--->8---

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Cc: Stefan Roese <sr@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
[agust: fixed getcwd() return warning]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2014-10-31 00:26:12 +01:00
Andreas Bießmann
bedcf395b3 gitignore: ignore atmel pmecc parameter tool
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2014-10-27 17:54:13 -04:00
Tom Rini
0cf8761549 Merge branch 'master' of git://git.denx.de/u-boot-mpc5xxx 2014-10-27 11:03:00 -04:00
Marek Vasut
5038d7f189 ppc: Zap Hymod board
Remove this board as this is the only one last user of eeprom_probe(),
which is pretty non-standard stuff.

This patch also removes all the PHP, SQL and CSS stuff from U-Boot,
which probably makes U-Boot a bit less IoT ;-)

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tom Rini <trini@ti.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Heiko Schocher <hs@denx.de>
2014-10-27 14:35:55 +01:00
Andreas Bießmann
686ed2c228 tools/socfpgaimage.c: fix build on darwin
socfpgaimage utilizes htole32 and friends, unfortunately these functions are
not available on darwin. Fix it by using the cpu_to_le32 and friends defined
in compiler.h as other parts in mkimage do.

This patch fixes the following error:
---8<---
  HOSTCC  tools/socfpgaimage.o
tools/socfpgaimage.c:77:22: warning: implicit declaration of function 'htole32' is invalid in C99 [-Wimplicit-function-declaration]
        header.validation = htole32(VALIDATION_WORD);
                            ^
tools/socfpgaimage.c:80:22: warning: implicit declaration of function 'htole16' is invalid in C99 [-Wimplicit-function-declaration]
        header.length_u32 = htole16(length_bytes/4);
                            ^
tools/socfpgaimage.c:95:6: warning: implicit declaration of function 'le32toh' is invalid in C99 [-Wimplicit-function-declaration]
        if (le32toh(header.validation) != VALIDATION_WORD)
            ^
tools/socfpgaimage.c:97:6: warning: implicit declaration of function 'le16toh' is invalid in C99 [-Wimplicit-function-declaration]
        if (le16toh(header.checksum) != hdr_checksum(&header))
            ^
4 warnings generated.
...
  HOSTLD  tools/dumpimage
Undefined symbols for architecture x86_64:
  "_htole16", referenced from:
      _socfpgaimage_set_header in socfpgaimage.o
  "_htole32", referenced from:
      _socfpgaimage_set_header in socfpgaimage.o
  "_le16toh", referenced from:
      _verify_buffer in socfpgaimage.o
  "_le32toh", referenced from:
      _verify_buffer in socfpgaimage.o
ld: symbol(s) not found for architecture x86_64
--->8---

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Acked-by: Pavel Machek <pavel@denx.de>
2014-10-27 02:26:24 +01:00
Stefan Roese
4acd2d24b6 tools: kwbimage: Add image version 1 support for Armada XP / 370
This patch integrates the Barebox version of this kwbimage.c file into
U-Boot. As this version supports the image version 1 type for the
Armada XP / 370 SoCs.

It was easier to integrate the existing and known to be working Barebox
source than to update the current U-Boot version to support this
v1 image header format. Now all Marvell MVEBU SoCs are supported:

Image type 0: Kirkwood & Dove
Image type 1: Armada 370 & Armada XP

Please note that the current v1 support has this restuction (same as
has Barebox version):

Not implemented: support for the register headers and secure headers
in v1 images

Tested on Marvell DB-78460-BP eval board.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Luka Perkov <luka@openwrt.org>
2014-10-23 09:59:21 -04:00
Stefan Roese
2afa331260 tools: Compile kwboot for Marvell Armada XP as those SoCs are now supported
Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Luka Perkov <luka@openwrt.org>
2014-10-23 09:59:21 -04:00
Stefan Roese
84899e2db3 tools/kwboot: Sync with latest barebox version to support Armada XP
The barebox version of the kwboot tool has evolved a bit. To support
Armada XP and Dove. Additionally a few minor fixes have been applied.
So lets sync with the latest barebox version.

Please note that the main difference between both versions now is, that
the U-Boot version still supports the -p option, to dynamically patch
an image for UART boot mode. I didn't test it now though.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Luka Perkov <luka@openwrt.org>
2014-10-23 09:59:21 -04:00
Charles Manning
832472a94d tools: socfpga: Add socfpga preloader signing to mkimage
Like many platforms, the Altera socfpga platform requires that the
preloader be "signed" in a certain way or the built-in boot ROM will
not boot the code.

This change automatically creates an appropriately signed preloader
from an SPL image.

The signed image includes a CRC which must, of course, be generated
with a CRC generator that the SoCFPGA boot ROM agrees with otherwise
the boot ROM will reject the image.

Unfortunately the CRC used in this boot ROM is not the same as the
Adler CRC in lib/crc32.c. Indeed the Adler code is not technically a
CRC but is more correctly described as a checksum.

Thus, the appropriate CRC generator is added to lib/ as crc32_alt.c.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Tom Rini <trini@ti.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Pavel Machek <pavel@denx.de>
Acked-by: Pavel Machek <pavel@denx.de>

V2: - Zap unused constant
    - Explicitly print an error message in case of error
    - Rework the hdr_checksum() function to take the *header directly
      instead of a plan buffer pointer
2014-10-06 17:38:17 +02:00
Masahiro Yamada
540d434aa4 tools: remove reformat.py
This tools is unnecessary since commit f6c8f38ec6
(tools/genboardscfg.py: improve performance more with Kconfiglib).

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-09-24 18:30:29 -04:00
Masahiro Yamada
5dff844d7f tools/genboardscfg.py: pick up also commented maitainers
We are still keeping invalid email addressed in MAINTAINERS
because they carry information.

The problem is that scripts/get_maintainer.pl adds emails in the
"M:" field including invalid ones.

We want to comment out invalid email addresses in MAINTAINERS
to prevent scripts/get_maintainer.pl from picking them up.
On the other hand, we want to collect them for boards.cfg
to know the last known maintainer of each board.

This commit adjusts tools/genboardscfg.py to parse also
the commented "M:" fields, which is useful for the next commit.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-09-24 18:30:28 -04:00
Thomas Petazzoni
bdc7dc4595 tools/env: change stripping strategy to allow no-stripping
When building the U-Boot tools for non-ELF platforms (such as Blackfin
FLAT), since commit 79fc0c5f49
("tools/env: cross-compile fw_printenv without setting HOSTCC"), the
build fails because it tries to strip a FLAT binary, which does not
make sense.

This commit solves this by changing the stripping logic in
tools/env/Makefile to be similar to the one in tools/Makefile. This
logic continues to apply strip to the final binary, but does not abort
the build if it fails, and does the stripping in place on the final
binary. This allows the logic to work fine if stripping doesn't work,
as it leaves the final binary untouched.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Sonic Zhang <sonic.zhang@analog.com>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reviewed-by: Sonic Zhang <sonic.zhang@analog.com>
2014-09-24 18:30:27 -04:00
Simon Glass
983a2749e2 patman: Add a -m option to avoid copying the maintainers
The get_maintainers script is a useful default, but sometimes is copies
too many people, or takes a long time to run.

Add an option to disable it and update the README.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-21 12:03:07 -06:00
Simon Glass
7798e2285f buildman: Fix the logic for the bloat command
This check should now be done whatever mode buildman is running in, since
we may be displaying information while building.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-21 12:03:07 -06:00
Masahiro Yamada
9170818a4e kconfiglib: change SPDX-License-Identifier to ISC
Commit f219e01311 (tools: Import Kconfiglib)
added SPDX GPL-2.0+ to this library by mistake.
It should be ISC.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Ulf Magnusson <ulfalizer@gmail.com>
2014-09-17 21:03:18 -04:00
Tom Rini
e38b15b061 Merge branch 'master' of git://git.denx.de/u-boot-arm 2014-09-17 18:01:04 -04:00
Masahiro Yamada
f6c8f38ec6 tools/genboardscfg.py: improve performance more with Kconfiglib
The idea of using Kconfiglib was given by Tom Rini.
It allows us to scan lots of defconfigs very quickly.
This commit also uses multiprocessing for further acceleration.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Suggested-by: Tom Rini <trini@ti.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-09-16 12:23:56 -04:00
Masahiro Yamada
f219e01311 tools: Import Kconfiglib
Kconfiglib is the flexible Python Kconfig parser and library
created by Ulf Magnusson.
(https://github.com/ulfalizer/Kconfiglib)

This commit imports kconfiglib.py from
commit ce84c22e58fa59cb93679d4ead03c3cd1387965e,
with ISC SPDX-License-Identifier.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Cc: Ulf Magnusson <ulfalizer@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
2014-09-16 12:23:56 -04:00
Masahiro Yamada
d0ea61d9ca buildman: fix typos of --dry-run help message
try run    => dry run
no nothing => do nothing
"..."      => '...'

The last one is for consistency with the other option helps.

Change-Id: I1d69047d1fae6ef095a18f69f44ee13c448db9b7
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
2014-09-09 16:48:06 -06:00
Thierry Reding
f3d015cb4a buildman: Create parent directories as necessary
When creating build directories also create parents as necessary. This
fixes a failure when building a hierarchical branch (i.e. foo/bar).

Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Tom Rini <trini@ti.com>
2014-09-09 16:38:32 -06:00
Vadim Bendebury
1f7278851e patman: make run results better visible
For an occasional user of patman some failures are not obvious: for
instance when checkpatch reports warnings, the dry run still reports
that the email would be sent. If it is not dry run, the warnings are
shown on the screen, but it is not clear that the email was not sent.

Add some code to report failure to send email explicitly.

Tested by running the script on a patch with style violations,
observed error messages in the script output.

Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2014-09-09 16:38:31 -06:00
Simon Glass
950a23133d buildman: Ignore conflicting tags
Tags like Series-version are normally expected to appear once, and with a
unique value. But buildman doesn't actually look at these tags. So ignore
conflicts.

This allows bulidman to build a branch containing multiple patman series.

Reported-by: Steve Rae <srae@broadcom.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-09 16:38:31 -06:00
Simon Glass
f7582ce849 buildman: Permit branch names with an embedded '/'
At present buildman naively uses the branch name as part of its directory
path, which causes problems if the name has an embedded '/'.

Replace these with '_' to fix the problem.

Reported-by: Steve Rae <srae@broadcom.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-09 16:38:31 -06:00
Simon Glass
930c8d4ad8 buildman: Expand output test to cover directory prefixes
Now that buildman supports removing the build directory prefix from output,
add a test for it. Also ensure that output directories are removed when the
test completes.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-09 16:38:30 -06:00
Simon Glass
dfb7e93235 buildman: Add additional functional tests
This adds coverage of core features of the builder, including the
command-line options which affect building.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-09 16:38:30 -06:00
Simon Glass
891b7a0761 patman: Start with a clean series when needed
For reasons that are not well-understood, GetMetaDataForList() can end up
adding to an existing series even when it appears that it should be
starting a new one.

Change from using a default constructor parameter to an explicit one, to
work around this problem.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-09 16:38:30 -06:00
Simon Glass
883a321a4b buildman: Provide an internal option to clean the outpur dir
For testing it is useful to clean the output directory before running a
test. This avoids a test interfering with the results of a subsequent
test by leaving data around.

Add this feature as an optional parameter to the control logic.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-09 16:38:29 -06:00
Simon Glass
fb3954f9ea buildman: Correct counting of build failures on retry
When a build is to be performed, buildman checks to see if it has already
been done. In most cases it will not bother trying again. However, it was
not reading the return code from the 'done' file, so if the result was a
failure, it would not be counted. This depresses the 'failure' count stats
that buildman prints in this case.

Fix this bug by always reading the return code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-09 16:38:29 -06:00
Simon Glass
823e60b62a buildman: Allow tests to have their own boards
Rather than reading boards.cfg, which may take time to generate and is not
necessarily suitable for running tests, create our own list of boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-09 16:38:29 -06:00
Simon Glass
8b985eebd0 buildman: Avoid looking at config file or toolchains in tests
These files may not exist in the environment, or may not be suitable for
testing. Provide our own config file and our own toolchains when running
tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
2014-09-09 16:38:28 -06:00