* [u-boot-test-hooks PATCH] travis-ci: Add SiFive Unleashed QEMU targets
@ 2021-08-22 5:01 Bin Meng
2021-08-23 23:22 ` Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Bin Meng @ 2021-08-22 5:01 UTC (permalink / raw)
To: Tom Rini, u-boot
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.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---
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
diff --git a/bin/travis-ci/conf.sifive_unleashed_sdcard_qemu b/bin/travis-ci/conf.sifive_unleashed_sdcard_qemu
new file mode 100644
index 0000000..f3c3da1
--- /dev/null
+++ b/bin/travis-ci/conf.sifive_unleashed_sdcard_qemu
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: MIT
+#
+# Copyright (c) 2021 Bin Meng <bmeng.cn@gmail.com>
+
+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
diff --git a/bin/travis-ci/conf.sifive_unleashed_spi-nor_qemu b/bin/travis-ci/conf.sifive_unleashed_spi-nor_qemu
new file mode 100644
index 0000000..e28bfc4
--- /dev/null
+++ b/bin/travis-ci/conf.sifive_unleashed_spi-nor_qemu
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: MIT
+#
+# Copyright (c) 2021 Bin Meng <bmeng.cn@gmail.com>
+
+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
diff --git a/py/travis-ci/u_boot_boardenv_sifive_unleashed_sdcard_qemu.py b/py/travis-ci/u_boot_boardenv_sifive_unleashed_sdcard_qemu.py
new file mode 100644
index 0000000..a86e0bd
--- /dev/null
+++ b/py/travis-ci/u_boot_boardenv_sifive_unleashed_sdcard_qemu.py
@@ -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'],
+}
diff --git a/py/travis-ci/u_boot_boardenv_sifive_unleashed_spi-nor_qemu.py b/py/travis-ci/u_boot_boardenv_sifive_unleashed_spi-nor_qemu.py
new file mode 100644
index 0000000..a86e0bd
--- /dev/null
+++ b/py/travis-ci/u_boot_boardenv_sifive_unleashed_spi-nor_qemu.py
@@ -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'],
+}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-23 23:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-22 5:01 [u-boot-test-hooks PATCH] travis-ci: Add SiFive Unleashed QEMU targets Bin Meng
2021-08-23 23:22 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox