summaryrefslogtreecommitdiff
path: root/tools/dtoc/fdt_fallback.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-07-25 18:59:14 -0600
committerSimon Glass <sjg@chromium.org>2016-09-18 21:04:39 -0600
commit2a70d897ed68fd521411a10831ac05e1ffdd3d41 (patch)
treee3923ef5b91172f52da3627b6370e9fbee6b5bc2 /tools/dtoc/fdt_fallback.py
parent0170804f60b19a2033ac39964fcd192a0c7eda42 (diff)
downloadu-boot-imx-2a70d897ed68fd521411a10831ac05e1ffdd3d41.zip
u-boot-imx-2a70d897ed68fd521411a10831ac05e1ffdd3d41.tar.gz
u-boot-imx-2a70d897ed68fd521411a10831ac05e1ffdd3d41.tar.bz2
dtoc: Support deleting device tree properties
Add support for deleting a device tree property. With the fallback implementation this uses fdtput. With libfdt it uses the API call and updates the offsets afterwards. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/fdt_fallback.py')
-rw-r--r--tools/dtoc/fdt_fallback.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/dtoc/fdt_fallback.py b/tools/dtoc/fdt_fallback.py
index 1c8c9c7..0c0ebbc 100644
--- a/tools/dtoc/fdt_fallback.py
+++ b/tools/dtoc/fdt_fallback.py
@@ -70,6 +70,19 @@ class Node(NodeBase):
node.Scan()
+ def DeleteProp(self, prop_name):
+ """Delete a property of a node
+
+ The property is deleted using fdtput.
+
+ Args:
+ prop_name: Name of the property to delete
+ Raises:
+ CommandError if the property does not exist
+ """
+ args = [self._fdt._fname, '-d', self.path, prop_name]
+ command.Output('fdtput', *args)
+ del self.props[prop_name]
class FdtFallback(Fdt):
"""Provides simple access to a flat device tree blob using fdtget/fdtput