def GetDefaultFilename(self):
return None
- def GetFdtSet(self):
- """Get the set of device trees used by this entry
+ def GetFdts(self):
+ """Get the device trees used by this entry
Returns:
- Set containing the filename from this entry, if it is a .dtb, else
- an empty set
+ Empty dict, if this entry is not a .dtb, otherwise:
+ Dict:
+ key: Filename from this entry (without the path)
+ value: Fdt object for this dtb, or None if not available
"""
- return set()
+ return {}
def ExpandEntries(self):
pass
data = self.CompressData(indata)
return self.ProcessContentsUpdate(data)
- def GetFdtSet(self):
- """Get the set of device trees used by this entry
+ def GetFdts(self):
+ """Get the device trees used by this entry
Returns:
- Set containing the filename from this entry
+ Dict:
+ key: Filename from this entry (without the path)
+ value: Fdt object for this dtb, or None if not available
"""
- fname = self.GetDefaultFilename()
- return set([fname])
+ return {self.GetDefaultFilename(): None}
entry.SetPrefix(self._name_prefix)
self._entries[node.name] = entry
- def GetFdtSet(self):
- fdt_set = set()
+ def GetFdts(self):
+ fdts = {}
for entry in self._entries.values():
- fdt_set.update(entry.GetFdtSet())
- return fdt_set
+ fdts.update(entry.GetFdts())
+ return fdts
def ProcessFdt(self, fdt):
"""Allow entries to adjust the device tree
# ftest.py)
use_fake_dtb = False
-# Set of all device tree files references by images
-fdt_set = set()
-
-# Same as above, but excluding the main one
-fdt_subset = set()
+# Dict of device trees, keyed by filename, but excluding the main one
+fdt_subset = {}
# The DTB which contains the full image information
main_dtb = None
main_dtb = dtb
fdt_files.clear()
fdt_files['u-boot.dtb'] = dtb
- fdt_subset = set()
+ fdt_subset = {}
if not use_fake_dtb:
for image in images.values():
- fdt_subset.update(image.GetFdtSet())
- fdt_subset.discard('u-boot.dtb')
+ fdt_subset.update(image.GetFdts())
+ if 'u-boot.dtb' in fdt_subset:
+ del fdt_subset['u-boot.dtb']
for other_fname in fdt_subset:
infile = tools.GetInputFilename(other_fname)
other_fname_dtb = fdt_util.EnsureCompiled(infile)