blob: f011b034f63c0df2df2473537e8907247d498864 [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
Simon Glassfb916372025-02-09 09:07:15 -07009import utils
Simon Glassf1eba352022-10-20 18:23:20 -060010
11@pytest.mark.boardspec('sandbox_vpl')
12@pytest.mark.requiredtool('dtc')
Simon Glassddba5202025-02-09 09:07:14 -070013def test_vbe_vpl(ubman):
Simon Glass32701112025-02-09 09:07:17 -070014 #cmd = [ubman.config.build_dir + fname, '-v']
15 ram = os.path.join(ubman.config.build_dir, 'ram.bin')
16 fdt = os.path.join(ubman.config.build_dir, 'arch/sandbox/dts/test.dtb')
17 image_fname = os.path.join(ubman.config.build_dir, 'image.bin')
Simon Glassf1eba352022-10-20 18:23:20 -060018
19 # Enable firmware1 and the mmc that it uses. These are needed for the full
20 # VBE flow.
Simon Glassfb916372025-02-09 09:07:15 -070021 utils.run_and_log(
Simon Glass32701112025-02-09 09:07:17 -070022 ubman, f'fdtput -t s {fdt} /bootstd/firmware0 status disabled')
Simon Glassfb916372025-02-09 09:07:15 -070023 utils.run_and_log(
Simon Glass32701112025-02-09 09:07:17 -070024 ubman, f'fdtput -t s {fdt} /bootstd/firmware1 status okay')
Simon Glassfb916372025-02-09 09:07:15 -070025 utils.run_and_log(
Simon Glass32701112025-02-09 09:07:17 -070026 ubman, f'fdtput -t s {fdt} /mmc3 status okay')
Simon Glassfb916372025-02-09 09:07:15 -070027 utils.run_and_log(
Simon Glass32701112025-02-09 09:07:17 -070028 ubman, f'fdtput -t s {fdt} /mmc3 filename {image_fname}')
Simon Glassf1eba352022-10-20 18:23:20 -060029
30 # Remove any existing RAM file, so we don't have old data present
31 if os.path.exists(ram):
32 os.remove(ram)
Simon Glassda0ed9d2023-04-02 14:01:25 +120033 flags = ['-p', image_fname, '-w', '-s', 'state.dtb']
Simon Glass32701112025-02-09 09:07:17 -070034 ubman.restart_uboot_with_flags(flags)
Simon Glassf1eba352022-10-20 18:23:20 -060035
36 # Make sure that VBE was used in both VPL (to load SPL) and SPL (to load
37 # U-Boot
Simon Glass32701112025-02-09 09:07:17 -070038 output = ubman.run_command('vbe state')
Simon Glassf1eba352022-10-20 18:23:20 -060039 assert output == 'Phases: VPL SPL'