[RFC PATCH 8/9] sandbox_vpl: Enable Universal Payload

Simon Glass sjg at chromium.org
Thu Aug 31 01:29:22 CEST 2023


Use the sandbox_vpl build to test UPL since it supports a real devicetree
in SPL. The sandbox_spl build uses OF_PLATDATA.

Enable writing the UPL handoff in SPL and reading it in U-Boot proper.
Provide a test to check that this handoff works.

Note that the test uses the standard devicetree rather than the test one,
since it is a lot smaller and fits in the existing bloblist.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 configs/sandbox_vpl_defconfig |  4 ++++
 test/py/tests/test_upl.py     | 25 +++++++++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 test/py/tests/test_upl.py

diff --git a/configs/sandbox_vpl_defconfig b/configs/sandbox_vpl_defconfig
index 27354b8b5ed..598ec9620b0 100644
--- a/configs/sandbox_vpl_defconfig
+++ b/configs/sandbox_vpl_defconfig
@@ -27,6 +27,9 @@ CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_FIT_BEST_MATCH=y
 CONFIG_SPL_LOAD_FIT=y
+CONFIG_UPL=y
+CONFIG_UPL_IN=y
+CONFIG_SPL_UPL_OUT=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
@@ -36,6 +39,7 @@ CONFIG_BOOTSTAGE_STASH_SIZE=0x4096
 CONFIG_CONSOLE_RECORD=y
 CONFIG_CONSOLE_RECORD_OUT_SIZE=0x1000
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_BLOBLIST_SIZE=0x5000
 CONFIG_SPL_NO_BSS_LIMIT=y
 CONFIG_HANDOFF=y
 CONFIG_SPL_BOARD_INIT=y
diff --git a/test/py/tests/test_upl.py b/test/py/tests/test_upl.py
new file mode 100644
index 00000000000..0b24053e222
--- /dev/null
+++ b/test/py/tests/test_upl.py
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright 2023 Google LLC
+#
+# Test addition of Universal Payload
+
+import os
+
+import pytest
+import u_boot_utils
+
+ at pytest.mark.boardspec('sandbox_vpl')
+def test_upl_handoff(u_boot_console):
+    cons = u_boot_console
+    ram = os.path.join(cons.config.build_dir, 'ram.bin')
+    fdt = os.path.join(cons.config.build_dir, 'u-boot.dtb')
+
+    # Remove any existing RAM file, so we don't have old data present
+    if os.path.exists(ram):
+        os.remove(ram)
+    flags = ['-m', ram, '-d', fdt]
+    cons.restart_uboot_with_flags(flags, use_dtb=False)
+
+    # Make sure that Universal Payload is detected in U-Boot proper
+    output = cons.run_command('upl info')
+    assert output == 'UPL state: active'
-- 
2.42.0.rc2.253.gd59a3bf2b4-goog



More information about the U-Boot mailing list