diff options
author | Simon Glass <sjg@chromium.org> | 2018-07-06 10:27:40 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2018-07-09 09:11:00 -0600 |
commit | ecab89737a4eb58c043388b1ca1c0f1dfdaa3346 (patch) | |
tree | e4cdc99478b084d017cb359f2025e7e2d7088ef3 /tools/binman/bsection.py | |
parent | 0a4357c4c2b29d787d70775dd6ad64b50e23082a (diff) |
binman: Add a ProcessFdt() method
Some entry types modify the device tree, e.g. to remove microcode or add a
property. So far this just modifies their local copy and does not affect
a 'shared' device tree.
Rather than doing this modification in the ObtainContents() method, and a
new ProcessFdt() method which is specifically designed to modify this
shared device tree.
Move the existing device-tree code over to use this method, reducing
ObtainContents() to the goal of just obtaining the contents without any
processing, even for device tree.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/bsection.py')
-rw-r--r-- | tools/binman/bsection.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/binman/bsection.py b/tools/binman/bsection.py index 06a6711350..3ed361d69a 100644 --- a/tools/binman/bsection.py +++ b/tools/binman/bsection.py @@ -90,6 +90,21 @@ class Section(object): entry.SetPrefix(self._name_prefix) self._entries[node.name] = entry + 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 |