[PATCH v4 3/3] tests/functional/aarch64/test_aspeed_ast2700fc: Add vbootrom test

Jamin Lin via posted 3 patches 1 month, 2 weeks ago
Maintainers: "Cédric Le Goater" <clg@kaod.org>, Peter Maydell <peter.maydell@linaro.org>, Steven Lee <steven_lee@aspeedtech.com>, Troy Lee <leetroy@gmail.com>, Jamin Lin <jamin_lin@aspeedtech.com>, Andrew Jeffery <andrew@codeconstruct.com.au>, Joel Stanley <joel@jms.id.au>
[PATCH v4 3/3] tests/functional/aarch64/test_aspeed_ast2700fc: Add vbootrom test
Posted by Jamin Lin via 1 month, 2 weeks ago
Introduce load_ast2700fc_coprocessor() to load the SSP/TSP ELF images
via -device loader. Use this helper in start_ast2700fc_test() to remove
duplicated code.

Add start_ast2700fc_test_vbootrom() which boots the ast2700fc machine
with -bios ast27x0_bootrom.bin and reuses the coprocessor loader.

Add test_aarch64_ast2700fc_sdk_vbootrom_v09_06() to test the vbootrom
with ast2700fc machine.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
 .../aarch64/test_aspeed_ast2700fc.py          | 37 ++++++++++++++-----
 1 file changed, 28 insertions(+), 9 deletions(-)

diff --git a/tests/functional/aarch64/test_aspeed_ast2700fc.py b/tests/functional/aarch64/test_aspeed_ast2700fc.py
index 28b66614d9..c0458e47b2 100755
--- a/tests/functional/aarch64/test_aspeed_ast2700fc.py
+++ b/tests/functional/aarch64/test_aspeed_ast2700fc.py
@@ -83,6 +83,17 @@ def do_ast2700fc_tsp_test(self):
         exec_command_and_wait_for_pattern(self, 'md 72c02000 1',
                                           '[72c02000] 06010103')
 
