diff options
author | Simon Glass <sjg@chromium.org> | 2021-01-06 21:35:18 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-01-30 14:25:41 -0700 |
commit | 6eb9932668fa6bd8c659484b2d18d8a73713208c (patch) | |
tree | 6c4b726aaceedc0f28c522457dc14438a86316e9 /tools/dtoc/fdt.py | |
parent | 5af9ebc4bcbcca91b21257c18cb94c78e7356980 (diff) | |
download | u-boot-6eb9932668fa6bd8c659484b2d18d8a73713208c.zip u-boot-6eb9932668fa6bd8c659484b2d18d8a73713208c.tar.gz u-boot-6eb9932668fa6bd8c659484b2d18d8a73713208c.tar.bz2 |
binman: Support alignment of files
When packing files it is sometimes useful to align the start of each file,
e.g. if the flash driver can only access 32-bit-aligned data. Provides a
new property to support this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/fdt.py')
-rw-r--r-- | tools/dtoc/fdt.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py index 965106a..25ce513 100644 --- a/tools/dtoc/fdt.py +++ b/tools/dtoc/fdt.py @@ -463,6 +463,18 @@ class Node: val = bytes(val, 'utf-8') self.AddData(prop_name, val + b'\0') + def AddInt(self, prop_name, val): + """Add a new integer property to a node + + The device tree is marked dirty so that the value will be written to + the blob on the next sync. + + Args: + prop_name: Name of property to add + val: Integer value of property + """ + self.AddData(prop_name, struct.pack('>I', val)) + def AddSubnode(self, name): """Add a new subnode to the node |