summaryrefslogtreecommitdiff
path: root/tools/dtoc/dtb_platdata.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-02-03 06:01:11 -0700
committerSimon Glass <sjg@chromium.org>2021-03-22 19:23:27 +1300
commit50aae3e62d57931afcafec7eb973f222cb3131c7 (patch)
tree3134e1b2b7911642191b5bb3f2d8b318853a004d /tools/dtoc/dtb_platdata.py
parent337d6972f5f5294971db52809f83c0454cb4e7ba (diff)
dtoc: Support processing the root node
The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/dtb_platdata.py')
-rw-r--r--tools/dtoc/dtb_platdata.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index af21156659b..e08b92cf8a3 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -350,16 +350,22 @@ class DtbPlatdata():
# recurse to handle any subnodes
self.scan_node(subnode, valid_nodes)
- def scan_tree(self):
+ def scan_tree(self, add_root):
"""Scan the device tree for useful information
This fills in the following properties:
_valid_nodes_unsorted: A list of nodes we wish to consider include
in the platform data (in devicetree node order)
_valid_nodes: Sorted version of _valid_nodes_unsorted
+
+ Args:
+ add_root: True to add the root node also (which wouldn't normally
+ be added as it may not have a compatible string)
"""
root = self._fdt.GetRoot()
valid_nodes = []
+ if add_root:
+ valid_nodes.append(root)
self.scan_node(root, valid_nodes)
self._valid_nodes_unsorted = valid_nodes
self._valid_nodes = sorted(valid_nodes,
@@ -839,7 +845,7 @@ def run_steps(args, dtb_file, include_disabled, output, output_dirs, phase,
do_process = False
plat = DtbPlatdata(scan, dtb_file, include_disabled)
plat.scan_dtb()
- plat.scan_tree()
+ plat.scan_tree(add_root=False)
plat.prepare_nodes()
plat.scan_reg_sizes()
plat.setup_output_dirs(output_dirs)