oweals/u-boot.git
4 years agoMerge branch 'master' of git://git.denx.de/u-boot-sh
Tom Rini [Tue, 30 Jul 2019 23:19:04 +0000 (19:19 -0400)]
Merge branch 'master' of git://git.denx.de/u-boot-sh

4 years agoPrepare v2019.10-rc1 v2019.10-rc1
Tom Rini [Tue, 30 Jul 2019 01:16:16 +0000 (21:16 -0400)]
Prepare v2019.10-rc1

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge tag 'dm-pull-29jul19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Mon, 29 Jul 2019 21:59:51 +0000 (17:59 -0400)]
Merge tag 'dm-pull-29jul19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm

binman support for replacing files

4 years agoMerge branch '2019-07-29-ti-imports'
Tom Rini [Mon, 29 Jul 2019 21:59:15 +0000 (17:59 -0400)]
Merge branch '2019-07-29-ti-imports'

- More DaVinci DM migration, drop am18xx EVM platform
- Keystone bug fix

4 years agoarm: mach-keystone: Use appended original image size in image processing
Andrew F. Davis [Tue, 16 Jul 2019 13:49:38 +0000 (09:49 -0400)]
arm: mach-keystone: Use appended original image size in image processing

When an image is signed/encrypted on K2 devices the image may get padded
to meet alignment requirements for the signature/encryption type. The
original size is appended as 4 bytes little-endian to the end of the
final image.

Normally the trailing extra bytes are ignored and so restoring the
exact original size is not important. In the case of initrd the
original size is important as the kernel uses it to look for
additional filesystem data and can do the wrong thing when the
size is not correct.

Read off the original size and report it back from the image post
processing stage.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
4 years agoconfigs: omapl138_lcdk: enable NAND self-init in SPL
Bartosz Golaszewski [Mon, 29 Jul 2019 06:58:10 +0000 (08:58 +0200)]
configs: omapl138_lcdk: enable NAND self-init in SPL

Now that we have enabled the driver-model in SPL, we can remove the
code disabling NAND self-init in SPL from the config include for
omapl138-lcdk.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agodavinci: omapl138-lcdk: enable driver-model in SPL
Bartosz Golaszewski [Mon, 29 Jul 2019 06:58:09 +0000 (08:58 +0200)]
davinci: omapl138-lcdk: enable driver-model in SPL

Enable CONFIG_SPL_DM and enable the driver model for serial by defining
an appropriate device in the board file for da850-lcdk.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agodavinci: omapl138-lcdk: remove unneeded includes
Bartosz Golaszewski [Mon, 29 Jul 2019 06:58:08 +0000 (08:58 +0200)]
davinci: omapl138-lcdk: remove unneeded includes

There's no SPI on da850-lcdk. Remove unnecessary includes.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agodavinci: omapl138-lcdk: enable CONFIG_USE_TINY_PRINTF
Bartosz Golaszewski [Mon, 29 Jul 2019 06:58:07 +0000 (08:58 +0200)]
davinci: omapl138-lcdk: enable CONFIG_USE_TINY_PRINTF

We're working towards enabling the driver-model in SPL for da850-lcdk.
Enable CONFIG_USE_TINY_PRINTF in defconfig to reduce SPL size.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agodavinci: omapl138-lcdk: enable SPL_SYS_MALLOC_SIMPLE
Bartosz Golaszewski [Mon, 29 Jul 2019 06:58:06 +0000 (08:58 +0200)]
davinci: omapl138-lcdk: enable SPL_SYS_MALLOC_SIMPLE

We're working towards enabling the driver model in SPL for da850-lcdk.
Enable SPL_SYS_MALLOC_SIMPLE in defconfig to reduce SPL size.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agodavinci: da850-evm: enable driver model for NAND
Bartosz Golaszewski [Mon, 29 Jul 2019 06:58:05 +0000 (08:58 +0200)]
davinci: da850-evm: enable driver model for NAND

Enable the driver-model on da850-evm. We need to add a dummy nand node
to the device tree, as the real nand node is a sub-node of the aemif
device.

On linux the aemif driver populates all its child nodes, but we can't do
it in u-boot currently.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Tested-by: Adam Ford <aford173@gmail.com> #da850-evm
4 years agodavinci: omapl138-lcdk: enable driver model for NAND
Bartosz Golaszewski [Mon, 29 Jul 2019 06:58:04 +0000 (08:58 +0200)]
davinci: omapl138-lcdk: enable driver model for NAND

Enable the driver-model on da850-lcdk. We need to add a dummy nand node
to the device tree, as the real nand node is a sub-node of the aemif
device.

On linux the aemif driver populates all its child nodes, but we can't do
it in u-boot currently.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agonand: davinci: add support for driver model
Bartosz Golaszewski [Mon, 29 Jul 2019 06:58:03 +0000 (08:58 +0200)]
nand: davinci: add support for driver model

Extend the davinci NAND driver to support the driver model. For now this
doesn't add any device-tree parsing due to the fact that we can't access
the actual nand node on the device-tree - it's a subnode of the aemif
device and we don't have an aemif driver on davinci at the moment.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agonand: davinci: make davinci_nand_init() static
Bartosz Golaszewski [Mon, 29 Jul 2019 06:58:02 +0000 (08:58 +0200)]
nand: davinci: make davinci_nand_init() static

