From: Jamin Lin <jamin_lin@aspeedtech.com>
To: "Cédric Le Goater" <clg@kaod.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Steven Lee" <steven_lee@aspeedtech.com>,
"Troy Lee" <leetroy@gmail.com>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Joel Stanley" <joel@jms.id.au>,
"Fabiano Rosas" <farosas@suse.de>,
"Laurent Vivier" <lvivier@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"open list:ASPEED BMCs" <qemu-arm@nongnu.org>,
"open list:All patches CC here" <qemu-devel@nongnu.org>
Cc: Jamin Lin <jamin_lin@aspeedtech.com>,
Troy Lee <troy_lee@aspeedtech.com>,
Kane Chen <kane_chen@aspeedtech.com>,
"nabihestefan@google.com" <nabihestefan@google.com>
Subject: [PATCH v2 08/11] tests/functional/aarch64/test_aspeed_ast2700: Add AST2700 A2 EVB functional tests
Date: Tue, 10 Feb 2026 05:10:18 +0000 [thread overview]
Message-ID: <20260210051008.355149-9-jamin_lin@aspeedtech.com> (raw)
In-Reply-To: <20260210051008.355149-1-jamin_lin@aspeedtech.com>
Add functional coverage for the AST2700 A2 EVB machine by introducing
test cases that boot and validate an OpenBMC SDK v11.00 image on
"ast2700a2-evb".
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
tests/functional/aarch64/meson.build | 2 +
.../functional/aarch64/test_aspeed_ast2700.py | 190 ++++++++++++++++++
2 files changed, 192 insertions(+)
create mode 100644 tests/functional/aarch64/test_aspeed_ast2700.py
diff --git a/tests/functional/aarch64/meson.build b/tests/functional/aarch64/meson.build
index b5dd674bac..1bf0a30a9b 100644
--- a/tests/functional/aarch64/meson.build
+++ b/tests/functional/aarch64/meson.build
@@ -3,6 +3,7 @@
test_aarch64_timeouts = {
'aspeed_ast2700a1' : 600,
'aspeed_ast2700fc' : 600,
+ 'aspeed_ast2700' : 600,
'device_passthrough' : 720,
'imx8mp_evk' : 240,
'raspi4' : 480,
@@ -25,6 +26,7 @@ tests_aarch64_system_quick = [
tests_aarch64_system_thorough = [
'aspeed_ast2700a1',
'aspeed_ast2700fc',
+ 'aspeed_ast2700',
'device_passthrough',
'hotplug_pci',
'imx8mp_evk',
diff --git a/tests/functional/aarch64/test_aspeed_ast2700.py b/tests/functional/aarch64/test_aspeed_ast2700.py
new file mode 100644
index 0000000000..64f0a5abe4
--- /dev/null
+++ b/tests/functional/aarch64/test_aspeed_ast2700.py
@@ -0,0 +1,190 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots the ASPEED SoCs with firmware
+#
+# Copyright (C) 2022 ASPEED Technology Inc
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import os
+
+from qemu_test import QemuSystemTest, Asset
+from qemu_test import wait_for_console_pattern, exec_command
+from qemu_test import exec_command_and_wait_for_pattern
+
+
+class AST2x00MachineSDK(QemuSystemTest):
+
+ def do_test_aarch64_aspeed_sdk_start(self, image, bus_id):
+ bus_str = str(bus_id)
+ self.require_netdev('user')
+ self.vm.set_console()
+ self.vm.add_args(
+ '-device',
+ f'tmp105,'
+ f'bus=aspeed.i2c.bus.{bus_str},'
+ f'address=0x4d,'
+ f'id=tmp-test-{bus_str}'
+ )
+ self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
+ '-net', 'nic', '-net', 'user', '-snapshot')
+
+ self.vm.launch()
+
+ def verify_vbootrom_firmware_flow(self):
+ wait_for_console_pattern(self, 'Found valid caliptra flash image')
+ wait_for_console_pattern(self, 'Check flash image checksum')
+ wait_for_console_pattern(self, 'pass')
+ wait_for_console_pattern(self, 'Read abb header')
+ wait_for_console_pattern(self, 'pass')
+ wait_for_console_pattern(self, 'Read soc manifest')
+ wait_for_console_pattern(self, 'pass')
+ wait_for_console_pattern(self, 'Load atf image')
+ wait_for_console_pattern(self, 'pass')
+ wait_for_console_pattern(self, 'Load optee image')
+ wait_for_console_pattern(self, 'pass')
+ wait_for_console_pattern(self, 'Load uboot image')
+ wait_for_console_pattern(self, 'pass')
+ wait_for_console_pattern(self, 'Load ssp image')
+ wait_for_console_pattern(self, 'pass')
+ wait_for_console_pattern(self, 'Load tsp image')
+ wait_for_console_pattern(self, 'pass')
+ wait_for_console_pattern(self, 'Jumping to BL31 (Trusted Firmware-A)')
+
+ def enable_ast2700_pcie2(self):
+ wait_for_console_pattern(self, 'Hit any key to stop autoboot')
+ exec_command_and_wait_for_pattern(self, '\012', '=>')
+ exec_command_and_wait_for_pattern(self,
+ 'cp 100420000 403000000 900000', '=>')
+ exec_command_and_wait_for_pattern(self,
+ 'bootm start 403000000', '=>')
+ exec_command_and_wait_for_pattern(self, 'bootm loados', '=>')
+ exec_command_and_wait_for_pattern(self, 'bootm ramdisk', '=>')
+ exec_command_and_wait_for_pattern(self, 'bootm prep', '=>')
+ exec_command_and_wait_for_pattern(self,
+ 'fdt set /soc@14000000/pcie@140d0000 status "okay"', '=>')
+ exec_command(self, 'bootm go')
+
+ def verify_openbmc_boot_start(self, enable_pcie=True):
+ wait_for_console_pattern(self, 'U-Boot 2023.10')
+ if enable_pcie:
+ self.enable_ast2700_pcie2()
+ wait_for_console_pattern(self, 'Linux version ')
+
+ def verify_openbmc_boot_and_login(self, name, enable_pcie=True):
+ self.verify_openbmc_boot_start(enable_pcie)
+
+ wait_for_console_pattern(self, f'{name} login:')
+ exec_command_and_wait_for_pattern(self, 'root', 'Password:')
+ exec_command_and_wait_for_pattern(self, '0penBmc', f'root@{name}:~#')
+
+ ASSET_SDK_V1100_AST2700 = Asset(
+ 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v11.00/ast2700-default-obmc.tar.gz',
+ 'e2b8f043fe8063dd3b6ded93422e38bd41914dc9c3202199507652df024de4dc')
+
+ ASSET_SDK_V1100_AST2700_DCSCM = Asset(
+ 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v11.00/ast2700-dcscm-obmc.tar.gz',
+ '0e93f7976139da71fab9df7952a58bdd80650e23e7abf5853b0eb6695deb02d0')
+
+ def do_ast2700_i2c_test(self, bus_id):
+ bus_str = str(bus_id)
+ exec_command_and_wait_for_pattern(self,
+ 'echo lm75 0x4d > '
+ f'/sys/class/i2c-dev/i2c-{bus_str}/device/new_device ',
+ f'i2c i2c-{bus_str}: new_device: Instantiated device lm75 at 0x4d')
+ exec_command_and_wait_for_pattern(self,
+ f'cat /sys/bus/i2c/devices/{bus_str}-004d/hwmon/hwmon*/temp1_input',
+ '0')
+ self.vm.cmd('qom-set', path=f'/machine/peripheral/tmp-test-{bus_str}',
+ property='temperature', value=18000)
+ exec_command_and_wait_for_pattern(self,
+ f'cat /sys/bus/i2c/devices/{bus_str}-004d/hwmon/hwmon*/temp1_input',
+ '18000')
+
+ def do_ast2700_pcie_test(self):
+ exec_command_and_wait_for_pattern(self,
+ 'lspci -s 0002:00:00.0',
+ '0002:00:00.0 PCI bridge: '
+ 'ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge')
+ exec_command_and_wait_for_pattern(self,
+ 'lspci -s 0002:01:00.0',
+ '0002:01:00.0 Ethernet controller: '
+ 'Intel Corporation 82574L Gigabit Network Connection')
+ exec_command_and_wait_for_pattern(self,
+ 'ip addr show dev eth2',
+ 'inet 10.0.2.15/24')
+
+ def start_ast2700_test(self, name, bus_id):
+ num_cpu = 4
+ load_images_list = [
+ {
+ 'addr': '0x400000000',
+ 'file': self.scratch_file(name, 'u-boot.bin')
+ },
+ {
+ 'addr': '0x430000000',
+ 'file': self.scratch_file(name, 'bl31.bin')
+ },
+ {
+ 'addr': '0x430080000',
+ 'file': self.scratch_file(name, 'optee', 'tee-raw.bin')
+ }
+ ]
+
+ for load_image in load_images_list:
+ addr = load_image['addr']
+ file = load_image['file']
+ self.vm.add_args('-device',
+ f'loader,force-raw=on,addr={addr},file={file}')
+
+ for i in range(num_cpu):
+ self.vm.add_args('-device',
+ f'loader,addr=0x430000000,cpu-num={i}')
+
+ self.vm.add_args('-smp', str(num_cpu))
+ self.do_test_aarch64_aspeed_sdk_start(
+ self.scratch_file(name, 'image-bmc'), bus_id)
+
+ def start_ast2700_test_vbootrom(self, name, bus_id):
+ self.vm.add_args('-bios', 'ast27x0_bootrom.bin')
+ self.do_test_aarch64_aspeed_sdk_start(
+ self.scratch_file(name, 'image-bmc'), bus_id)
+
+ def test_aarch64_ast2700_evb_sdk_v11_00(self):
+ self.set_machine('ast2700a2-evb')
+ self.require_netdev('user')
+
+ self.archive_extract(self.ASSET_SDK_V1100_AST2700)
+ self.vm.add_args('-device', 'e1000e,netdev=net1,bus=pcie.2')
+ self.vm.add_args('-netdev', 'user,id=net1')
+ self.start_ast2700_test('ast2700-default', 1)
+ self.verify_openbmc_boot_and_login('ast2700-default')
+ self.do_ast2700_i2c_test(1)
+ self.do_ast2700_pcie_test()
+
+ def test_aarch64_ast2700_evb_sdk_vbootrom_v11_00(self):
+ self.set_machine('ast2700a2-evb')
+ self.require_netdev('user')
+
+ self.archive_extract(self.ASSET_SDK_V1100_AST2700)
+ self.vm.add_args('-device', 'e1000e,netdev=net1,bus=pcie.2')
+ self.vm.add_args('-netdev', 'user,id=net1')
+ self.start_ast2700_test_vbootrom('ast2700-default', 1)
+ self.verify_vbootrom_firmware_flow()
+ self.verify_openbmc_boot_start()
+
+ def test_aarch64_ast2700_evb_ioexp_v11_00(self):
+ self.set_machine('ast2700a2-evb')
+ self.require_netdev('user')
+
+ self.archive_extract(self.ASSET_SDK_V1100_AST2700_DCSCM)
+ self.vm.set_machine('ast2700a2-evb,fmc-model=w25q512jv')
+ self.vm.add_args('-device',
+ 'tmp105,bus=ioexp0.0,address=0x4d,id=tmp-test-16')
+ self.start_ast2700_test('ast2700-dcscm', 8)
+ self.verify_openbmc_boot_and_login('ast2700-dcscm', False)
+ self.do_ast2700_i2c_test(8)
+ self.do_ast2700_i2c_test(16)
+
+if __name__ == '__main__':
+ QemuSystemTest.main()
--
2.43.0
next prev parent reply other threads:[~2026-02-10 5:12 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 5:10 [PATCH v2 00/11] Support ASPEED AST2700 A2 Jamin Lin
2026-02-10 5:10 ` [PATCH v2 01/11] hw/misc/aspeed_scu: Remove unused SoC silicon revision definitions Jamin Lin
2026-02-10 5:10 ` [PATCH v2 02/11] hw/misc/aspeed_scu: Add AST2700 A2 silicon revisions Jamin Lin
2026-02-10 5:10 ` [PATCH v2 03/11] hw/arm/aspeed_ast27x0: Add AST2700 A2 SoC support Jamin Lin
2026-02-10 7:14 ` Cédric Le Goater
2026-02-10 19:25 ` Nabih Estefan
2026-02-10 5:10 ` [PATCH v2 04/11] hw/arm/aspeed_ast27x0_evb: Add AST2700 A2 EVB machine Jamin Lin
2026-02-10 7:15 ` Cédric Le Goater
2026-02-10 5:10 ` [PATCH v2 05/11] hw/arm/aspeed_ast27x0_evb: Move ast2700-evb alias to AST2700 A2 EVB Jamin Lin
2026-02-10 15:11 ` Cédric Le Goater
2026-02-10 5:10 ` [PATCH v2 06/11] tests/qtest/ast2700-hace-test: Use ast2700-evb alias for AST2700 HACE tests Jamin Lin
2026-02-10 5:10 ` [PATCH v2 07/11] tests/functional/aarch64/test_aspeed_ast2700: Rename AST2700 A1 test to reduce test runtime Jamin Lin
2026-02-10 7:15 ` Cédric Le Goater
2026-02-10 5:10 ` Jamin Lin [this message]
2026-02-10 15:15 ` [PATCH v2 08/11] tests/functional/aarch64/test_aspeed_ast2700: Add AST2700 A2 EVB functional tests Cédric Le Goater
2026-02-11 1:59 ` Jamin Lin
2026-02-10 5:10 ` [PATCH v2 09/11] hw/arm/aspeed_ast27x0-fc: Switch AST2700 FC machine to A2 SoC Jamin Lin
2026-02-10 7:16 ` Cédric Le Goater
2026-02-10 5:10 ` [PATCH v2 10/11] hw/arm/aspeed_ast27x0-fc: Increase BMC DRAM size to 2GB for AST2700 A2 Jamin Lin
2026-02-10 7:16 ` Cédric Le Goater
2026-02-10 5:10 ` [PATCH v2 11/11] tests/functional/aarch64/test_aspeed_ast2700fc: Use AST2700 A2 SDK image for FC tests Jamin Lin
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=20260210051008.355149-9-jamin_lin@aspeedtech.com \
--to=jamin_lin@aspeedtech.com \
--cc=andrew@codeconstruct.com.au \
--cc=clg@kaod.org \
--cc=farosas@suse.de \
--cc=joel@jms.id.au \
--cc=kane_chen@aspeedtech.com \
--cc=leetroy@gmail.com \
--cc=lvivier@redhat.com \
--cc=nabihestefan@google.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=steven_lee@aspeedtech.com \
--cc=troy_lee@aspeedtech.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.