1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-29 22:41:17 +02:00

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>
This commit is contained in:
Simon Glass
2021-02-03 06:01:11 -07:00
parent 337d6972f5
commit 50aae3e62d
4 changed files with 58 additions and 19 deletions

View File

@@ -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)