From nobody Sun Apr 12 07:20:22 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1770932629; cv=none; d=zohomail.com; s=zohoarc; b=R4Nd7UxDTid9AEn9Ak94LE+Yzv1ZYgf37BS9fgpdqb3/bqz+haS8XTmFs1AD+JpaAWW14qnilAT4uWCDY10xnDj+cw/nQl9rdoB3pVucq++YqXyGrxTeN7NsTt+hxZYQVLO2+8g25+Z2G1IxGWyzgVZClyW4keNtX0nw6WpBSrU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770932629; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QqfC/Y4H9AQxjD2fA3eZ8vbjWhVvXuBuXTwWYX84JS8=; b=B8lIgV4m+ruKvdGOttBuwvnvk5oKwZzWgqR1w5NkLzekwyQuqJoThL7VNudM6XV96jjViE6BbXoo2qokWyTEvtfAopbU+VkDYa2ne/Igi/SQ3y9at3eSefBs3IioWVDtWJ2BK17nMI2ERuJIXuLc7hUzajYbWRjr9HdmeSV74oo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770932629099308.21428240549017; Thu, 12 Feb 2026 13:43:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vqeQP-0008Lq-52; Thu, 12 Feb 2026 16:40:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqeQM-0008JR-JF for qemu-devel@nongnu.org; Thu, 12 Feb 2026 16:40:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vqeQK-0006BU-Hc for qemu-devel@nongnu.org; Thu, 12 Feb 2026 16:40:34 -0500 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-672-sbp7CGQTMEmeyIT-doSvaA-1; Thu, 12 Feb 2026 16:40:28 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 781EB180047F; Thu, 12 Feb 2026 21:40:27 +0000 (UTC) Received: from corto.redhat.com (unknown [10.45.224.55]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E01061800668; Thu, 12 Feb 2026 21:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770932431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QqfC/Y4H9AQxjD2fA3eZ8vbjWhVvXuBuXTwWYX84JS8=; b=T00uM7yqP6/wQQPUdOeX/ZPpy9DdVOy4/jNLmkFYb/KHorS8LC35GsBerldDwVZz8ty82n r0bSbwVodxRt+Ws/2snLL+v+D28gXePI5vdavNOW8+mH4iVJT7Q5iQR63kRiQ9IlMgqB0b xXw4OPx/bgj+97bNxPN1Bs5Ujddxbrw= X-MC-Unique: sbp7CGQTMEmeyIT-doSvaA-1 X-Mimecast-MFC-AGG-ID: sbp7CGQTMEmeyIT-doSvaA_1770932427 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Jamin Lin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 13/16] tests/functional/aarch64/test_aspeed_ast2700a2: Add AST2700 A2 EVB functional tests Date: Thu, 12 Feb 2026 22:39:52 +0100 Message-ID: <20260212213955.2225662-14-clg@redhat.com> In-Reply-To: <20260212213955.2225662-1-clg@redhat.com> References: <20260212213955.2225662-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1770932630858158500 From: Jamin Lin 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 Reviewed-by: C=C3=A9dric Le Goater Link: https://lore.kernel.org/qemu-devel/20260211021527.119674-9-jamin_lin@= aspeedtech.com Signed-off-by: C=C3=A9dric Le Goater --- tests/functional/aarch64/meson.build | 2 + .../aarch64/test_aspeed_ast2700a2.py | 190 ++++++++++++++++++ 2 files changed, 192 insertions(+) create mode 100755 tests/functional/aarch64/test_aspeed_ast2700a2.py diff --git a/tests/functional/aarch64/meson.build b/tests/functional/aarch6= 4/meson.build index b5dd674bac61..49eca1205898 100644 --- a/tests/functional/aarch64/meson.build +++ b/tests/functional/aarch64/meson.build @@ -2,6 +2,7 @@ =20 test_aarch64_timeouts =3D { 'aspeed_ast2700a1' : 600, + 'aspeed_ast2700a2' : 600, 'aspeed_ast2700fc' : 600, 'device_passthrough' : 720, 'imx8mp_evk' : 240, @@ -24,6 +25,7 @@ tests_aarch64_system_quick =3D [ =20 tests_aarch64_system_thorough =3D [ 'aspeed_ast2700a1', + 'aspeed_ast2700a2', 'aspeed_ast2700fc', 'device_passthrough', 'hotplug_pci', diff --git a/tests/functional/aarch64/test_aspeed_ast2700a2.py b/tests/func= tional/aarch64/test_aspeed_ast2700a2.py new file mode 100755 index 000000000000..e527518a5537 --- /dev/null +++ b/tests/functional/aarch64/test_aspeed_ast2700a2.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 =3D str(bus_id) + self.require_netdev('user') + self.vm.set_console() + self.vm.add_args( + '-device', + f'tmp105,' + f'bus=3Daspeed.i2c.bus.{bus_str},' + f'address=3D0x4d,' + f'id=3Dtmp-test-{bus_str}' + ) + self.vm.add_args('-drive', 'file=3D' + image + ',if=3Dmtd,format= =3Draw', + '-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', '=3D>') + exec_command_and_wait_for_pattern(self, + 'cp 100420000 403000000 900000', '=3D>') + exec_command_and_wait_for_pattern(self, + 'bootm start 403000000', '=3D>') + exec_command_and_wait_for_pattern(self, 'bootm loados', '=3D>') + exec_command_and_wait_for_pattern(self, 'bootm ramdisk', '=3D>') + exec_command_and_wait_for_pattern(self, 'bootm prep', '=3D>') + exec_command_and_wait_for_pattern(self, + 'fdt set /soc@14000000/pcie@140d0000 status "okay"', '=3D>') + exec_command(self, 'bootm go') + + def verify_openbmc_boot_start(self, enable_pcie=3DTrue): + 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=3DTrue): + 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_AST2700A2 =3D Asset( + 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v= 11.00/ast2700-default-obmc.tar.gz', + 'e2b8f043fe8063dd3b6ded93422e38bd41914dc9c3202199507652df024de= 4dc') + + ASSET_SDK_V1100_AST2700A2_DCSCM =3D Asset( + 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v= 11.00/ast2700-dcscm-obmc.tar.gz', + '0e93f7976139da71fab9df7952a58bdd80650e23e7abf5853b0eb6695deb0= 2d0') + + def do_ast2700_i2c_test(self, bus_id): + bus_str =3D 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 0= x4d') + exec_command_and_wait_for_pattern(self, + f'cat /sys/bus/i2c/devices/{bus_str}-004d/hwmon/hwmon*/temp1_i= nput', + '0') + self.vm.cmd('qom-set', path=3Df'/machine/peripheral/tmp-test-{bus_= str}', + property=3D'temperature', value=3D18000) + exec_command_and_wait_for_pattern(self, + f'cat /sys/bus/i2c/devices/{bus_str}-004d/hwmon/hwmon*/temp1_i= nput', + '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 =3D 4 + load_images_list =3D [ + { + '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 =3D load_image['addr'] + file =3D load_image['file'] + self.vm.add_args('-device', + f'loader,force-raw=3Don,addr=3D{addr},file=3D= {file}') + + for i in range(num_cpu): + self.vm.add_args('-device', + f'loader,addr=3D0x430000000,cpu-num=3D{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_ast2700a2_evb_sdk_v11_00(self): + self.set_machine('ast2700a2-evb') + self.require_netdev('user') + + self.archive_extract(self.ASSET_SDK_V1100_AST2700A2) + self.vm.add_args('-device', 'e1000e,netdev=3Dnet1,bus=3Dpcie.2') + self.vm.add_args('-netdev', 'user,id=3Dnet1') + 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_ast2700a2_evb_sdk_vbootrom_v11_00(self): + self.set_machine('ast2700a2-evb') + self.require_netdev('user') + + self.archive_extract(self.ASSET_SDK_V1100_AST2700A2) + self.vm.add_args('-device', 'e1000e,netdev=3Dnet1,bus=3Dpcie.2') + self.vm.add_args('-netdev', 'user,id=3Dnet1') + self.start_ast2700_test_vbootrom('ast2700-default', 1) + self.verify_vbootrom_firmware_flow() + self.verify_openbmc_boot_start() + + def test_aarch64_ast2700a2_evb_ioexp_v11_00(self): + self.set_machine('ast2700a2-evb') + self.require_netdev('user') + + self.archive_extract(self.ASSET_SDK_V1100_AST2700A2_DCSCM) + self.vm.set_machine('ast2700a2-evb,fmc-model=3Dw25q512jv') + self.vm.add_args('-device', + 'tmp105,bus=3Dioexp0.0,address=3D0x4d,id=3Dtmp-te= st-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__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.53.0