binman: cbfs: Refactor the init process
authorSimon Glass <sjg@chromium.org>
Tue, 23 Nov 2021 18:03:52 +0000 (11:03 -0700)
committerSimon Glass <sjg@chromium.org>
Thu, 2 Dec 2021 16:16:30 +0000 (09:16 -0700)
Update the constructor to work in the recommended way, where the node
properties are read in a separate function. This makes it more similar to
entry_Section.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/etype/cbfs.py

index 873b199a91da2109113f9325a1fdf64482b5e74b..a5120127059bac8db4e4ff16184239756016662b 100644 (file)
@@ -168,12 +168,16 @@ class Entry_cbfs(Entry):
         from binman import state
 
         super().__init__(section, etype, node)
-        self._cbfs_arg = fdt_util.GetString(node, 'cbfs-arch', 'x86')
         self.align_default = None
         self._entries = OrderedDict()
-        self.ReadEntries()
         self.reader = None
 
+    def ReadNode(self):
+        """Read properties from the atf-fip node"""
+        super().ReadNode()
+        self._cbfs_arg = fdt_util.GetString(self._node, 'cbfs-arch', 'x86')
+        self.ReadEntries()
+
     def ReadEntries(self):
         """Read the subnodes to find out what should go in this CBFS"""
         for node in self._node.subnodes: