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

@@ -161,6 +161,10 @@ class TestSrcScan(unittest.TestCase):
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 @@ U_BOOT_DRIVER(%s) = {
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):