Commit Graph

1303 Commits

Author SHA1 Message Date
Simon Glass
2ddd85dc34 moveconfig: Allow piping in 'git show --stat' output
It is useful to be able to process only a subset of boards to save time.
Often that subset is defined by the defconfig files in a git commit. This
change allows things like:

   # Build the database
   ./tools.moveconfig.py -b

   # Find some implying configs
   ./tools/moveconfig.py -i CONFIG_X

   # Add some 'imply' statements to Kconfig files
   ./tools/moveconfig.py -i CONFIG_X -a CONFIG_A,CONFIG_B

   # Reprocess the defconfig files to see if we can drop some changes
   git show --stat | ./tools/moveconfig.py -s -d -

   # Update the commit, with fewer defconfig changes
   gii commit -au

Where the commit contains defconfig files, this will reprocess them to
take account of the imply statements that you added.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11 10:08:20 -06:00
Simon Glass
2cce586651 dtoc: Support multiple compatible strings in a node
Sometimes a node will have multiple compatible strings. Drivers may use
one or the other so the best approach seems to be to #define them to be
equivalent.

Update dtoc to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Kever Yang <kever.yang@rock-chips.com>
2017-07-11 10:08:19 -06:00
Simon Glass
99b66605f0 moveconfig: Support looking for implied CONFIG options
Some CONFIG options can be implied by others and this can help to reduce
the size of the defconfig files. For example, CONFIG_X86 implies
CONFIG_CMD_IRQ, so we can put 'imply CMD_IRQ' under 'config X86' and
all x86 boards will have that option, avoiding adding CONFIG_CMD_IRQ to
each of the x86 defconfig files.

Add a -i option which searches for such options.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
2017-07-11 10:08:19 -06:00
Simon Glass
d73fcb12e2 moveconfig: Support building a simple config database
Add a -b option which scans all the defconfigs and builds a database of
all the CONFIG options used by each. This is useful for querying later.

At present this only works with the separate -b option, which does not
move any configs. It would be possible to adjust the script to build the
database automatically when moving configs, but this might not be useful
as the database does not change that often.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11 10:08:19 -06:00
Simon Glass
f3b8e6470c moveconfig: Add a constant for auto.conf
This filename is used a few times. Move it to a constant before adding
further uses.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11 10:08:19 -06:00
Simon Glass
ddf91c6423 moveconfig: Tidy up the documentation and add hints
The newest clean-up features are not mentioned in the docs. Fix this and
add a few hints for particular workflows that are hopefully helpful.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11 10:08:19 -06:00
Simon Glass
ee4e61bda4 moveconfig: Allow reading the defconfig list from stdin
Support passes in a defconfig filename of '-' to read the list from stdin
instead of from a file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11 10:08:19 -06:00
Simon Glass
25f978cb1c moveconfig: Support providing a path to the defconfig files
It is convenient to provide the full patch to the defconfig files in some
situations, e.g. when the file was generated by a shell command (e.g.
'ls configs/zynq*').

Add support for this, and move the globbing code into a function with its
own documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11 10:08:19 -06:00
Andy Shevchenko
daab59ac05 avr32: Retire AVR32 for good
AVR32 is gone. It's already more than two years for no support in Buildroot,
even longer there is no support in GCC (last version is heavily patched 4.2.4).