+    def load_ast2700fc_coprocessor(self, name):
+        load_elf_list = {
+            'ssp': self.scratch_file(name, 'zephyr-aspeed-ssp.elf'),
+            'tsp': self.scratch_file(name, 'zephyr-aspeed-tsp.elf')
+        }
+
+        for cpu_num, key in enumerate(load_elf_list, start=4):
+            file = load_elf_list[key]
+            self.vm.add_args('-device',
+                             f'loader,file={file},cpu-num={cpu_num}')
+
     def start_ast2700fc_test(self, name):
         ca35_core = 4
         uboot_size = os.path.getsize(self.scratch_file(name,
@@ -120,16 +131,13 @@ def start_ast2700fc_test(self, name):
             self.vm.add_args('-device',
                              f'loader,addr=0x430000000,cpu-num={i}')
 
-        load_elf_list = {
-            'ssp': self.scratch_file(name, 'zephyr-aspeed-ssp.elf'),
-            'tsp': self.scratch_file(name, 'zephyr-aspeed-tsp.elf')
-        }
-
-        for cpu_num, key in enumerate(load_elf_list, start=4):
-            file = load_elf_list[key]
-            self.vm.add_args('-device',
-                             f'loader,file={file},cpu-num={cpu_num}')
+        self.load_ast2700fc_coprocessor(name)
+        self.do_test_aarch64_aspeed_sdk_start(
+                self.scratch_file(name, 'image-bmc'))
 
+    def start_ast2700fc_test_vbootrom(self, name):
+        self.vm.add_args('-bios', 'ast27x0_bootrom.bin')
+        self.load_ast2700fc_coprocessor(name)
         self.do_test_aarch64_aspeed_sdk_start(
                 self.scratch_file(name, 'image-bmc'))
 
@@ -144,5 +152,16 @@ def test_aarch64_ast2700fc_sdk_v09_06(self):
         self.do_ast2700fc_ssp_test()
         self.do_ast2700fc_tsp_test()
 
+    def test_aarch64_ast2700fc_sdk_vbootrom_v09_06(self):
+        self.set_machine('ast2700fc')
+
+        self.archive_extract(self.ASSET_SDK_V906_AST2700)
+        self.start_ast2700fc_test_vbootrom('ast2700-default')
+        self.verify_openbmc_boot_and_login('ast2700-default')
+        self.do_ast2700_i2c_test()
+        self.do_ast2700_pcie_test()
+        self.do_ast2700fc_ssp_test()
+        self.do_ast2700fc_tsp_test()
+
 if __name__ == '__main__':
     QemuSystemTest.main()
-- 
2.43.0
Re: [PATCH v4 3/3] tests/functional/aarch64/test_aspeed_ast2700fc: Add vbootrom test
Posted by Cédric Le Goater 1 month, 2 weeks ago
Hello,

On 10/1/25 08:46, Jamin Lin wrote:
> Introduce load_ast2700fc_coprocessor() to load the SSP/TSP ELF images
> via -device loader. Use this helper in start_ast2700fc_test() to remove
> duplicated code.

Ideally, this should be an extra patch. Minor.

> 
> Add start_ast2700fc_test_vbootrom() which boots the ast2700fc machine
> with -bios ast27x0_bootrom.bin and reuses the coprocessor loader.
> 
> Add test_aarch64_ast2700fc_sdk_vbootrom_v09_06() to test the vbootrom
> with ast2700fc machine.
> 
> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> ---
>   .../aarch64/test_aspeed_ast2700fc.py          | 37 ++++++++++++++-----
>   1 file changed, 28 insertions(+), 9 deletions(-)
> 
> diff --git a/tests/functional/aarch64/test_aspeed_ast2700fc.py b/tests/functional/aarch64/test_aspeed_ast2700fc.py
> index 28b66614d9..c0458e47b2 100755
> --- a/tests/functional/aarch64/test_aspeed_ast2700fc.py
> +++ b/tests/functional/aarch64/test_aspeed_ast2700fc.py
> @@ -83,6 +83,17 @@ def do_ast2700fc_tsp_test(self):
>           exec_command_and_wait_for_pattern(self, 'md 72c02000 1',
>                                             '[72c02000] 06010103')
>   
> +    def load_ast2700fc_coprocessor(self, name):
> +        load_elf_list = {
> +            'ssp': self.scratch_file(name, 'zephyr-aspeed-ssp.elf'),
> +            'tsp': self.scratch_file(name, 'zephyr-aspeed-tsp.elf')
> +        }
> +
> +        for cpu_num, key in enumerate(load_elf_list, start=4):
> +            file = load_elf_list[key]
> +            self.vm.add_args('-device',
> +                             f'loader,file={file},cpu-num={cpu_num}')
> +
>       def start_ast2700fc_test(self, name):
>           ca35_core = 4
>           uboot_size = os.path.getsize(self.scratch_file(name,
> @@ -120,16 +131,13 @@ def start_ast2700fc_test(self, name):
>               self.vm.add_args('-device',
>                                f'loader,addr=0x430000000,cpu-num={i}')
>   
> -        load_elf_list = {
> -            'ssp': self.scratch_file(name, 'zephyr-aspeed-ssp.elf'),
> -            'tsp': self.scratch_file(name, 'zephyr-aspeed-tsp.elf')
> -        }
> -
> -        for cpu_num, key in enumerate(load_elf_list, start=4):
> -            file = load_elf_list[key]
> -            self.vm.add_args('-device',
> -                             f'loader,file={file},cpu-num={cpu_num}')
> +        self.load_ast2700fc_coprocessor(name)
> +        self.do_test_aarch64_aspeed_sdk_start(
> +                self.scratch_file(name, 'image-bmc'))
>   
> +    def start_ast2700fc_test_vbootrom(self, name):
> +        self.vm.add_args('-bios', 'ast27x0_bootrom.bin')
> +        self.load_ast2700fc_coprocessor(name)
>           self.do_test_aarch64_aspeed_sdk_start(
>                   self.scratch_file(name, 'image-bmc'))
>   
> @@ -144,5 +152,16 @@ def test_aarch64_ast2700fc_sdk_v09_06(self):
>           self.do_ast2700fc_ssp_test()
>           self.do_ast2700fc_tsp_test()
>   
> +    def test_aarch64_ast2700fc_sdk_vbootrom_v09_06(self):
> +        self.set_machine('ast2700fc')
> +
> +        self.archive_extract(self.ASSET_SDK_V906_AST2700)

Could we update all tests to use the latest SDK v09.08 [1] which
was released ?

Thanks,

C.

[1]  https://github.com/AspeedTech-BMC/openbmc/releases/tag/v09.08ed

> +        self.start_ast2700fc_test_vbootrom('ast2700-default')
> +        self.verify_openbmc_boot_and_login('ast2700-default')
> +        self.do_ast2700_i2c_test()
> +        self.do_ast2700_pcie_test()
> +        self.do_ast2700fc_ssp_test()
> +        self.do_ast2700fc_tsp_test()
> +
>   if __name__ == '__main__':
>       QemuSystemTest.main()
RE: [PATCH v4 3/3] tests/functional/aarch64/test_aspeed_ast2700fc: Add vbootrom test
Posted by Jamin Lin 1 month, 2 weeks ago
Hi Cédric

> Subject: Re: [PATCH v4 3/3] tests/functional/aarch64/test_aspeed_ast2700fc:
> Add vbootrom test
> 
> Hello,
> 
> On 10/1/25 08:46, Jamin Lin wrote:
> > Introduce load_ast2700fc_coprocessor() to load the SSP/TSP ELF images
> > via -device loader. Use this helper in start_ast2700fc_test() to
> > remove duplicated code.
> 
> Ideally, this should be an extra patch. Minor.


Will fix

> 
> >
> > Add start_ast2700fc_test_vbootrom() which boots the ast2700fc machine
> > with -bios ast27x0_bootrom.bin and reuses the coprocessor loader.
> >
> > Add test_aarch64_ast2700fc_sdk_vbootrom_v09_06() to test the vbootrom
> > with ast2700fc machine.
> >
> > Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> > ---
> >   .../aarch64/test_aspeed_ast2700fc.py          | 37
> ++++++++++++++-----
> >   1 file changed, 28 insertions(+), 9 deletions(-)
> >
> > diff --git a/tests/functional/aarch64/test_aspeed_ast2700fc.py
> > b/tests/functional/aarch64/test_aspeed_ast2700fc.py
> > index 28b66614d9..c0458e47b2 100755
> > --- a/tests/functional/aarch64/test_aspeed_ast2700fc.py
> > +++ b/tests/functional/aarch64/test_aspeed_ast2700fc.py
> > @@ -83,6 +83,17 @@ def do_ast2700fc_tsp_test(self):
> >           exec_command_and_wait_for_pattern(self, 'md 72c02000 1',
> >                                             '[72c02000]
> 06010103')
> >
> > +    def load_ast2700fc_coprocessor(self, name):
> > +        load_elf_list = {
> > +            'ssp': self.scratch_file(name, 'zephyr-aspeed-ssp.elf'),
> > +            'tsp': self.scratch_file(name, 'zephyr-aspeed-tsp.elf')
> > +        }
> > +
> > +        for cpu_num, key in enumerate(load_elf_list, start=4):
> > +            file = load_elf_list[key]
> > +            self.vm.add_args('-device',
> > +                             f'loader,file={file},cpu-num={cpu_num}')
> > +
> >       def start_ast2700fc_test(self, name):
> >           ca35_core = 4
> >           uboot_size = os.path.getsize(self.scratch_file(name,
> > @@ -120,16 +131,13 @@ def start_ast2700fc_test(self, name):
> >               self.vm.add_args('-device',
> >
> f'loader,addr=0x430000000,cpu-num={i}')
> >
> > -        load_elf_list = {
> > -            'ssp': self.scratch_file(name, 'zephyr-aspeed-ssp.elf'),
> > -            'tsp': self.scratch_file(name, 'zephyr-aspeed-tsp.elf')
> > -        }
> > -
> > -        for cpu_num, key in enumerate(load_elf_list, start=4):
> > -            file = load_elf_list[key]
> > -            self.vm.add_args('-device',
> > -                             f'loader,file={file},cpu-num={cpu_num}')
> > +        self.load_ast2700fc_coprocessor(name)
> > +        self.do_test_aarch64_aspeed_sdk_start(
> > +                self.scratch_file(name, 'image-bmc'))
> >
> > +    def start_ast2700fc_test_vbootrom(self, name):
> > +        self.vm.add_args('-bios', 'ast27x0_bootrom.bin')
> > +        self.load_ast2700fc_coprocessor(name)
> >           self.do_test_aarch64_aspeed_sdk_start(
> >                   self.scratch_file(name, 'image-bmc'))
> >
> > @@ -144,5 +152,16 @@ def test_aarch64_ast2700fc_sdk_v09_06(self):
> >           self.do_ast2700fc_ssp_test()
> >           self.do_ast2700fc_tsp_test()
> >
> > +    def test_aarch64_ast2700fc_sdk_vbootrom_v09_06(self):
> > +        self.set_machine('ast2700fc')
> > +
> > +        self.archive_extract(self.ASSET_SDK_V906_AST2700)
> 
> Could we update all tests to use the latest SDK v09.08 [1] which was released ?
> 

I’ll update AST2500 and AST2600 to SDK v09.08 after the release.

For AST2700, there are a few issues we should discuss.
1. AST2700 (ast2700fc) – SDK v09.08 support
The ast2700fc machine currently works only with SDK v09.06.  v09.07 and v09.08 --> Will encounter boot crash.
To move to v09.08, I need the patch series(Control Coprocessor Reset....). I’m reworking it so it can be accepted upstream.
This refactor introduces AspeedBase and AspeedCoprocessor classes and will require substantial changes across the codebase(It will need a lot of changes).

2. Starting with SDK v09.07, our SDK no longer produces "u-boot-nodtb.bin".
As a result, the manual device loader tests only work with v09.06 (-device loader,addr=0x400000000,file=u-boot-nodtb.bin,force-raw=on) .
Proposal: drop the manual device loader tests and keep only the vbootrom-based test cases going forward.

Could you please give me any suggestion?
Thanks-Jamin

> Thanks,
> 
> C.
> 
> [1]  https://github.com/AspeedTech-BMC/openbmc/releases/tag/v09.08ed
> 
> > +        self.start_ast2700fc_test_vbootrom('ast2700-default')
> > +        self.verify_openbmc_boot_and_login('ast2700-default')
> > +        self.do_ast2700_i2c_test()
> > +        self.do_ast2700_pcie_test()
> > +        self.do_ast2700fc_ssp_test()
> > +        self.do_ast2700fc_tsp_test()
> > +
> >   if __name__ == '__main__':
> >       QemuSystemTest.main()

Re: [PATCH v4 3/3] tests/functional/aarch64/test_aspeed_ast2700fc: Add vbootrom test
Posted by Cédric Le Goater 1 month, 2 weeks ago
Hello Jamin,

>> Could we update all tests to use the latest SDK v09.08 [1] which was released ?
>>
> 
> I’ll update AST2500 and AST2600 to SDK v09.08 after the release.
> 
> For AST2700, there are a few issues we should discuss.
> 1. AST2700 (ast2700fc) – SDK v09.08 support
> The ast2700fc machine currently works only with SDK v09.06.  v09.07 and v09.08 --> Will encounter boot crash.
> To move to v09.08, I need the patch series(Control Coprocessor Reset....). I’m reworking it so it can be accepted upstream.
> This refactor introduces AspeedBase and AspeedCoprocessor classes and will require substantial changes across the codebase(It will need a lot of changes).
> 
> 2. Starting with SDK v09.07, our SDK no longer produces "u-boot-nodtb.bin".
> As a result, the manual device loader tests only work with v09.06 (-device loader,addr=0x400000000,file=u-boot-nodtb.bin,force-raw=on) .
> Proposal: drop the manual device loader tests and keep only the vbootrom-based test cases going forward.
> 
> Could you please give me any suggestion?

I suggest updating tests with SDK v09.08 for all supported machines.
The commit log should mention which, and briefly why, machines are
kept to the previous releases.

Then, the series refactoring the AspeedCoprocessor models can update
the SDK to v09.08 once it is ready.

Thanks,

C.


RE: [PATCH v4 3/3] tests/functional/aarch64/test_aspeed_ast2700fc: Add vbootrom test
Posted by Jamin Lin 1 month, 1 week ago
Hi Cédric

> Subject: Re: [PATCH v4 3/3] tests/functional/aarch64/test_aspeed_ast2700fc:
> Add vbootrom test
> 
> Hello Jamin,
> 
> >> Could we update all tests to use the latest SDK v09.08 [1] which was
> released ?
> >>
> >
> > I’ll update AST2500 and AST2600 to SDK v09.08 after the release.
> >
> > For AST2700, there are a few issues we should discuss.
> > 1. AST2700 (ast2700fc) – SDK v09.08 support The ast2700fc machine
> > currently works only with SDK v09.06.  v09.07 and v09.08 --> Will encounter
> boot crash.
> > To move to v09.08, I need the patch series(Control Coprocessor Reset....).
> I’m reworking it so it can be accepted upstream.
> > This refactor introduces AspeedBase and AspeedCoprocessor classes and will
> require substantial changes across the codebase(It will need a lot of changes).
> >
> > 2. Starting with SDK v09.07, our SDK no longer produces "u-boot-nodtb.bin".
> > As a result, the manual device loader tests only work with v09.06 (-device
> loader,addr=0x400000000,file=u-boot-nodtb.bin,force-raw=on) .
> > Proposal: drop the manual device loader tests and keep only the
> vbootrom-based test cases going forward.
> >
> > Could you please give me any suggestion?
> 
> I suggest updating tests with SDK v09.08 for all supported machines.
> The commit log should mention which, and briefly why, machines are kept to
> the previous releases.
> 
> Then, the series refactoring the AspeedCoprocessor models can update the
> SDK to v09.08 once it is ready.
> 

This patch series will not be resent and will remain pending until the AspeedCoprocessor models patch series is accepted.

Thanks-Jamin

> Thanks,
> 
> C.