This function is only used within the driver itself. No need
to export it.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agoomapl138_lcdk_defconfig: don't build support for SPI
Bartosz Golaszewski [Mon, 29 Jul 2019 06:58:01 +0000 (08:58 +0200)]
omapl138_lcdk_defconfig: don't build support for SPI

The following warning is emited when building u-boot for da850-lcdk:

===================== WARNING ======================
This board does not use CONFIG_DM_SPI. Please update
the board before v2019.04 for no dm conversion
and v2019.07 for partially dm converted drivers.
Failure to update can lead to driver/board removal
See doc/driver-model/MIGRATION.txt for more info.
====================================================
===================== WARNING ======================
This board does not use CONFIG_DM_SPI_FLASH. Please update
the board to use CONFIG_SPI_FLASH before the v2019.07 release.
Failure to update by the deadline may result in board removal.
See doc/driver-model/MIGRATION.txt for more info.
====================================================

While we could fix it by selecting CONFIG_DM_SPI, there's no need to
build it at all as SPI is disabled on da850-lcdk. Remove all unneeded
options from the defconfig.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Heiko Schocher <hs@denx.de>
4 years agoi2c: remove i2c driver-model compatibility layer
Bartosz Golaszewski [Mon, 29 Jul 2019 06:58:00 +0000 (08:58 +0200)]
i2c: remove i2c driver-model compatibility layer

There are no more users of the compatibility layer for i2c. Remove the
driver and all references to it.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Heiko Schocher <hs@denx.de>
4 years agosandbox: remove CONFIG_DM_I2C_COMPAT from defconfigs
Bartosz Golaszewski [Mon, 29 Jul 2019 06:57:59 +0000 (08:57 +0200)]
sandbox: remove CONFIG_DM_I2C_COMPAT from defconfigs

There are no more "real" users of CONFIG_DM_I2C_COMPAT and we'll soon
remove it altogether. Stop building it in sandbox mode.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Heiko Schocher <hs@denx.de>
4 years agodavinci: remove CONFIG_DM_I2C_COMPAT from defconfigs
Bartosz Golaszewski [Mon, 29 Jul 2019 06:57:58 +0000 (08:57 +0200)]
davinci: remove CONFIG_DM_I2C_COMPAT from defconfigs

This option is no longer used on any davinci board but still selected
in defconfigs which causes the following warning:

===================== WARNING ======================
This board uses CONFIG_DM_I2C_COMPAT. Please remove
(possibly in a subsequent patch in your series)
before sending patches to the mailing list.
====================================================

Remove all references to CONFIG_DM_I2C_COMPAT from davinci.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Heiko Schocher <hs@denx.de>
4 years agoARM: da850_am18xxevm: Remove config and references
Adam Ford [Mon, 29 Jul 2019 13:28:39 +0000 (08:28 -0500)]
ARM: da850_am18xxevm: Remove config and references

This board has been abandonded for a while.  I do not have this hardware
and nobody has appeared to notice and/or care that it's orphaned.
Since much of this code is inserted into the da850evm code base, removing
it from support will make da850evm support easier going forward.
This patch removes the da850_am18xxevm_defconfig, README references to this
board and the reference to this board from the MAINTAINERS list.

Signed-off-by: Adam Ford <aford173@gmail.com>
4 years agoMerge branch '2019-07-29-master-imports'
Tom Rini [Mon, 29 Jul 2019 15:51:17 +0000 (11:51 -0400)]
Merge branch '2019-07-29-master-imports'

- Assorted bug fixes

4 years agoMakefile: fix implementation of BINMAN_DEBUG
Stephen Warren [Fri, 19 Jul 2019 17:21:17 +0000 (11:21 -0600)]
Makefile: fix implementation of BINMAN_DEBUG

binman only accepts the -D argument early on the command-line, yet the
Makefile currently passes it near the end. This causes the build to fail
if this feature is used. Re-order the command-line to fix this.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add command-line support for replacing entries
Simon Glass [Sat, 20 Jul 2019 18:24:15 +0000 (12:24 -0600)]
binman: Add command-line support for replacing entries

Add a 'replace' command to binman to permit entries to be replaced, either
individually or all at once (using a filter).

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Correct the error message for invalid path
Simon Glass [Sat, 20 Jul 2019 18:24:14 +0000 (12:24 -0600)]
binman: Correct the error message for invalid path

At present this message references -o for output file. But binman uses -f
now. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Split control.WriteEntryToImage() into separate functions
Simon Glass [Sat, 20 Jul 2019 18:24:13 +0000 (12:24 -0600)]
binman: Split control.WriteEntryToImage() into separate functions

This code has three distinct phases:

1. The image is loaded and the state module is set up
2. The entry is written to the image
3. The image is repacked and written back to the file

Split the code out with three separate functions, one for each phase.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Update control.WriteEntry() to support writing the map
Simon Glass [Sat, 20 Jul 2019 18:24:12 +0000 (12:24 -0600)]
binman: Update control.WriteEntry() to support writing the map

