[PATCH v2 13/14] tests/functional/arm/test_aspeed_ast2600: add PCIe enumeration test

Jamin Lin via posted 14 patches 2 weeks, 3 days ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, "Cédric Le Goater" <clg@kaod.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>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
There is a newer version of this series
[PATCH v2 13/14] tests/functional/arm/test_aspeed_ast2600: add PCIe enumeration test
Posted by Jamin Lin via 2 weeks, 3 days ago
Extend the AST2600 functional tests with a PCIe enumeration check.

This patch introduces a new helper "do_ast2600_pcie_test()" that runs
"lspci" on the emulated system and verifies the presence of the expected
PCIe devices:

- 80:00.0 Host bridge: ASPEED Technology, Inc. Device 2600
- 80:08.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
 tests/functional/arm/test_aspeed_ast2600.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/functional/arm/test_aspeed_ast2600.py b/tests/functional/arm/test_aspeed_ast2600.py
index 129695ca4e..f97fbbaa11 100755
--- a/tests/functional/arm/test_aspeed_ast2600.py
+++ b/tests/functional/arm/test_aspeed_ast2600.py
@@ -101,6 +101,14 @@ def test_arm_ast2600_evb_buildroot_tpm(self):
         'https://github.com/AspeedTech-BMC/openbmc/releases/download/v09.07/ast2600-default-obmc.tar.gz',
         'cb6c08595bcbba1672ce716b068ba4e48eda1ed9abe78a07b30392ba2278feba')
 
+    def do_ast2600_pcie_test(self):
+        exec_command_and_wait_for_pattern(self,
+            'lspci -s 80:00.0',
+            '80:00.0 Host bridge: ASPEED Technology, Inc. Device 2600')
+        exec_command_and_wait_for_pattern(self,
+            'lspci -s 80:08.0',
+            '80:08.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge')
+
     def test_arm_ast2600_evb_sdk(self):
         self.set_machine('ast2600-evb')
 
@@ -136,5 +144,7 @@ def test_arm_ast2600_evb_sdk(self):
         exec_command_and_wait_for_pattern(self,
              '/sbin/hwclock -f /dev/rtc1', year)
 
+        self.do_ast2600_pcie_test()
+
 if __name__ == '__main__':
     AspeedTest.main()
-- 
2.43.0
Re: [SPAM] [PATCH v2 13/14] tests/functional/arm/test_aspeed_ast2600: add PCIe enumeration test
Posted by Cédric Le Goater 1 week, 5 days ago
On 9/11/25 09:24, Jamin Lin wrote:
> Extend the AST2600 functional tests with a PCIe enumeration check.
> 
> This patch introduces a new helper "do_ast2600_pcie_test()" that runs
> "lspci" on the emulated system and verifies the presence of the expected
> PCIe devices:
> 
> - 80:00.0 Host bridge: ASPEED Technology, Inc. Device 2600
> - 80:08.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge
> 
> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> ---
>   tests/functional/arm/test_aspeed_ast2600.py | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/tests/functional/arm/test_aspeed_ast2600.py b/tests/functional/arm/test_aspeed_ast2600.py
> index 129695ca4e..f97fbbaa11 100755
> --- a/tests/functional/arm/test_aspeed_ast2600.py
> +++ b/tests/functional/arm/test_aspeed_ast2600.py
> @@ -101,6 +101,14 @@ def test_arm_ast2600_evb_buildroot_tpm(self):
>           'https://github.com/AspeedTech-BMC/openbmc/releases/download/v09.07/ast2600-default-obmc.tar.gz',
>           'cb6c08595bcbba1672ce716b068ba4e48eda1ed9abe78a07b30392ba2278feba')
>   
> +    def do_ast2600_pcie_test(self):
> +        exec_command_and_wait_for_pattern(self,
> +            'lspci -s 80:00.0',
> +            '80:00.0 Host bridge: ASPEED Technology, Inc. Device 2600')
> +        exec_command_and_wait_for_pattern(self,
> +            'lspci -s 80:08.0',
> +            '80:08.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI Bridge')
> +

I would add '-device e1000e,netdev=net1,bus=pcie.0 -netdev user,id=net1' and
check that an IP address is assigned to the interface.


Thanks,

C.



>       def test_arm_ast2600_evb_sdk(self):
>           self.set_machine('ast2600-evb')
>   
> @@ -136,5 +144,7 @@ def test_arm_ast2600_evb_sdk(self):
>           exec_command_and_wait_for_pattern(self,
>                '/sbin/hwclock -f /dev/rtc1', year)
>   
> +        self.do_ast2600_pcie_test()
> +
>   if __name__ == '__main__':
>       AspeedTest.main()
RE: [SPAM] [PATCH v2 13/14] tests/functional/arm/test_aspeed_ast2600: add PCIe enumeration test
Posted by Jamin Lin 1 week, 5 days ago
Hi Cédric

> tests/functional/arm/test_aspeed_ast2600: add PCIe enumeration test
> 
> On 9/11/25 09:24, Jamin Lin wrote:
> > Extend the AST2600 functional tests with a PCIe enumeration check.
> >
> > This patch introduces a new helper "do_ast2600_pcie_test()" that runs
> > "lspci" on the emulated system and verifies the presence of the
> > expected PCIe devices:
> >
> > - 80:00.0 Host bridge: ASPEED Technology, Inc. Device 2600
> > - 80:08.0 PCI bridge: ASPEED Technology, Inc. AST1150 PCI-to-PCI
> > Bridge
> >
> > Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> > ---
> >   tests/functional/arm/test_aspeed_ast2600.py | 10 ++++++++++
> >   1 file changed, 10 insertions(+)
> >
> > diff --git a/tests/functional/arm/test_aspeed_ast2600.py
> > b/tests/functional/arm/test_aspeed_ast2600.py
> > index 129695ca4e..f97fbbaa11 100755
> > --- a/tests/functional/arm/test_aspeed_ast2600.py
> > +++ b/tests/functional/arm/test_aspeed_ast2600.py
> > @@ -101,6 +101,14 @@ def test_arm_ast2600_evb_buildroot_tpm(self):
> >
> 'https://github.com/AspeedTech-BMC/openbmc/releases/download/v09.07/ast
> 2600-default-obmc.tar.gz',
> >
> >
> 'cb6c08595bcbba1672ce716b068ba4e48eda1ed9abe78a07b30392ba2278feba'
> )
> >
> > +    def do_ast2600_pcie_test(self):
> > +        exec_command_and_wait_for_pattern(self,
> > +            'lspci -s 80:00.0',
> > +            '80:00.0 Host bridge: ASPEED Technology, Inc. Device 2600')
> > +        exec_command_and_wait_for_pattern(self,
> > +            'lspci -s 80:08.0',
> > +            '80:08.0 PCI bridge: ASPEED Technology, Inc. AST1150
> > + PCI-to-PCI Bridge')
> > +
> 
> I would add '-device e1000e,netdev=net1,bus=pcie.0 -netdev user,id=net1' and
> check that an IP address is assigned to the interface.
> 
> 
Thanks for your review and suggestion.
I will add a test for the e1000e device on AST2600.

I also have a question regarding AST2700:

1. SDK v09.06 does not include a built-in e1000e driver.
2. AST2700 A0 does not support PCIe RC.

Given these limitations, if we want to test e1000e on AST2700, can I only add a test case for the AST2700 vbootrom?

1. The AST2700 FC SDK is still on v09.06 and cannot be upgraded to v09.07 until the following patch series is applied:
https://patchwork.kernel.org/project/qemu-devel/cover/20250717034054.1903991-1-jamin_lin@aspeedtech.com/

2. The manual device loader cannot be updated to SDK v09.07 because of this commit
https://github.com/AspeedTech-BMC/openbmc/commit/17f7a259f3a4d052b9ea93353a3400040f39992e

Starting from SDK v09.07, u-boot-nodtb.bin is no longer shipped.
If we want to support it, we can generate it manually with the following commands:

dumpimage -T flat_dt -p 0 -o u-boot-nodtb.bin u-boot.bin
dumpimage -T flat_dt -p 1 -o u-boot.dtb u-boot.bin

However, I am not sure how to install the dumpimage tool in the test environment.
Could you please give me any suggestion?

Thanks-Jamin

> Thanks,
> 
> C.
> 
> 
> 
> >       def test_arm_ast2600_evb_sdk(self):
> >           self.set_machine('ast2600-evb')
> >
> > @@ -136,5 +144,7 @@ def test_arm_ast2600_evb_sdk(self):
> >           exec_command_and_wait_for_pattern(self,
> >                '/sbin/hwclock -f /dev/rtc1', year)
> >
> > +        self.do_ast2600_pcie_test()
> > +
> >   if __name__ == '__main__':
> >       AspeedTest.main()

Re: [SPAM] [PATCH v2 13/14] tests/functional/arm/test_aspeed_ast2600: add PCIe enumeration test
Posted by Cédric Le Goater 1 week, 5 days ago
Hi,

>> I would add '-device e1000e,netdev=net1,bus=pcie.0 -netdev user,id=net1' and
>> check that an IP address is assigned to the interface.
>>
>>
> Thanks for your review and suggestion.
> I will add a test for the e1000e device on AST2600.
> 
> I also have a question regarding AST2700:
> 
> 1. SDK v09.06 does not include a built-in e1000e driver.

We have switched to v09.07 now.

> 2. AST2700 A0 does not support PCIe RC.
> 
> Given these limitations, if we want to test e1000e on AST2700, can I only add a test case for the AST2700 vbootrom?

I think we can limit the test to AST2700 A1 since A0 should be removed.
  
> 1. The AST2700 FC SDK is still on v09.06 and cannot be upgraded to v09.07 until the following patch series is applied:
> https://patchwork.kernel.org/project/qemu-devel/cover/20250717034054.1903991-1-jamin_lin@aspeedtech.com/

v09.07 is merged already and the series above needs a large rework
of the coprocessor models.

> 2. The manual device loader cannot be updated to SDK v09.07 because of this commit
> https://github.com/AspeedTech-BMC/openbmc/commit/17f7a259f3a4d052b9ea93353a3400040f39992e
>
> Starting from SDK v09.07, u-boot-nodtb.bin is no longer shipped.
> If we want to support it, we can generate it manually with the following commands:
> 
> dumpimage -T flat_dt -p 0 -o u-boot-nodtb.bin u-boot.bin
> dumpimage -T flat_dt -p 1 -o u-boot.dtb u-boot.bin
> 
> However, I am not sure how to install the dumpimage tool in the test environment.
> Could you please give me any suggestion?

I am not sure I am following the constraints/requirements :/

As of today, ast2600-evb looks ok to me. May be work on that first.


Thanks,

C.
RE: [SPAM] [PATCH v2 13/14] tests/functional/arm/test_aspeed_ast2600: add PCIe enumeration test
Posted by Jamin Lin 1 week, 5 days ago
Hi Cédric

> tests/functional/arm/test_aspeed_ast2600: add PCIe enumeration test
> 
> Hi,
> 
> >> I would add '-device e1000e,netdev=net1,bus=pcie.0 -netdev
> >> user,id=net1' and check that an IP address is assigned to the interface.
> >>
> >>
> > Thanks for your review and suggestion.
> > I will add a test for the e1000e device on AST2600.
> >
> > I also have a question regarding AST2700:
> >
> > 1. SDK v09.06 does not include a built-in e1000e driver.
> 
> We have switched to v09.07 now.
> 
> > 2. AST2700 A0 does not support PCIe RC.
> >
> > Given these limitations, if we want to test e1000e on AST2700, can I only add
> a test case for the AST2700 vbootrom?
> 
> I think we can limit the test to AST2700 A1 since A0 should be removed.
> 
> > 1. The AST2700 FC SDK is still on v09.06 and cannot be upgraded to v09.07
> until the following patch series is applied:
> > https://patchwork.kernel.org/project/qemu-devel/cover/20250717034054.1
> > 903991-1-jamin_lin@aspeedtech.com/
> 
> v09.07 is merged already and the series above needs a large rework of the
> coprocessor models.
> 
> > 2. The manual device loader cannot be updated to SDK v09.07 because of
> > this commit
> >
> https://github.com/AspeedTech-BMC/openbmc/commit/17f7a259f3a4d052b9
> ea9
> > 3353a3400040f39992e
> >
> > Starting from SDK v09.07, u-boot-nodtb.bin is no longer shipped.
> > If we want to support it, we can generate it manually with the following
> commands:
> >
> > dumpimage -T flat_dt -p 0 -o u-boot-nodtb.bin u-boot.bin dumpimage -T
> > flat_dt -p 1 -o u-boot.dtb u-boot.bin
> >
> > However, I am not sure how to install the dumpimage tool in the test
> environment.
> > Could you please give me any suggestion?
> 
> I am not sure I am following the constraints/requirements :/
> 
> As of today, ast2600-evb looks ok to me. May be work on that first.
> 
Thanks for the suggestions.
Will resend v3 
Jamin
> 
> Thanks,
> 
> C.