blob: d1c9d0548ae098078ae708d3ed8b1cf1ff46ab84 [file] [log] [blame]
Simon Glassf1eba352022-10-20 18:23:20 -06001# SPDX-License-Identifier: GPL-2.0+
2# Copyright 2022 Google LLC
3#
4# Test addition of VBE
5
6import os
7
8import pytest
9import u_boot_utils
10
11@pytest.mark.boardspec('sandbox_vpl')
12@pytest.mark.requiredtool('dtc')
13def test_vbe_vpl(u_boot_console):
14 cons = u_boot_console
15 #cmd = [cons.config.build_dir + fname, '-v']
16 ram = os.path.join(cons.config.build_dir, 'ram.bin')
17 fdt = os.path.join(cons.config.build_dir, 'arch/sandbox/dts/test.dtb')
18
19 # Enable firmware1 and the mmc that it uses. These are needed for the full
20 # VBE flow.
21 u_boot_utils.run_and_log(
22 cons, f'fdtput -t s {fdt} /bootstd/firmware0 status disabled')
23 u_boot_utils.run_and_log(
24 cons, f'fdtput -t s {fdt} /bootstd/firmware1 status okay')
25 u_boot_utils.run_and_log(
26 cons, f'fdtput -t s {fdt} /mmc3 status okay')
27
28 # Remove any existing RAM file, so we don't have old data present
29 if os.path.exists(ram):
30 os.remove(ram)
31 flags = ['-p', os.path.join(cons.config.build_dir, 'image.bin'), '-w',
32 '-s', 'state.dtb']
33 cons.restart_uboot_with_flags(flags)
34
35 # Make sure that VBE was used in both VPL (to load SPL) and SPL (to load
36 # U-Boot
37 output = cons.run_command('vbe state')
38 assert output == 'Phases: VPL SPL'