Add the ability to write a new map file. Also tidy up a few comments and
rename a misleading variable.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Move control.WriteEntry further down the file
Simon Glass [Sat, 20 Jul 2019 18:24:11 +0000 (12:24 -0600)]
binman: Move control.WriteEntry further down the file

Move this function after the extraction logic so we can keep the writing
logic in one place.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Clean up all output directories in tests
Simon Glass [Sat, 20 Jul 2019 18:24:10 +0000 (12:24 -0600)]
binman: Clean up all output directories in tests

At present some tests leave behind output directories. This happens
because some tests call binman, which sets up an output directory, then
call it again, which sets up another output directory and leaves the
original one behind.

Fix this by using a separate temporary directory when binman is called
twice, or by manually removing the output directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add a test function to clean up the output dir
Simon Glass [Sat, 20 Jul 2019 18:24:09 +0000 (12:24 -0600)]
binman: Add a test function to clean up the output dir

Put tearDown()'s logic into a new _CleanupOutputDir() function so that it
can be called from elsewhere.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Update state when replacing device-tree entries
Simon Glass [Sat, 20 Jul 2019 18:24:08 +0000 (12:24 -0600)]
binman: Update state when replacing device-tree entries

Since the state module holds references to all the device trees used by
binman, it must be updated when the device trees are updated. Add support
for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agopatman: Reset the output directory when it is removed
Simon Glass [Sat, 20 Jul 2019 18:24:07 +0000 (12:24 -0600)]
patman: Reset the output directory when it is removed

At present outdir remains set ever after the output directory has been
removed. Fix this to avoid trying to access it when it is not present.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Support replacing data in a cbfs
Simon Glass [Sat, 20 Jul 2019 18:24:06 +0000 (12:24 -0600)]
binman: Support replacing data in a cbfs

At present binman cannot replace data within a CBFS since it does not
allow rewriting of the files in that CBFS. Implement this by using the
new WriteData() method to handle the case.

Add a header to compressed data so that the amount of compressed data can
be determined without reference to the size of the containing entry. This
allows the entry to be larger that the contents, without causing errors in
decompression. This is necessary to cope with a compressed device tree
being updated in such a way that it shrinks after the entry size is
already set (an obscure case). It is not used with CBFS since it has its
own metadata for this. Increase the number of passes allowed to resolve
the position of entries, to handle this case.

Add a test for this new logic.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Update Entry.WriteData() to handle special sections
Simon Glass [Sat, 20 Jul 2019 18:24:05 +0000 (12:24 -0600)]
binman: Update Entry.WriteData() to handle special sections

At present this method assumes that the parent section does not need
to recalculate its position or adjust any metadata it may contain. But
when the entry changes size this may not be true. Also if the parent
section is more than just a container (e.g. it is a CBFS) then the
section may need to regenerate its output.

Add a new WriteChildData() method to sections and call this from the
WriteData() method, to handle this situation.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Update Entry.ReadEntry() to work through classes
Simon Glass [Sat, 20 Jul 2019 18:24:04 +0000 (12:24 -0600)]
binman: Update Entry.ReadEntry() to work through classes

At present we simply extract the data directly from entries using the
image_pos information. This happens to work on current entry types, but
cannot work if the entry type encodes the data in some way. Update the
ReadData() method to provide the data by calling a new ReadChildData()
method in the parent. This allows the entry_Section class, or possibly
any other container class, to return the correct data in all cases.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add a prefix before CBFS hex offsets
Simon Glass [Sat, 20 Jul 2019 18:24:03 +0000 (12:24 -0600)]
binman: Add a prefix before CBFS hex offsets

Add a 0x prefix to these errors to avoid confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add a few more features to the wishlist
Simon Glass [Sat, 20 Jul 2019 18:24:02 +0000 (12:24 -0600)]
binman: Add a few more features to the wishlist

Add mention of a few other desirable features that may be implemented in
the future.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Place Intel descriptor at image start
Simon Glass [Sat, 20 Jul 2019 18:24:01 +0000 (12:24 -0600)]
binman: Place Intel descriptor at image start

The Intel descriptor must always appear at the start of an (x86) image,
so it is supposed to position itself there always. However there is no
explicit test for this. Add one and fix a bug introduced by the recent
change to adjust Entry to read the node in a separate call.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Adjust fmap to ignore CBFS files
Simon Glass [Sat, 20 Jul 2019 18:24:00 +0000 (12:24 -0600)]
binman: Adjust fmap to ignore CBFS files

The FMAP is not intended to show the files inside a CBFS. The FMAP can be
used to locate the CBFS itself, but then the CBFS must be read to find out
what is in it.

Update the FMAP to work this way and add some debugging while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agolibfdt: Copy the struct region in fdt_resize()
Simon Glass [Sat, 20 Jul 2019 18:23:59 +0000 (12:23 -0600)]
libfdt: Copy the struct region in fdt_resize()

At present this function appears to copy only the data before the struct
region and the data in the string region. It does not seem to copy the
struct region itself.

>From the arguments of this function it seems that it should support fdt
and buf being different. This patch attempts to fix this problem.

Upstream commit: c72fa77 libfdt: Copy the struct region in fdt_resize()

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Support shrinking a entry after packing
Simon Glass [Sat, 20 Jul 2019 18:23:58 +0000 (12:23 -0600)]
binman: Support shrinking a entry after packing

Sometimes an entry may shrink after it has already been packed. In that
case we must repack the items. Of course it is always possible to just
leave the entry at its original size and waste space at the end. This is
what binman does by default, since there is the possibility of the entry
changing size every time binman calculates its contents, thus causing a
loop.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Update the _testing entry to support shrinkage
Simon Glass [Sat, 20 Jul 2019 18:23:57 +0000 (12:23 -0600)]
binman: Update the _testing entry to support shrinkage

Sometimes entries shrink after packing. As a start towards supporting
this, update the _testing entry to handle the test case.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Allow updating entries that change size
Simon Glass [Sat, 20 Jul 2019 18:23:56 +0000 (12:23 -0600)]
binman: Allow updating entries that change size

So far we don't allow entries to change size when repacking. But this is
not very useful since it is common for entries to change size after an
updated binary is built, etc.

Add support for this, respecting the original offset/size/alignment
constraints of the image layout. For this to work the original image
must have been created with the 'allow-repack' property.

This does not support entry types with sub-entries such as files and
CBFS, but it does support sections.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add more tests for image header position
Simon Glass [Sat, 20 Jul 2019 18:23:55 +0000 (12:23 -0600)]
binman: Add more tests for image header position

The positioning does not currently work correctly if at the end of an
image with no fixed size. Also if the header is in the middle of an image
it can cause a gap in the image since the header position is normally at
the image end, so entries after it are placed after the end of the image.

Fix these problems and add more tests to cover these cases.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Move Image.BuildImage() into a single function
Simon Glass [Sat, 20 Jul 2019 18:23:54 +0000 (12:23 -0600)]
binman: Move Image.BuildImage() into a single function

Now that an Image is an Entry_section, there is no need for the separate
BuildSection() function. Drop it and add a bit of logging.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Write the original input fdtmap to a file
Simon Glass [Sat, 20 Jul 2019 18:23:53 +0000 (12:23 -0600)]
binman: Write the original input fdtmap to a file

When reading an image in, write its fdtmap to a file in the output
directory. This is useful for debugging. Update the 'ls' command to set up
the output directory; otherwise it will fail.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Update documentation for image creation
Simon Glass [Sat, 20 Jul 2019 18:23:52 +0000 (12:23 -0600)]
binman: Update documentation for image creation

There are a few more steps in the process now. Update the documentation to
reflect this.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add info to allow safely repacking an image later
Simon Glass [Sat, 20 Jul 2019 18:23:51 +0000 (12:23 -0600)]
binman: Add info to allow safely repacking an image later

At present it is not possible to discover the contraints to repacking an
image (e.g. maximum section size) since this information is not preserved
from the original image description.

Add new 'orig-offset' and 'orig-size' properties to hold this. Add them to
the main device tree in the image.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Support updating entries in an existing image
Simon Glass [Sat, 20 Jul 2019 18:23:50 +0000 (12:23 -0600)]
binman: Support updating entries in an existing image

While it is useful and efficient to build images in a single pass from a
unified description, it is sometimes desirable to update the image later.

Add support for replace an existing file with one of the same size. This
avoids needing to repack the file. Support for more advanced updates will
come in future patches.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Tidy up _SetupDtb() to use its own temporary file
Simon Glass [Sat, 20 Jul 2019 18:23:49 +0000 (12:23 -0600)]
binman: Tidy up _SetupDtb() to use its own temporary file

At present EnsureCompiled() uses an file from the 'output' directory (in
the tools module) when compiling the device tree. This is fine in most
cases, allowing useful inspection of the output files from binman.

However in functional tests, _SetupDtb() creates an output directory and
immediately removes it afterwards. This serves no benefit and just
confuses things, since the 'official' output directory is supposed to be
created and destroyed in control.Binman().

Add a new parameter for the optional temporary directory to use, and use a
separate temporary directory in _SetupDtb().

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Allow the fdtmap to remain unchanged
Simon Glass [Sat, 20 Jul 2019 18:23:48 +0000 (12:23 -0600)]
binman: Allow the fdtmap to remain unchanged

When updating an existing image where the size of all entries remains the
same, we should not need to regenerate the fdtmap. Update the entry to
return the same fdtmap as was read from the image.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add a constant for common entry properties
Simon Glass [Sat, 20 Jul 2019 18:23:47 +0000 (12:23 -0600)]
binman: Add a constant for common entry properties

We use this same combination of properties several times in tests. Add a
constant for it to avoid typos, etc.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add a function to obtain the image for an Entry
Simon Glass [Sat, 20 Jul 2019 18:23:46 +0000 (12:23 -0600)]
binman: Add a function to obtain the image for an Entry

At present we have an 'image' property in the entry for this purpose, but
this is not necessary and seems error-prone in the presence of
inheritance. Add a function instead. The Entry_section class overrides
this with a special version, since top-level sections are in fact images,
since Image inherits Entry_section.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Adjust Entry to read the node in a separate call
Simon Glass [Sat, 20 Jul 2019 18:23:45 +0000 (12:23 -0600)]
binman: Adjust Entry to read the node in a separate call

At present the Entry constructor sets up the object and then immediately
reads its device-tree node to obtain its properties.

This breaks a convention that constructors should not do any processing.
A consequence is that we must pass all arguments to the constructor and
cannot have the node-reading proceed in a different way unless we pass
flags to that constructor. We already have a 'test' flag in a few cases,
and now need to control whether the 'orig_offset' and 'orig_size'
properties are set or not.

Adjust the code to require a separate call to ReadNode() after
construction. The Image class remains as it was.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add an image name into the fdtmap
Simon Glass [Sat, 20 Jul 2019 18:23:44 +0000 (12:23 -0600)]
binman: Add an image name into the fdtmap

Since binman supports multiple images it is useful to know which one
created the image that has been read. Then it is possible to look up that
name in the 'master' device tree (containing the description of all
images).

Add a property for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Store the entry in output_fdt_files
Simon Glass [Sat, 20 Jul 2019 18:23:43 +0000 (12:23 -0600)]
binman: Store the entry in output_fdt_files

In some cases we want to access the Entry object for a particular device
tree. This allows us to read its contents or update it. Add this
information to output_fdt_files and provide a function to read it.

Also rename output_fdt_files since its name is no-longer descriptive.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Allow state functions to fail to return data
Simon Glass [Sat, 20 Jul 2019 18:23:42 +0000 (12:23 -0600)]
binman: Allow state functions to fail to return data

At present these state functions raise an exception if they cannot find
what is requested. But in some cases the information is optional (e.g. an
fdtmap in a coming patch) so it is better to return gracefully.

Update these two functions to return None when the data cannot be found.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Support loading entry data from a file
Simon Glass [Sat, 20 Jul 2019 18:23:41 +0000 (12:23 -0600)]
binman: Support loading entry data from a file

When modifying an image it is convenient to load the data from the file
into each entry so that it can be reprocessed. Add a new LoadData() method
to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Store image fdtmap when loading from a file
Simon Glass [Sat, 20 Jul 2019 18:23:40 +0000 (12:23 -0600)]
binman: Store image fdtmap when loading from a file

This data provides all the information about the position and size of each
entry. Store it for later use when loading an image. It can be reused as
is if the image is modified without changing offsets/sizes.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodtoc: Update Fdt.GetNode() to handle the root node
Simon Glass [Sat, 20 Jul 2019 18:23:39 +0000 (12:23 -0600)]
dtoc: Update Fdt.GetNode() to handle the root node

This function currently fails if the root node is requested. Requesting
the root node is sometimes useful, so fix the bug.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodtoc: Update Fdt.FromData() to allow a name
Simon Glass [Sat, 20 Jul 2019 18:23:38 +0000 (12:23 -0600)]
dtoc: Update Fdt.FromData() to allow a name

It is confusing when something goes wrong with a device tree which was
created from data rather than a file, since there is no identifying
filename. Add an option to provide this. Use the filename as the name,
where available

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Show a helpful error when a DT property is missing
Simon Glass [Sat, 20 Jul 2019 18:23:37 +0000 (12:23 -0600)]
binman: Show a helpful error when a DT property is missing

At present a Python exception is raised which does not show the node
information. Add a more helpful exception in this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Add a bit of logging in entries when packing
Simon Glass [Sat, 20 Jul 2019 18:23:36 +0000 (12:23 -0600)]
binman: Add a bit of logging in entries when packing

Use the new logging feature to log information about progress with
packing. This is useful to see how binman is figuring things out.

Also update elf.py to use the same feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agopatman: Update tout to avoid open-coding the debug levels
Simon Glass [Sat, 20 Jul 2019 18:23:35 +0000 (12:23 -0600)]
patman: Update tout to avoid open-coding the debug levels

Use the debug level constants instead of open-coding them in the file.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Drop state.fdt_set as this is not needed
Simon Glass [Sat, 20 Jul 2019 18:23:34 +0000 (12:23 -0600)]
binman: Drop state.fdt_set as this is not needed

We can iterate through the output files so don't need this global anymore.
Remove it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Simplify state.fdt_subset
Simon Glass [Sat, 20 Jul 2019 18:23:33 +0000 (12:23 -0600)]
binman: Simplify state.fdt_subset

At present this excludes the device tree passed in to binman since it
is always returned first by GetAllFdts(). However, this is easy to ensure
by adding a check in that function. Change this dict to includes all
device trees, and rename it to fdt_set.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Adjust state.fdt_files to be keyed by entry type
Simon Glass [Sat, 20 Jul 2019 18:23:32 +0000 (12:23 -0600)]
binman: Adjust state.fdt_files to be keyed by entry type

It makes more sense to use entry type as the key for this dictionary,
since the filename can in principle be anything. Make this change and also
rename fdt_files and add a comment to explain it better.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Adjust GetFdt() to be keyed by etype
Simon Glass [Sat, 20 Jul 2019 18:23:31 +0000 (12:23 -0600)]
binman: Adjust GetFdt() to be keyed by etype

