]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - tools/dtoc/fdt.py
Merge git://git.denx.de/u-boot-samsung
[people/ms/u-boot.git] / tools / dtoc / fdt.py
index ffd42ce541d1c8945ddd7712a52a1cee818d1063..dbc338653bca6f542f8ab0676f3a1bb76e1a7b3a 100644 (file)
@@ -212,6 +212,10 @@ class Node:
         searching into subnodes so that the entire tree is built.
         """
         self.props = self._fdt.GetProps(self)
+        phandle = self.props.get('phandle')
+        if phandle:
+            val = fdt_util.fdt32_to_cpu(phandle.value)
+            self._fdt.phandle_to_node[val] = self
 
         offset = libfdt.fdt_first_subnode(self._fdt.GetFdt(), self.Offset())
         while offset >= 0:
@@ -263,6 +267,7 @@ class Fdt:
     def __init__(self, fname):
         self._fname = fname
         self._cached_offsets = False
+        self.phandle_to_node = {}
         if self._fname:
             self._fname = fdt_util.EnsureCompiled(self._fname)