diff options
author | Simon Glass <sjg@chromium.org> | 2018-09-14 04:57:22 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-09-28 11:09:01 -0600 |
commit | 539aece516d87084437a38d879a1b91c661209f8 (patch) | |
tree | a45acd2eefdd43707b7f5176a1b24e008b8d3668 /tools/binman/state.py | |
parent | f46621d255181bd8d1e8092945ffc66147b88531 (diff) |
binman: Obtain the list of device trees from the config
We always have a device tree for U-Boot proper. But we may also have one
for SPL and TPL. Add a new Entry method to find out what DTs an entry
has, and use that list when updating DTs.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/state.py')
-rw-r--r-- | tools/binman/state.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/tools/binman/state.py b/tools/binman/state.py index 5f25b907b9..600eb86cfe 100644 --- a/tools/binman/state.py +++ b/tools/binman/state.py @@ -18,6 +18,10 @@ fdt_files = {} # Arguments passed to binman to provide arguments to entries entry_args = {} +# True to use fake device-tree files for testing (see U_BOOT_DTB_DATA in +# ftest.py) +use_fake_dtb = True + # Set of all device tree files references by images fdt_set = Set() @@ -85,13 +89,14 @@ def GetEntryArg(name): """ return entry_args.get(name) -def Prepare(dtb): +def Prepare(images, dtb): """Get device tree files ready for use This sets up a set of device tree files that can be retrieved by GetFdts(). At present there is only one, that for U-Boot proper. Args: + images: List of images being used dtb: Main dtb """ global fdt_set, fdt_subset, fdt_files, main_dtb @@ -107,8 +112,19 @@ def Prepare(dtb): main_dtb = dtb fdt_files.clear() fdt_files['u-boot.dtb'] = dtb - fdt_set = Set() fdt_subset = Set() + if not use_fake_dtb: + for image in images.values(): + fdt_subset.update(image.GetFdtSet()) + fdt_subset.discard('u-boot.dtb') + for other_fname in fdt_subset: + infile = tools.GetInputFilename(other_fname) + other_fname_dtb = fdt_util.EnsureCompiled(infile) + out_fname = tools.GetOutputFilename('%s.out' % + os.path.split(other_fname)[1]) + tools.WriteFile(out_fname, tools.ReadFile(other_fname_dtb)) + other_dtb = fdt.FdtScan(out_fname) + fdt_files[other_fname] = other_dtb def GetFdts(): """Yield all device tree files being used by binman |