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/test_src_scan.py b/tools/dtoc/test_src_scan.py
index d32aa58..0af86dc 100644
--- a/tools/dtoc/test_src_scan.py
+++ b/tools/dtoc/test_src_scan.py
@@ -161,6 +161,10 @@
         prop.value = 'rockchip,rk3288-grf'
         node = FakeNode()
         node.props = {'compatible': prop}
+
+        # get_normalized_compat_name() uses this to check for root node
+        node.parent = FakeNode()
+
         scan = src_scan.Scanner(None, False, None)
         with test_util.capture_sys_output() as (stdout, _):
             name, aliases = scan.get_normalized_compat_name(node)
@@ -419,6 +423,9 @@
         node.name = 'testing'
         node.props = {'compatible': prop}
 
+        # get_normalized_compat_name() uses this to check for root node
+        node.parent = FakeNode()
+
         return scan, drv1, driver2, node
 
     def test_dup_drivers(self):