dtoc: Support tracking the phase of U-Boot

U-Boot operates in several phases, typically TPL, SPL and U-Boot proper.
The latter does not use dtoc.

In some rare cases different drivers are used for two phases. For example,
in TPL it may not be necessary to use the full PCI subsystem, so a simple
driver can be used instead.

This works in the build system simply by compiling in one driver or the
other (e.g. PCI driver + uclass for SPL; simple_bus for TPL). But dtoc has
no way of knowing which code is compiled in for which phase, since it does
not inspect Makefiles or dependency graphs.

So to make this work for dtoc, we need to be able to explicitly mark
drivers with their phase. This is done by adding an empty macro to the
driver. Add support for this in dtoc.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/dtoc/main.py b/tools/dtoc/main.py
index 355b1e6..15a8ff1 100755
--- a/tools/dtoc/main.py
+++ b/tools/dtoc/main.py
@@ -85,6 +85,8 @@
                   help='Include disabled nodes')
 parser.add_option('-o', '--output', action='store',
                   help='Select output filename')
+parser.add_option('-p', '--phase', type=str,
+                  help='set phase of U-Boot this invocation is for (spl/tpl)')
 parser.add_option('-P', '--processes', type=int,
                   help='set number of processes to use for running tests')
 parser.add_option('-t', '--test', action='store_true', dest='test',
@@ -104,4 +106,5 @@
 else:
     dtb_platdata.run_steps(args, options.dtb_file, options.include_disabled,
                            options.output,
-                           [options.c_output_dir, options.h_output_dir])
+                           [options.c_output_dir, options.h_output_dir],
+                           phase=options.phase)