At present the FDTs are keyed by their default filename (not their actual
filename). It seems easier to key by the entry type, since this is always
the same for each FDT type.

To do this, add a new Entry method called GetFdtEtype(). This is necessary
since some entry types contain a device tree which are not the simple
three entry types 'u-boot-dtb', 'u-boot-spl' or 'u-boot-tpl'.

The code already returns a dict for GetFdt(). Update the value of that
dict to include the filename so that existing code can work.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Rename state.GetFdt()
Simon Glass [Sat, 20 Jul 2019 18:23:30 +0000 (12:23 -0600)]
binman: Rename state.GetFdt()

This function name conflicts with Fdt.Node.GetFdt() which has a different
purpose. Rename it to avoid confusion.

The new name suggests it is indexed by entry type rather than filename.
This will be tidied up in a future commit.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Rename state.GetFdts()
Simon Glass [Sat, 20 Jul 2019 18:23:29 +0000 (12:23 -0600)]
binman: Rename state.GetFdts()

This function name conflicts with Entry.GetFdts() which has a different
purpose. Rename it to avoid confusion. Also update a stale comment
relating to this function.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Convert GetFdtSet() to use a dict
Simon Glass [Sat, 20 Jul 2019 18:23:28 +0000 (12:23 -0600)]
binman: Convert GetFdtSet() to use a dict

At present this function returns a set of device-tree filenames. It has no
way of returning the actual device-tree object. Change it to a dictionary
so that we can add this feature in a future patch.

Also drop fdt_set since it is no-longer used.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Move image/fdt code into PrepareImagesAndDtbs()
Simon Glass [Sat, 20 Jul 2019 18:23:27 +0000 (12:23 -0600)]
binman: Move image/fdt code into PrepareImagesAndDtbs()

Further reduce the size of the main Binman() function by moving this setup
code into its own function.

Note that the 'images' value is accessed from other modules so must be made
a global.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Use print() to print output
Simon Glass [Sat, 20 Jul 2019 18:23:26 +0000 (12:23 -0600)]
binman: Use print() to print output

At present tout writes directly to stdout. This is not necessary and it
prevents tests from redirecting output. Change it to use print() for the
non-progress output.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Move GetFdtSet() into blob_dtb
Simon Glass [Sat, 20 Jul 2019 18:23:25 +0000 (12:23 -0600)]
binman: Move GetFdtSet() into blob_dtb

At present we check the filename to see if an entry holds a device-tree
file. It is easier to use the base class designed for this purpose.

Move this method implementation into Entry_blob_dtb and update the default
one to return an empty set.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agobinman: Move image-processing code into a function
Simon Glass [Sat, 20 Jul 2019 18:23:24 +0000 (12:23 -0600)]
binman: Move image-processing code into a function

The Binman() function is very long. Split out the image code to make it
more manageable.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodtoc: Return a non-zero exit code when tests fail
Simon Glass [Sat, 20 Jul 2019 18:23:23 +0000 (12:23 -0600)]
dtoc: Return a non-zero exit code when tests fail

At present 'dtoc -t' return a success code even if some of the tests fail.
Fix this by checking the test result and setting the exit code. This
allows 'make qcheck' to function as expected.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoAdd validation for icache/dcache arguments - arguments different from off/on/flush...
Eric Perie [Sat, 13 Jul 2019 18:54:58 +0000 (14:54 -0400)]
Add validation for icache/dcache arguments - arguments different from off/on/flush are currently silently ignored.

Signed-off-by: Eric Perie <eric.perie@yahoo.com>
4 years agolib: uuid: alignment error in gen_rand_uuid()
Heinrich Schuchardt [Sun, 14 Jul 2019 21:31:50 +0000 (23:31 +0200)]
lib: uuid: alignment error in gen_rand_uuid()

Packed structures like struct uuid are not aligned. GCC 9.1 therefore
throws an error when trying to compile gen_rand_uuid().

lib/uuid.c: In function ‘gen_rand_uuid’:
lib/uuid.c:244:2: error: converting a packed ‘struct uuid’ pointer
(alignment 1) to a ‘unsigned int’ pointer (alignment 4) may result in
an unaligned pointer value [-Werror=address-of-packed-member]
  244 |  unsigned int *ptr = (unsigned int *)&uuid;
      |  ^~~~~~~~

Generate the uuid in a properly aligned buffer.

The byte order of a random number should not matter. Do not call
cpu_to_be32() to change the byte order.

Reported-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agortc, rx8025: add DM support
Heiko Schocher [Tue, 16 Jul 2019 03:31:35 +0000 (05:31 +0200)]
rtc, rx8025: add DM support

add DM support for this RTC driver.

Signed-off-by: Heiko Schocher <hs@denx.de>
4 years agortc, rx8025: fix Coding Style
Heiko Schocher [Tue, 16 Jul 2019 03:31:34 +0000 (05:31 +0200)]
rtc, rx8025: fix Coding Style

fix Coding Style for this driver.

Signed-off-by: Heiko Schocher <hs@denx.de>
4 years agortc: move RTC_RX8025 to Kconfig
Heiko Schocher [Tue, 16 Jul 2019 03:31:33 +0000 (05:31 +0200)]
rtc: move RTC_RX8025 to Kconfig

