Commit Graph

969 Commits

Author SHA1 Message Date
Andreas Fenkart
14070e69ad tools/env: allow to pass NULL for environment options
If users of the library are happy with the default, e.g. config file
name. They can pass NULL as the opts pointer. This simplifies the
transition of existing library users.
FIXES a compile error. since common_args has been removed by
a previous patch

Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
2016-05-31 10:23:10 -04:00
Tom Rini
e4a94ce4ac Merge git://git.denx.de/u-boot-dm
For odroid-c2 (arch-meson) for now disable designware eth as meson
now needs to do some harder GPIO work.

Signed-off-by: Tom Rini <trini@konsulko.com>

Conflicts:
	lib/efi_loader/efi_disk.c

Modified:
	configs/odroid-c2_defconfig
2016-05-27 20:34:12 -04:00
Robert P. J. Day
87c2f76f3f tools: Add entry for generated tools/bin2header to tools/.gitignore
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2016-05-27 15:47:56 -04:00
Masahiro Yamada
d339df522b tools/genboardscfg.py: remove bogus import subprocess
Since f6c8f38ec6 ("tools/genboardscfg.py: improve performance more
with Kconfiglib"), this tool does not use the subprocess module.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-05-27 15:47:56 -04:00
Andreas Fenkart
81974f4479 tools/env: no global variable sharing between application and library
Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
2016-05-27 15:39:56 -04:00
Simon Glass
9217d93bc4 rockchip: Check image name for the rksd image
We need a correct name (rk3288, rk3036) so check this to avoid a crash
later.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-05-27 10:23:07 -06:00
Andreas Fenkart
f71cee4bfc tools/env: compute size of usable area only once
for double buffering to work, redundant buffers must have equal size

Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
2016-05-27 09:56:19 -04:00
Andreas Fenkart
cedb341e7f tools/env: fw_printenv pass value_only as argument
Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
2016-05-27 09:56:19 -04:00
Andreas Fenkart
c3a23e8b5f tools/env: remove 'extern' from function prototype in fw_env.h
checkpatch complains about in succeding patch. Prefer to fix all
declarations in a dedicated patch.

Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
2016-05-27 09:56:18 -04:00
Andreas Fenkart
dcdc1f6a9b tools/env: pass key as argument to env_aes_cbc_crypt
Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
2016-05-27 09:56:17 -04:00
Michal Simek
d9b58b3031 tools: zynqmpimage: Add Xilinx ZynqMP boot header generation
Add support for the zynqmpimage to mkimage.
Only basic functionality is supported without encryption and register
initialization with one partition which is filled by U-Boot SPL.
For more detail information look at Xilinx ZynqMP TRM.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-24 11:15:01 +02:00
Simon Glass
bd6e142094 mkimage: Add a quiet mode
Some build systems want to be quiet unless there is a problem. At present
mkimage displays quite a bit of information when generating a FIT file. Add
a '-q' flag to silence this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2016-05-23 11:50:19 -04:00
Tom Rini
4b6e1fda10 Merge git://git.denx.de/u-boot-dm 2016-05-17 13:58:27 -04:00
Stephen Warren
f79f1e0c0e buildman: allow more incremental building
One use-case for buildman is to continually run it interactively after
each small step in a large refactoring operation. This gives more
immediate feedback than making a number of commits and then going back and
testing them. For this to work well, buildman needs to be extremely fast.
At present, a couple issues prevent it being as fast as it could be:

1) Each time buildman runs "make %_defconfig", it runs "make mrproper"
first. This throws away all previous build results, requiring a
from-scratch build. Optionally avoiding this would speed up the build, at
the cost of potentially causing or missing some build issues.

2) A build tree is created per thread rather than per board. When a thread
switches between building different boards, this often causes many files
to be rebuilt due to changing config options. Using a separate build tree
for each board would avoid this. This does put more strain on the system's
disk cache, but it is worth it on my system at least.

This commit adds two command-line options to implement the changes
described above; -I ("--incremental") turns of "make mrproper" and -P
("--per-board-out-dir") creats a build directory per board rather than per
thread.

Tested:

    ./tools/buildman/buildman.py tegra
    ./tools/buildman/buildman.py -I -P tegra
    ./tools/buildman/buildman.py -b tegra_dev tegra
    ./tools/buildman/buildman.py -b tegra_dev -I -P tegra

... each once after deleting the buildman result/work directory, and once
"incrementally" after a previous identical invocation.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org> # v1
Tested-by: Simon Glass <sjg@chromium.org> # v1
Acked-by: Simon Glass <sjg@chromium.org>
2016-05-17 09:54:43 -06:00
Adrian Alonso
0782a8803d imx: tools: imximage: fix CLR bit command
Fix incorrect parametr in CMD_CHECK_BITS_CLR command
Pass CLR parameter to DCD header for CMD_CHECK_BITS_CLR

