Skip to content
This repository was archived by the owner on Jun 20, 2025. It is now read-only.

Commit 5317dae

Browse files
Merge pull request #88 from chetan-rathore/main
BSA 1.0.3 release changes
2 parents 5e26c4e + 2ef7629 commit 5317dae

File tree

9 files changed

+101
-61
lines changed

9 files changed

+101
-61
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A few tests are executed by running the BSA ACS Linux application which in turn
1616

1717

1818
## Release details
19-
- Code quality: v1.0.2
19+
- Code quality: v1.0.3
2020
- The tests are written for version 1.0 of the BSA specification.
2121
- The compliance suite is not a substitute for design verification.
2222
- To review the BSA ACS logs, Arm licensees can contact Arm directly through their partner managers.
@@ -243,4 +243,4 @@ BSA ACS is distributed under Apache v2.0 License.
243243

244244
--------------
245245

246-
*Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.*
246+
*Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.*

linux_app/bsa-acs-app/include/bsa_app.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2016-2022, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2016-2023, 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");
@@ -22,7 +22,7 @@
2222

2323
#define BSA_APP_VERSION_MAJOR 1
2424
#define BSA_APP_VERSION_MINOR 0
25-
#define BSA_APP_VERSION_SUBMINOR 2
25+
#define BSA_APP_VERSION_SUBMINOR 3
2626

2727
#define G_SW_OS 0
2828
#define G_SW_HYP 1

platform/pal_uefi_acpi/src/pal_pe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2016-2021, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2016-2023, 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");
@@ -157,7 +157,7 @@ pal_pe_create_info_table(PE_INFO_TABLE *PeTable)
157157
Ptr->pe_num = PeTable->header.num_of_pe;
158158
Ptr->pmu_gsiv = Entry->PerformanceInterruptGsiv;
159159
Ptr->gmain_gsiv = Entry->VGICMaintenanceInterrupt;
160-
bsa_print(ACS_PRINT_DEBUG, L" MPIDR %x PE num %x \n", Ptr->mpidr, Ptr->pe_num);
160+
bsa_print(ACS_PRINT_DEBUG, L" MPIDR %llx PE num %x \n", Ptr->mpidr, Ptr->pe_num);
161161
pal_pe_data_cache_ops_by_va((UINT64)Ptr, CLEAN_AND_INVALIDATE);
162162
Ptr++;
163163
PeTable->header.num_of_pe++;

platform/pal_uefi_dt/src/pal_dt_debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2021 Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2023 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");
@@ -42,7 +42,7 @@ dt_dump_pe_table(PE_INFO_TABLE *PeTable)
4242

4343
while (Index < PeTable->header.num_of_pe) {
4444
bsa_print(ACS_PRINT_DEBUG, L" PE NUM :%x\n", PeTable->pe_info[Index].pe_num);
45-
bsa_print(ACS_PRINT_DEBUG, L" MPIDR :%x\n", PeTable->pe_info[Index].mpidr);
45+
bsa_print(ACS_PRINT_DEBUG, L" MPIDR :%llx\n", PeTable->pe_info[Index].mpidr);
4646
// bsa_print(ACS_PRINT_DEBUG, L" ATTR :%x\n", PeTable->pe_info[Index].attr);
4747
bsa_print(ACS_PRINT_DEBUG, L" PMU GSIV :%x\n", PeTable->pe_info[Index].pmu_gsiv);
4848
Index++;

test_pool/memory_map/operating_system/test_os_m002.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2021 Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2023 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");
@@ -28,7 +28,7 @@
2828

2929
#define LOOP_VAR 3 /* Number of Addresses to check */
3030

31-
static void *branch_to_test;
31+
static uint64_t branch_to_test;
3232
uint32_t loop_var = LOOP_VAR;
3333
uint32_t instance = 0;
3434
uint32_t timeout;
@@ -42,7 +42,7 @@ void
4242
esr(uint64_t interrupt_type, void *context)
4343
{
4444
/* Update the ELR to point to next instrcution */
45-
val_pe_update_elr(context, (uint64_t)branch_to_test);
45+
val_pe_update_elr(context, branch_to_test);
4646

4747
val_print(ACS_PRINT_DEBUG, "\n Received DAbort Exception ", 0);
4848
}
@@ -60,7 +60,7 @@ payload()
6060
val_pe_install_esr(EXCEPT_AARCH64_SERROR, esr);
6161
val_set_status(index, RESULT_SKIP(TEST_NUM, 1));
6262

63-
branch_to_test = &&exception_taken_d;
63+
branch_to_test = (uint64_t)&&exception_taken_d;
6464
while (loop_var) {
6565
timeout = TIMEOUT_SMALL;
6666
/* Get the address of device memory region */
@@ -86,7 +86,7 @@ payload()
8686
normal_mem_test:
8787
loop_var = LOOP_VAR;
8888
instance = 0;
89-
branch_to_test = &&exception_taken_n;
89+
branch_to_test = (uint64_t)&&exception_taken_n;
9090
while (loop_var) {
9191
timeout = TIMEOUT_SMALL;
9292
/* Get the address of normal memory region */

uefi_app/BsaAcs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2016-2022, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2016-2023, 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");
@@ -22,7 +22,7 @@
2222

2323
#define BSA_ACS_MAJOR_VER 1
2424
#define BSA_ACS_MINOR_VER 0
25-
#define BSA_ACS_SUBMINOR_VER 2
25+
#define BSA_ACS_SUBMINOR_VER 3
2626

2727
#define G_PRINT_LEVEL ACS_PRINT_TEST
2828

val/include/bsa_acs_exerciser.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2016-2020,2021 Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2016-2021, 2023 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");
@@ -97,7 +97,7 @@ typedef enum {
9797
INVALID_CFG = 0x19
9898
} EXERCISER_ERROR_CODE;
9999

100-
void val_exerciser_create_info_table(void);
100+
uint32_t val_exerciser_create_info_table(void);
101101
uint32_t val_exerciser_init(uint32_t instance);
102102
uint32_t val_exerciser_get_info(EXERCISER_INFO_TYPE type, uint32_t instance);
103103
uint32_t val_exerciser_set_param(EXERCISER_PARAM_TYPE type, uint64_t value1, uint64_t value2, uint32_t instance);

val/src/acs_exerciser.c

Lines changed: 72 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2016-2022 Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2016-2023 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");
@@ -30,44 +30,89 @@ extern uint32_t pcie_bdf_table_list_flag;
3030
@param exerciser_info_table - Table pointer to be filled by this API
3131
@return exerciser_info_table - Contains info to communicate with stimulus generation hardware
3232
**/
33-
void val_exerciser_create_info_table(void)
33+
uint32_t val_exerciser_create_info_table(void)
3434
{
35-
uint32_t Bdf;
35+
uint32_t num_ecam;
36+
uint32_t seg_num;
37+
uint32_t start_bus;
38+
uint32_t end_bus;
39+
uint32_t bus_index;
40+
uint32_t dev_index;
41+
uint32_t func_index;
42+
uint32_t ecam_index;
43+
uint32_t bdf;
3644
uint32_t reg_value;
37-
uint32_t num_bdf;
38-
pcie_device_bdf_table *bdf_table;
45+
uint32_t cid_offset;
46+
uint32_t p_cap;
3947

40-
bdf_table = val_pcie_bdf_table_ptr();
41-
/* if no bdf table ptr return error */
42-
if (bdf_table->num_entries == 0)
48+
num_ecam = val_pcie_get_info(PCIE_INFO_NUM_ECAM, 0);
49+
if (num_ecam == 0)
4350
{
44-
val_print(ACS_PRINT_DEBUG, "\n No BDFs discovered ", 0);
45-
return;
51+
val_print(ACS_PRINT_ERR,
52+
" No ECAMs discovered \n ", 0);
53+
return 1;
4654
}
4755

48-
num_bdf = bdf_table->num_entries;
49-
while (num_bdf-- != 0)
56+
for (ecam_index = 0; ecam_index < num_ecam; ecam_index++)
5057
{
58+
/* Derive ecam specific information */
59+
seg_num = val_pcie_get_info(PCIE_INFO_SEGMENT, ecam_index);
60+
start_bus = val_pcie_get_info(PCIE_INFO_START_BUS, ecam_index);
61+
end_bus = val_pcie_get_info(PCIE_INFO_END_BUS, ecam_index);
5162

52-
Bdf = bdf_table->device[num_bdf].bdf;
53-
/* Probe pcie device Function with this bdf */
54-
if (val_pcie_read_cfg(Bdf, TYPE01_VIDR, &reg_value) == PCIE_NO_MAPPING)
63+
/* Iterate over all buses, devices and functions in this ecam */
64+
for (bus_index = start_bus; bus_index <= end_bus; bus_index++)
5565
{
56-
/* Return if there is a bdf mapping issue */
57-
val_print(ACS_PRINT_ERR, "\n BDF 0x%x mapping issue", Bdf);
58-
return;
59-
}
60-
61-
/* Store the Function's BDF if there was a valid response */
62-
if (pal_is_bdf_exerciser(Bdf))
63-
{
64-
g_exercier_info_table.e_info[g_exercier_info_table.num_exerciser].bdf = Bdf;
65-
g_exercier_info_table.e_info[g_exercier_info_table.num_exerciser++].initialized = 0;
66-
val_print(ACS_PRINT_INFO, "\n exerciser Bdf %x", Bdf);
66+
for (dev_index = 0; dev_index < PCIE_MAX_DEV; dev_index++)
67+
{
68+
for (func_index = 0; func_index < PCIE_MAX_FUNC; func_index++)
69+
{
70+
/* Form bdf using seg, bus, device, function numbers */
71+
bdf = PCIE_CREATE_BDF(seg_num, bus_index, dev_index, func_index);
72+
73+
/* Probe pcie device Function with this bdf */
74+
if (val_pcie_read_cfg(bdf, TYPE01_VIDR, &reg_value) == PCIE_NO_MAPPING)
75+
{
76+
/* Return if there is a bdf mapping issue */
77+
val_print(ACS_PRINT_ERR, "\n BDF 0x%x mapping issue", bdf);
78+
return 1;
79+
}
80+
81+
/* Store the Function's BDF if there was a valid response */
82+
if (reg_value != PCIE_UNKNOWN_RESPONSE)
83+
{
84+
/* Skip if the device is a host bridge */
85+
if (val_pcie_is_host_bridge(bdf))
86+
continue;
87+
88+
/* Skip if the device is a PCI legacy device */
89+
p_cap = val_pcie_find_capability(
90+
bdf,
91+
PCIE_CAP,
92+
CID_PCIECS,
93+
&cid_offset);
94+
95+
if (p_cap != PCIE_SUCCESS)
96+
continue;
97+
98+
/* Store the Function's BDF if there was a valid response */
99+
if (pal_is_bdf_exerciser(bdf))
100+
{
101+
g_exercier_info_table.e_info[g_exercier_info_table.num_exerciser].bdf
102+
= bdf;
103+
g_exercier_info_table.e_info[g_exercier_info_table.num_exerciser++]
104+
.initialized = 0;
105+
val_print(ACS_PRINT_INFO, "\n exerciser Bdf %x", bdf);
106+
}
107+
}
108+
}
109+
}
67110
}
68111
}
112+
69113
val_print(ACS_PRINT_INFO, "\n exerciser cards in the system %x \n",
70114
g_exercier_info_table.num_exerciser);
115+
return 0;
71116
}
72117

73118
uint32_t val_get_exerciser_err_info(EXERCISER_ERROR_CODE type)
@@ -305,18 +350,11 @@ val_exerciser_execute_tests(uint32_t *g_sw_view)
305350
}
306351

307352
/* Create the list of valid Pcie Device Functions */
308-
if (val_pcie_create_device_bdf_table()) {
353+
if (val_exerciser_create_info_table()) {
309354
val_print(ACS_PRINT_WARN, "\n Create BDF Table Failed, Skipping Exerciser tests...\n", 0);
310355
return ACS_STATUS_SKIP;
311356
}
312357

313-
if (pcie_bdf_table_list_flag == 1) {
314-
val_print(ACS_PRINT_WARN, "\n *** Created device list with valid bdf doesn't match \
315-
with the platform pcie device hierarchy, Skipping exerciser tests *** \n", 0);
316-
return ACS_STATUS_SKIP;
317-
}
318-
319-
val_exerciser_create_info_table();
320358
num_instances = val_exerciser_get_info(EXERCISER_NUM_CARDS, 0);
321359

322360
if (num_instances == 0) {

val/src/acs_pcie.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2016-2022 Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2016-2023 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");
@@ -75,8 +75,7 @@ val_pcie_read_cfg(uint32_t bdf, uint32_t offset, uint32_t *data)
7575
}
7676

7777
if (ecam_base == 0) {
78-
val_print(ACS_PRINT_ERR, "\n Read PCIe_CFG: ECAM Base is zero "
79-
" ", 0);
78+
val_print(ACS_PRINT_ERR, "\n Read PCIe_CFG: ECAM Base is zero %x", bdf);
8079
return PCIE_NO_MAPPING;
8180
}
8281

@@ -152,7 +151,7 @@ val_pcie_write_cfg(uint32_t bdf, uint32_t offset, uint32_t data)
152151
}
153152

154153
if (ecam_base == 0) {
155-
val_print(ACS_PRINT_ERR, "\n Read PCIe_CFG: ECAM Base is zero ", 0);
154+
val_print(ACS_PRINT_ERR, "\n Write PCIe_CFG: ECAM Base is zero %x", bdf);
156155
return;
157156
}
158157

@@ -223,7 +222,7 @@ uint64_t val_pcie_get_bdf_config_addr(uint32_t bdf)
223222
}
224223

225224
if (ecam_base == 0) {
226-
val_print(ACS_PRINT_ERR, "\n Read PCIe_CFG: ECAM Base is zero ", 0);
225+
val_print(ACS_PRINT_ERR, "\n BDF config Read PCIe_CFG: ECAM Base is zero %x", bdf);
227226
return 0;
228227
}
229228

@@ -502,7 +501,7 @@ val_pcie_create_info_table(uint64_t *pcie_info_table)
502501

503502
/* Create the list of valid Pcie Device Functions */
504503
if (val_pcie_create_device_bdf_table()) {
505-
val_print(ACS_PRINT_ERR, " Create Bdf table failed.\n", 0);
504+
val_print(ACS_PRINT_ERR, " Create Bdf table failed.\n", 0);
506505
return;
507506
}
508507

@@ -660,16 +659,19 @@ val_pcie_create_device_bdf_table()
660659
}
661660
}
662661

