11/** @file
2- * Copyright (c) 2020-2025 , Arm Limited or its affiliates. All rights reserved.
2+ * Copyright (c) 2020-2026 , Arm Limited or its affiliates. All rights reserved.
33 * SPDX-License-Identifier : Apache-2.0
44
55 * Licensed under the Apache License, Version 2.0 (the "License");
2121#include "val/include/acs_pe.h"
2222#include "val/include/acs_memory.h"
2323
24- static const
25- test_config_t test_entries [] = {
26- { ACS_PCIE_TEST_NUM_BASE + 70 , "Check Power Management rules: RCiEP " , "RE_PWR_1" },
27- { ACS_PCIE_TEST_NUM_BASE + 34 , "Check Power Management rules: iEP/RP " , "IE_PWR_1" }
28- };
29-
30- /* Declare and define struct - passed as argument to payload */
31- typedef struct {
32- uint32_t test_num ;
33- uint32_t dev_type1 ;
34- uint32_t dev_type2 ;
35- } test_data_t ;
24+ #define TEST_NUM (ACS_PCIE_TEST_NUM_BASE + 70)
25+ #define TEST_RULE "RI_PWR_1"
26+ #define TEST_DESC "Check Power Mgmt rules: RCiEP/iEP/RP "
3627
3728static
3829void
39- payload (void * arg )
30+ payload (void )
4031{
4132
4233 uint32_t bdf ;
@@ -47,7 +38,6 @@ payload(void *arg)
4738 uint32_t test_fails ;
4839 bool test_skip = 1 ;
4940 pcie_device_bdf_table * bdf_tbl_ptr ;
50- test_data_t * test_data = (test_data_t * )arg ;
5141
5242 pe_index = val_pe_get_index_mpid (val_pe_get_mpid ());
5343 bdf_tbl_ptr = val_pcie_bdf_table_ptr ();
@@ -61,7 +51,7 @@ payload(void *arg)
6151 dp_type = val_pcie_device_port_type (bdf );
6252
6353 /* Check entry is onchip peripherals */
64- if (( dp_type == test_data -> dev_type1 ) || ( dp_type == test_data -> dev_type2 ) )
54+ if (dp_type == RCiEP || dp_type == iEP_EP || dp_type == iEP_RP )
6555 {
6656 val_print (ACS_PRINT_DEBUG , "\n BDF - 0x%x" , bdf );
6757
@@ -80,52 +70,29 @@ payload(void *arg)
8070 if (test_skip == 1 ) {
8171 val_print (ACS_PRINT_DEBUG ,
8272 "\n No target device type found. Skipping test" , bdf );
83- val_set_status (pe_index , RESULT_SKIP (test_data -> test_num , 01 ));
73+ val_set_status (pe_index , RESULT_SKIP (TEST_NUM , 01 ));
8474 }
8575 else if (test_fails )
86- val_set_status (pe_index , RESULT_FAIL (test_data -> test_num , test_fails ));
76+ val_set_status (pe_index , RESULT_FAIL (TEST_NUM , test_fails ));
8777 else
88- val_set_status (pe_index , RESULT_PASS (test_data -> test_num , 01 ));
78+ val_set_status (pe_index , RESULT_PASS (TEST_NUM , 01 ));
8979}
9080
9181uint32_t
9282p070_entry (uint32_t num_pe )
9383{
9484 uint32_t status = ACS_STATUS_FAIL ;
95- test_data_t data = {.test_num = test_entries [0 ].test_num , .dev_type1 = (uint32_t )RCiEP };
96-
97- num_pe = 1 ; //This test is run on single processor
98-
99- val_log_context ((char8_t * )__FILE__ , (char8_t * )__func__ , __LINE__ );
100- status = val_initialize_test (test_entries [0 ].test_num , test_entries [0 ].desc , num_pe );
101- if (status != ACS_STATUS_SKIP )
102- val_run_test_configurable_payload (& data , payload );
103-
104- /* get the result from all PE and check for failure */
105- status = val_check_for_error (test_entries [0 ].test_num , num_pe , test_entries [0 ].rule );
106-
107- val_report_status (0 , ACS_END (test_entries [0 ].test_num ), test_entries [0 ].rule );
108- return status ;
109- }
110-
111- uint32_t
112- p034_entry (uint32_t num_pe )
113- {
114- uint32_t status = ACS_STATUS_FAIL ;
115- test_data_t data = {.test_num = test_entries [1 ].test_num ,
116- .dev_type1 = (uint32_t )iEP_EP ,
117- .dev_type2 = (uint32_t )iEP_RP };
11885
11986 num_pe = 1 ; //This test is run on single processor
12087
12188 val_log_context ((char8_t * )__FILE__ , (char8_t * )__func__ , __LINE__ );
122- status = val_initialize_test (test_entries [ 1 ]. test_num , test_entries [ 1 ]. desc , num_pe );
89+ status = val_initialize_test (TEST_NUM , TEST_DESC , num_pe );
12390 if (status != ACS_STATUS_SKIP )
124- val_run_test_configurable_payload ( & data , payload );
91+ val_run_test_payload ( TEST_NUM , num_pe , payload , 0 );
12592
12693 /* get the result from all PE and check for failure */
127- status = val_check_for_error (test_entries [ 1 ]. test_num , num_pe , test_entries [ 1 ]. rule );
94+ status = val_check_for_error (TEST_NUM , num_pe , TEST_RULE );
12895
129- val_report_status (0 , ACS_END (test_entries [ 1 ]. test_num ), test_entries [ 1 ]. rule );
96+ val_report_status (0 , ACS_END (TEST_NUM ), NULL );
13097 return status ;
13198}
0 commit comments