diff options
author | Tom Rini <trini@konsulko.com> | 2022-10-31 14:43:04 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-10-31 14:43:04 -0400 |
commit | a90afc6730e6c67ad37f4c98a02891a93b4ff971 (patch) | |
tree | 724c085433631e142a56c052d667139cba29b4a6 /test/py | |
parent | 6f38d91158e7e4199753b79e0a25c1a65175aba4 (diff) | |
parent | 77bec9e3d8bd2dc307447b92a3d5cefd693a62ad (diff) |
Merge branch '2022-10-31-vbe-implement-the-full-firmware-flow'
To quote Simon:
This series provides an implementation of VBE from TPL through to U-Boot
proper, using VBE to load the relevant firmware stages. It buils a single
image.bin file containing all the phases:
TPL - initial phase, loads VPL using binman symbols
VPL - main firmware phase, loads SPL using VBE parameters
SPL - loads U-Boot proper using VBE parameters
U-Boot - final firmware phase, where OS booting is processed
This series does not include the OS-booting phase. That will be the
subject of a future series.
The implementation is entirely handled by sandbox. It should be possible
to enable this on a real board without much effort, but that is also the
subject of a future series.
Diffstat (limited to 'test/py')
-rw-r--r-- | test/py/conftest.py | 8 | ||||
-rw-r--r-- | test/py/tests/test_event_dump.py | 4 | ||||
-rw-r--r-- | test/py/tests/test_vbe.py | 7 | ||||
-rw-r--r-- | test/py/tests/test_vbe_vpl.py | 38 |
4 files changed, 49 insertions, 8 deletions
diff --git a/test/py/conftest.py b/test/py/conftest.py index 304e93164a..fc9dd3a83f 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -289,7 +289,13 @@ def generate_ut_subtest(metafunc, fixture_name, sym_path): m = re_ut_test_list.search(l) if not m: continue - vals.append(m.group(1) + ' ' + m.group(2)) + suite, name = m.groups() + + # Tests marked with _norun should only be run manually using 'ut -f' + if name.endswith('_norun'): + continue + + vals.append(f'{suite} {name}') ids = ['ut_' + s.replace(' ', '_') for s in vals] metafunc.parametrize(fixture_name, vals, ids=ids) diff --git a/test/py/tests/test_event_dump.py b/test/py/tests/test_event_dump.py index 674df2ea00..1a46ca30f4 100644 --- a/test/py/tests/test_event_dump.py +++ b/test/py/tests/test_event_dump.py @@ -16,7 +16,7 @@ def test_event_dump(u_boot_console): out = util.run_and_log(cons, ['scripts/event_dump.py', sandbox]) expect = '''.*Event type Id Source location -------------------- ------------------------------ ------------------------------ -EVT_FT_FIXUP bootmeth_vbe_ft_fixup .*vbe_fixup.c:.* -EVT_FT_FIXUP bootmeth_vbe_simple_ft_fixup .*vbe_simple.c:.* +EVT_FT_FIXUP bootmeth_vbe_ft_fixup .*vbe_request.c:.* +EVT_FT_FIXUP bootmeth_vbe_simple_ft_fixup .*vbe_simple_os.c:.* EVT_MISC_INIT_F sandbox_misc_init_f .*start.c:''' assert re.match(expect, out, re.MULTILINE) is not None diff --git a/test/py/tests/test_vbe.py b/test/py/tests/test_vbe.py index 559c291886..50b6c1cd91 100644 --- a/test/py/tests/test_vbe.py +++ b/test/py/tests/test_vbe.py @@ -85,7 +85,7 @@ bootm loados bootm prep fdt addr fdt print -ut bootstd vbe_test_fixup +ut bootstd -f vbe_test_fixup_norun ''' @pytest.mark.boardspec('sandbox_flattree') @@ -117,7 +117,4 @@ def test_vbe(u_boot_console): with cons.log.section('Kernel load'): output = cons.run_command_list(cmd.splitlines()) - # This is a little wonky since there are two tests running in CI. The final - # one is the 'ut bootstd' command above - failures = [line for line in output if 'Failures' in line] - assert len(failures) >= 1 and 'Failures: 0' in failures[-1] + assert 'Failures: 0' in output[-1] diff --git a/test/py/tests/test_vbe_vpl.py b/test/py/tests/test_vbe_vpl.py new file mode 100644 index 0000000000..d1c9d0548a --- /dev/null +++ b/test/py/tests/test_vbe_vpl.py @@ -0,0 +1,38 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright 2022 Google LLC +# +# Test addition of VBE + +import os + +import pytest +import u_boot_utils + +@pytest.mark.boardspec('sandbox_vpl') +@pytest.mark.requiredtool('dtc') +def test_vbe_vpl(u_boot_console): + cons = u_boot_console + #cmd = [cons.config.build_dir + fname, '-v'] + ram = os.path.join(cons.config.build_dir, 'ram.bin') + fdt = os.path.join(cons.config.build_dir, 'arch/sandbox/dts/test.dtb') + + # Enable firmware1 and the mmc that it uses. These are needed for the full + # VBE flow. + u_boot_utils.run_and_log( + cons, f'fdtput -t s {fdt} /bootstd/firmware0 status disabled') + u_boot_utils.run_and_log( + cons, f'fdtput -t s {fdt} /bootstd/firmware1 status okay') + u_boot_utils.run_and_log( + cons, f'fdtput -t s {fdt} /mmc3 status okay') + + # Remove any existing RAM file, so we don't have old data present + if os.path.exists(ram): + os.remove(ram) + flags = ['-p', os.path.join(cons.config.build_dir, 'image.bin'), '-w', + '-s', 'state.dtb'] + cons.restart_uboot_with_flags(flags) + + # Make sure that VBE was used in both VPL (to load SPL) and SPL (to load + # U-Boot + output = cons.run_command('vbe state') + assert output == 'Phases: VPL SPL' |