aboutsummaryrefslogtreecommitdiff
path: root/tools/dtoc/fdt.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-07-25 18:59:16 -0600
committerSimon Glass <sjg@chromium.org>2016-09-18 21:04:39 -0600
commitbabdbde68f1b993289462394f209f4010c761246 (patch)
tree4f058c7234cbb8ba2400447d9c9f8fabd6d85e8c /tools/dtoc/fdt.py
parentda5f74998b9e5e6b706608a4ca625ef0ee195150 (diff)
downloadu-boot-babdbde68f1b993289462394f209f4010c761246.zip
u-boot-babdbde68f1b993289462394f209f4010c761246.tar.gz
u-boot-babdbde68f1b993289462394f209f4010c761246.tar.bz2
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>
Diffstat (limited to 'tools/dtoc/fdt.py')
-rw-r--r--tools/dtoc/fdt.py11
1 files changed, 11 insertions, 0 deletions
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 @@ class PropBase:
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