#!/usr/bin/python
+# SPDX-License-Identifier: GPL-2.0+
#
# Copyright (C) 2016 Google, Inc
# Written by Simon Glass <sjg@chromium.org>
#
-# SPDX-License-Identifier: GPL-2.0+
-#
import struct
import sys
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:
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)