summaryrefslogtreecommitdiff
path: root/test/py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-10-20 18:23:20 -0600
committerTom Rini <trini@konsulko.com>2022-10-31 11:04:00 -0400
commit77bec9e3d8bd2dc307447b92a3d5cefd693a62ad (patch)
tree724c085433631e142a56c052d667139cba29b4a6 /test/py
parent7f3470bfaa2fd9f2adaa959ce3af8ecf924f4678 (diff)
downloadu-boot-77bec9e3d8bd2dc307447b92a3d5cefd693a62ad.tar.gz
u-boot-77bec9e3d8bd2dc307447b92a3d5cefd693a62ad.tar.bz2
u-boot-77bec9e3d8bd2dc307447b92a3d5cefd693a62ad.zip
vbe: Add a test for the VBE flow into U-Boot proper
Add a test which checks that VBE boots correctly from TPL through to U-Boot proper. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/py')
-rw-r--r--test/py/tests/test_vbe_vpl.py38
1 files changed, 38 insertions, 0 deletions
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'