[Concept,12/13] ulib: riscv: Enable Rust demo for efi-riscv_app64

Message ID 20260220001926.2366140-13-sjg@u-boot.org
State New
Headers
Series ulib: Enable the Rust demo on more architectures |

Commit Message

Simon Glass Feb. 20, 2026, 12:19 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

RUST_TARGET_riscv is already defined as riscv64gc-unknown-none-elf, so
the Rust demo just needs to be enabled in the defconfig.

Enable CONFIG_RUST_EXAMPLES in efi-riscv_app64_defconfig and add a QEMU
boot test that launches rust-demo-app.efi under RISC-V UEFI firmware.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 configs/efi-riscv_app64_defconfig |  1 +
 test/py/tests/test_ulib.py        | 10 ++++++++++
 2 files changed, 11 insertions(+)
  

Patch

diff --git a/configs/efi-riscv_app64_defconfig b/configs/efi-riscv_app64_defconfig
index d48ecf19585..e89d392050b 100644
--- a/configs/efi-riscv_app64_defconfig
+++ b/configs/efi-riscv_app64_defconfig
@@ -54,4 +54,5 @@  CONFIG_CONSOLE_SCROLL_LINES=5
 CONFIG_FAT_WRITE=y
 CONFIG_ULIB=y
 CONFIG_EXAMPLES=y
+CONFIG_RUST_EXAMPLES=y
 CONFIG_CMD_DHRYSTONE=y
diff --git a/test/py/tests/test_ulib.py b/test/py/tests/test_ulib.py
index 851732fa1da..65485118812 100644
--- a/test/py/tests/test_ulib.py
+++ b/test/py/tests/test_ulib.py
@@ -545,3 +545,13 @@  def test_ulib_demo_efi_riscv64(ubman):
                  '/usr/share/qemu-efi-riscv64/RISCV_VIRT_CODE.fd',
                  '/usr/share/qemu-efi-riscv64/RISCV_VIRT_VARS.fd',
                  ['--machine', 'virt'])
+
+@pytest.mark.localqemu
+@pytest.mark.boardspec('efi-riscv_app64')
+@pytest.mark.buildconfigspec("rust_examples")
+def test_ulib_rust_demo_efi_riscv64(ubman):
+    """Test the Rust ulib demo EFI app under QEMU RISC-V 64 with UEFI."""
+    run_efi_rust_demo(ubman, 'qemu-system-riscv64',
+                      '/usr/share/qemu-efi-riscv64/RISCV_VIRT_CODE.fd',
+                      '/usr/share/qemu-efi-riscv64/RISCV_VIRT_VARS.fd',
+                      ['--machine', 'virt'])