Signed-off-by: Adrian Alonso <adrian.alonso@nxp.com>
2016-05-17 17:52:19 +02:00
Heiko Schocher
4cf4600f25 test, tools: update tbot documentation
update tbot documentation in U-Boot, as I just
merged the event system into tbots master
branch.

Signed-off-by: Heiko Schocher <hs@denx.de>
2016-05-13 11:25:59 -04:00
Robert P. J. Day
1cc0a9f496 Fix various typos, scattered over the code.
Spelling corrections for (among other things):

* environment
* override
* variable
* ftd (should be "fdt", for flattened device tree)
* embedded
* FTDI
* emulation
* controller
2016-05-05 21:39:26 -04:00
Andreas Bießmann
8edeac86db mkimage: fix generation of FIT image
Commit 7a439cadcf broke generation of SPL
loadable FIT images (CONFIG_SPL_LOAD_FIT).
Fix it by removing the unnecessary storage of expected image type. This was a
left over of the previous implementation. It is not longer necessary since the
mkimage -b switch always has one parameter.

Tested-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Andreas Bießmann <andreas@biessmann.org>
2016-05-03 11:28:18 -04:00
Simon Glass
4c1dc1a90f fit_image: Fix a double close() on the error path
There is an extra close() call which is not needed.

Reported-by: Coverity (CID: 143065)
Signed-off-by: Simon Glass <sjg@chromium.org>
2016-05-02 18:37:10 -04:00
Anatolij Gustschin
925c97c248 tools: env: fix config file loading in env library
env library is broken as the config file pointer is only initialized
in main(). When running in the env library parse_config() fails:

  Cannot parse config file '(null)': Bad address

Ensure that config file pointer is always initialized.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
2016-05-02 18:37:10 -04:00
Andreas Bießmann
09c2b8f3e3 Change my mailaddress
I'll switch my mails to my own server, so drop all gmail references.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2016-05-02 18:37:09 -04:00
Andreas Bießmann
7a439cadcf mkimage: fix argument parsing on BSD systems
The getopt(3) optstring '-' is a GNU extension which is not available on BSD
systems like OS X.

Remove this dependency by implementing argument parsing in another way. This
will also change the lately introduced '-b' switch behaviour.

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-02 18:37:09 -04:00
Andreas Fenkart
43cb65b7a0 tools: env: bug: config structs must be defined in tools library
fw_senten/fw_printenv can be compiled as a tools library,
excluding the fw_env_main object.

Reported-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
2016-03-27 09:13:03 -04:00
Andreas Fenkart
69067a34b1 tools: env: fw_parse_script: simplify removal of newline/carriage return
fgets returns when the first '\n' is found

Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
2016-03-26 18:49:29 -04:00
Andreas Fenkart
938c29ff41 tools: env: split fw_string_blank into skip_chars / skip_blanks
Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
2016-03-26 18:49:29 -04:00
Andreas Fenkart
9583efcc74 tools: env: fw_string_blank: return from loop when item found
Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
2016-03-26 18:49:29 -04:00
Andreas Fenkart
10667e15f4 tools: env: replace WHITESPACE macro by isblank
Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
2016-03-26 18:49:29 -04:00
Kevin Smith
7497a6a1f1 tools: kwboot: Add xmodem timeout option
Add command-line specification of xmodem timeout.  If the binary
header needs to take a while to do something (e.g. DDR ECC
scrubbing), the xmodem transfer can time out.  Add a configurable
xmodem block timeout to allow transfers with slow binary headers
to succeed.

Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
2016-03-24 10:08:49 +01:00
Kevin Smith
8669dacfb8 tools: kwboot: Clean up usage text
Usage text was getting unwieldy and somewhat incorrect.  The
usage summary implied that some options were mutually exclusive
(e.g. -q or -s).  Clean up the summary to just include the
important ones, and include a generic "[OPTIONS]" instead.

Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Stefan Roese <sr@denx.de>
2016-03-24 10:08:38 +01:00
Simon Glass
5b15a2596f mkimage: Don't close the file if it wasn't opened
The error path for fit_import_data() is incorrect if the second open() call
fails.

Reported-by: Coverity (CID: 138489)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:28 -04:00
Simon Glass
3bd3a54ac5 mkimage: Ensure file is closed in fdt_property_file()
The file that is opened is not closed in all cases. Fix it.

Reported-by: Coverity (CID: 138490)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:27 -04:00
Simon Glass
7b0bbd886d mkimage: Fix missing free() and close() in fit_build()
Make sure that both the error path and normal return free the buffer and
close the file.

Reported-by: Coverity (CID: 138491)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:27 -04:00
Simon Glass
21c2975a94 mkimage: Fix missing free() in fit_extract_data()
The 'buf' variable is not freed. Fix it.

Reported-by: Coverity (CID: 138492)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:21 -04:00
Simon Glass
b97d71e26a mkimage: Fix error path in fit_extract_data()
The 'fdt' variable is not unmapped in all error cases. Fix this.

Reported-by: Coverity (CID: 138493)

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:20 -04:00
Simon Glass
6e0ffce6cb mkimage: Add a missing free() to fit_import_data()
The space allocated to fdt is not freed on error. Fix it.

