diff options
| author | Paul HENRYS <[email protected]> | 2024-11-25 18:51:10 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-12-19 09:10:34 -0600 |
| commit | 9cc36d654c4d25a128a4df310c8176acd1b7db0f (patch) | |
| tree | e9b7f0f5dba6a1977716e7eb7486467ac02f2788 | |
| parent | 1a957ff5d47a1f7e45c30c92da03972ea11409a7 (diff) | |
tools: dtoc: Allow passing optional input directories
An optional list of input directories can be passed to EnsureCompiled() which
allows to pass a list of directories where input files can be searched.
Signed-off-by: Paul HENRYS <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
| -rw-r--r-- | tools/dtoc/fdt_util.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/dtoc/fdt_util.py b/tools/dtoc/fdt_util.py index f1f70568cfe..d5ecc4207d8 100644 --- a/tools/dtoc/fdt_util.py +++ b/tools/dtoc/fdt_util.py @@ -55,7 +55,7 @@ def fdt_cells_to_cpu(val, cells): out = out << 32 | fdt32_to_cpu(val[1]) return out -def EnsureCompiled(fname, tmpdir=None, capture_stderr=False): +def EnsureCompiled(fname, tmpdir=None, capture_stderr=False, indir=None): """Compile an fdt .dts source file into a .dtb binary blob if needed. Args: @@ -63,6 +63,7 @@ def EnsureCompiled(fname, tmpdir=None, capture_stderr=False): left alone tmpdir: Temporary directory for output files, or None to use the tools-module output directory + indir: List of directories where input files can be found Returns: Filename of resulting .dtb file @@ -79,6 +80,8 @@ def EnsureCompiled(fname, tmpdir=None, capture_stderr=False): dtb_output = tools.get_output_filename('source.dtb') search_paths = [os.path.join(os.getcwd(), 'include')] + if indir is not None: + search_paths += indir root, _ = os.path.splitext(fname) cc, args = tools.get_target_compile_tool('cc') args += ['-E', '-P', '-x', 'assembler-with-cpp', '-D__ASSEMBLY__'] |
