]> git.sur5r.net Git - u-boot/blobdiff - tools/binman/entry.py
binman: Add a SetCalculatedProperties() method
[u-boot] / tools / binman / entry.py
index 303c992e3758777387a0807dac5554473c24364a..6a173e663d0fcfc1505e570c8b37dc59ddf71c0f 100644 (file)
@@ -130,6 +130,20 @@ class Entry(object):
         self.align_end = fdt_util.GetInt(self._node, 'align-end')
         self.pos_unset = fdt_util.GetBool(self._node, 'pos-unset')
 
+    def AddMissingProperties(self):
+        """Add new properties to the device tree as needed for this entry"""
+        for prop in ['pos', 'size']:
+            if not prop in self._node.props:
+                self._node.AddZeroProp(prop)
+
+    def SetCalculatedProperties(self):
+        """Set the value of device-tree properties calculated by binman"""
+        self._node.SetInt('pos', self.pos)
+        self._node.SetInt('size', self.size)
+
+    def ProcessFdt(self, fdt):
+        return True
+
     def SetPrefix(self, prefix):
         """Set the name prefix for a node