Commit Graph

14 Commits

Author SHA1 Message Date
Simon Glass
34861d506c binman: Use super() instead of specifying parent type
It is easier and less error-prone to use super() when the parent type is
needed. Update binman to remove the type names.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-25 14:46:57 -06:00
Tom Rini
7208396bbf Revert "Merge tag 'dm-pull-20jul20' of git://git.denx.de/u-boot-dm"
This reverts commit 5d3a21df66, reversing
changes made to 56d37f1c56.

Unfortunately this is causing CI failures:
https://travis-ci.org/github/trini/u-boot/jobs/711313649

Signed-off-by: Tom Rini <trini@konsulko.com>
2020-07-24 08:42:06 -04:00
Simon Glass
1216448573 binman: Use super() instead of specifying parent type
It is easier and less error-prone to use super() when the parent type is
needed. Update binman to remove the type names.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20 11:37:47 -06:00
Simon Glass
16287933a8 binman: Move to absolute imports
At present binman sets the python path on startup so that it can access
the libraries it needs. If we convert to use absolute imports this is not
necessary.

Move binman to use absolute imports. This enables removable of the path
adjusting in Entry also.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26 14:25:21 -06:00
Simon Glass
8dbb7444eb binman: Allow use of help and entry-docs without libfdt
At present if libfdt is not available binman can't do anything much.
Improve the situation a little.

Ideally there should be a test to cover this, but I'm not quite sure how
to fake this.

Signed-off-by: Simon Glass <sjg@chromium.org>
(fixed up missing ReadChildData() enty test)
2019-10-15 08:40:02 -06:00
Simon Glass
f6e02497ae 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>
2019-07-29 09:38:06 -06:00
Simon Glass
fb5e8b163e 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>
2019-07-29 09:38:05 -06:00
Simon Glass
4bdd30055c 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>
2019-07-29 09:38:05 -06:00
Simon Glass
a8adb6dfeb 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>
2019-07-29 09:38:05 -06:00
Simon Glass
935461262e 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>
2019-07-29 09:38:05 -06:00
Simon Glass
6c223fda1e binman: Allow device-tree entries to be compressed
At present the logic skips the blob class' handling of compression, so
this is not supported with device tree entries. Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24 12:54:08 -07:00
Simon Glass
a0dcaf2049 binman: Add a return value to ProcessContentsUpdate()
At present if this function tries to update the contents such that the
size changes, it raises an error. We plan to add the ability to change
the size of entries after packing is completed, since in some cases it is
not possible to determine the size in advance.

An example of this is with a compressed device tree, where the values
of the device tree change in SetCalculatedProperties() or
ProcessEntryContents(). While the device tree itself does not change size,
since placeholders for any new properties have already bee added by
AddMissingProperties(), we cannot predict the size of the device tree
after compression. If a value changes from 0 to 0x1234 (say), then the
compressed device tree may expand.

As a first step towards supporting this, make ProcessContentsUpdate()
return a value indicating whether the content size is OK. For now this is
always True (since otherwise binman raises an error), but later patches
will adjust this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24 12:54:08 -07:00
Simon Glass
7f9e00a2a6 binman: Call ProcessUpdateContents() consistently
SetContents() should only be called to set the contents of an entry from
within the ObtainContents() call, since it has no guard against increasing
the size of the contents, thus triggering incorrect operation.

Change all such calls to use ProcessUpdateContents() instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24 12:54:08 -07:00
Simon Glass
6ed45ba0a8 binman: Support updating all device tree files
Binman currently supports updating the main device tree with things like
the position of each entry. Extend this support to SPL and TPL as well,
since they may need (a subset of) this information.

Also adjust DTB output files to have a .out extension since this seems
clearer than having a .dtb extension with 'out' in the name somwhere.

Also add a few missing comments and update the DT setup code to use
ReadFile and WriteFile().

Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28 11:09:01 -06:00