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
+ value: Tuple:
+ Fdt object for this dtb, or None if not available
+ Filename of file containing this dtb
"""
return {}
base_entry = entry.Entry(None, None, None, read_node=False)
self.assertIsNone(base_entry.GetDefaultFilename())
+ def testBlobFdt(self):
+ """Test the GetFdtEtype() method of the blob-dtb entries"""
+ base = entry.Entry.Create(None, self.GetNode(), 'blob-dtb')
+ self.assertIsNone(base.GetFdtEtype())
+
+ dtb = entry.Entry.Create(None, self.GetNode(), 'u-boot-dtb')
+ self.assertEqual('u-boot-dtb', dtb.GetFdtEtype())
+
+
if __name__ == "__main__":
unittest.main()
data = self.CompressData(indata)
return self.ProcessContentsUpdate(data)
+ def GetFdtEtype(self):
+ """Get the entry type of this device tree
+
+ This can be 'u-boot-dtb', 'u-boot-spl-dtb' or 'u-boot-tpl-dtb'
+ Returns:
+ Entry type if any, e.g. 'u-boot-dtb'
+ """
+ return None
+
def GetFdts(self):
"""Get the device trees used by this entry
Returns:
Dict:
key: Filename from this entry (without the path)
- value: Fdt object for this dtb, or None if not available
+ value: Tuple:
+ Fdt object for this dtb, or None if not available
+ Filename of file containing this dtb
"""
- return {self.GetDefaultFilename(): None}
+ fname = self.GetDefaultFilename()
+ return {self.GetFdtEtype(): [self, fname]}
def GetDefaultFilename(self):
return 'u-boot.dtb'
+
+ def GetFdtEtype(self):
+ return 'u-boot-dtb'
def GetDefaultFilename(self):
return 'u-boot.dtb'
+ def GetFdtEtype(self):
+ return 'u-boot-dtb'
+
def ProcessFdt(self, fdt):
# So the module can be loaded without it
import fdt
def GetDefaultFilename(self):
return 'spl/u-boot-spl.dtb'
+
+ def GetFdtEtype(self):
+ return 'u-boot-spl-dtb'
def GetDefaultFilename(self):
return 'tpl/u-boot-tpl.dtb'
+
+ def GetFdtEtype(self):
+ return 'u-boot-tpl-dtb'
def GetDefaultFilename(self):
return 'tpl/u-boot-tpl.dtb'
+
+ def GetFdtEtype(self):
+ return 'u-boot-tpl-dtb'
# 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
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' %
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):