aboutsummaryrefslogtreecommitdiff
path: root/test/py/tests
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-10-31 14:43:04 -0400
committerTom Rini <trini@konsulko.com>2022-10-31 14:43:04 -0400
commita90afc6730e6c67ad37f4c98a02891a93b4ff971 (patch)
tree724c085433631e142a56c052d667139cba29b4a6 /test/py/tests
parent6f38d91158e7e4199753b79e0a25c1a65175aba4 (diff)
parent77bec9e3d8bd2dc307447b92a3d5cefd693a62ad (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/tests')
-rw-r--r--test/py/tests/test_event_dump.py4
-rw-r--r--test/py/tests/test_vbe.py7
-rw-r--r--test/py/tests/test_vbe_vpl.py38
3 files changed, 42 insertions, 7 deletions
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'