Linux kernel v4.12 got rid of it (and v4.11 didn't build successfully).

There is no good point to keep this support in U-Boot either.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-07-06 16:17:19 -04:00
Baruch Siach
79aa33cdb3 mkimage: fix display of image types list
Since commit 5b9d44df23 (mkimage: Display a better list of available image
types) mkimage usage text suggest to "use -T to see a list of available image
types". Unfortunately, commit 02221f29deb8 (mkimage: Convert to use getopt())
broke that feature, because getopt() fails when -T has no option argument.

Add a pseudo image type name 'list' that lists all image types. Update the
usage text accordingly.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2017-07-06 16:17:16 -04:00
Kever Yang
915e09814a rockchip: mkimage: correct spl_size for rk3399
The maximum spl_size for rk3399 is the internal memory size minus
the size used in bootrom (which usually can get from SPL_TEXT_BASE).

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-23 16:40:23 +02:00
Tom Rini
beca2901fd rkcommon.c: Remove unused rkcommon_spi_to_offset
This function is unused, remove.  Reported by clang-3.8.

Fixes: a1c29d4b43 ("rockchip: mkimage: set init_boot_size to avoid ...")
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-23 16:40:23 +02:00
Heiko Schocher
b9f7d88174 powerpc, 5xx: remove some "5xx" remains
we removed 5xx support. So delete some forgotten remains.

Signed-off-by: Heiko Schocher <hs@denx.de>
2017-06-16 10:14:56 -04:00
Masahiro Yamada
51855e8981 treewide: remove unneeded semicolons
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-06-16 10:11:38 -04:00
Heiko Schocher
630dfede22 tools/tbot: update README
refer in the README to tbots webpage, and delete
the README in tools/tbot, as the latest documentation
for tbot is on this webpage.

Signed-off-by: Heiko Schocher <hs@denx.de>
2017-06-12 08:38:44 -04:00
Simon Glass
22929bec52 rkcommon.c: Drop pointless assignment
Assigning a variable to itself is not necessary. Drop this and also add a
check for malloc() failure.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Coverity (CID: 161418)
Fixes: 111bcc4 (rockchip: mkimage: pad the header to 8-bytes (using a 'nop') for RK3399)
2017-06-12 08:38:12 -04:00
Simon Glass
9672515319 fdtgrep: Deal with NULL data passed to check_type_include()
Since the parameter can be NULL we must be careful not to dereference it
in this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Coverity (CID: 163250)
Fixes: 1043d0a0 (fdt: Add fdtgrep tool)
2017-06-12 08:38:07 -04:00
Tom Rini
8cb3ce64f9 Merge git://git.denx.de/u-boot-dm 2017-06-10 18:01:22 -04:00
Marek Behún
56491f98d4 tools/kwbimage: Support building with LibreSSL
The kwbimage utility fails to compile when LibreSSL is present on
the host system instead of OpenSSL. This one-line patch resolves
this.

Signed-off-by: Marek Behun <marek.behun@nic.cz>
2017-06-09 20:34:57 -04:00
Daniel Schwierzeck
aafbe82fb6 buildman: properly translate strings for log and err files to ASCII
The build output can still produce unicode encoded output. But in
the buildman's log and err files we only want plain ASCII characters.

To handle all situations with unicode and non-unicode output, encode
the stdout and stderr strings to UTF-8 and afterwards to ASCII with
replacing all special characters.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2017-06-09 13:45:34 -06:00
Daniel Schwierzeck
b0e994c29e buildman: disable localized and unicode output of all build tools
Build tools like Make, gcc or binutils support localized output
or unicode encoded output dependent on the default system locale.
This is not useful for buildman, where we want reproducible
warning or error messages or where the output of binutils is
further processed.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2017-06-09 13:45:34 -06:00
Simon Glass
6e87ae1c07 patman: Add a functional test
The existing test (patman --test) only covers basic checkpatch output.
We have had some problems with unicode processing and could use test
coverage for the various tags patman supports.

Add a new functional test which runs most of the patman flow on a few
test commits and checks that the results are correct.

See the documentation in the test for a description of what it does.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-08 20:21:59 -06:00
Simon Glass
a44f4fb72b patman: Rename 'list' variable in MakeCcFile()
This is not a good variable name in Python because 'list' is a type. It
shows up highlighted in some editors. Rename it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-08 20:21:59 -06:00
Simon Glass
1f487f85d2 patman: Add a maintainer test feature to MakeCcFile()
Allow the add_maintainers parameter to be a list of maintainers, thus
allowing us to simulate calling the script in tests without actually
needing it to work.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-08 20:21:59 -06:00
Simon Glass
2eb5fc13b3 patman: Add unicode to test patches
Add some unicode to the test patches to make sure that patman does the
right thing.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-08 20:21:59 -06:00
Simon Glass
db116cc8d0 patman: Don't return the series in FixPatches()
There is no need for this function to return the same object that was
passed in. Drop the return value.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-08 20:21:59 -06:00
Simon Glass
04f7870635 patman: Don't report unicode character
Unicode characters may appear in input patches so we should not warn about
them. Drop this warning.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-08 20:21:59 -06:00
Simon Glass
2df3a01974 patman: Rename 'str' variable in EmailPatches()
This is not a good variable name in Python because 'str' is a type. It
shows up highlighted in some editors. Rename it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-08 20:21:59 -06:00
Simon Glass
5c724dc440 patman: Don't convert input data to unicode
The communication filter reads data in blocks and converts each block to
unicode (if necessary) one at a time. In the unlikely event that a unicode
character in the input spans a block this will not work. We get an error
like:

UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1022-1023:
   unexpected end of data

There is no need to change the input to unicode, so the easiest fix is to
drop this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-08 20:21:59 -06:00
Simon Glass
6f8abf765b patman: Adjust handling of unicode email address
Don't mess with the email address when outputting them. Just make sure
they are encoded with utf-8.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-08 20:21:59 -06:00
Philipp Tomsich
21caa558ca patman: encode CC list to UTF-8
This change encodes the CC list to UTF-8 to avoid failures on
maintainer-addresses that include non-ASCII characters (observed on
Debian 7.11 with Python 2.7.3).

Without this, I get the following failure:
  Traceback (most recent call last):
    File "tools/patman/patman", line 159, in <module>
      options.add_maintainers)
    File "[snip]/u-boot/tools/patman/series.py", line 234, in MakeCcFile
      print(commit.patch, ', '.join(set(list)), file=fd)
  UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 81: ordinal not in range(128)