663-
val_print(ACS_PRINT_INFO,
664-
" Number of valid BDFs is %x\n", g_pcie_bdf_table->num_entries);
665-
666662
/* Sanity Check : Confirm all EP (normal, integrated) have a rootport */
667663
if (val_pcie_populate_device_rootport())
668664
{
669665
/* Discard the bdf table */
670666
g_pcie_bdf_table->num_entries = 0;
667+
val_print(ACS_PRINT_TEST,
668+
" PCIE_INFO: Number of BDFs found : %x\n", g_pcie_bdf_table->num_entries);
669+
671670
return 1;
672671
}
672+
val_print(ACS_PRINT_TEST,
673+
" PCIE_INFO: Number of BDFs found : %x\n", g_pcie_bdf_table->num_entries);
674+
673675
return 0;
674676
}
675677

@@ -2105,7 +2107,7 @@ val_pcie_get_rootport(uint32_t bdf, uint32_t *rp_bdf)
21052107
}
21062108

21072109
/* Return failure */
2108-
val_print(ACS_PRINT_ERR, "\n PCIe Hierarchy fail: RP of bdf 0x%x not found", bdf);
2110+
val_print(ACS_PRINT_DEBUG, " PCIe Hierarchy fail: RP of bdf 0x%x not found\n", bdf);
21092111
*rp_bdf = 0;
21102112
return 1;
21112113

0 commit comments

Comments
 (0)