From: Bin Meng <bmeng.cn@gmail.com>
To: Tom Rini <trini@konsulko.com>, u-boot@lists.denx.de
Subject: [u-boot-test-hooks PATCH] travis-ci: Add SiFive Unleashed QEMU targets
Date: Sun, 22 Aug 2021 13:01:23 +0800 [thread overview]
Message-ID: <20210822050123.2355-1-bmeng.cn@gmail.com> (raw)
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
next reply other threads:[~2021-08-22 5:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-22 5:01 Bin Meng [this message]
2021-08-23 23:22 ` [u-boot-test-hooks PATCH] travis-ci: Add SiFive Unleashed QEMU targets Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210822050123.2355-1-bmeng.cn@gmail.com \
--to=bmeng.cn@gmail.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox