diff options
author | Simon Glass <sjg@chromium.org> | 2019-07-20 12:23:31 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2019-07-29 09:38:05 -0600 |
commit | 4bdd30055ca3a9096f462177758b97e55c15f1e7 (patch) | |
tree | 82a457491e4be44ee87e32ff890b681f4a7a600f /tools/binman/state.py | |
parent | 726e2961291dec2c46d773866c5923210c3bac0f (diff) |
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>
Diffstat (limited to 'tools/binman/state.py')
-rw-r--r-- | tools/binman/state.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/binman/state.py b/tools/binman/state.py index c8175a30334..ee11ba470e0 100644 --- a/tools/binman/state.py +++ b/tools/binman/state.py @@ -22,7 +22,10 @@ entry_args = {} # ftest.py) use_fake_dtb = False -# Dict of device trees, keyed by filename, but excluding the main one +# Dict of device trees, keyed by entry type, but excluding the main one +# The value is as returned by Entry.GetFdts(), i.e. a tuple: +# Fdt object for this dtb, or None if not available +# Filename of file containing this dtb fdt_subset = {} # The DTB which contains the full image information @@ -142,9 +145,10 @@ def Prepare(images, dtb): if not use_fake_dtb: for image in images.values(): fdt_subset.update(image.GetFdts()) - if 'u-boot.dtb' in fdt_subset: - del fdt_subset['u-boot.dtb'] - for other_fname in fdt_subset: + if 'u-boot-dtb' in fdt_subset: + del fdt_subset['u-boot-dtb'] + for etype, other in fdt_subset.items(): + _, other_fname = other infile = tools.GetInputFilename(other_fname) other_fname_dtb = fdt_util.EnsureCompiled(infile) out_fname = tools.GetOutputFilename('%s.out' % @@ -160,7 +164,7 @@ def GetAllFdts(): Device trees being used (U-Boot proper, SPL, TPL) """ yield main_dtb - for other_fname in fdt_subset: + for etype, other_fname in fdt_subset.values(): yield fdt_files[other_fname] def GetUpdateNodes(node): |