Skip to contentSkip to conversation

travis-ci: Add SiFive Unleashed QEMU targets

PATCH In review Bin Meng 2 participants 2 messages Aug 22, 2021 – Aug 23, 2021 SiFive drivers

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/1 travis-ci: Add SiFive Unleashed QEMU targets

Add support for testing sifive_unleashed_defconfig via QEMU. QEMU supports booting exact the same images as used on the real hardware out of the box, that U-Boot SPL loads U-Boot proper from either an SD card or the SPI NOR flash, hence we can easily set up CI to cover these 2 boot flows of SiFive Unleashed board.

---

 bin/travis-ci/conf.sifive_unleashed_sdcard_qemu       | 11 +++++++++++
 bin/travis-ci/conf.sifive_unleashed_spi-nor_qemu      | 11 +++++++++++
 .../u_boot_boardenv_sifive_unleashed_sdcard_qemu.py   | 10 ++++++++++
 .../u_boot_boardenv_sifive_unleashed_spi-nor_qemu.py  | 10 ++++++++++
 4 files changed, 42 insertions(+)
 create mode 100644 bin/travis-ci/conf.sifive_unleashed_sdcard_qemu
 create mode 100644 bin/travis-ci/conf.sifive_unleashed_spi-nor_qemu
 create mode 100644 py/travis-ci/u_boot_boardenv_sifive_unleashed_sdcard_qemu.py
 create mode 100644 py/travis-ci/u_boot_boardenv_sifive_unleashed_spi-nor_qemu.py
bin/travis-ci/conf.sifive_unleashed_sdcard_qemu new file +11 -0
new file mode 100644
index 0000000..f3c3da1
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: MIT
+#
+# Copyright (c) 2021 Bin Meng <[email protected]>
+
+console_impl=qemu
+qemu_machine="sifive_u,msel=11"
+qemu_binary="qemu-system-riscv64"
+qemu_extra_args="-smp 5 -m 8G -nographic -nic user,tftp=${UBOOT_TRAVIS_BUILD_DIR}"
+qemu_kernel_args="-bios ${U_BOOT_BUILD_DIR}/spl/u-boot-spl.bin -drive file=${U_BOOT_BUILD_DIR}/sdcard.img,if=sd"
+reset_impl=none
+flash_impl=none
bin/travis-ci/conf.sifive_unleashed_spi-nor_qemu new file +11 -0
new file mode 100644
index 0000000..e28bfc4
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: MIT
+#
+# Copyright (c) 2021 Bin Meng <[email protected]>
+
+console_impl=qemu
+qemu_machine="sifive_u,msel=6"
+qemu_binary="qemu-system-riscv64"
+qemu_extra_args="-smp 5 -m 8G -nographic -nic user,tftp=${UBOOT_TRAVIS_BUILD_DIR}"
+qemu_kernel_args="-bios ${U_BOOT_BUILD_DIR}/spl/u-boot-spl.bin -drive file=${U_BOOT_BUILD_DIR}/spi-nor.img,if=mtd"
+reset_impl=none
+flash_impl=none
py/travis-ci/u_boot_boardenv_sifive_unleashed_sdcard_qemu.py new file +10 -0
new file mode 100644
index 0000000..a86e0bd
@@ -0,0 +1,10 @@
+import os
+import travis_tftp
+
+env__net_dhcp_server = True
+env__net_tftp_readable_file = travis_tftp.file2env('u-boot')
+env__efi_loader_helloworld_file = travis_tftp.file2env('lib/efi_loader/helloworld.efi')
+env__efi_loader_grub_file = travis_tftp.file2env('grub_riscv64.efi')
+env__efi_fit_tftp_file = {
+    "dn" : os.environ['UBOOT_TRAVIS_BUILD_DIR'],
+}
py/travis-ci/u_boot_boardenv_sifive_unleashed_spi-nor_qemu.py new file +10 -0
new file mode 100644
index 0000000..a86e0bd
@@ -0,0 +1,10 @@
+import os
+import travis_tftp
+
+env__net_dhcp_server = True
+env__net_tftp_readable_file = travis_tftp.file2env('u-boot')
+env__efi_loader_helloworld_file = travis_tftp.file2env('lib/efi_loader/helloworld.efi')
+env__efi_loader_grub_file = travis_tftp.file2env('grub_riscv64.efi')
+env__efi_fit_tftp_file = {
+    "dn" : os.environ['UBOOT_TRAVIS_BUILD_DIR'],
+}
Signature · 1 line
2.25.1
#1 lore raw
Quoted 8 lines · Bin Meng

Add support for testing sifive_unleashed_defconfig via QEMU. QEMU supports booting exact the same images as used on the real hardware out of the box, that U-Boot SPL loads U-Boot proper from either an SD card or the SPI NOR flash, hence we can easily set up CI to cover these 2 boot flows of SiFive Unleashed board.

Applied to u-boot-test-hooks/master, thanks!

Signature · 1 line
Tom