test_vbe_vpl.py 1.3 KB

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