self.out(''.join(self.get_buf()))
-def run_steps(args, dtb_file, include_disabled, output, warning_disabled=False,
- drivers_additional=None):
+
+def run_steps(args, dtb_file, include_disabled, output, output_dirs,
+ warning_disabled=False, drivers_additional=None):
"""Run all the steps of the dtoc tool
Args:
dtb_file (str): Filename of dtb file to process
include_disabled (bool): True to include disabled nodes
output (str): Name of output file (None for stdout)
+ output_dirs (tuple of str):
+ Directory to put C output files
+ Directory to put H output files
warning_disabled (bool): True to avoid showing warnings about missing
drivers
drivers_additional (list): List of additional drivers to use during
parser = OptionParser()
parser.add_option('-B', '--build-dir', type='string', default='b',
help='Directory containing the build output')
+parser.add_option('-c', '--c-output-dir', action='store',
+ help='Select output directory for C files')
+parser.add_option('-C', '--h-output-dir', action='store',
+ help='Select output directory for H files (defaults to --c-output-di)')
parser.add_option('-d', '--dtb-file', action='store',
help='Specify the .dtb input file')
parser.add_option('--include-disabled', action='store_true',
else:
dtb_platdata.run_steps(args, options.dtb_file, options.include_disabled,
- options.output)
+ options.output,
+ [options.c_output_dir, options.h_output_dir])
dtb_file (str): Filename of .dtb file
output (str): Filename of output file
"""
- dtb_platdata.run_steps(args, dtb_file, False, output, True)
+ dtb_platdata.run_steps(args, dtb_file, False, output, [], True)
def test_name(self):
"""Test conversion of device tree names to C identifiers"""
dtb_file = get_dtb_file('dtoc_test_invalid_driver.dts')
output = tools.GetOutputFilename('output')
with test_util.capture_sys_output() as _:
- dtb_platdata.run_steps(['struct'], dtb_file, False, output)
+ dtb_platdata.run_steps(['struct'], dtb_file, False, output, [])
with open(output) as infile:
data = infile.read()
self._check_strings(HEADER + '''
''', data)
with test_util.capture_sys_output() as _:
- dtb_platdata.run_steps(['platdata'], dtb_file, False, output)
+ dtb_platdata.run_steps(['platdata'], dtb_file, False, output, [])
with open(output) as infile:
data = infile.read()
self._check_strings(C_HEADER + '''
"""Test that phandle targets are generated when unsing cd-gpios"""
dtb_file = get_dtb_file('dtoc_test_phandle_cd_gpios.dts')
output = tools.GetOutputFilename('output')
- dtb_platdata.run_steps(['platdata'], dtb_file, False, output, True)
+ dtb_platdata.run_steps(['platdata'], dtb_file, False, output, [], True)
with open(output) as infile:
data = infile.read()
self._check_strings(C_HEADER + '''
output = tools.GetOutputFilename('output')
with test_util.capture_sys_output() as _:
dtb_platdata.run_steps(
- ['struct'], dtb_file, False, output, True,
+ ['struct'], dtb_file, False, output, [], True,
[None, '', 'tools/dtoc/dtoc_test_scan_drivers.cxx'])
@staticmethod
fout.write(b'\x81')
with test_util.capture_sys_output() as _:
- dtb_platdata.run_steps(['struct'], dtb_file, False, output, True,
- [driver_fn])
+ dtb_platdata.run_steps(['struct'], dtb_file, False, output, [],
+ True, [driver_fn])
def test_driver(self):
"""Test the Driver class"""