Re: [PATCH 25/26] tests/functional/riscv64: Add Icicle Kit firmware boot test

Chao Liu <[email protected]> Mon, 27 Jul 2026 13:38:04 +0800
Newsgroups org.nongnu.qemu-riscv,org.nongnu.qemu-devel
Message-ID <[email protected]>
On Thu, Jul 23, 2026 at 11:18:52PM +0800, Bin Meng wrote:
> Add functional coverage using prebuilt HSS and SD card images.
> 
> Boot HSS and U-Boot with five harts and 2 GiB of RAM. Connect
> the test console to MMUART1 and let U-Boot start Linux.
> 
> The complete boot exercises the SDHCI controller in the DMA modes
> used at each stage. HSS uses Version 4 64-bit SDMA to load U-Boot.
> U-Boot uses ADMA2-64 to read the boot script and the large FIT
> image. Linux then selects 64-bit ADMA for SD card and rootfs I/O.
> 
> Check the machine identity, kernel ADMA initialization, root
> filesystem mount, and login prompt.
> 
> Signed-off-by: Bin Meng <[email protected]>
Reviewed-by: Chao Liu <[email protected]>

Thanks,
Chao

> ---
> 
>  MAINTAINERS                                   |  1 +
>  tests/functional/riscv64/meson.build          |  2 +
>  .../riscv64/test_microchip_icicle_kit.py      | 52 +++++++++++++++++++
>  3 files changed, 55 insertions(+)
>  create mode 100644 tests/functional/riscv64/test_microchip_icicle_kit.py
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 4bcc59f1cf..800a2f31cd 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1780,6 +1780,7 @@ F: include/hw/misc/mchp_pfsoc_ioscb.h
>  F: include/hw/misc/mchp_pfsoc_l2cc.h
>  F: include/hw/misc/mchp_pfsoc_sysreg.h
>  F: include/hw/rtc/mchp_pfsoc_rtc.h
> +F: tests/functional/riscv64/test_microchip_icicle_kit.py
>  F: tests/qtest/mchp_pfsoc_l2cc_test.c
>  F: tests/qtest/mchp_pfsoc_rtc_test.c
>  
> diff --git a/tests/functional/riscv64/meson.build b/tests/functional/riscv64/meson.build
> index d1a3e6c2bf..cbf61d9535 100644
> --- a/tests/functional/riscv64/meson.build
> +++ b/tests/functional/riscv64/meson.build
> @@ -3,6 +3,7 @@
>  test_riscv64_timeouts = {
>    'boston' : 120,
>    'k230' : 120,
> +  'microchip_icicle_kit' : 180,
>    'tuxrun' : 120,
>  }
>  
> @@ -15,6 +16,7 @@ tests_riscv64_system_thorough = [
>    'endianness',
>    'boston',
>    'k230',
> +  'microchip_icicle_kit',
>    'sifive_u',
>    'tt_atlantis',
>    'tuxrun',
> diff --git a/tests/functional/riscv64/test_microchip_icicle_kit.py b/tests/functional/riscv64/test_microchip_icicle_kit.py
> new file mode 100644
> index 0000000000..a75803fb84
> --- /dev/null
> +++ b/tests/functional/riscv64/test_microchip_icicle_kit.py
> @@ -0,0 +1,52 @@
> +#!/usr/bin/env python3
> +#
> +# Functional test that boots HSS, U-Boot, and Linux on an Icicle Kit.
> +#
> +# Copyright (c) 2026 Process Mission
> +#
> +# Author:
> +#   Bin Meng <[email protected]>
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +from qemu_test import Asset, LinuxKernelTest
> +
> +
> +class MicrochipIcicleKitMachine(LinuxKernelTest):
> +
> +    ASSET_IMAGES = Asset(
> +        ('https://github.com/processmission/qemu-machine-images/releases/'
> +         'download/v1.0.0/'
> +         'riscv64-microchip-icicle-kit-v1.0.0.tar.zst'),
> +        '8a8a831f5a1715503abf88386fca81c8e5edb303bff0265118f6ac35a725d27f')
> +
> +    def test_microchip_icicle_kit_boot(self):
> +        self.require_accelerator('tcg')
> +        self.set_machine('microchip-icicle-kit')
> +
> +        archive_path = self.uncompress(
> +            self.ASSET_IMAGES, target='microchip_icicle_kit_images.tar')
> +        self.archive_extract(archive_path, format='tar')
> +        firmware_path = self.scratch_file('images', 'hss.bin')
> +        sdcard_path = self.scratch_file('images', 'sdcard.img')
> +
> +        self.vm.set_console(console_index=1)
> +        self.vm.add_args(
> +            '-smp', '5',
> +            '-m', '2G',
> +            '-bios', firmware_path,
> +            '-drive', f'if=sd,file={sdcard_path},format=raw,snapshot=on',
> +            '-no-reboot')
> +        self.vm.launch()
> +
> +        self.wait_for_console_pattern('U-Boot ')
> +        self.wait_for_console_pattern('Starting kernel ...')
> +        self.wait_for_console_pattern(
> +            'Machine model: Microchip PolarFire-SoC Icicle Kit')
> +        self.wait_for_console_pattern('using ADMA 64-bit')
> +        self.wait_for_console_pattern('VFS: Mounted root')
> +        self.wait_for_console_pattern('mpfs_icicle login:')
> +
> +
> +if __name__ == '__main__':
> +    LinuxKernelTest.main()
> -- 
> 2.34.1
>