]> git.sur5r.net Git - u-boot/blobdiff - tools/binman/bsection.py
binman: Add a SetCalculatedProperties() method
[u-boot] / tools / binman / bsection.py
index 3f30f6e4fe7da30c3191a886db05ff955a68200f..de439ef625fcb894f547e034be8510545aa60d40 100644 (file)
@@ -90,6 +90,29 @@ class Section(object):
             entry.SetPrefix(self._name_prefix)
             self._entries[node.name] = entry
 
+    def AddMissingProperties(self):
+        for entry in self._entries.values():
+            entry.AddMissingProperties()
+
+    def SetCalculatedProperties(self):
+        for entry in self._entries.values():
+            entry.SetCalculatedProperties()
+
+    def ProcessFdt(self, fdt):
+        todo = self._entries.values()
+        for passnum in range(3):
+            next_todo = []
+            for entry in todo:
+                if not entry.ProcessFdt(fdt):
+                    next_todo.append(entry)
+            todo = next_todo
+            if not todo:
+                break
+        if todo:
+            self._Raise('Internal error: Could not complete processing of Fdt: '
+                        'remaining %s' % todo)
+        return True
+
     def CheckSize(self):
         """Check that the section contents does not exceed its size, etc."""
         contents_size = 0
@@ -162,6 +185,10 @@ class Section(object):
             todo = next_todo
             if not todo:
                 break
+        if todo:
+            self._Raise('Internal error: Could not complete processing of '
+                        'contents: remaining %s' % todo)
+        return True
 
     def _SetEntryPosSize(self, name, pos, size):
         """Set the position and size of an entry