move RTC_RX8025 to Kconfig and fixup board configs.

Signed-off-by: Heiko Schocher <hs@denx.de>
4 years agoboard: mediatek: Add pumpkin board support
Fabien Parent [Thu, 18 Jul 2019 17:08:09 +0000 (19:08 +0200)]
board: mediatek: Add pumpkin board support

The pumpkin board is made by Gossamer Engineering and is using
a MediaTek SoC. The board currently comes in two available version:
MT8516 SoC and MT8167 SoC.
The board provides the following IOs: eMMC, NAND, SD card, USB type-A,
Ethernet, Wi-Fi, Bluetooth, Audio (jack out, 2 PDM port, 1 analog in),
serial over USB, and an expansion header.

Additionally there is a HDMI port, DSI port, and camera port only
on the MT8167 version of the board.

The board can be powered by battery and/or via a USB Type-C port and
is using a PMIC MT6392.

The eMMC and NAND are sharing pins and cannot be used together.

This commit is adding the basic boot support for the Pumpkin MT8516
board on the eMMC.

Signed-off-by: Fabien Parent <fparent@baylibre.com>
4 years agopinctrl: mediatek: fix warning
Fabien Parent [Thu, 18 Jul 2019 17:08:08 +0000 (19:08 +0200)]
pinctrl: mediatek: fix warning

Fix the following warning when CONFIG_PINCONF=n:

