mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
binman: Add a SetCalculatedProperties() method
Once binman has packed the image, the position and size of each entry is known. It is then possible for binman to update the device tree with these positions. Since placeholder values have been added, this does not affect the size of the device tree and therefore the packing does not need to be performed again. Add a new SetCalculatedProperties method to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@ -130,6 +130,17 @@ 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
|
||||
|
||||
|
Reference in New Issue
Block a user