master
py 52 lines 1.76 KB
Raw
1 #!/usr/bin/env python3
2 #
3 # Functional test that boots the ASPEED SoCs with firmware
4 #
5 # Copyright (C) 2025 ASPEED Technology Inc
6 #
7 # SPDX-License-Identifier: GPL-2.0-or-later
8
9 from aspeed import AspeedTest
10 from qemu_test import Asset, exec_command_and_wait_for_pattern
11
12
13 class AST1060Machine(AspeedTest):
14 ASSET_ASPEED_AST1060_PROT_3_07 = Asset(
15 ('https://github.com/AspeedTech-BMC'
16 '/aspeed-zephyr-project/releases/download/v03.07'
17 '/ast1060_prot_v03.07.tgz'),
18 '55a7f51f0b77051a0ef2ada993a16c5033768e1b8e8be3babfc52c303eecd07f')
19
20 def test_arm_ast1060_prot_3_07(self):
21 self.set_machine('ast1060-evb')
22
23 kernel_name = "ast1060_prot/zephyr.bin"
24 kernel_file = self.archive_extract(
25 self.ASSET_ASPEED_AST1060_PROT_3_07, member=kernel_name)
26
27 self.vm.set_console()
28 self.vm.add_args('-kernel', kernel_file, '-nographic')
29 self.vm.launch()
30 self.wait_for_console_pattern("Booting Zephyr OS")
31 exec_command_and_wait_for_pattern(self, "help",
32 "Available commands")
33
34 def test_arm_ast1060_otp_blockdev_device(self):
35 self.vm.set_machine("ast1060-evb")
36
37 kernel_name = "ast1060_prot/zephyr.bin"
38 kernel_file = self.archive_extract(self.ASSET_ASPEED_AST1060_PROT_3_07,
39 member=kernel_name)
40 otp_img = self.generate_otpmem_image()
41
42 self.vm.set_console()
43 self.vm.add_args(
44 "-kernel", kernel_file,
45 "-blockdev", f"driver=file,filename={otp_img},node-name=otp",
46 "-global", "aspeed-otp.drive=otp",
47 )
48 self.vm.launch()
49 self.wait_for_console_pattern("Booting Zephyr OS")
50
51 if __name__ == '__main__':
52 AspeedTest.main()