diff options
author | Tom Rini <trini@konsulko.com> | 2018-08-03 10:08:13 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-08-03 10:08:13 -0400 |
commit | a30691a538b0894dfc0076150b8a3a7326b9e45a (patch) | |
tree | 2d12b0e66b9baa83199c74b5d9b392e09b529f79 /tools/dtoc/fdt.py | |
parent | a839c3641e4de98981695056eeeb2ec17ba1a4ab (diff) | |
parent | cee02e6ff422fdb8b543a8097b84a9682785f46d (diff) |
Merge git://git.denx.de/u-boot-dm
Diffstat (limited to 'tools/dtoc/fdt.py')
-rw-r--r-- | tools/dtoc/fdt.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py index 9d69b426c14..d36179bad36 100644 --- a/tools/dtoc/fdt.py +++ b/tools/dtoc/fdt.py @@ -181,7 +181,15 @@ class Node: self.subnodes = [] self.props = {} - def _FindNode(self, name): + 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 Args: @@ -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 @@ -349,7 +368,7 @@ class Fdt: if len(parts) < 2: return None for part in parts[1:]: - node = node._FindNode(part) + node = node.FindNode(part) if not node: return None return node |