Skip to content

Commit

Permalink
ATS capability of RP/RC from IORT (ARM-software#373)
Browse files Browse the repository at this point in the history
* ATS capability of RP/RC from IORT

- ATS capavbility for RP is known from the IORT table
  If RC supports ATS then RP also supports ATS.
- The test will pass only if RP supports P2P as well,
  which is currently obtained from PAL. By default the
  PAL returns that P2P isnt supported, hence the test will
  skip. If a RP supports P2P then this API needs to change
- Errata 594

Signed-off-by: Sujana M <sujana.murali@arm.com>

* Change in Github CI

- For BSA Baremetal compilation, it should take the latest code
  and not from merged bsa-acs

Signed-off-by: Sujana M <sujana.murali@arm.com>

---------

Signed-off-by: Sujana M <sujana.murali@arm.com>
  • Loading branch information
Sujana-M authored Oct 25, 2024
1 parent c9bbb55 commit 6a25910
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/bsa-acs_build_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ jobs:
steps:
- name: Checkout bsa-acs repository
uses: actions/checkout@v4
with:
repository: ARM-software/bsa-acs

- name: Remove build folder if present in BSA-ACS
run: |
Expand Down
37 changes: 31 additions & 6 deletions test_pool/pcie/operating_system/test_os_p017.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "val/common/include/acs_pcie.h"
#include "val/common/include/acs_pe.h"
#include "val/common/include/acs_memory.h"
#include "val/common/include/acs_iovirt.h"

#define TEST_NUM (ACS_PCIE_TEST_NUM_BASE + 17)
#define TEST_RULE "PCI_PP_05"
Expand All @@ -37,6 +38,9 @@ payload(void)
uint32_t test_fails;
uint32_t test_skip = 1;
uint32_t acs_data;
uint32_t num_pcie_rc;
uint32_t rc_ats_attr;
uint32_t rc_ats_supp;
uint32_t data;
pcie_device_bdf_table *bdf_tbl_ptr;

Expand All @@ -55,6 +59,32 @@ payload(void)

test_fails = 0;

num_pcie_rc = val_iovirt_get_pcie_rc_info(NUM_PCIE_RC, 0);

/* Get the number of Root Complex in the system */
if (!num_pcie_rc) {
val_print(ACS_PRINT_DEBUG, "\n Skip because no PCIe RC detected ", 0);
val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 1));
return;
}

/* For each Root Complex, check if it supports ATS capability.
* This information should be obtained from ACPI-IORT table for UEFI based
* systems and platform config file for Baremetal based system
* If RC supports the ATS, RP also supports ATS
*/
while (num_pcie_rc) {
num_pcie_rc--; // Index is one lesser than the component number being accessed
rc_ats_attr = val_iovirt_get_pcie_rc_info(RC_ATS_ATTRIBUTE, num_pcie_rc);
rc_ats_supp = rc_ats_attr & 1;

if (!rc_ats_supp)
{
val_print(ACS_PRINT_DEBUG, "\n ATS Capability Not Present for RC: %x", num_pcie_rc);
continue;
}
}

/* Check for all the function present in bdf table */
for (tbl_index = 0; tbl_index < bdf_tbl_ptr->num_entries; tbl_index++)
{
Expand All @@ -68,12 +98,7 @@ payload(void)
if (val_pcie_dev_p2p_support(bdf))
continue;

/* It ATS Not supported, Skip the BDF. */
if (val_pcie_find_capability(bdf, PCIE_ECAP, ECID_ATS, &cap_base) != PCIE_SUCCESS) {
continue;
}

/* If test runs for atleast an endpoint */
/* If test runs for atleast one RP */
test_skip = 0;

val_print(ACS_PRINT_DEBUG, "\n For BDF : 0x%x", bdf);
Expand Down

0 comments on commit 6a25910

Please sign in to comment.