blob: ed12d3a46186f6b957c0ec7d606af2269388bac2 [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')
Simon Glassda0ed9d2023-04-02 14:01:25 +120018 image_fname = os.path.join(cons.config.build_dir, 'image.bin')
Simon Glassf1eba352022-10-20 18:23:20 -060019
20 # Enable firmware1 and the mmc that it uses. These are needed for the full
21 # VBE flow.
22 u_boot_utils.run_and_log(
23 cons, f'fdtput -t s {fdt} /bootstd/firmware0 status disabled')
24 u_boot_utils.run_and_log(
25 cons, f'fdtput -t s {fdt} /bootstd/firmware1 status okay')
26 u_boot_utils.run_and_log(
27 cons, f'fdtput -t s {fdt} /mmc3 status okay')
Simon Glassda0ed9d2023-04-02 14:01:25 +120028 u_boot_utils.run_and_log(
29 cons, f'fdtput -t s {fdt} /mmc3 filename {image_fname}')
Simon Glassf1eba352022-10-20 18:23:20 -060030
31 # Remove any existing RAM file, so we don't have old data present
32 if os.path.exists(ram):
33 os.remove(ram)
Simon Glassda0ed9d2023-04-02 14:01:25 +120034 flags = ['-p', image_fname, '-w', '-s', 'state.dtb']
Simon Glassf1eba352022-10-20 18:23:20 -060035 cons.restart_uboot_with_flags(flags)
36
37 # Make sure that VBE was used in both VPL (to load SPL) and SPL (to load
38 # U-Boot
39 output = cons.run_command('vbe state')
40 assert output == 'Phases: VPL SPL'