mirror of
https://xff.cz/git/u-boot/
synced 2025-11-02 03:17:29 +01:00
dtoc: Check that a parent is not missing
With of-platdata-inst we want to set up a reference to each devices' parent device, if there is one. If we find that the device has a parent (i.e. is not a root node) but it is not in the list of devices being written, then we cannot create the reference. Report an error in this case, since it indicates that the parent node is either missing a compatible string, is disabled, or perhaps does not have any properties because it was not tagged for SPL. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -749,6 +749,15 @@ class DtbPlatdata():
|
||||
break
|
||||
|
||||
if node.parent and node.parent.parent:
|
||||
if node.parent not in self._valid_nodes:
|
||||
# This might indicate that the parent node is not in the
|
||||
# SPL/TPL devicetree but the child is. For example if we are
|
||||
# dealing with of-platdata in TPL, the parent has a
|
||||
# u-boot,dm-tpl tag but the child has u-boot,dm-pre-reloc. In
|
||||
# this case the child node exists in TPL but the parent does
|
||||
# not.
|
||||
raise ValueError("Node '%s' requires parent node '%s' but it is not in the valid list" %
|
||||
(node.path, node.parent.path))
|
||||
self.buf('\t.parent\t\t= DM_DEVICE_REF(%s),\n' %
|
||||
node.parent.var_name)
|
||||
if priv_name:
|
||||
|
||||
Reference in New Issue
Block a user