SSP and TSP now boot in a powered-off state by default. Enabling them requires
the PSP (Cortex-A35) to explicitly set SCU control registers at runtime. This
behavior aligns with real hardware.

Update the AST2700 FC functional test to reflect this behavior by enabling
SSP and TSP from the U-Boot shell before booting OpenBMC. The test now
programs the required SCU registers, saves the environment, and boots the
system so that SSP and TSP are powered on when the PSP starts.

Additionally, switch SSP and TSP loading from ELF-based CPU loaders to
binary images loaded into PSP DRAM at fixed addresses, and remove the use
of snapshot mode.

Changes include:
- Add enable_ast2700_ssp_tsp() to configure SCU registers via U-Boot
- Remove snapshot option from QEMU command line
- Load SSP binary at DRAM address 0x42C000000
- Load TSP binary at DRAM address 0x42E000000

Signed-off-by: Jamin Lin <[email protected]>
---
 .../aarch64/test_aspeed_ast2700fc.py          | 34 ++++++++++---------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/tests/functional/aarch64/test_aspeed_ast2700fc.py 
b/tests/functional/aarch64/test_aspeed_ast2700fc.py
index 51ee8bc787..3b68f37b63 100755
--- a/tests/functional/aarch64/test_aspeed_ast2700fc.py
+++ b/tests/functional/aarch64/test_aspeed_ast2700fc.py
@@ -23,13 +23,17 @@ def do_test_aarch64_aspeed_sdk_start(self, image):
         self.vm.add_args('-device', 'e1000e,netdev=net1,bus=pcie.2')
         self.vm.add_args('-netdev', 'user,id=net1')
         self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
-                         '-net', 'nic', '-net', 'user', '-snapshot')
+                         '-net', 'nic', '-net', 'user')
 
         self.vm.launch()
 
+    def enable_ast2700_ssp_tsp(self):
+        exec_command_and_wait_for_pattern(self,
+            'setenv bootcmd "mw 12c02204 40000000; mw 12c02120 1; '
+            'mw 12c02224 00000200; mw 12c02160 1; run bootspi"', '=>')
+        exec_command_and_wait_for_pattern(self, 'saveenv', 'OK')
+
     def enable_ast2700_pcie2(self):
-        wait_for_console_pattern(self, 'Hit any key to stop autoboot')
-        exec_command_and_wait_for_pattern(self, '\012', '=>')
         exec_command_and_wait_for_pattern(self,
             'cp 100420000 403000000 900000', '=>')
         exec_command_and_wait_for_pattern(self,
@@ -43,6 +47,9 @@ def enable_ast2700_pcie2(self):
 
     def verify_openbmc_boot_and_login(self, name):
         wait_for_console_pattern(self, 'U-Boot 2023.10')
+        wait_for_console_pattern(self, 'Hit any key to stop autoboot')
+        exec_command_and_wait_for_pattern(self, '\012', '=>')
+        self.enable_ast2700_ssp_tsp()
         self.enable_ast2700_pcie2()
         wait_for_console_pattern(self, 'Starting kernel ...')
 
@@ -50,17 +57,6 @@ def verify_openbmc_boot_and_login(self, name):
         exec_command_and_wait_for_pattern(self, 'root', 'Password:')
         exec_command_and_wait_for_pattern(self, '0penBmc', f'root@{name}:~#')
 
-    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}')
-
     ASSET_SDK_V1100_AST2700 = Asset(
             
'https://github.com/AspeedTech-BMC/openbmc/releases/download/v11.00/ast2700-default-obmc.tar.gz',
             'e2b8f043fe8063dd3b6ded93422e38bd41914dc9c3202199507652df024de4dc')
@@ -118,6 +114,14 @@ def start_ast2700fc_test(self, name):
                 'addr': '0x400000000',
                 'file': self.scratch_file(name, 'u-boot.bin')
             },
+            {
+                'addr': '0x42C000000',
+                'file': self.scratch_file(name, 'zephyr-aspeed-ssp.bin')
+            },
+            {
+                'addr': '0x42E000000',
+                'file': self.scratch_file(name, 'zephyr-aspeed-tsp.bin')
+            },
             {
                 'addr': '0x430000000',
                 'file': self.scratch_file(name, 'bl31.bin')
@@ -138,13 +142,11 @@ def start_ast2700fc_test(self, name):
             self.vm.add_args('-device',
                              f'loader,addr=0x430000000,cpu-num={i}')
 
-        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'))
 
-- 
2.43.0

Reply via email to