Merge tag 'pull-riscv-to-apply-20260714' of https://github.com/alistair23/qemu into staging
RISC-V PR for 11.1 * Mark Microchip PolarFire SoC as Odd Fixes in MAINTAINERS * Fix RISC-V privilege level in uftrace plugin * Add K230 Linux boot tests * Fix kernel command line for sifive_u test # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCgAdFiEEaukCtqfKh31tZZKWr3yVEwxTgBMFAmpVteUACgkQr3yVEwxT # gBOPmxAAmPrfbQUTe2Zs0jZGYc3joPHWLIjBwx1p/623WtjXYwXYXbkgKw3BVNOf # qtu8O2dkNeUK7V8Udmi2tPiANHrV0bbvhFWPgLOINtQQyQV79mpwZGO9id1eU2Xj # rRLxB190rA2IKFN4Stum1SCuVQpO3DiDtf6B+VppgpShH08TIFeaDtCySOv5UfHS # WoYlpCFyp99dkkOD+fBNojILiJSLfquhw5tmMgKeFUJXAvVJxDKhAtIHKziCbTUx # VozVx7blAUEMsf4z+ZUq1Buu/6p8kDD6f+eEQ4eCqHh2HfB6V0BV1uvQFaaxMMF2 # h4mOGuZV1L1d1h5cGtSg1aMJNgAUEUKo+ykiXsGGiaYvUnt3eNZh2xAYwJImliVA # U9Y6MizID3DaECP27wETTLmrbayuJ8GzSlkoI7jwm9QDmxYFp+TvneTuz9xSlIEy # lRz/l3mUMJ0RCpvrEbBX56RPbCGIuXgOTdCyAd1hxvCMjwzqtsmQ0vftuFTbWliO # t5/4EPDJuZVseIKFMSE2RHM2kWWcIOUs5Op42tNxP0Yp/UjBdhNy8KaNWpWmn8vF # PPSBsFr2dsVSaQz0kSiYTSTg2TcOlGug6mvZJeTdXDNRY0uWIPPrMFpHwk/Fa5G5 # VQC6s/BX9dFAiJDqDwwN9CZR3TzYOHmQfiSWY71+lfb6AI4CuLg= # =mUxx # -----END PGP SIGNATURE----- # gpg: Signature made Tue 14 Jul 2026 05:07:01 BST # gpg: using RSA key 6AE902B6A7CA877D6D659296AF7C95130C538013 # gpg: Good signature from "Alistair Francis <alistair@alistair23.me>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6AE9 02B6 A7CA 877D 6D65 9296 AF7C 9513 0C53 8013 * tag 'pull-riscv-to-apply-20260714' of https://github.com/alistair23/qemu: tests/functional/riscv64: sifive_u: Fix kernel command line tests/functional/riscv64: Add K230 Linux boot tests uftrace: riscv privilege level MAINTAINERS: Mark Microchip PolarFire SoC as Odd Fixes Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
@@ -1760,8 +1760,10 @@ F: target/riscv/xlrbr.decode
|
|||||||
F: tests/tcg/riscv64/test-crc32.S
|
F: tests/tcg/riscv64/test-crc32.S
|
||||||
|
|
||||||
Microchip PolarFire SoC Icicle Kit
|
Microchip PolarFire SoC Icicle Kit
|
||||||
|
M: Conor Dooley <conor@kernel.org>
|
||||||
|
M: Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
L: qemu-riscv@nongnu.org
|
L: qemu-riscv@nongnu.org
|
||||||
S: Supported
|
S: Odd Fixes
|
||||||
F: docs/system/riscv/microchip-icicle-kit.rst
|
F: docs/system/riscv/microchip-icicle-kit.rst
|
||||||
F: hw/riscv/microchip_pfsoc.c
|
F: hw/riscv/microchip_pfsoc.c
|
||||||
F: hw/char/mchp_pfsoc_mmuart.c
|
F: hw/char/mchp_pfsoc_mmuart.c
|
||||||
@@ -1828,6 +1830,7 @@ F: hw/riscv/k230.c
|
|||||||
F: hw/watchdog/k230_wdt.c
|
F: hw/watchdog/k230_wdt.c
|
||||||
F: include/hw/riscv/k230.h
|
F: include/hw/riscv/k230.h
|
||||||
F: include/hw/watchdog/k230_wdt.h
|
F: include/hw/watchdog/k230_wdt.h
|
||||||
|
F: tests/functional/riscv64/test_k230.py
|
||||||
F: tests/qtest/k230-wdt-test.c
|
F: tests/qtest/k230-wdt-test.c
|
||||||
|
|
||||||
RX Machines
|
RX Machines
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
test_riscv64_timeouts = {
|
test_riscv64_timeouts = {
|
||||||
'boston' : 120,
|
'boston' : 120,
|
||||||
|
'k230' : 120,
|
||||||
'tuxrun' : 120,
|
'tuxrun' : 120,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -13,6 +14,7 @@ tests_riscv64_system_quick = [
|
|||||||
tests_riscv64_system_thorough = [
|
tests_riscv64_system_thorough = [
|
||||||
'endianness',
|
'endianness',
|
||||||
'boston',
|
'boston',
|
||||||
|
'k230',
|
||||||
'sifive_u',
|
'sifive_u',
|
||||||
'tt_atlantis',
|
'tt_atlantis',
|
||||||
'tuxrun',
|
'tuxrun',
|
||||||
|
|||||||
108
tests/functional/riscv64/test_k230.py
Executable file
108
tests/functional/riscv64/test_k230.py
Executable file
@@ -0,0 +1,108 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
#
|
||||||
|
# Functional tests that boot Linux on a Kendryte K230 machine.
|
||||||
|
#
|
||||||
|
# The direct boot test lets QEMU load OpenSBI, Linux, the device tree, and the
|
||||||
|
# initramfs. The firmware boot test starts the K230 SDK U-Boot and uses bootm
|
||||||
|
# to launch OpenSBI and Linux from images preloaded into RAM.
|
||||||
|
#
|
||||||
|
# Author:
|
||||||
|
# Junze Cao
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from qemu_test import Asset, LinuxKernelTest
|
||||||
|
from qemu_test import exec_command_and_wait_for_pattern
|
||||||
|
from qemu_test import interrupt_interactive_console_until_pattern
|
||||||
|
|
||||||
|
|
||||||
|
class K230Machine(LinuxKernelTest):
|
||||||
|
|
||||||
|
ASSET_KERNEL = Asset(
|
||||||
|
('https://raw.githubusercontent.com/zevorn/k230-boot-assets/'
|
||||||
|
'c3c32fb46e8307c5063f13e8f367c98bf9273cd1/'
|
||||||
|
'yocto/direct-boot/Image'),
|
||||||
|
'3a44970213fa68ad318d308518adfc0bf4bee72ed1b2926f9b468f82ef7d7829')
|
||||||
|
ASSET_DTB = Asset(
|
||||||
|
('https://raw.githubusercontent.com/zevorn/k230-boot-assets/'
|
||||||
|
'c3c32fb46e8307c5063f13e8f367c98bf9273cd1/'
|
||||||
|
'yocto/direct-boot/k230-canmv.dtb'),
|
||||||
|
'5050240b48ce0988c73eaefa73e4945a40abca503cf488d22a3adf6ef50bbe4c')
|
||||||
|
ASSET_INITRD = Asset(
|
||||||
|
('https://raw.githubusercontent.com/zevorn/k230-boot-assets/'
|
||||||
|
'c3c32fb46e8307c5063f13e8f367c98bf9273cd1/'
|
||||||
|
'yocto/direct-boot/rootfs.cpio.gz'),
|
||||||
|
'4e1869a99a232ee60324f71f3a9e84a79b03ccabb5b73f8a727c5ff5be5c0914')
|
||||||
|
ASSET_UBOOT = Asset(
|
||||||
|
('https://raw.githubusercontent.com/zevorn/k230-boot-assets/'
|
||||||
|
'c3c32fb46e8307c5063f13e8f367c98bf9273cd1/common/u-boot'),
|
||||||
|
'0915b9a92a7c911846a8cf691866ef14ef050a51d04209f884ae8e9ec33f36d2')
|
||||||
|
ASSET_FW_JUMP = Asset(
|
||||||
|
('https://raw.githubusercontent.com/zevorn/k230-boot-assets/'
|
||||||
|
'c3c32fb46e8307c5063f13e8f367c98bf9273cd1/'
|
||||||
|
'common/fw_jump.uImage'),
|
||||||
|
'cf7788e470f1d6e8c85491ecdc2705518db1b6af54080e8c7a3464bad0d902b7')
|
||||||
|
|
||||||
|
def wait_for_linux_shell(self):
|
||||||
|
self.wait_for_console_pattern('meta-k230 initramfs starting...')
|
||||||
|
self.wait_for_console_pattern('~ #')
|
||||||
|
|
||||||
|
def test_k230_direct_boot(self):
|
||||||
|
self.set_machine('k230')
|
||||||
|
kernel_path = self.ASSET_KERNEL.fetch()
|
||||||
|
dtb_path = self.ASSET_DTB.fetch()
|
||||||
|
initrd_path = self.ASSET_INITRD.fetch()
|
||||||
|
|
||||||
|
self.vm.set_console()
|
||||||
|
self.vm.add_args('-kernel', kernel_path,
|
||||||
|
'-dtb', dtb_path,
|
||||||
|
'-initrd', initrd_path,
|
||||||
|
'-append', 'console=ttyS0,115200 earlycon=sbi',
|
||||||
|
'-no-reboot')
|
||||||
|
self.vm.launch()
|
||||||
|
self.wait_for_linux_shell()
|
||||||
|
|
||||||
|
def test_k230_uboot_boot(self):
|
||||||
|
self.set_machine('k230')
|
||||||
|
kernel_path = self.ASSET_KERNEL.fetch()
|
||||||
|
dtb_path = self.ASSET_DTB.fetch()
|
||||||
|
initrd_path = self.ASSET_INITRD.fetch()
|
||||||
|
uboot_path = self.ASSET_UBOOT.fetch()
|
||||||
|
fw_jump_path = self.ASSET_FW_JUMP.fetch()
|
||||||
|
initrd_end = 0x0a100000 + os.path.getsize(initrd_path)
|
||||||
|
|
||||||
|
self.vm.set_console()
|
||||||
|
self.vm.add_args(
|
||||||
|
'-bios', uboot_path,
|
||||||
|
'-device',
|
||||||
|
f'loader,file={fw_jump_path},addr=0xc100000,force-raw=on',
|
||||||
|
'-device',
|
||||||
|
f'loader,file={kernel_path},addr=0x8200000,force-raw=on',
|
||||||
|
'-device',
|
||||||
|
f'loader,file={initrd_path},addr=0xa100000,force-raw=on',
|
||||||
|
'-device',
|
||||||
|
f'loader,file={dtb_path},addr=0xa000000,force-raw=on',
|
||||||
|
'-no-reboot')
|
||||||
|
self.vm.launch()
|
||||||
|
|
||||||
|
interrupt_interactive_console_until_pattern(self, 'K230#')
|
||||||
|
commands = (
|
||||||
|
'setenv bootargs console=ttyS0,115200 earlycon=sbi',
|
||||||
|
'fdt addr 0xa000000',
|
||||||
|
'fdt resize 8192',
|
||||||
|
'fdt set /chosen linux,initrd-start <0x0 0xa100000>',
|
||||||
|
f'fdt set /chosen linux,initrd-end <0x0 0x{initrd_end:x}>',
|
||||||
|
)
|
||||||
|
for command in commands:
|
||||||
|
exec_command_and_wait_for_pattern(self, command, 'K230#')
|
||||||
|
|
||||||
|
exec_command_and_wait_for_pattern(
|
||||||
|
self, 'bootm 0xc100000 - 0xa000000',
|
||||||
|
'Starting kernel ...', failure_message='ERROR')
|
||||||
|
self.wait_for_linux_shell()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
LinuxKernelTest.main()
|
||||||
@@ -35,9 +35,6 @@ def do_test_riscv64_sifive_u_mmc_spi(self, connect_card):
|
|||||||
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
|
kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
|
||||||
'earlycon=sbi console=ttySIF0 '
|
'earlycon=sbi console=ttySIF0 '
|
||||||
'root=/dev/mmcblk0 ')
|
'root=/dev/mmcblk0 ')
|
||||||
self.vm.add_args('-kernel', kernel_path,
|
|
||||||
'-append', kernel_command_line,
|
|
||||||
'-no-reboot')
|
|
||||||
if connect_card:
|
if connect_card:
|
||||||
kernel_command_line += 'panic=-1 noreboot rootwait '
|
kernel_command_line += 'panic=-1 noreboot rootwait '
|
||||||
self.vm.add_args('-drive', f'file={rootfs_path},if=sd,format=raw')
|
self.vm.add_args('-drive', f'file={rootfs_path},if=sd,format=raw')
|
||||||
@@ -46,6 +43,9 @@ def do_test_riscv64_sifive_u_mmc_spi(self, connect_card):
|
|||||||
kernel_command_line += 'panic=0 noreboot '
|
kernel_command_line += 'panic=0 noreboot '
|
||||||
pattern = 'Cannot open root device "mmcblk0" or unknown-block(0,0)'
|
pattern = 'Cannot open root device "mmcblk0" or unknown-block(0,0)'
|
||||||
|
|
||||||
|
self.vm.add_args('-kernel', kernel_path,
|
||||||
|
'-append', kernel_command_line,
|
||||||
|
'-no-reboot')
|
||||||
self.vm.launch()
|
self.vm.launch()
|
||||||
self.wait_for_console_pattern(pattern)
|
self.wait_for_console_pattern(pattern)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user