From nobody Mon Feb 9 03:25:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1745918485; cv=none; d=zohomail.com; s=zohoarc; b=E+iaOaUSRTNkFNrC28bmK0gGgSrIYI73PkIhrNdAiGk9+OXCW4OdSAjrrTRNJE+dPzn9JdwGUMf2AKrkNWSW6dIKiEP0r9xxAIGsy2KSGIKvqf9kmq5AboMLbwx52Gvwvcwbm1bPXDfg273cTKW9iNEqREzd8birfqzzz0wSZ94= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745918485; 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:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=d2VYrc/2qlG8ZvFfw9XnVIqE4iz/lswW2QWV1US4TSo=; b=NVHnsI+co18PDzaVIhqC5EHuZ0VhPUoUzVumrC5I3SVANYQHD71fbXMsyYRuC42PuQNddoVpHXKdLacV+cRZ9YEfx/ExJDyOp1ptDVaDBJRF65n6sLg92r74AD51uh/D6zfrtxtPdqF83U+eav0tfhIET5LXJ4f5j0ggYbndrrw= ARC-Authentication-Results: i=1; mx.zohomail.com; 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1745918485841124.17995268478637; Tue, 29 Apr 2025 02:21:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u9h7t-0005jd-IX; Tue, 29 Apr 2025 05:19:41 -0400 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 1u9h7p-0005g8-Vx; Tue, 29 Apr 2025 05:19:38 -0400 Received: from mail.aspeedtech.com ([211.20.114.72] helo=TWMBX01.aspeed.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u9h7n-0004Ff-Uh; Tue, 29 Apr 2025 05:19:37 -0400 Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Tue, 29 Apr 2025 17:18:58 +0800 Received: from mail.aspeedtech.com (192.168.10.10) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.10 via Frontend Transport; Tue, 29 Apr 2025 17:18:58 +0800 To: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Peter Maydell , Troy Lee , Jamin Lin , Andrew Jeffery , Joel Stanley , "open list:ASPEED BMCs" , "open list:All patches CC here" CC: , , , Subject: [PATCH v3 8/9] tests/function/aspeed: Add functional test for AST2700FC Date: Tue, 29 Apr 2025 17:18:52 +0800 Message-ID: <20250429091855.1948374-9-steven_lee@aspeedtech.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250429091855.1948374-1-steven_lee@aspeedtech.com> References: <20250429091855.1948374-1-steven_lee@aspeedtech.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=211.20.114.72; envelope-from=steven_lee@aspeedtech.com; helo=TWMBX01.aspeed.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_FAIL=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Steven Lee From: Steven Lee via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1745918488423019000 Content-Type: text/plain; charset="utf-8" Add functional test for AST2700-fc machine. Signed-off-by: Steven Lee Change-Id: Ieced249cf471515a33f8f5f5386a2f58d431f2f9 Reviewed-by: C=C3=A9dric Le Goater --- tests/functional/test_aarch64_ast2700fc.py | 137 +++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100755 tests/functional/test_aarch64_ast2700fc.py diff --git a/tests/functional/test_aarch64_ast2700fc.py b/tests/functional/= test_aarch64_ast2700fc.py new file mode 100755 index 0000000000..f7b7907fde --- /dev/null +++ b/tests/functional/test_aarch64_ast2700fc.py @@ -0,0 +1,137 @@ +#!/usr/bin/env python3 +# +# Functional test that boots the AST2700 multi-SoCs with firmware +# +# Copyright (C) 2025 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 +from qemu_test import exec_command_and_wait_for_pattern + + +class AST2700fcMachineSDK(QemuSystemTest): + ASSET_SDK_V905_AST2700 =3D Asset( + 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v= 09.05/ast2700-default-obmc.tar.gz', + 'c1f4496aec06743c812a6e9a1a18d032f34d62f3ddb6956e924fef62aa204= 6a5') + + def do_test_aarch64_ast2700fc_ca35_start(self, image): + self.require_netdev('user') + self.vm.set_console() + self.vm.add_args('-drive', 'file=3D' + image + ',if=3Dmtd,format= =3Draw', + '-net', 'nic', '-net', 'user', '-snapshot') + + self.vm.launch() + + wait_for_console_pattern(self, 'U-Boot 2023.10') + wait_for_console_pattern(self, '## Loading kernel from FIT Image') + wait_for_console_pattern(self, 'Starting kernel ...') + + def do_test_aarch64_ast2700fc_ssp_start(self): + + self.vm.shutdown() + self.vm.set_console(console_index=3D1) + self.vm.launch() + + def do_test_aarch64_ast2700fc_tsp_start(self): + self.vm.shutdown() + self.vm.set_console(console_index=3D2) + self.vm.launch() + + def start_ast2700fc_test(self, name): + ca35_core =3D 4 + uboot_size =3D os.path.getsize(self.scratch_file(name, + 'u-boot-nodtb.bin')) + uboot_dtb_load_addr =3D hex(0x400000000 + uboot_size) + + load_images_list =3D [ + { + 'addr': '0x400000000', + 'file': self.scratch_file(name, + 'u-boot-nodtb.bin') + }, + { + 'addr': str(uboot_dtb_load_addr), + 'file': self.scratch_file(name, 'u-boot.dtb') + }, + { + '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(ca35_core): + self.vm.add_args('-device', + f'loader,addr=3D0x430000000,cpu-num=3D{i}') + + load_elf_list =3D { + 'ssp': self.scratch_file(name, 'ast2700-ssp.elf'), + 'tsp': self.scratch_file(name, 'ast2700-tsp.elf') + } + + for cpu_num, key in enumerate(load_elf_list, start=3D4): + file =3D load_elf_list[key] + self.vm.add_args('-device', + f'loader,file=3D{file},cpu-num=3D{cpu_num}') + + self.vm.add_args('-device', + 'tmp105,bus=3Daspeed.i2c.bus.1,address=3D0x4d,id= =3Dtmp-test') + self.do_test_aarch64_ast2700fc_ca35_start( + self.scratch_file(name, 'image-bmc')) + + 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}:~= #') + + exec_command_and_wait_for_pattern( + self, + 'echo lm75 0x4d > /sys/class/i2c-dev/i2c-1/device/new_devi= ce ', + 'i2c i2c-1: new_device: Instantiated device lm75 at 0x4d') + exec_command_and_wait_for_pattern( + self, + 'cat /sys/class/hwmon/hwmon*/temp1_input', '0') + self.vm.cmd('qom-set', path=3D'/machine/peripheral/tmp-test', + property=3D'temperature', value=3D18000) + exec_command_and_wait_for_pattern( + self, + 'cat /sys/class/hwmon/hwmon*/temp1_input', '18000') + + self.do_test_aarch64_ast2700fc_ssp_start() + + exec_command_and_wait_for_pattern(self, '\012', 'ssp:~$') + exec_command_and_wait_for_pattern(self, 'version', + 'Zephyr version 3.7.1') + exec_command_and_wait_for_pattern(self, 'md 72c02000 1', + '[72c02000] 06010103') + + self.do_test_aarch64_ast2700fc_tsp_start() + + exec_command_and_wait_for_pattern(self, '\012', 'tsp:~$') + exec_command_and_wait_for_pattern(self, 'version', + 'Zephyr version 3.7.1') + exec_command_and_wait_for_pattern(self, 'md 72c02000 1', + '[72c02000] 06010103') + + def test_aarch64_ast2700fc_sdk_v09_05(self): + self.set_machine('ast2700fc') + self.archive_extract(self.ASSET_SDK_V905_AST2700) + self.start_ast2700fc_test('ast2700-default') + + +if __name__ =3D=3D '__main__': + QemuSystemTest.main() --=20 2.34.1