from Heiko's email address:
  [..., u'"Heiko St\xfcbner" <heiko@sntech.de>', ...]

While with this change added this encodes to:
  "=?UTF-8?q?Heiko=20St=C3=BCbner?= <heiko@sntech.de>"

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-06-08 20:21:59 -06:00
Tom Rini
d5686a61d6 buildman: Fix bloat option when 'new' only drops functions
In the case where a new build only decreases sizes and does not increase
any size we still want to report what functions have been dropped when
doing a bloat comparison.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-06-08 20:21:59 -06:00
Andy Yan
79fa157387 rockchip: mkimage: Add support for RV1108
Add support to mkimage for rv1108 soc, the max
spl code size for rv1108 is 6kb, and the spl
code should be packed by rksd, wether boot from
emmc or spi nor flash.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-06-07 07:29:24 -06:00
Philipp Tomsich
a1c29d4b43 rockchip: mkimage: set init_boot_size to avoid confusing the boot ROM
This change restores the earlier setting of init_boot_size to include
the maximum area covered by the the boot ROM of each chip for resolve
issues with back-to-bootrom functionality reported by Kever and Heiko.

To ensure that we don't run into the same issue again in the future,
I have updated the comments accordingly and added a reference to the
mailing list archive (there's some very helpful info from Andy Yan
that provides background on the BootROM requirements regarding these
fields).

See https://lists.denx.de/pipermail/u-boot/2017-May/293267.html for
some background (by Andy Yan) of how the BootROM processes this field.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-06-07 07:29:23 -06:00
Philipp Tomsich
ad972ac3d9 rockchip: mkimage: force 2KB alignment for init_size
The Rockchip BootROM relies on init_size being aligned to 2KB
(see https://lists.denx.de/pipermail/u-boot/2017-May/293268.html).

This pads the image to 2KB both for SD card images and SPI images
and uses a common symbolic constant for the alignment.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-06-07 07:29:22 -06:00
Philipp Tomsich
2fb371ff64 rockchip: mkimage: add support for verify_header/print_header
The rockchip image generation was previously missing the ability to
verify the generated header (and dump the image-type) without having
to resort to hexdump or od. Experience in our testing has showed it
to be very easy to get the rkspi and rksd images mixed up and the
lab... so we add the necessary support to have dumpimage tell us
what image type we're dealing with.

This change set adds the verify_header and print_header capability
to the rksd/rkspi image drivers (through shared code in rkcommon).

As of now, we only support images fully that are not RC4-encoded for
the SPL payload (i.e. header1 and payload). For RC4-encoded payloads,
the outer header (header0) is checked, but no detection of whether
this is a SD/MMC or SPI formatted payload takes place.

The output of dumpsys now prints the image type (spl_hdr), whether it
is a SD/MMC or SPI image, and the (padded) size of the image:
  $ ./tools/dumpimage -l ./spl.img
  Image Type:   Rockchip RK33 (SD/MMC) boot image
                               ^^^^^^ SD/MMC vs. SPI indication
                         ^^^^ spl_hdr indicated by the image
  Data Size:    79872 bytes

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Simon Glass <sjg@chromium.org>
2017-06-07 07:29:22 -06:00
Simon Glass
99ed4a2e97 fdt: Drop fdt_select.py
This file was used to select between the normal and fallback libfdt
implementations. Now that we only have one, it is not needed.

Drop it and fix up all users.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:18:20 -06:00
Simon Glass
ec3f378a31 binman: Rename fdt variable to dtb
Since fdt is the name of a module, use a different name for variables to
avoid a conflict.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:18:20 -06:00
Simon Glass
7b75b4482d fdt: Merge fdt_normal with its base class
Since we only have one Fdt implementation now we don't need to have a base
class. Merge the implementation and the base class together.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:18:20 -06:00
Simon Glass
515d3f0801 binman: Drop a special case related to fdt_fallback
Previously we were sometimes forced to collate x86 microcode due to not
having access to the offset of each individual piece. Now that we never
use fdt_fallback, we don't have this problem. Drop this special case from
the code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:18:20 -06:00
Simon Glass
160a766425 fdt: Drop fdt_fallback library
Drop this now-unused library and associated tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:18:20 -06:00
Simon Glass
6d804eafc1 fdt: Drop use of the legacy libfdt python module
Now that this is no-longer available, stop looking for it. The new module
will be used if available.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:18:19 -06:00
Simon Glass
727f153629 fdt: Stop building the old python libfdt module
This is no-longer needed, so stop building it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:18:19 -06:00
Simon Glass
b4360206a4 fdt: Support use of the new python libfdt library
Use the new library if available, while retaining backwards compatibility
with the old library for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:48 -06:00
Simon Glass
4a28b00703 fdt: dtoc: Add a full set of property tests
The tests don't currently cover all the different property types. Add a
new test which checks each property type in turn, to make sure each has
the correct type and value.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:47 -06:00
Simon Glass
1d88ebb270 fdt: Update fdt_test to use 'dt' instead of 'fdt'
Since fdt is a module it conflicts with this variable name and prevents it
being used in tests. Rename the variable.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:47 -06:00
Simon Glass
ee95d10ba9 fdt: Build the new python libfdt module
Build the upstream python libfdt module. At present the legacy module is
still built and is the one that it used. Future work will switch this
over.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:47 -06:00
Simon Glass
555ba4889c fdt: Rename existing python libfdt module
Now that this module has been accepted upstream we should stop using the
local U-Boot one. In preparation for this, rename it to indicate it is for
legacy use.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:47 -06:00
Simon Glass
330274f19d fdt: Add all source files to the libfdt build
At present only a subset of source files are build. Add the rest and
refactor this so that a source file list is available also. This will be
used in later commit.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-02 10:16:47 -06:00
Patrick Wildt
6cbf7eda3c arm: mvebu: kwbimage: inline function to fix use-after-free
image_version_file()'s only use is to return the version number of the
specified image, and it's only called by kwbimage_generate().  This
version function mallocs "image_cfg" and reads the contents of the image
into that buffer.  Before return to its caller it frees the buffer.

After extracting the version, kwb_image_generate() tries to calculate
the header size by calling image_headersz_v1().  This function now
accesses "image_cfg", which has already been freed.

Since image_version_file() is only used by a single function, inline it
into kwbimage_generate() and only free the buffer after it is no longer
needed.  This also improves code readability since the code is mostly
equal to kwbimage_set_header().

Signed-off-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Stefan Roese <sr@denx.de>
2017-05-31 07:43:04 +02:00