diff options
author | Simon Glass | 2017-06-18 22:09:03 -0600 |
---|---|---|
committer | Simon Glass | 2017-07-11 10:08:20 -0600 |
commit | fa0ea5b09ead2b0fa17754c0bf99249533fd36a3 (patch) | |
tree | 0a3bafde44f729bc0f7443baf131ea28c5561ecf /tools/dtoc/dtoc.py | |
parent | 56e0bbe0577f33d5bb2486a60267ba759e2ea643 (diff) |
dtoc: Move the main logic into the dtb_platdata file
Collect the main logic of dtoc into a function and put it into
dtb_platdata. This will allow tests to use this function instead of
duplicating the code themselves.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/dtoc.py')
-rwxr-xr-x | tools/dtoc/dtoc.py | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/tools/dtoc/dtoc.py b/tools/dtoc/dtoc.py index 1f17ea47e02..140a19e9d47 100755 --- a/tools/dtoc/dtoc.py +++ b/tools/dtoc/dtoc.py @@ -49,20 +49,5 @@ parser.add_option('-o', '--output', action='store', default='-', help='Select output filename') (options, args) = parser.parse_args() -if not args: - raise ValueError('Please specify a command: struct, platdata') - -plat = dtb_platdata.DtbPlatdata(options.dtb_file, options.include_disabled) -plat.scan_dtb() -plat.scan_tree() -plat.setup_output(options.output) -structs = plat.scan_structs() -plat.scan_phandles() - -for cmd in args[0].split(','): - if cmd == 'struct': - plat.generate_structs(structs) - elif cmd == 'platdata': - plat.generate_tables() - else: - raise ValueError("Unknown command '%s': (use: struct, platdata)" % cmd) +dtb_platdata.run_steps(args, options.dtb_file, options.include_disabled, + options.output) |