diff options
author | Simon Glass <sjg@chromium.org> | 2016-07-25 18:59:15 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-09-18 21:04:39 -0600 |
commit | da5f74998b9e5e6b706608a4ca625ef0ee195150 (patch) | |
tree | 2c628a3eafc53e5976da64efef57569462595ab5 /tools/dtoc/fdt.py | |
parent | 2a70d897ed68fd521411a10831ac05e1ffdd3d41 (diff) |
dtoc: Support packing the device tree
After any node/property deletion the device tree can be packed to remove
spare space. Add a way to perform this operation.
Note that for fdt_fallback, fdtput automatically packs the device tree after
deletion, so no action is required here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/fdt.py')
-rw-r--r-- | tools/dtoc/fdt.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py index f01c7b18ea..403eb1fe6d 100644 --- a/tools/dtoc/fdt.py +++ b/tools/dtoc/fdt.py @@ -240,3 +240,19 @@ class Fdt: return None return node + def Flush(self): + """Flush device tree changes back to the file + + If the device tree has changed in memory, write it back to the file. + Subclasses can implement this if needed. + """ + pass + + def Pack(self): + """Pack the device tree down to its minimum size + + When nodes and properties shrink or are deleted, wasted space can + build up in the device tree binary. Subclasses can implement this + to remove that spare space. + """ + pass |