summaryrefslogtreecommitdiff
path: root/tools/dtoc/test_dtoc.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-02-03 16:01:02 +0300
committerSimon Glass <sjg@chromium.org>2021-03-22 09:23:27 +0300
commitb00f0066e52413e0f8fd4a84681e6e27c4270c26 (patch)
treede41f3fc135501b607ad5790b03dc27c63e32e5d /tools/dtoc/test_dtoc.py
parentb9319c4f9b103b6c5b10e8592471a29bd9645caf (diff)
downloadu-boot-b00f0066e52413e0f8fd4a84681e6e27c4270c26.tar.xz
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>
Diffstat (limited to 'tools/dtoc/test_dtoc.py')
-rwxr-xr-xtools/dtoc/test_dtoc.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py
index d90ece205d..c1fafb656f 100755
--- a/tools/dtoc/test_dtoc.py
+++ b/tools/dtoc/test_dtoc.py
@@ -138,8 +138,8 @@ class TestDtoc(unittest.TestCase):
dtb_file (str): Filename of .dtb file
output (str): Filename of output file
"""
- dtb_platdata.run_steps(args, dtb_file, False, output, [], True,
- None, None, scan=copy_scan())
+ dtb_platdata.run_steps(args, dtb_file, False, output, [], None,
+ warning_disabled=True, scan=copy_scan())
def test_name(self):
"""Test conversion of device tree names to C identifiers"""
@@ -365,7 +365,7 @@ U_BOOT_DRVINFO(gpios_at_0) = {
output = tools.GetOutputFilename('output')
with test_util.capture_sys_output() as _:
dtb_platdata.run_steps(['struct'], dtb_file, False, output, [],
- scan=copy_scan())
+ None, scan=copy_scan())
with open(output) as infile:
data = infile.read()
self._check_strings(HEADER + '''
@@ -375,7 +375,7 @@ struct dtd_invalid {
with test_util.capture_sys_output() as _:
dtb_platdata.run_steps(['platdata'], dtb_file, False, output, [],
- scan=copy_scan())
+ None, scan=copy_scan())
with open(output) as infile:
data = infile.read()
self._check_strings(C_HEADER + '''
@@ -927,8 +927,8 @@ U_BOOT_DRVINFO(spl_test2) = {
def test_output_conflict(self):
"""Test a conflict between and output dirs and output file"""
with self.assertRaises(ValueError) as exc:
- dtb_platdata.run_steps(['all'], None, False, 'out', ['cdir'], True,
- scan=copy_scan())
+ dtb_platdata.run_steps(['all'], None, False, 'out', ['cdir'], None,
+ warning_disabled=True, scan=copy_scan())
self.assertIn("Must specify either output or output_dirs, not both",
str(exc.exception))
@@ -944,8 +944,8 @@ U_BOOT_DRVINFO(spl_test2) = {
fnames = glob.glob(outdir + '/*')
self.assertEqual(2, len(fnames))
- dtb_platdata.run_steps(['all'], dtb_file, False, None, [outdir], True,
- scan=copy_scan())
+ dtb_platdata.run_steps(['all'], dtb_file, False, None, [outdir], None,
+ warning_disabled=True, scan=copy_scan())
fnames = glob.glob(outdir + '/*')
self.assertEqual(4, len(fnames))