Reported-by: Coverity (CID: 138494)

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:20 -04:00
Simon Glass
b12a81c4cc mkimage: Close the file when unable to get its size
There is a missing close() on the error path. Add it.

Reported-by: Coverity (CID: 138496)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:19 -04:00
Simon Glass
f980ca3411 mkimage: Correct file being closed twice in fit_extract_data()
The code flows through to the end of the function, so we don't need another
close() before this. Remove it.

Reported-by: Coverity (CID: 138503)

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:18 -04:00
Simon Glass
508b028a4c mkimage: Correct file being closed twice in fit_import_data()
The code flows through to the end of the function, so we don't need another
close() before this. Remove it.

Reported-by: Coverity (CID: 138504)

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:17 -04:00
Simon Glass
9cff2d1e39 mkimage: Fix munmap() call when importing data
The munmap() call unmaps the wrong memory buffer. Fix it.

Reported-by: Coverity (CID: 138505)
Reported-by: Coverity (CID: 138495)
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:17 -04:00
Vagrant Cascadian
0e28065949 Fix spelling of "comment".
Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:13 -04:00
Tom Rini
8a7367acca cmd: Fix license command
The license command isn't usually built and has a few problems:
- The rules to generate license.h haven't worked in a long time,
  re-write these based on the bmp_logo.h rules.
- 'tok' is unused and the license text size has increased
- bin2header.c wasn't grabbing unistd.h to know the prototype for
  read().

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2016-03-22 12:16:13 -04:00
Simon Glass
c81d0d215e buildman: Clarify the use of -V
This option outputs to the log file, not to the terminal. Clarify that in
the help, and add a mention of it in the README.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Stephen Warren <swarren@wwwdotorg.org>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
2016-03-17 21:27:39 -06:00
Simon Glass
17bce66cbf buildman: Add a way to specific a full toolchain prefix
At present buildman allows you to specify the directory containing the
toolchain, but not the actual toolchain prefix. If there are multiple
toolchains in a single directory, this can be inconvenient.

Add a new 'toolchain-prefix' setting to the settings file, which allows
the full prefix (or path to the C compiler) to be specified.

Update the documentation to match.

Suggested-by: Stephen Warren <swarren@wwwdotorg.org>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
2016-03-17 21:27:39 -06:00
Simon Glass
d4c8572b71 buildman: Allow branch names which conflict with directories
At present if you try to use buildman with the branch 'test' it will
complain that it is unsure whether you mean the branch or the directory.
This is a feature of the 'git log' command that buildman uses. Fix it
by resolving the ambiguity.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
2016-03-17 21:27:39 -06:00
Tom Rini
88033d737d Merge git://git.denx.de/u-boot-dm 2016-03-14 19:21:44 -04:00
Simon Glass
529fd18866 mkimage: Bring data into the FIT before processing
Since we now support data outside the FIT image, bring it into the FIT image
first before we do any processing. This avoids adding new functionality to
the core FIT code for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-03-14 19:18:30 -04:00
Simon Glass
722ebc8f84 mkimage: Support placing data outside the FIT
One limitation of FIT is that all the data is 'inline' within it, using a
'data' property in each image node. This means that to find out what is in
the FIT it is necessary to scan the entire file. Once loaded it can be
scanned and then the images can be copied to the correct place in memory.

In SPL it can take a significant amount of time to copy images around in
memory. Also loading data that does not end up being used is wasteful. It
would be useful if the FIT were small, acting as a directory, with the
actual data stored elsewhere.

This allows SPL to load the entire FIT, without the images, then load the
images it wants later.

Add a -E option to mkimage to request that it output an 'external' FIT.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-03-14 19:18:29 -04:00
Simon Glass
fb4cce0f98 mkimage: Support adding device tree files to a FIT
To make the auto-FIT feature useful we need to be able to provide a list of
device tree files on the command line for mkimage to add into the FIT. Add
support for this feature.

So far there is no support for hashing or verified boot using this method.
For those cases, a .its file must still be provided.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-03-14 19:18:29 -04:00
Simon Glass
8e35bb07eb mkimage: Support automatic creating of a FIT without a .its
At present, when generating a FIT, mkimage requires a .its file containing
the structure of the FIT and referring to the images to be included.

Creating the .its file is a separate step that makes it harder to use FIT.
This is not required for creating legacy images.

Often the FIT is pretty standard, consisting of an OS image, some device
tree files and a single configuration. We can handle this case automatically
and avoid needing a .its file at all.

To start with, support automatically generate the FIT using a new '-f auto'
option. Initially this only supports adding a single image (e.g. a linux
kernel) and a single configuration.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-03-14 19:18:28 -04:00
Simon Glass
3837ce65bd tools: Add a function to obtain the size of a file
This will be used in mkimage when working out the required size of the FIT
based on the files to be placed into it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-03-14 19:18:27 -04:00