From da1030c2fc50fa4c8c1ed762ba96fd8da0fc9d9d Mon Sep 17 00:00:00 2001 From: Sujana-M <52772661+Sujana-M@users.noreply.github.com> Date: Wed, 6 Nov 2024 11:50:26 +0530 Subject: [PATCH] S_PCIe_11: Steering Tag properties (#507) - Use _DSM Method to obtain the STE values from table Signed-off-by: Sujana M --- docs/arm_sbsa_testcase_checklist.rst | 4 ++ linux_app/sbsa-acs-app/sbsa_app_main.c | 4 ++ test_pool/Makefile | 1 + test_pool/pcie/operating_system/test_p066.c | 73 +++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 test_pool/pcie/operating_system/test_p066.c diff --git a/docs/arm_sbsa_testcase_checklist.rst b/docs/arm_sbsa_testcase_checklist.rst index 52c71447..73df0c64 100644 --- a/docs/arm_sbsa_testcase_checklist.rst +++ b/docs/arm_sbsa_testcase_checklist.rst @@ -233,6 +233,8 @@ The below table provides the following details +-------+--------------------------------------------+-----+----------------------------------------------------+----------------+----+----------+-----+-------------------+ |865 |Check RP Extensions for DPC |FR |PCI_ER_09 |Yes |Yes |Yes |No |No | +-------+--------------------------------------------+-----+----------------------------------------------------+----------------+----+----------+-----+-------------------+ +|866 |Steering Tag value properties |FR |S_PCIe_11 |Yes |Yes#|Yes |Yes |No | ++-------+--------------------------------------------+-----+----------------------------------------------------+----------------+----+----------+-----+-------------------+ |901 |Enhanced ECAM Memory access check |L3 |PCI_IN_01, PCI_IN_02 |No |Yes |Yes |No |Yes | +-------+--------------------------------------------+-----+----------------------------------------------------+----------------+----+----------+-----+-------------------+ |902 |PCIe Address translation check |L6 |RE_SMU_2 |No |Yes |Yes |No |Yes | @@ -257,6 +259,8 @@ The below table provides the following details +-------+--------------------------------------------+-----+----------------------------------------------------+----------------+----+----------+-----+-------------------+ |912 |RAS ERR record for external abort |FR |PCI_ER_07 |No |Yes |Yes |No |Yes | +-------+--------------------------------------------+-----+----------------------------------------------------+----------------+----+----------+-----+-------------------+ +|913 |Enable and disable STE.DCP bit |FR |S_PCIe_10 |No |Yes |Yes |No |Yes | ++-------+--------------------------------------------+-----+----------------------------------------------------+----------------+----+----------+-----+-------------------+ |1001 |Check for MPAM extension |L7 |S_L7MP_01, S_L7MP_02 |Yes |Yes |Yes |No |No | +-------+--------------------------------------------+-----+----------------------------------------------------+----------------+----+----------+-----+-------------------+ |1002 |Check for MPAM LLC CSU |L7 |S_L7MP_03, S_L7MP_04 |Yes |Yes |Yes |No |No | diff --git a/linux_app/sbsa-acs-app/sbsa_app_main.c b/linux_app/sbsa-acs-app/sbsa_app_main.c index cbf4da70..c2fc6e08 100644 --- a/linux_app/sbsa-acs-app/sbsa_app_main.c +++ b/linux_app/sbsa-acs-app/sbsa_app_main.c @@ -74,6 +74,7 @@ main (int argc, char **argv) { {"skip", required_argument, NULL, 'n'}, {"help", no_argument, NULL, 'h'}, + {"fr", no_argument, NULL, 'r'}, {NULL, 0, NULL, 0} }; @@ -90,6 +91,9 @@ main (int argc, char **argv) case 'l': g_sbsa_level = strtol(optarg, &endptr, 10); break; + case 'r': + g_sbsa_level = 8; + break; case 'h': print_help(); return 1; diff --git a/test_pool/Makefile b/test_pool/Makefile index 2095c17b..fa89ffb7 100644 --- a/test_pool/Makefile +++ b/test_pool/Makefile @@ -27,6 +27,7 @@ obj-m += sbsa_acs_test.o sbsa_acs_test-objs += $(TEST_POOL)/pcie/operating_system/test_p001.o \ $(TEST_POOL)/pcie/operating_system/test_p005.o \ $(TEST_POOL)/pcie/operating_system/test_p009.o \ + $(TEST_POOL)/pcie/operating_system/test_p066.o \ $(TEST_POOL)/smmu/operating_system/test_i016.o ccflags-y=-I$(PWD)/$(ACS_DIR)/.. -I$(PWD)/$(ACS_DIR)/val/ -I$(PWD)/$(ACS_DIR)/ -DTARGET_LINUX -Wall -Werror diff --git a/test_pool/pcie/operating_system/test_p066.c b/test_pool/pcie/operating_system/test_p066.c new file mode 100644 index 00000000..7094554d --- /dev/null +++ b/test_pool/pcie/operating_system/test_p066.c @@ -0,0 +1,73 @@ +/** @file + * Copyright (c) 2024, Arm Limited or its affiliates. All rights reserved. + * SPDX-License-Identifier : Apache-2.0 + + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + **/ + +#include "val/common/include/acs_val.h" +#include "val/common/include/acs_pe.h" +#include "val/common/include/acs_pcie.h" + +#include "val/sbsa/include/sbsa_acs_pcie.h" +#include "val/sbsa/include/sbsa_val_interface.h" + +#define TEST_NUM (ACS_PCIE_TEST_NUM_BASE + 66) +#define TEST_RULE "S_PCIe_11" +#define TEST_DESC "Steering Tag value properties " + +static +void +payload(void) +{ + uint32_t index = val_pe_get_index_mpid(val_pe_get_mpid()); + uint32_t status; + + /* Obtain the STE values from PAL using _DSM Method */ + status = val_pcie_dsm_ste_tags(); + val_print(ACS_PRINT_DEBUG, "\n STE tag value is %x", status); + + + if (status == NOT_IMPLEMENTED) { + val_print(ACS_PRINT_DEBUG, "\n DSM method for STE not implemented\n", 0); + val_set_status(index, RESULT_SKIP(TEST_NUM, 0)); + } + else if (status == 0) { + val_print(ACS_PRINT_ERR, "\n STE tag value should not be 0\n", 0); + val_set_status(index, RESULT_FAIL(TEST_NUM, 1)); + } + else + val_set_status(index, RESULT_PASS(TEST_NUM, 0)); + +} + +uint32_t +p066_entry(uint32_t num_pe) +{ + + uint32_t status = ACS_STATUS_FAIL; + + num_pe = 1; //This test is run on single processor + + status = val_initialize_test(TEST_NUM, TEST_DESC, num_pe); + if (status != ACS_STATUS_SKIP) + val_run_test_payload(TEST_NUM, num_pe, payload, 0); + + /* get the result from all PE and check for failure */ + status = val_check_for_error(TEST_NUM, num_pe, TEST_RULE); + + val_report_status(0, ACS_END(TEST_NUM), NULL); + + return status; +} +