dtoc: Support finding the offset of a property
Add a way to find the byte offset of a property within the device tree. This
is only supported with the normal libfdt implementation since fdtget does
not provide this information.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py
index 403eb1f..816fdbe 100644
--- a/tools/dtoc/fdt.py
+++ b/tools/dtoc/fdt.py
@@ -144,6 +144,17 @@
else:
return True
+ def GetOffset(self):
+ """Get the offset of a property
+
+ This can be implemented by subclasses.
+
+ Returns:
+ The offset of the property (struct fdt_property) within the
+ file, or None if not known.
+ """
+ return None
+
class NodeBase:
"""A device tree node