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>
diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index af21156..e08b92c 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -350,16 +350,22 @@
             # 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 @@
         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)