summaryrefslogtreecommitdiff
path: root/tools/dtoc/fdt.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/dtoc/fdt.py')
-rw-r--r--tools/dtoc/fdt.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py
index 01e39b8a2a..d36179bad3 100644
--- a/tools/dtoc/fdt.py
+++ b/tools/dtoc/fdt.py
@@ -181,6 +181,14 @@ class Node:
self.subnodes = []
self.props = {}
+ def GetFdt(self):
+ """Get the Fdt object for this node
+
+ Returns:
+ Fdt object
+ """
+ return self._fdt
+
def FindNode(self, name):
"""Find a node given its name
@@ -314,6 +322,17 @@ class Fdt:
with open(self._fname) as fd:
self._fdt_obj = libfdt.Fdt(fd.read())
+ def LookupPhandle(self, phandle):
+ """Look up a phandle
+
+ Args:
+ phandle: Phandle to look up (int)
+
+ Returns:
+ Node object the phandle points to
+ """
+ return self.phandle_to_node.get(phandle)
+
def Scan(self, root='/'):
"""Scan a device tree, building up a tree of Node objects