drivers/pinctrl/mediatek/pinctrl-mtk-common.c:35:36:
warning: ‘mtk_drive’ defined but not used [-Wunused-const-variable=]
 static const struct mtk_drive_desc mtk_drive[] = {
                                    ^~~~~~~~~

Signed-off-by: Fabien Parent <fparent@baylibre.com>
4 years agogpio: fixes for gpio-hog support
Heiko Schocher [Wed, 17 Jul 2019 04:59:51 +0000 (06:59 +0200)]
gpio: fixes for gpio-hog support

recently added gpio hog patch was "in discussion"
state with Simon Glass. This patch now adds most
of comments from Simon Glass.

Signed-off-by: Heiko Schocher <hs@denx.de>
4 years agodoc: arch: sandbox: Replace all the instances of README.sandbox
Keerthy [Mon, 29 Jul 2019 08:22:04 +0000 (13:52 +0530)]
doc: arch: sandbox: Replace all the instances of README.sandbox

commit 49116e6d236d ("doc: arch: Convert README.sandbox to reST")
Moves README.sandbox to doc/arch.
Replace all the existing instances to point to the right documentation
file.

Signed-off-by: Keerthy <j-keerthy@ti.com>
4 years agoDrop linker-generated array creation when CONFIG_CMDLINE is disabled
Andrej Rosano [Mon, 29 Jul 2019 07:24:53 +0000 (09:24 +0200)]
Drop linker-generated array creation when CONFIG_CMDLINE is disabled

Linker generated array entry is not needed when the command line is
disabled. Remove this code in that case.

This is required as the commit 80a48dd47e3bf3ede676fae5a630cb6c80de3e69
breaks the linking stage when CONFIG_CMDLINE=n:

..
  LDS     u-boot.lds
  LD      u-boot
u-boot contains unexpected relocations: R_ARM_NONE
R_ARM_RELATIVE
make: *** [Makefile:1775: checkarmreloc] Error 1

Signed-off-by: Andrej Rosano <andrej.rosano@f-secure.com>
4 years agodoc: board: Add missing board index.rst files
Bin Meng [Fri, 26 Jul 2019 02:04:04 +0000 (19:04 -0700)]
doc: board: Add missing board index.rst files

These board index.rst files are missing in previous html doc patch
series, hence it causes some build warnings. Add those files.

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agotools/logos: remove black background of U-Boot logo
Heinrich Schuchardt [Thu, 25 Jul 2019 18:46:15 +0000 (20:46 +0200)]
tools/logos: remove black background of U-Boot logo

When generating the Sphinx documentation with command 'make htmldocs' the
U-Boot logo is displayed with a black box as a background.

Remove the black box.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agofit: Support compat string property in configuration node
Julius Werner [Thu, 25 Jul 2019 02:37:56 +0000 (19:37 -0700)]
fit: Support compat string property in configuration node

This patch adds support for an optional optimization to compatible
string matching where the compatible string property from the root node
of the kernel FDT can be copied into the configuration node of the FIT
image. This is most useful when using compressed FDTs or when using FDT
overlays, where the traditional extraction of the compatible string from
the kernel FDT itself is not easily possible.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agofit: Support compression for non-kernel components (e.g. FDT)
Julius Werner [Thu, 25 Jul 2019 02:37:55 +0000 (19:37 -0700)]
fit: Support compression for non-kernel components (e.g. FDT)

This patch adds support for compressing non-kernel image nodes in a FIT
image (kernel nodes could already be compressed previously). This can
reduce the size of FIT images and therefore improve boot times
(especially when an image bundles many different kernel FDTs). The
images will automatically be decompressed on load.

This patch does not support extracting compatible strings from
compressed FDTs, so it's not very helpful in conjunction with
CONFIG_FIT_BEST_MATCH yet, but it can already be used in environments
that select the configuration to load explicitly.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
4 years agocommon: Move bootm_decomp_image() to image.c (as image_decomp())
Julius Werner [Thu, 25 Jul 2019 02:37:54 +0000 (19:37 -0700)]
common: Move bootm_decomp_image() to image.c (as image_decomp())

Upcoming patches want to add decompression to use cases that are no
longer directly related to booting. It makes sense to retain a single
decompression routine, but it should no longer be in bootm.c (which is
not compiled for all configurations). This patch moves
bootm_decomp_image() to image.c and renames it to image_decomp() in
preparation of those upcoming patches.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
[trini: Fix warning around handle_decomp_error being unused]
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-socfpga
Tom Rini [Mon, 29 Jul 2019 13:03:11 +0000 (09:03 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-socfpga

- Various gen5 fixes

4 years agoMerge tag 'video-for-2019.10' of https://gitlab.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 29 Jul 2019 13:02:46 +0000 (09:02 -0400)]
Merge tag 'video-for-2019.10' of https://gitlab.denx.de/u-boot/custodians/u-boot-video

- dcu and imx7 DM_VIDEO conversion
- lb070wv8 compatible in simple_panel driver
- bmp_logo improvements for DM_VIDEO
- EDID updates to filter supported modes
- meson_dw_hdmi: support EDID mode filtering
- dw_hdmi: support ddc-i2c-bus phandle for external I2C masters
- fix rpi crash when firmware doesn't report connected display

4 years agoMerge tag 'u-boot-rockchip-20190729' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Mon, 29 Jul 2019 13:02:15 +0000 (09:02 -0400)]
Merge tag 'u-boot-rockchip-20190729' of https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip

- Clean up and migrate to use common rockchip spl board file
- Clean up and migrate to use common rockchip board file
- Increase rk3288 CONFIG_SYS_BOOTM_LEN to 16MB

4 years agogitlab-ci: Switch to a Docker image that contains a QEMU we build
Tom Rini [Wed, 24 Jul 2019 17:09:31 +0000 (13:09 -0400)]
gitlab-ci: Switch to a Docker image that contains a QEMU we build

Rather than buiding QEMU for each test.py build it once in our
Dockerfile and re-use it as needed.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agopinctrl: renesas: fix R-Car gpio0_00 operation fails with 'gpio -input' command
titron [Mon, 22 Jul 2019 09:45:37 +0000 (17:45 +0800)]
pinctrl: renesas: fix R-Car gpio0_00 operation fails with 'gpio -input' command

Fix GPIO bank 0 pin 0 request/release off by one error. Without this
patch, it is not possible to request/release GPIO bank 0 pin 0.

Signed-off-by: Tiezhuang Dong <tiezhuang.dong.yh@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Eugeniu Rosca <roscaeugeniu@gmail.com>
Cc: Yoshihiro Shimoda <shimoda.yoshihiro.uh@renesas.com>
4 years agovideo: arm: rpi: Bail out early if querying video information fails
Fabian Vogt [Thu, 11 Jul 2019 14:56:24 +0000 (16:56 +0200)]
video: arm: rpi: Bail out early if querying video information fails

When probing we query for the width and hight of the display. If the
firmware does not report any connected display the system will crash.
See https://github.com/raspberrypi/firmware/issues/1157 for details.

Signed-off-by: Fabian Vogt <fvogt@suse.com>
[mb: update commit message]
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Andre Przywara <andre.przywara@arm.com>
4 years agorockchip: rv1108: Migrate to use common board file
Kever Yang [Mon, 22 Jul 2019 12:02:21 +0000 (20:02 +0800)]
rockchip: rv1108: Migrate to use common board file

Use common board file for board_init() and board_late_init(),
for Rockchip SoCs have very similar process.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorockchip: elgin-rv1108: use board_early_init_f for per-boar init
Kever Yang [Mon, 22 Jul 2019 12:02:20 +0000 (20:02 +0800)]
rockchip: elgin-rv1108: use board_early_init_f for per-boar init

Use board_early_init_f() for per-board init operation and
use board_init() from common board file.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorockchip: rk3399: Migrate to use common board file
Kever Yang [Mon, 22 Jul 2019 12:02:19 +0000 (20:02 +0800)]
rockchip: rk3399: Migrate to use common board file

Use common board file for board_init() and board_late_init(),
for Rockchip SoCs have very similar process.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorockchip: rk3399: init vbus regulator in board_early_init_f()
Kever Yang [Mon, 22 Jul 2019 12:02:18 +0000 (20:02 +0800)]
rockchip: rk3399: init vbus regulator in board_early_init_f()

Handle per-board init in board_early_init_f() and use the
common board_init() for per-platform board init later.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
4 years agorockchip: rk3368: Migrate to use common board file
Kever Yang [Mon, 22 Jul 2019 12:02:17 +0000 (20:02 +0800)]
rockchip: rk3368: Migrate to use common board file

Use common board file for board_init() and board_late_init(),
for Rockchip SoCs have very similar process.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>