summaryrefslogtreecommitdiffstats
path: root/tools/dtoc/fdt_normal.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-07-25 18:59:10 -0600
committerSimon Glass <sjg@chromium.org>2016-09-18 21:04:39 -0600
commit355c67c35a8ce5aa9e9e2e2e8df99413c8215093 (patch)
tree3dcdace42cd5f60bfd5c24b200b89f8eb12836f2 /tools/dtoc/fdt_normal.py
parent0faf6144fd1f6443a52abb0d80a6ca1238ecc029 (diff)
downloadu-boot-355c67c35a8ce5aa9e9e2e2e8df99413c8215093.tar.gz
u-boot-355c67c35a8ce5aa9e9e2e2e8df99413c8215093.tar.xz
u-boot-355c67c35a8ce5aa9e9e2e2e8df99413c8215093.zip
dtoc: Allow the device tree to be compiled from source
If a source device tree is provide to the Fdt() constructors, compile it automatically. This will be used in tests, where we want to build a particular test .dts file and check that it works correctly in binman. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/fdt_normal.py')
-rw-r--r--tools/dtoc/fdt_normal.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/dtoc/fdt_normal.py b/tools/dtoc/fdt_normal.py
index 861f60c7d0..d9ba4aca80 100644
--- a/tools/dtoc/fdt_normal.py
+++ b/tools/dtoc/fdt_normal.py
@@ -83,8 +83,11 @@ class FdtNormal(Fdt):
"""
def __init__(self, fname):
Fdt.__init__(self, fname)
- with open(self._fname) as fd:
- self._fdt = fd.read()
+ if self._fname:
+ self._fname = fdt_util.EnsureCompiled(self._fname)
+
+ with open(self._fname) as fd:
+ self._fdt = fd.read()
def GetFdt(self):
"""Get the contents of the FDT