diff --git a/acs-drv/files/MakefileBSA b/acs-drv/files/Makefile old mode 100755 new mode 100644 similarity index 79% rename from acs-drv/files/MakefileBSA rename to acs-drv/files/Makefile index b169898ae85a70b9737f8ddc0cb5c651aa7725c4..f379595dc5eb2aea811b135a8457d57f36212fe6 --- a/acs-drv/files/MakefileBSA +++ b/acs-drv/files/Makefile @@ -23,11 +23,20 @@ export ARCH ?= arm64 #since we have copied the files locally ACS_DIR ?= ./ +ifeq ($(ACS), bsa) obj-m += bsa_acs.o bsa_acs-objs += bsa_acs_drv.o \ val/bsa_acs_val.o \ test_pool/bsa_acs_test.o \ platform/pal_linux/files/bsa_acs_pal.o +else +obj-m += sbsa_acs.o +sbsa_acs-objs += sbsa_acs_drv.o \ + val/sbsa_acs_val.o \ + test_pool/sbsa_acs_test.o \ + platform/pal_linux/files/sbsa_acs_pal.o + +endif ccflags-y=-I$(PWD)/$(ACS_DIR)/include -I$(PWD)/$(ACS_DIR)/ -DTARGET_LINUX -Wall -Werror @@ -39,7 +48,11 @@ else echo "Kernel source is set to $(KERNEL_SRC)" endif - make -C $(KERNEL_SRC) M=$(PWD) modules +bsa: + make -C $(KERNEL_SRC) M=$(PWD) ACS=bsa modules + +sbsa: + make -C $(KERNEL_SRC) M=$(PWD) ACS=sbsa modules modules_install: $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules_install diff --git a/acs-drv/files/MakefileSBSA b/acs-drv/files/MakefileSBSA deleted file mode 100644 index f42cdf0188f69d508a738b8ad8ba8bda0a818968..0000000000000000000000000000000000000000 --- a/acs-drv/files/MakefileSBSA +++ /dev/null @@ -1,50 +0,0 @@ -## @file - # SBSA ACS Kernel module Makefile - # - # This program is free software; you can redistribute it and/or modify - # it under the terms of the GNU General Public License version 2 as - # published by the Free Software Foundation. - # - # This program is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - # GNU General Public License for more details. - # - # You should have received a copy of the GNU General Public License - # along with this program. If not, see . - # - # Copyright (C) 2016-2018, 2025 Arm Limited - # - # Author: Prasanth Pulla - # -## - -export CROSS_COMPILE ?= aarch64-linux-gnu- -export ARCH ?= arm64 - -#since we have copied the files locally -ACS_DIR ?= ./ - -obj-m += sbsa_acs.o -sbsa_acs-objs += sbsa_acs_drv.o \ - val/sbsa_acs_val.o \ - test_pool/sbsa_acs_test.o \ - platform/pal_linux/files/sbsa_acs_pal.o - -ccflags-y=-I$(PWD)/$(ACS_DIR)/include -I$(PWD)/$(ACS_DIR)/ -DTARGET_LINUX -Wall -Werror - -all: -ifeq ($(KERNEL_SRC),) - echo " KERNEL_SRC variable should be set to kernel path " - exit 1 -else - echo "Kernel source is set to $(KERNEL_SRC)" -endif - - make -C $(KERNEL_SRC) M=$(PWD) modules - -modules_install: - $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules_install - -clean: - make -C $(KERNEL_SRC) M=$(PWD) clean diff --git a/acs-drv/files/bsa_setup.sh b/acs-drv/files/acs_setup.sh similarity index 86% rename from acs-drv/files/bsa_setup.sh rename to acs-drv/files/acs_setup.sh index 2e39cfd151fd200980cade9f5ba51059eb44b239..b8f3b60f57936ee796793e0b6de7f16d9787147c 100755 --- a/acs-drv/files/bsa_setup.sh +++ b/acs-drv/files/acs_setup.sh @@ -6,7 +6,7 @@ echo "==================================================================" if [ $# -ne 1 ]; then - echo "Give BSA-ACS PATH as the arguments to the script" + echo "Give SYSARCH-ACS PATH as the arguments to the script" return 0 fi diff --git a/acs-drv/files/bsa_acs_drv.c b/acs-drv/files/bsa_acs_drv.c index dc801cc52a91a8c200ac990f25e5d9c904c95c36..e5c9630de7bf61bb4eaf9e94215687cc4ea6560c 100755 --- a/acs-drv/files/bsa_acs_drv.c +++ b/acs-drv/files/bsa_acs_drv.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2016-2024 Arm Limited + * Copyright (C) 2016-2025 Arm Limited * * Author: Prasanth Pulla * @@ -22,12 +22,10 @@ #include #include "bsa_acs_drv.h" -#include "val/common/include/val_interface.h" -#include "val/bsa/include/bsa_val_interface.h" -#include "val/common/include/acs_common.h" -#include "val/common/include/acs_val.h" -#include "val/common/include/acs_pcie.h" -#include "val/bsa/include/bsa_acs_pcie.h" +#include "val/include/val_interface.h" +#include "val/include/acs_common.h" +#include "val/include/acs_val.h" +#include "val/include/acs_pcie.h" test_params_t params; test_msg_parms_t msg_params; diff --git a/acs-drv/files/bsa_acs_drv.h b/acs-drv/files/bsa_acs_drv.h index 59c312366223f1e6af924e0ddf8f7e1f5e3a4327..80aacba2eaec4c8b14b58b705525c601a1739d67 100644 --- a/acs-drv/files/bsa_acs_drv.h +++ b/acs-drv/files/bsa_acs_drv.h @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2016-2024 Arm Limited + * Copyright (C) 2016-2025 Arm Limited * * Author: Prasanth Pulla * diff --git a/acs-drv/files/build.sh b/acs-drv/files/build.sh index 9c20724f8c4034f30c3ec15ce0e07f371044a52f..9f773b34abe498dc095ba6577a46be4514ec1f00 100755 --- a/acs-drv/files/build.sh +++ b/acs-drv/files/build.sh @@ -2,21 +2,18 @@ WRK_DIR=$PWD -export LINUX_KERNEL_VERSION=6.8 +export LINUX_KERNEL_VERSION=6.10 export GCC_TOOLS_VERSION=13.2.rel1 export GCC=tools/arm-gnu-toolchain-${GCC_TOOLS_VERSION}-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu- -export BSA_PATH=$WRK_DIR/bsa-acs -export SBSA_PATH=$WRK_DIR/sbsa-acs export BUILD_PATH=$WRK_DIR/build - +export SYSARCH_PATH=$WRK_DIR/sysarch-acs print_help() { echo "" echo "================ ACS Build Environment Info ==================" echo "" echo "Working Directory : $WRK_DIR" - echo "BSA ACS Path : $BSA_PATH" - echo "SBSA ACS Path : $SBSA_PATH" + echo "SYSARCH ACS Path : $SYSARCH_PATH" echo "Build Output Path : $BUILD_PATH" echo "Linux Kernel Version : $LINUX_KERNEL_VERSION" echo "GCC Tools Version : $GCC_TOOLS_VERSION" @@ -54,8 +51,7 @@ check_repos_status() { echo "Platform: $platform" echo "Note: On non-AArch64 platforms, Linux source and toolchain must be present." - [[ -d "$BSA_PATH" ]] && echo "BSA repo - OK" || echo "BSA repo - Not present" - [[ -d "$SBSA_PATH" ]] && echo "SBSA repo - OK" || echo "SBSA repo - Not present" + [[ -d "$SYSARCH_PATH" ]] && echo "SYSARCH repo - OK" || echo "SYSARCH repo - Not present" [[ -d "$WRK_DIR/linux-acs" ]] && echo "linux acs repo - OK" || echo "linux acs repo - Not present" [[ -d "$WRK_DIR/linux-${LINUX_KERNEL_VERSION}" ]] && echo "Linux source - OK" || echo "Linux source - Not present" [[ -d "$WRK_DIR/tools/arm-gnu-toolchain-${GCC_TOOLS_VERSION}-x86_64-aarch64-none-linux-gnu" ]] && echo "Cross compiler - OK" || echo "Cross compiler - Not present" @@ -72,8 +68,7 @@ clean_build_outputs() { return elif [[ "$1" == "--clean_all" ]]; then echo "🧹 Cleaning everything under: $WRK_DIR" - rm -rf "$WRK_DIR/bsa-acs" - rm -rf "$WRK_DIR/sbsa-acs" + rm -rf "$WRK_DIR/sysarch-acs" rm -rf "$WRK_DIR/linux-acs" rm -rf "$WRK_DIR/build" [[ -d "$WRK_DIR/tools" ]] && rm -rf "$WRK_DIR/tools" @@ -124,35 +119,20 @@ while [[ $# -gt 0 ]]; do esac done -get_bsa_acs() -{ - echo "Downloading BSA ACS" - if [[ -d "$WRK_DIR/bsa-acs" ]]; then - echo "Directory '$WRK_DIR/bsa-acs' already exists. Skipping clone." - else - git clone https://github.com/ARM-software/bsa-acs.git bsa-acs - if [[ $? -ne 0 ]]; then - echo "ERROR: Failed to download BSA ACS repository." - return - fi - fi -} - -get_sbsa_acs() +get_sysarch_acs() { - echo "Downloading SBSA ACS" + echo "Downloading SYS ARCH ACS" - if [[ -d "$WRK_DIR/sbsa-acs" ]]; then - echo "Directory '$WRK_DIR/sbsa-acs' already exists. Skipping clone." + if [[ -d "$WRK_DIR/sysarch-acs" ]]; then + echo "Directory '$WRK_DIR/sysarch-acs' already exists. Skipping clone." else - git clone https://github.com/ARM-software/sbsa-acs.git sbsa-acs + git clone https://github.com/Sujana-M/sysarch-acs.git sysarch-acs if [[ $? -ne 0 ]]; then - echo "ERROR: Failed to download SBSA ACS repository." + echo "ERROR: Failed to download SYSARCH ACS repository." return fi fi - } get_linux_acs() @@ -162,7 +142,7 @@ get_linux_acs() if [[ -d "$WRK_DIR/linux-acs" ]]; then echo "Directory '$WRK_DIR/linux-acs' already exists. Skipping clone." else - git clone https://git.gitlab.arm.com/linux-arm/linux-acs.git linux-acs + git clone https://git.gitlab.arm.com/linux-arm/linux-acs.git -b sysarch-acs if [[ $? -ne 0 ]]; then echo "ERROR: Failed to download LINUX ACS repository." return @@ -283,8 +263,8 @@ do_build_bsa_module() export KERNEL_SRC="/lib/modules/$(uname -r)/build" fi - ./bsa_setup.sh $BSA_PATH - ./linux_bsa_acs.sh + ./acs_setup.sh $SYSARCH_PATH + ./linux_acs.sh bsa cp bsa_acs.ko $BUILD_PATH/ popd } @@ -304,8 +284,8 @@ do_build_sbsa_module() export KERNEL_SRC="/lib/modules/$(uname -r)/build" fi - ./sbsa_setup.sh $BSA_PATH $SBSA_PATH - ./linux_sbsa_acs.sh + ./acs_setup.sh $SYSARCH_PATH + ./linux_acs.sh sbsa cp sbsa_acs.ko $BUILD_PATH popd @@ -313,7 +293,7 @@ do_build_sbsa_module() do_build_sbsa_app() { - pushd $SBSA_PATH/linux_app/sbsa-acs-app + pushd $SYSARCH_PATH/apps/linux/sbsa-acs-app make cp sbsa $BUILD_PATH/sbsa_app popd @@ -321,7 +301,7 @@ do_build_sbsa_app() do_build_bsa_app() { - pushd $BSA_PATH/linux_app/bsa-acs-app + pushd $SYSARCH_PATH/apps/linux/bsa-acs-app make cp bsa $BUILD_PATH/bsa_app popd @@ -353,8 +333,7 @@ check_build_outputs() { echo "----------------------------------------" } -get_bsa_acs -get_sbsa_acs +get_sysarch_acs get_linux_acs get_linux_source get_cross_compiler @@ -372,3 +351,4 @@ do_build_bsa_app do_build_sbsa_app check_build_outputs + diff --git a/acs-drv/files/linux_bsa_acs.sh b/acs-drv/files/linux_acs.sh similarity index 68% rename from acs-drv/files/linux_bsa_acs.sh rename to acs-drv/files/linux_acs.sh index ea05eef7c69c914b7dc30183a20a9bae741b8b54..e1c2d7999aaee1d85896c9fa343d3e09e6709715 100755 --- a/acs-drv/files/linux_bsa_acs.sh +++ b/acs-drv/files/linux_acs.sh @@ -1,5 +1,5 @@ # /** @file -# * Copyright (c) 2018-2024, Arm Limited or its affiliates. All rights reserved. +# * Copyright (c) 2018-2025, Arm Limited or its affiliates. All rights reserved. # * SPDX-License-Identifier : Apache-2.0 # # * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,10 +18,10 @@ #!/bin/bash echo "==================================================================" -echo "This script will compile the Linux BSA Kernel module " +echo "This script will compile the Linux BSA/SBSA Kernel module " echo "==================================================================" -BSA_ACS_PATH=`pwd` +ACS_PATH=`pwd` if [ -z $KERNEL_SRC ] then echo "Error: set KERNEL_SRC path" @@ -34,20 +34,24 @@ then exit 0 fi -cd $BSA_ACS_PATH/platform/pal_linux/files -cp MakefileBSA Makefile -make -cp bsa_acs_pal.o $BSA_ACS_PATH/ +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +acs="$1" + +cd $ACS_PATH/platform/pal_linux/files +make "$acs" +cp ${acs}_acs_pal.o $ACS_PATH/ -cd $BSA_ACS_PATH/val/ -cp MakefileBSA Makefile -make -cp bsa_acs_val.o $BSA_ACS_PATH/ +cd $ACS_PATH/val/ +make "$acs" +cp ${acs}_acs_val.o $ACS_PATH/ -cd $BSA_ACS_PATH/test_pool/ -make -cp bsa_acs_test.o $BSA_ACS_PATH/ +cd $ACS_PATH/test_pool/ +make "$acs" +cp ${acs}_acs_test.o $ACS_PATH/ -cd $BSA_ACS_PATH/ -cp MakefileBSA Makefile -make +cd $ACS_PATH/ +make "$acs" diff --git a/acs-drv/files/linux_sbsa_acs.sh b/acs-drv/files/linux_sbsa_acs.sh deleted file mode 100755 index 9bca76b3f40138c87ba44a87099009c35b26fd16..0000000000000000000000000000000000000000 --- a/acs-drv/files/linux_sbsa_acs.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -echo "==================================================================" -echo "This script will compile the Linux SBSA Kernel module " -echo "==================================================================" - -SBSA_ACS_PATH=`pwd` -if [ -z $KERNEL_SRC ] -then - echo "Error: set KERNEL_SRC path" - exit 0 -fi - -if [ $(uname -m) != "aarch64" ] && [ -z $CROSS_COMPILE ] -then - echo "Error: set CROSS_COMPILE path" - exit 0 -fi - -cd $SBSA_ACS_PATH/platform/pal_linux/files -cp MakefileSBSA Makefile -make -cp sbsa_acs_pal.o $SBSA_ACS_PATH/ - -cd $SBSA_ACS_PATH/val/ -cp MakefileSBSA Makefile -make -cp sbsa_acs_val.o $SBSA_ACS_PATH/ - -cd $SBSA_ACS_PATH/test_pool/ -make -cp sbsa_acs_test.o $SBSA_ACS_PATH/ - -cd $SBSA_ACS_PATH/ -cp MakefileSBSA Makefile -make diff --git a/acs-drv/files/platform/pal_linux/files/sbsa/Makefile b/acs-drv/files/platform/pal_linux/files/Makefile similarity index 53% rename from acs-drv/files/platform/pal_linux/files/sbsa/Makefile rename to acs-drv/files/platform/pal_linux/files/Makefile index 7f0e1d253c3f8e09ed00bf849aa93cc98e577dd1..a196cd58d901f705a0fe21ede1aa44101dce264b 100644 --- a/acs-drv/files/platform/pal_linux/files/sbsa/Makefile +++ b/acs-drv/files/platform/pal_linux/files/Makefile @@ -12,10 +12,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # - # Copyright (C) 2016-2018 Arm Limited + # Copyright (C) 2016-2018, 2021,2025 Arm Limited # ## +.PHONY: all bsa sbsa clean modules_install export CROSS_COMPILE ?= aarch64-linux-gnu- export ARCH ?= arm64 @@ -24,13 +25,25 @@ ACS_DIR ?= . PAL_SRC = $(ACS_DIR)/src +ifeq ($(ACS), bsa) +obj-m += bsa_acs_pal.o +bsa_acs_pal-objs += $(PAL_SRC)/pal_misc.o \ + $(PAL_SRC)/pal_pe.o $(PAL_SRC)/pal_pcie.o $(PAL_SRC)/pal_pcie_enumeration.o \ + $(PAL_SRC)/pal_smmu.o $(PAL_SRC)/pal_iovirt.o $(PAL_SRC)/pal_peripherals.o \ + $(PAL_SRC)/pal_dma.o $(PAL_SRC)/pal_acpi.o $(PAL_SRC)/pal_gic.o \ + $(PAL_SRC)/pal_dt.o $(PAL_SRC)/pal_acpi.o $(PAL_SRC)/pal_exerciser.o $(PAL_SRC)/bsa-dma-iommu.o +ccflags-y=-I$(PWD)/$(ACS_DIR)/val/include -I$(PWD)/$(ACS_DIR)/val/include -I$(PWD)/$(ACS_DIR)/include -I$(PWD)/$(ACS_DIR)/include -I$(PWD) -I$(PWD)/../../ -I$(PWD)/../../../ -DTARGET_LINUX -Wall -Werror +else obj-m += sbsa_acs_pal.o sbsa_acs_pal-objs += $(PAL_SRC)/pal_misc.o \ $(PAL_SRC)/pal_pe.o $(PAL_SRC)/pal_pcie.o $(PAL_SRC)/pal_pcie_enumeration.o \ - $(PAL_SRC)/pal_smmu.o $(PAL_SRC)/pal_iovirt.o $(PAL_SRC)/pal_peripherals.o \ - $(PAL_SRC)/pal_dma.o $(PAL_SRC)/pal_acpi.o $(PAL_SRC)/pal_gic.o $(PAL_SRC)/pal_exerciser.o + $(PAL_SRC)/pal_smmu.o $(PAL_SRC)/pal_iovirt.o $(PAL_SRC)/pal_peripherals.o $(PAL_SRC)/bsa-dma-iommu.o\ + $(PAL_SRC)/pal_dma.o $(PAL_SRC)/pal_acpi.o $(PAL_SRC)/pal_gic.o \ + $(PAL_SRC)/pal_iovirt.o $(PAL_SRC)/pal_exerciser.o + +ccflags-y=-I$(PWD)/$(ACS_DIR)/val/include -I$(PWD)/$(ACS_DIR)/val/include -I$(PWD)/$(ACS_DIR)/include -I$(PWD)/$(ACS_DIR)/include -I$(PWD) -I$(PWD)/../../ -I$(PWD)/../../../ -DTARGET_LINUX -DBUILD_SBSA -Wall -Werror +endif -ccflags-y=-I$(PWD)/$(ACS_DIR)/val/include -I$(PWD)/$(ACS_DIR)/include -I$(PWD) -I$(PWD)/../../ -I$(PWD)/../../../ -DTARGET_LINUX -Wall -Werror all: ifeq ($(KERNEL_SRC),) @@ -40,7 +53,11 @@ else echo "Kernel source is set to $(KERNEL_SRC)" endif - make -C $(KERNEL_SRC) M=$(PWD) modules +bsa: + make -C $(KERNEL_SRC) M=$(PWD) ACS=bsa modules + +sbsa: + make -C $(KERNEL_SRC) M=$(PWD) ACS=sbsa modules modules_install: $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules_install diff --git a/acs-drv/files/platform/pal_linux/files/MakefileBSA b/acs-drv/files/platform/pal_linux/files/MakefileBSA deleted file mode 100644 index 9b7115b430f7453c3a07d92d7986531423463279..0000000000000000000000000000000000000000 --- a/acs-drv/files/platform/pal_linux/files/MakefileBSA +++ /dev/null @@ -1,52 +0,0 @@ -## @file - # - # This program is free software; you can redistribute it and/or modify - # it under the terms of the GNU General Public License version 2 as - # published by the Free Software Foundation. - # - # This program is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - # GNU General Public License for more details. - # - # You should have received a copy of the GNU General Public License - # along with this program. If not, see . - # - # Copyright (C) 2016-2018, 2021, 2025, Arm Limited - # -## - -export CROSS_COMPILE ?= aarch64-linux-gnu- -export ARCH ?= arm64 - -#since we have copied the files locally -ACS_DIR ?= . - -COMMON_PAL_SRC = $(ACS_DIR)/common/src -BSA_PAL_SRC = $(ACS_DIR)/bsa/src - -obj-m += bsa_acs_pal.o -bsa_acs_pal-objs += $(COMMON_PAL_SRC)/pal_misc.o \ - $(COMMON_PAL_SRC)/pal_pe.o $(COMMON_PAL_SRC)/pal_pcie.o $(COMMON_PAL_SRC)/pal_pcie_enumeration.o \ - $(COMMON_PAL_SRC)/pal_smmu.o $(COMMON_PAL_SRC)/pal_iovirt.o $(COMMON_PAL_SRC)/pal_peripherals.o \ - $(COMMON_PAL_SRC)/pal_dma.o $(COMMON_PAL_SRC)/pal_acpi.o $(COMMON_PAL_SRC)/pal_gic.o \ - $(BSA_PAL_SRC)/bsa_pal_dt.o $(BSA_PAL_SRC)/bsa_pal_acpi.o $(BSA_PAL_SRC)/bsa_pal_exerciser.o $(COMMON_PAL_SRC)/bsa-dma-iommu.o \ - $(COMMON_PAL_SRC)/pal_exerciser.o - -ccflags-y=-I$(PWD)/$(ACS_DIR)/val/common/include -I$(PWD)/$(ACS_DIR)/val/bsa/include -I$(PWD)/$(ACS_DIR)/common/include -I$(PWD)/$(ACS_DIR)/bsa/include -I$(PWD) -I$(PWD)/../../ -I$(PWD)/../../../ -DTARGET_LINUX -Wall -Werror - -all: -ifeq ($(KERNEL_SRC),) - echo " KERNEL_SRC variable should be set to kernel path " - exit 1 -else - echo "Kernel source is set to $(KERNEL_SRC)" -endif - - make -C $(KERNEL_SRC) M=$(PWD) modules - -modules_install: - $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules_install - -clean: - make -C $(KERNEL_SRC) M=$(PWD) clean diff --git a/acs-drv/files/platform/pal_linux/files/MakefileSBSA b/acs-drv/files/platform/pal_linux/files/MakefileSBSA deleted file mode 100644 index 6f1a6bce621153b939af3e824b45bd2f6d5214f4..0000000000000000000000000000000000000000 --- a/acs-drv/files/platform/pal_linux/files/MakefileSBSA +++ /dev/null @@ -1,51 +0,0 @@ -## @file - # - # This program is free software; you can redistribute it and/or modify - # it under the terms of the GNU General Public License version 2 as - # published by the Free Software Foundation. - # - # This program is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - # GNU General Public License for more details. - # - # You should have received a copy of the GNU General Public License - # along with this program. If not, see . - # - # Copyright (C) 2016-2018, 2025, Arm Limited - # -## - -export CROSS_COMPILE ?= aarch64-linux-gnu- -export ARCH ?= arm64 - -#since we have copied the files locally -ACS_DIR ?= . - -COMMON_PAL_SRC = $(ACS_DIR)/common/src -SBSA_PAL_SRC = $(ACS_DIR)/sbsa/src - -obj-m += sbsa_acs_pal.o -sbsa_acs_pal-objs += $(COMMON_PAL_SRC)/pal_misc.o \ - $(COMMON_PAL_SRC)/pal_pe.o $(COMMON_PAL_SRC)/pal_pcie.o $(COMMON_PAL_SRC)/pal_pcie_enumeration.o \ - $(COMMON_PAL_SRC)/pal_smmu.o $(COMMON_PAL_SRC)/pal_iovirt.o $(COMMON_PAL_SRC)/pal_peripherals.o \ - $(COMMON_PAL_SRC)/pal_dma.o $(COMMON_PAL_SRC)/pal_acpi.o $(COMMON_PAL_SRC)/pal_gic.o $(COMMON_PAL_SRC)/bsa-dma-iommu.o \ - $(SBSA_PAL_SRC)/sbsa_pal_iovirt.o $(COMMON_PAL_SRC)/pal_exerciser.o $(SBSA_PAL_SRC)/sbsa_pal_pcie.o - -ccflags-y=-I$(PWD)/$(ACS_DIR)/val/include -I$(PWD)/$(ACS_DIR)/include -I$(PWD) -I$(PWD)/../../ -I$(PWD)/../../../ -DTARGET_LINUX -DBUILD_SBSA -Wall -Werror - -all: -ifeq ($(KERNEL_SRC),) - echo " KERNEL_SRC variable should be set to kernel path " - exit 1 -else - echo "Kernel source is set to $(KERNEL_SRC)" -endif - - make -C $(KERNEL_SRC) M=$(PWD) modules - -modules_install: - $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules_install - -clean: - make -C $(KERNEL_SRC) M=$(PWD) clean diff --git a/acs-drv/files/platform/pal_linux/files/bsa/COPYING b/acs-drv/files/platform/pal_linux/files/bsa/COPYING deleted file mode 100644 index 6d45519c8c6cc926a7d6d96ebc45de7226f66099..0000000000000000000000000000000000000000 --- a/acs-drv/files/platform/pal_linux/files/bsa/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/acs-drv/files/platform/pal_linux/files/bsa/Makefile b/acs-drv/files/platform/pal_linux/files/bsa/Makefile deleted file mode 100644 index 74105f5fb0b604b38bbd1bd5b6e15db55848e26f..0000000000000000000000000000000000000000 --- a/acs-drv/files/platform/pal_linux/files/bsa/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -## @file - # - # This program is free software; you can redistribute it and/or modify - # it under the terms of the GNU General Public License version 2 as - # published by the Free Software Foundation. - # - # This program is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - # GNU General Public License for more details. - # - # You should have received a copy of the GNU General Public License - # along with this program. If not, see . - # - # Copyright (C) 2016-2018, 2021 Arm Limited - # -## - -export CROSS_COMPILE ?= aarch64-linux-gnu- -export ARCH ?= arm64 - -#since we have copied the files locally -ACS_DIR ?= . - -PAL_SRC = $(ACS_DIR)/src - -obj-m += bsa_acs_pal.o -bsa_acs_pal-objs += $(PAL_SRC)/pal_misc.o \ - $(PAL_SRC)/pal_pe.o $(PAL_SRC)/pal_pcie.o $(PAL_SRC)/pal_pcie_enumeration.o \ - $(PAL_SRC)/pal_smmu.o $(PAL_SRC)/pal_iovirt.o $(PAL_SRC)/pal_peripherals.o \ - $(PAL_SRC)/pal_dma.o $(PAL_SRC)/pal_acpi.o $(PAL_SRC)/pal_gic.o $(PAL_SRC)/pal_exerciser.o \ - $(PAL_SRC)/pal_dt.o - -ccflags-y=-I$(PWD)/$(ACS_DIR)/val/include -I$(PWD)/$(ACS_DIR)/include -I$(PWD) -I$(PWD)/../../ -I$(PWD)/../../../ -DTARGET_LINUX -Wall -Werror - -all: -ifeq ($(KERNEL_SRC),) - echo " KERNEL_SRC variable should be set to kernel path " - exit 1 -else - echo "Kernel source is set to $(KERNEL_SRC)" -endif - - make -C $(KERNEL_SRC) M=$(PWD) modules - -modules_install: - $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules_install - -clean: - make -C $(KERNEL_SRC) M=$(PWD) clean diff --git a/acs-drv/files/platform/pal_linux/files/bsa/include/bsa_pal_exerciser.h b/acs-drv/files/platform/pal_linux/files/bsa/include/bsa_pal_exerciser.h deleted file mode 100644 index e19efdd37116b88dfb8df33187398b9e4ca2ffdf..0000000000000000000000000000000000000000 --- a/acs-drv/files/platform/pal_linux/files/bsa/include/bsa_pal_exerciser.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * BSA SBSA ACS Platform module. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * Copyright (C) 2016-2021, 2023-2024, Arm Limited - * - */ - -#ifndef __BSA_PAL_EXERCISER_H__ -#define __BSA_PAL_EXERCISER_H__ - -#include - - -#define LEGACY_PCI_IRQ_CNT 4 -#define MAX_IRQ_CNT 0xFFFF // This value is arbitrary and may have to be adjusted - -typedef struct { - uint32_t irq_list[MAX_IRQ_CNT]; - uint32_t irq_count; -} PERIFERAL_IRQ_LIST; - -typedef struct { - PERIFERAL_IRQ_LIST legacy_irq_map[LEGACY_PCI_IRQ_CNT]; -} PERIPHERAL_IRQ_MAP; - -uint32_t pal_exerciser_get_legacy_irq_map(uint32_t seg, uint32_t bus, uint32_t dev, uint32_t fn, - PERIPHERAL_IRQ_MAP *irq_map); - -#endif diff --git a/acs-drv/files/platform/pal_linux/files/bsa/src/bsa_pal_acpi.c b/acs-drv/files/platform/pal_linux/files/bsa/src/bsa_pal_acpi.c deleted file mode 100644 index 7390fbac07be8f1ffdab7d12ddb73fddab4ae6fc..0000000000000000000000000000000000000000 --- a/acs-drv/files/platform/pal_linux/files/bsa/src/bsa_pal_acpi.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * BSA SBSA ACS Platform module. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * Copyright (C) 2016-2018, 2021, 2024, Arm Limited - * - * Author: Prasanth Pulla - * - */ - -#include "common/include/pal_linux.h" - -#include -#include -#include -#include - - - - -void -pal_dump_dtb() -{ - return; -} - diff --git a/acs-drv/files/platform/pal_linux/files/bsa/src/bsa_pal_exerciser.c b/acs-drv/files/platform/pal_linux/files/bsa/src/bsa_pal_exerciser.c deleted file mode 100644 index 09cbc42b4756fcbb3129f9e03f3ee133d6945f0c..0000000000000000000000000000000000000000 --- a/acs-drv/files/platform/pal_linux/files/bsa/src/bsa_pal_exerciser.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * BSA SBSA ACS Platform module. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * Copyright (C) 2016-2021, 2023, 2024 Arm Limited - * - */ - -#include "bsa/include/bsa_pal_exerciser.h" - -/** - @brief Get legacy IRQ routing for a PCI device - - @param bus PCI bus address - @param dev PCI device address - @param fn PCI function number - @param irq_map pointer to IRQ map structure - - @return irq_map IRQ routing map - @return status code -**/ -uint32_t -pal_exerciser_get_legacy_irq_map(uint32_t Seg, uint32_t Bus, uint32_t Dev, uint32_t Fn, PERIPHERAL_IRQ_MAP *IrqMap) -{ - return 0; -} - diff --git a/acs-drv/files/platform/pal_linux/files/common/COPYING b/acs-drv/files/platform/pal_linux/files/common/COPYING deleted file mode 100644 index 6d45519c8c6cc926a7d6d96ebc45de7226f66099..0000000000000000000000000000000000000000 --- a/acs-drv/files/platform/pal_linux/files/common/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/acs-drv/files/platform/pal_linux/files/common/Makefile b/acs-drv/files/platform/pal_linux/files/common/Makefile deleted file mode 100644 index 74105f5fb0b604b38bbd1bd5b6e15db55848e26f..0000000000000000000000000000000000000000 --- a/acs-drv/files/platform/pal_linux/files/common/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -## @file - # - # This program is free software; you can redistribute it and/or modify - # it under the terms of the GNU General Public License version 2 as - # published by the Free Software Foundation. - # - # This program is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - # GNU General Public License for more details. - # - # You should have received a copy of the GNU General Public License - # along with this program. If not, see . - # - # Copyright (C) 2016-2018, 2021 Arm Limited - # -## - -export CROSS_COMPILE ?= aarch64-linux-gnu- -export ARCH ?= arm64 - -#since we have copied the files locally -ACS_DIR ?= . - -PAL_SRC = $(ACS_DIR)/src - -obj-m += bsa_acs_pal.o -bsa_acs_pal-objs += $(PAL_SRC)/pal_misc.o \ - $(PAL_SRC)/pal_pe.o $(PAL_SRC)/pal_pcie.o $(PAL_SRC)/pal_pcie_enumeration.o \ - $(PAL_SRC)/pal_smmu.o $(PAL_SRC)/pal_iovirt.o $(PAL_SRC)/pal_peripherals.o \ - $(PAL_SRC)/pal_dma.o $(PAL_SRC)/pal_acpi.o $(PAL_SRC)/pal_gic.o $(PAL_SRC)/pal_exerciser.o \ - $(PAL_SRC)/pal_dt.o - -ccflags-y=-I$(PWD)/$(ACS_DIR)/val/include -I$(PWD)/$(ACS_DIR)/include -I$(PWD) -I$(PWD)/../../ -I$(PWD)/../../../ -DTARGET_LINUX -Wall -Werror - -all: -ifeq ($(KERNEL_SRC),) - echo " KERNEL_SRC variable should be set to kernel path " - exit 1 -else - echo "Kernel source is set to $(KERNEL_SRC)" -endif - - make -C $(KERNEL_SRC) M=$(PWD) modules - -modules_install: - $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules_install - -clean: - make -C $(KERNEL_SRC) M=$(PWD) clean diff --git a/acs-drv/files/platform/pal_linux/files/common/include/bsa-iommu.h b/acs-drv/files/platform/pal_linux/files/include/bsa-iommu.h similarity index 100% rename from acs-drv/files/platform/pal_linux/files/common/include/bsa-iommu.h rename to acs-drv/files/platform/pal_linux/files/include/bsa-iommu.h diff --git a/acs-drv/files/platform/pal_linux/files/bsa/include/bsa_pal_dt.h b/acs-drv/files/platform/pal_linux/files/include/pal_dt.h similarity index 96% rename from acs-drv/files/platform/pal_linux/files/bsa/include/bsa_pal_dt.h rename to acs-drv/files/platform/pal_linux/files/include/pal_dt.h index 3f7453e7fe0115bcf06f238f1a57c8f8425f95c5..d73f0281cff77b674f998e600b88d0f58e404c28 100644 --- a/acs-drv/files/platform/pal_linux/files/bsa/include/bsa_pal_dt.h +++ b/acs-drv/files/platform/pal_linux/files/include/pal_dt.h @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2021 Arm Limited + * Copyright (C) 2021, 2025 Arm Limited * */ diff --git a/acs-drv/files/platform/pal_linux/files/common/include/pal_exerciser.h b/acs-drv/files/platform/pal_linux/files/include/pal_exerciser.h similarity index 87% rename from acs-drv/files/platform/pal_linux/files/common/include/pal_exerciser.h rename to acs-drv/files/platform/pal_linux/files/include/pal_exerciser.h index 942994ea2b71a744e0487e2f6d5a9267160be56f..788d2926f605cb99d72b1b30266842e029951e71 100644 --- a/acs-drv/files/platform/pal_linux/files/common/include/pal_exerciser.h +++ b/acs-drv/files/platform/pal_linux/files/include/pal_exerciser.h @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2016-2021, 2023-2024, Arm Limited + * Copyright (C) 2016-2021, 2023-2025, Arm Limited * */ @@ -25,6 +25,8 @@ #define MAX_ARRAY_SIZE 32 #define TEST_REG_COUNT 10 #define TEST_DDR_REGION_CNT 16 +#define LEGACY_PCI_IRQ_CNT 4 +#define MAX_IRQ_CNT 0xFFFF // This value is arbitrary and may have to be adjusted typedef struct { uint64_t buf[MAX_ARRAY_SIZE]; @@ -125,6 +127,15 @@ typedef enum { EXERCISER_DATA_BAR0_SPACE = 0x2, } EXERCISER_DATA_TYPE; +typedef struct { + uint32_t irq_list[MAX_IRQ_CNT]; + uint32_t irq_count; +} PERIFERAL_IRQ_LIST; + +typedef struct { + PERIFERAL_IRQ_LIST legacy_irq_map[LEGACY_PCI_IRQ_CNT]; +} PERIPHERAL_IRQ_MAP; + void pal_exerciser_create_info_table(EXERCISER_INFO_TABLE *exerciser_info_table); uint32_t pal_exerciser_get_info(EXERCISER_INFO_TYPE type, uint32_t instance); @@ -135,5 +146,7 @@ uint32_t pal_exerciser_get_state(EXERCISER_STATE *state, uint32_t bdf); uint32_t pal_exerciser_ops(EXERCISER_OPS ops, uint64_t param, uint32_t instance); uint32_t pal_exerciser_get_data(EXERCISER_DATA_TYPE type, exerciser_data_t *data, uint32_t instance); uint32_t pal_is_bdf_exerciser(uint32_t bdf); +uint32_t pal_exerciser_get_legacy_irq_map(uint32_t seg, uint32_t bus, uint32_t dev, uint32_t fn, + PERIPHERAL_IRQ_MAP *irq_map); #endif diff --git a/acs-drv/files/platform/pal_linux/files/common/include/pal_linux.h b/acs-drv/files/platform/pal_linux/files/include/pal_linux.h similarity index 89% rename from acs-drv/files/platform/pal_linux/files/common/include/pal_linux.h rename to acs-drv/files/platform/pal_linux/files/include/pal_linux.h index a2df0a02f25a112695f102ee5b9af205c3078862..8f88c5ffb5e77090a8e0bb393a0c7d319469cc92 100644 --- a/acs-drv/files/platform/pal_linux/files/common/include/pal_linux.h +++ b/acs-drv/files/platform/pal_linux/files/include/pal_linux.h @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2016-2018, 2021, 2024, Arm Limited + * Copyright (C) 2016-2018, 2021, 2024-2025, Arm Limited * * Author: Prasanth Pulla * @@ -29,8 +29,7 @@ #include #include -#include "val/common/include/pal_interface.h" -#include "val/bsa/include/bsa_pal_interface.h" +#include "val/include/pal_interface.h" #define PAL_LINUX_SUCCESS 0x0 #define PAL_LINUX_ERR 0xEDCB1234 //some impropable value? @@ -84,4 +83,11 @@ int pal_smmu_check_dev_attach(struct device *dev); if(verbosity >= g_print_level) { \ pal_print(string, data); \ } + +uint32_t pal_get_device_path(const char *hid, char hid_path[][MAX_NAMED_COMP_LENGTH]); + +uint32_t pal_smmu_is_etr_behind_catu(char *etr_path); + +uint32_t pal_pcie_dsm_ste_tags(void); + #endif diff --git a/acs-drv/files/platform/pal_linux/files/common/include/pal_pcie_enum.h b/acs-drv/files/platform/pal_linux/files/include/pal_pcie_enum.h similarity index 100% rename from acs-drv/files/platform/pal_linux/files/common/include/pal_pcie_enum.h rename to acs-drv/files/platform/pal_linux/files/include/pal_pcie_enum.h diff --git a/acs-drv/files/platform/pal_linux/files/sbsa/COPYING b/acs-drv/files/platform/pal_linux/files/sbsa/COPYING deleted file mode 100644 index 6d45519c8c6cc926a7d6d96ebc45de7226f66099..0000000000000000000000000000000000000000 --- a/acs-drv/files/platform/pal_linux/files/sbsa/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/acs-drv/files/platform/pal_linux/files/sbsa/include/sbsa_pal_linux.h b/acs-drv/files/platform/pal_linux/files/sbsa/include/sbsa_pal_linux.h deleted file mode 100644 index a2f2f7ae308c8eefb115842948222bca5bd32454..0000000000000000000000000000000000000000 --- a/acs-drv/files/platform/pal_linux/files/sbsa/include/sbsa_pal_linux.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * BSA SBSA ACS Platform module. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * Copyright (C) 2016-2018, 2021, 2024, Arm Limited - * - * Author: Prasanth Pulla - * - */ - -#ifndef __PAL_LINUX_H__ -#define __PAL_LINUX_H__ - -#include -#include -#include -#include -#include -#include - -#include "val/include/pal_interface.h" - - - -acpi_status user_function (acpi_handle handle, uint32_t level, void *context, void **return_value); - -uint32_t pal_get_device_path(const char *hid, char hid_path[][MAX_NAMED_COMP_LENGTH]); - -uint32_t pal_smmu_is_etr_behind_catu(char *etr_path); - -uint32_t pal_pcie_dsm_ste_tags(void); - -#endif diff --git a/acs-drv/files/platform/pal_linux/files/sbsa/src/sbsa_pal_iovirt.c b/acs-drv/files/platform/pal_linux/files/sbsa/src/sbsa_pal_iovirt.c deleted file mode 100644 index aa53c04a9b0c15bfda2ef724ed98a8df9db11e0c..0000000000000000000000000000000000000000 --- a/acs-drv/files/platform/pal_linux/files/sbsa/src/sbsa_pal_iovirt.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * BSA SBSA ACS Platform module. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * Copyright (C) 2016-2019, 2021, 2023, 2024, Arm Limited - * - * Author: Sakar Arora - * - */ - -#include -#include -#include -#include - -#include "common/include/pal_linux.h" -#include "sbsa/include/sbsa_pal_linux.h" -#include "val/sbsa/include/sbsa_pal_interface.h" - -#define NOT_IMPLEMENTED 0x4B1D - -acpi_status user_function(acpi_handle handle, uint32_t level, void *context, void **return_value); -/** - @brief This function is called by the val function pal_get_device_path - when the hid type is found - - @param handle device handle - @param level nesting level - @param context data to be passed from caller function - @param return_value return value passed to caller function pal_get_device_path - - @return 1 if test fails, 0 if test passes -**/ -acpi_status user_function(acpi_handle handle, uint32_t level, - void *context, void **return_value) -{ - acpi_status status; - static uint32_t count; - struct acpi_buffer buffer; - char (*path_buffer)[MAX_NAMED_COMP_LENGTH] = context; - - buffer.length = ACPI_ALLOCATE_BUFFER; - status = acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); - strncpy((char *)path_buffer[count++], (char *)(buffer.pointer), 16); - return status; -} - -/** - @brief Check the hid in ACPI and copy te full path of hid - - @param hid hardware ID to get the path for - @param hid_path 2D array in which the path is copied - - @return 1 if test fails, 0 if test passes -**/ -uint32_t -pal_get_device_path(const char *hid, char hid_path[][MAX_NAMED_COMP_LENGTH]) -{ - acpi_status status; - status = acpi_get_devices(hid, user_function, (void *)hid_path, NULL); - return status; -} - -/** - @brief Platform defined method to check if CATU is behind an ETR device - - @param etr_path full path of ETR device - - @return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure -**/ -uint32_t -pal_smmu_is_etr_behind_catu(char *etr_path) -{ - return NOT_IMPLEMENTED; -} diff --git a/acs-drv/files/platform/pal_linux/files/sbsa/src/sbsa_pal_pcie.c b/acs-drv/files/platform/pal_linux/files/sbsa/src/sbsa_pal_pcie.c deleted file mode 100644 index c63d18b96cee2ed2352a0d4fe2b1e9c10e84adac..0000000000000000000000000000000000000000 --- a/acs-drv/files/platform/pal_linux/files/sbsa/src/sbsa_pal_pcie.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * BSA SBSA ACS Platform module. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - * Copyright (C) 2016-2019, 2021, 2023, 2024, Arm Limited - * - * Author: Sakar Arora - * - */ - -#include -#include -#include -#include -#include - -#include "common/include/pal_linux.h" -#include "sbsa/include/sbsa_pal_linux.h" -#include "val/sbsa/include/sbsa_pal_interface.h" - -#define NOT_IMPLEMENTED 0x4B1D - -/* UUID for PCIe */ -static const guid_t pci_guid = - GUID_INIT(0xE5C937D0, 0x3553, 0x4D7A, - 0x91, 0x17, 0xEA, 0x4D, 0x19, 0xC3, 0x43, 0x4D); - -/* Defines for the _DSM method for obtaining Steering tag value */ -#define PCI_REVISION 0x6 -#define PCI_FUNC_INDEX 0x0E - -acpi_status ste_user_function(acpi_handle handle, uint32_t level, void *context, void **return_value); - - -/** - @brief Gets RP support of transaction forwarding. - - @param bus PCI bus address - @param dev PCI device address - @param fn PCI function number - @param seg PCI segment number - - @return 0 if rp not involved in transaction forwarding - 1 if rp is involved in transaction forwarding -**/ -uint32_t -pal_pcie_get_rp_transaction_frwd_support(uint32_t seg, uint32_t bus, uint32_t dev, uint32_t fn) -{ - return 1; -} - - - -/** - @brief This function is called by the function pal_pcie_dsm_ste_tags - when the any device is found - - @param handle device handle - @param level nesting level - @param context data to be passed from caller function - @param return_value return value passed to caller function pal_pcie_dsm_ste_tags - - @return 0 - Failure, NOT_IMPLEMENTED - DSM Method not implemented, Other values - PASS -**/ -acpi_status ste_user_function(acpi_handle handle, uint32_t level, - void *context, void **return_value) -{ - - acpi_status status; - struct acpi_buffer buffer; - union acpi_object *obj; - uint32_t ste_value; - - buffer.length = ACPI_ALLOCATE_BUFFER; - status = acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); - - if (acpi_has_method(handle, "_DSM")) { - obj = acpi_evaluate_dsm_typed(handle, &pci_guid, PCI_REVISION, - PCI_FUNC_INDEX, NULL, ACPI_TYPE_INTEGER); - - if (!obj) { - acs_print(ACS_PRINT_INFO,"\n DSM method for STE not present.", 0); - return NOT_IMPLEMENTED; - } - - ste_value = obj->integer.value; - acs_print(ACS_PRINT_DEBUG,"\n Steering tag value is %x", ste_value); - if (ste_value == 0) { - ACPI_FREE(obj); - return ste_value; - } - - ACPI_FREE(obj); - return ste_value; - } - else - return 0; - - return NOT_IMPLEMENTED; -} - -/** - @brief Check for the _DSM method to obtain the STE value - - @param None - - @return 0 - Failure, NOT_IMPLEMENTED - DSM Method not implemented, Other values - PASS -**/ -uint32_t pal_pcie_dsm_ste_tags(void) -{ - acpi_handle handle = NULL; - acpi_status status; - - status = acpi_get_devices(NULL, ste_user_function, NULL, &handle); - return status; -} \ No newline at end of file diff --git a/acs-drv/files/platform/pal_linux/files/common/src/bsa-dma-iommu.c b/acs-drv/files/platform/pal_linux/files/src/bsa-dma-iommu.c similarity index 99% rename from acs-drv/files/platform/pal_linux/files/common/src/bsa-dma-iommu.c rename to acs-drv/files/platform/pal_linux/files/src/bsa-dma-iommu.c index 62ad9e92d71869566e9cf7fb8314501755203fc5..149d1d1756710e0a032d8869c97eaaa3da4485d6 100644 --- a/acs-drv/files/platform/pal_linux/files/common/src/bsa-dma-iommu.c +++ b/acs-drv/files/platform/pal_linux/files/src/bsa-dma-iommu.c @@ -18,7 +18,7 @@ #include #include #include -#include "common/include/bsa-iommu.h" +#include "include/bsa-iommu.h" #include #include #include diff --git a/acs-drv/files/platform/pal_linux/files/common/src/pal_acpi.c b/acs-drv/files/platform/pal_linux/files/src/pal_acpi.c similarity index 92% rename from acs-drv/files/platform/pal_linux/files/common/src/pal_acpi.c rename to acs-drv/files/platform/pal_linux/files/src/pal_acpi.c index 95e8bca5426f12ca3b8fcfbf4b250d9bfa76201f..37ca4261b8510b38293678a695c4205827f8aa35 100644 --- a/acs-drv/files/platform/pal_linux/files/common/src/pal_acpi.c +++ b/acs-drv/files/platform/pal_linux/files/src/pal_acpi.c @@ -13,13 +13,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2016-2018, 2021, 2024, Arm Limited + * Copyright (C) 2016-2018, 2021, 2024-2025, Arm Limited * * Author: Prasanth Pulla * */ -#include "common/include/pal_linux.h" +#include "include/pal_linux.h" #include #include @@ -72,4 +72,10 @@ pal_target_is_dt() return 0; } +void +pal_dump_dtb() +{ + return; +} + MODULE_LICENSE("GPL"); diff --git a/acs-drv/files/platform/pal_linux/files/common/src/pal_dma.c b/acs-drv/files/platform/pal_linux/files/src/pal_dma.c similarity index 99% rename from acs-drv/files/platform/pal_linux/files/common/src/pal_dma.c rename to acs-drv/files/platform/pal_linux/files/src/pal_dma.c index c37c78e4d8f9064d70b3e8f245765dd071a8eeb9..b6b781954f06772814cf236b7b86eb6e41000975 100644 --- a/acs-drv/files/platform/pal_linux/files/common/src/pal_dma.c +++ b/acs-drv/files/platform/pal_linux/files/src/pal_dma.c @@ -45,10 +45,10 @@ #include -#include "common/include/pal_linux.h" -#include "common/include/pal_pcie_enum.h" +#include "include/pal_linux.h" +#include "include/pal_pcie_enum.h" #include -#include "common/include/bsa-iommu.h" +#include "include/bsa-iommu.h" int bsa_scsi_sata_get_dma_addr(struct ata_port *ap, dma_addr_t *dma_addr, unsigned int *dma_len); diff --git a/acs-drv/files/platform/pal_linux/files/bsa/src/bsa_pal_dt.c b/acs-drv/files/platform/pal_linux/files/src/pal_dt.c similarity index 97% rename from acs-drv/files/platform/pal_linux/files/bsa/src/bsa_pal_dt.c rename to acs-drv/files/platform/pal_linux/files/src/pal_dt.c index 29287a646584ea110c2dd316ffdbab1eeeda353e..e26142d902d97bdd3e33ab2232cf8dff65f2e4ae 100644 --- a/acs-drv/files/platform/pal_linux/files/bsa/src/bsa_pal_dt.c +++ b/acs-drv/files/platform/pal_linux/files/src/pal_dt.c @@ -13,14 +13,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2016-2018,2021 Arm Limited + * Copyright (C) 2016-2018,2021,2025 Arm Limited * * Author: Prasanth Pulla * */ -#include "common/include/pal_linux.h" -#include "bsa/include/bsa_pal_dt.h" +#include "include/pal_linux.h" +#include "include/pal_dt.h" #include #include diff --git a/acs-drv/files/platform/pal_linux/files/common/src/pal_exerciser.c b/acs-drv/files/platform/pal_linux/files/src/pal_exerciser.c similarity index 89% rename from acs-drv/files/platform/pal_linux/files/common/src/pal_exerciser.c rename to acs-drv/files/platform/pal_linux/files/src/pal_exerciser.c index c9514b5e148dec1478b004d1edb7713cbd8edeb2..3e537b4ab17e6c823e6b91cf02f484e33fb2eed2 100644 --- a/acs-drv/files/platform/pal_linux/files/common/src/pal_exerciser.c +++ b/acs-drv/files/platform/pal_linux/files/src/pal_exerciser.c @@ -13,11 +13,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2016-2021, 2023, 2024 Arm Limited + * Copyright (C) 2016-2021, 2023-2025 Arm Limited * */ -#include "common/include/pal_exerciser.h" +#include "include/pal_exerciser.h" /** @brief This API popultaes information from all the PCIe stimulus generation IP available @@ -119,3 +119,20 @@ uint32_t pal_exerciser_get_data(EXERCISER_DATA_TYPE type, exerciser_data_t *data { return 0; } + +/** + @brief Get legacy IRQ routing for a PCI device + + @param bus PCI bus address + @param dev PCI device address + @param fn PCI function number + @param irq_map pointer to IRQ map structure + + @return irq_map IRQ routing map + @return status code +**/ +uint32_t +pal_exerciser_get_legacy_irq_map(uint32_t Seg, uint32_t Bus, uint32_t Dev, uint32_t Fn, PERIPHERAL_IRQ_MAP *IrqMap) +{ + return 0; +} diff --git a/acs-drv/files/platform/pal_linux/files/common/src/pal_gic.c b/acs-drv/files/platform/pal_linux/files/src/pal_gic.c similarity index 90% rename from acs-drv/files/platform/pal_linux/files/common/src/pal_gic.c rename to acs-drv/files/platform/pal_linux/files/src/pal_gic.c index 25ad719e351ab194866720113e78e3fbb81497d2..dd9f6ff3901dc9400502b4c18118d8c88fe44a2e 100644 --- a/acs-drv/files/platform/pal_linux/files/common/src/pal_gic.c +++ b/acs-drv/files/platform/pal_linux/files/src/pal_gic.c @@ -13,16 +13,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2016-2021, 2025, Arm Limited + * Copyright (C) 2016-2021,2025 Arm Limited * */ -#include "common/include/pal_linux.h" +#include "include/pal_linux.h" #include #include #include #include -#include "common/include/bsa-iommu.h" +#include "include/bsa-iommu.h" unsigned int pal_gic_install_isr(unsigned int int_id, void (*isr)(void)) { diff --git a/acs-drv/files/platform/pal_linux/files/common/src/pal_iovirt.c b/acs-drv/files/platform/pal_linux/files/src/pal_iovirt.c similarity index 91% rename from acs-drv/files/platform/pal_linux/files/common/src/pal_iovirt.c rename to acs-drv/files/platform/pal_linux/files/src/pal_iovirt.c index 404d8abc8dfaaca52bf0ba6eee8dc9b6062b0e1c..a717706a4e66af27c88bde15ccf16125f348c5a7 100644 --- a/acs-drv/files/platform/pal_linux/files/common/src/pal_iovirt.c +++ b/acs-drv/files/platform/pal_linux/files/src/pal_iovirt.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2016-2019, 2021, 2023, 2024, Arm Limited + * Copyright (C) 2016-2019, 2021, 2023-2025, Arm Limited * * Author: Sakar Arora * @@ -24,9 +24,12 @@ #include #include -#include "common/include/pal_linux.h" -#include "common/include/pal_pcie_enum.h" -#include "bsa/include/bsa_pal_dt.h" +#include "include/pal_linux.h" +#include "include/pal_pcie_enum.h" +#include "include/pal_dt.h" +#include "val/include/pal_interface.h" + +#define NOT_IMPLEMENTED 0x4B1D #if LINUX_VERSION_CODE < KERNEL_VERSION(4,18,0) struct acpi_iort_pmcg { @@ -36,6 +39,8 @@ struct acpi_iort_pmcg { }; #endif +acpi_status user_function(acpi_handle handle, uint32_t level, void *context, void **return_value); + /** @brief Dump the input block **/ @@ -514,3 +519,57 @@ pal_iovirt_get_rc_smmu_base(IOVIRT_INFO_TABLE *iovirt, uint32_t rc_seg_num, uint acs_print(ACS_PRINT_DEBUG, "No SMMU found behind the RootComplex with seg :%x", rc_seg_num); return 0; } + +/** + @brief This function is called by the val function pal_get_device_path + when the hid type is found + + @param handle device handle + @param level nesting level + @param context data to be passed from caller function + @param return_value return value passed to caller function pal_get_device_path + + @return 1 if test fails, 0 if test passes +**/ +acpi_status user_function(acpi_handle handle, uint32_t level, + void *context, void **return_value) +{ + acpi_status status; + static uint32_t count; + struct acpi_buffer buffer; + char (*path_buffer)[MAX_NAMED_COMP_LENGTH] = context; + + buffer.length = ACPI_ALLOCATE_BUFFER; + status = acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); + strncpy((char *)path_buffer[count++], (char *)(buffer.pointer), 16); + return status; +} + +/** + @brief Check the hid in ACPI and copy te full path of hid + + @param hid hardware ID to get the path for + @param hid_path 2D array in which the path is copied + + @return 1 if test fails, 0 if test passes +**/ +uint32_t +pal_get_device_path(const char *hid, char hid_path[][MAX_NAMED_COMP_LENGTH]) +{ + acpi_status status; + status = acpi_get_devices(hid, user_function, (void *)hid_path, NULL); + return status; +} + +/** + @brief Platform defined method to check if CATU is behind an ETR device + + @param etr_path full path of ETR device + + @return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure +**/ +uint32_t +pal_smmu_is_etr_behind_catu(char *etr_path) +{ + return NOT_IMPLEMENTED; +} diff --git a/acs-drv/files/platform/pal_linux/files/common/src/pal_misc.c b/acs-drv/files/platform/pal_linux/files/src/pal_misc.c similarity index 99% rename from acs-drv/files/platform/pal_linux/files/common/src/pal_misc.c rename to acs-drv/files/platform/pal_linux/files/src/pal_misc.c index 6efdc34f61c6dc5e64bf6dc0e966be6713d131bb..f05bce32113d389354041f374f1284ed9b4d1709 100644 --- a/acs-drv/files/platform/pal_linux/files/common/src/pal_misc.c +++ b/acs-drv/files/platform/pal_linux/files/src/pal_misc.c @@ -25,7 +25,7 @@ #include #include #include -#include "common/include/pal_linux.h" +#include "include/pal_linux.h" unsigned int *gSharedMemory; diff --git a/acs-drv/files/platform/pal_linux/files/common/src/pal_pcie.c b/acs-drv/files/platform/pal_linux/files/src/pal_pcie.c similarity index 85% rename from acs-drv/files/platform/pal_linux/files/common/src/pal_pcie.c rename to acs-drv/files/platform/pal_linux/files/src/pal_pcie.c index cc74bdc9b1e4b25f506c0d16241a39f918edfa61..2307b664f35a4548ed692fde9b30b7cd44c9fe41 100644 --- a/acs-drv/files/platform/pal_linux/files/common/src/pal_pcie.c +++ b/acs-drv/files/platform/pal_linux/files/src/pal_pcie.c @@ -20,9 +20,12 @@ * */ -#include "common/include/pal_linux.h" -#include "bsa/include/bsa_pal_dt.h" +#include "include/pal_linux.h" +#include "include/pal_dt.h" +#include "val/include/pal_interface.h" +#include +#include #include #include #include @@ -33,6 +36,20 @@ #include #include +#define NOT_IMPLEMENTED 0x4B1D + +/* UUID for PCIe */ +static const guid_t pci_guid = + GUID_INIT(0xE5C937D0, 0x3553, 0x4D7A, + 0x91, 0x17, 0xEA, 0x4D, 0x19, 0xC3, 0x43, 0x4D); + +/* Defines for the _DSM method for obtaining Steering tag value */ +#define PCI_REVISION 0x6 +#define PCI_FUNC_INDEX 0x0E + +acpi_status ste_user_function(acpi_handle handle, uint32_t level, void *context, void **return_value); + + /** @brief Read a device MSI(X) vector @@ -689,3 +706,86 @@ pal_pcie_bar_mem_write(uint32_t Bdf, uint64_t address, uint32_t data) pal_mmio_write(address, data); return 0; } + +/** + @brief Gets RP support of transaction forwarding. + + @param bus PCI bus address + @param dev PCI device address + @param fn PCI function number + @param seg PCI segment number + + @return 0 if rp not involved in transaction forwarding + 1 if rp is involved in transaction forwarding +**/ +uint32_t +pal_pcie_get_rp_transaction_frwd_support(uint32_t seg, uint32_t bus, uint32_t dev, uint32_t fn) +{ + return 1; +} + + + +/** + @brief This function is called by the function pal_pcie_dsm_ste_tags + when the any device is found + + @param handle device handle + @param level nesting level + @param context data to be passed from caller function + @param return_value return value passed to caller function pal_pcie_dsm_ste_tags + + @return 0 - Failure, NOT_IMPLEMENTED - DSM Method not implemented, Other values - PASS +**/ +acpi_status ste_user_function(acpi_handle handle, uint32_t level, + void *context, void **return_value) +{ + + acpi_status status; + struct acpi_buffer buffer; + union acpi_object *obj; + uint32_t ste_value; + + buffer.length = ACPI_ALLOCATE_BUFFER; + status = acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); + + if (acpi_has_method(handle, "_DSM")) { + obj = acpi_evaluate_dsm_typed(handle, &pci_guid, PCI_REVISION, + PCI_FUNC_INDEX, NULL, ACPI_TYPE_INTEGER); + + if (!obj) { + acs_print(ACS_PRINT_INFO,"\n DSM method for STE not present.", 0); + return NOT_IMPLEMENTED; + } + + ste_value = obj->integer.value; + acs_print(ACS_PRINT_DEBUG,"\n Steering tag value is %x", ste_value); + if (ste_value == 0) { + ACPI_FREE(obj); + return ste_value; + } + + ACPI_FREE(obj); + return ste_value; + } + else + return 0; + + return NOT_IMPLEMENTED; +} + +/** + @brief Check for the _DSM method to obtain the STE value + + @param None + + @return 0 - Failure, NOT_IMPLEMENTED - DSM Method not implemented, Other values - PASS +**/ +uint32_t pal_pcie_dsm_ste_tags(void) +{ + acpi_handle handle = NULL; + acpi_status status; + + status = acpi_get_devices(NULL, ste_user_function, NULL, &handle); + return status; +} diff --git a/acs-drv/files/platform/pal_linux/files/common/src/pal_pcie_enumeration.c b/acs-drv/files/platform/pal_linux/files/src/pal_pcie_enumeration.c similarity index 98% rename from acs-drv/files/platform/pal_linux/files/common/src/pal_pcie_enumeration.c rename to acs-drv/files/platform/pal_linux/files/src/pal_pcie_enumeration.c index 57ff6172dcc1957289bab9967adc0555f43465d6..3f2356596d1d49506c99ea5afcd59105cb392786 100644 --- a/acs-drv/files/platform/pal_linux/files/common/src/pal_pcie_enumeration.c +++ b/acs-drv/files/platform/pal_linux/files/src/pal_pcie_enumeration.c @@ -22,8 +22,8 @@ #include #include -#include "common/include/pal_pcie_enum.h" -#include "common/include/pal_linux.h" +#include "include/pal_pcie_enum.h" +#include "include/pal_linux.h" /** diff --git a/acs-drv/files/platform/pal_linux/files/common/src/pal_pe.c b/acs-drv/files/platform/pal_linux/files/src/pal_pe.c similarity index 97% rename from acs-drv/files/platform/pal_linux/files/common/src/pal_pe.c rename to acs-drv/files/platform/pal_linux/files/src/pal_pe.c index 14d17d69dd7ec7b67a7d0d8431090521b42aaf92..90906f98caf33b79e447276b34a0bdd9d99ea7ac 100644 --- a/acs-drv/files/platform/pal_linux/files/common/src/pal_pe.c +++ b/acs-drv/files/platform/pal_linux/files/src/pal_pe.c @@ -13,19 +13,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2016-2018, 2021, 2023 Arm Limited + * Copyright (C) 2016-2018, 2021, 2023,2025 Arm Limited * * Author: Prasanth Pulla * */ -#include "common/include/pal_linux.h" +#include "include/pal_linux.h" #include #include #include #include #include -#include "bsa/include/bsa_pal_dt.h" +#include "include/pal_dt.h" /** @brief This API fills in the PE_INFO Table with information about the PEs in the diff --git a/acs-drv/files/platform/pal_linux/files/common/src/pal_peripherals.c b/acs-drv/files/platform/pal_linux/files/src/pal_peripherals.c similarity index 97% rename from acs-drv/files/platform/pal_linux/files/common/src/pal_peripherals.c rename to acs-drv/files/platform/pal_linux/files/src/pal_peripherals.c index 6ec88023d63d9268dcaca837b6a018c6a4bee791..4c1140696aca4a9ab8995cd6774c8ef3f1e661c9 100644 --- a/acs-drv/files/platform/pal_linux/files/common/src/pal_peripherals.c +++ b/acs-drv/files/platform/pal_linux/files/src/pal_peripherals.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2016-2018, 2020-2023, 2024, Arm Limited + * Copyright (C) 2016-2018, 2020-2025, Arm Limited * * Author: Prasanth Pulla * @@ -24,8 +24,8 @@ #include #include -#include "common/include/pal_linux.h" -#include "common/include/pal_pcie_enum.h" +#include "include/pal_linux.h" +#include "include/pal_pcie_enum.h" #define USB_CLASSCODE 0x0C0330 #define SATA_CLASSCODE 0x010601 diff --git a/acs-drv/files/platform/pal_linux/files/common/src/pal_smmu.c b/acs-drv/files/platform/pal_linux/files/src/pal_smmu.c similarity index 97% rename from acs-drv/files/platform/pal_linux/files/common/src/pal_smmu.c rename to acs-drv/files/platform/pal_linux/files/src/pal_smmu.c index 09776ed0311de2ae4762d682a8a06d5ce8489229..a713525f1a787a8c87293808ed539734a37fd2bd 100644 --- a/acs-drv/files/platform/pal_linux/files/common/src/pal_smmu.c +++ b/acs-drv/files/platform/pal_linux/files/src/pal_smmu.c @@ -24,8 +24,8 @@ #include #include -#include "common/include/pal_linux.h" -#include "common/include/bsa-iommu.h" +#include "include/pal_linux.h" +#include "include/bsa-iommu.h" #define SMMU_V3_IDR1 0x4 #define SMMU_V3_IDR1_PASID_SHIFT 6 diff --git a/acs-drv/files/sbsa_acs_drv.c b/acs-drv/files/sbsa_acs_drv.c index ccf86310c40f25d915c04f99cfdf2f03b8a1845b..e82f1d067886a03f015e60f8f5cf40f7f2db4455 100755 --- a/acs-drv/files/sbsa_acs_drv.c +++ b/acs-drv/files/sbsa_acs_drv.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * Copyright (C) 2016-2020, 2023, 2024, Arm Limited + * Copyright (C) 2016-2020, 2023-2025, Arm Limited * * Author: Prasanth Pulla * @@ -22,11 +22,10 @@ #include #include "sbsa_acs_drv.h" -#include "val/common/include/val_interface.h" -#include "val/common/include/acs_val.h" -#include "val/common/include/acs_common.h" -#include "val/sbsa/include/sbsa_acs_pcie.h" -#include "val/sbsa/include/sbsa_val_interface.h" +#include "val/include/val_interface.h" +#include "val/include/acs_common.h" +#include "val/include/acs_val.h" +#include "val/include/acs_pcie.h" test_params_t params; test_msg_parms_t msg_params; diff --git a/acs-drv/files/sbsa_setup.sh b/acs-drv/files/sbsa_setup.sh deleted file mode 100755 index 22ceede1be8835e5f6520c89f2f368037a848295..0000000000000000000000000000000000000000 --- a/acs-drv/files/sbsa_setup.sh +++ /dev/null @@ -1,19 +0,0 @@ - -echo "==================================================================" -echo "This script will copy the necessary files for Kernel module build " -echo "to the present directory" -echo "==================================================================" - -if [ $# -ne 2 ]; -then - echo "Give both BSA_ACS (1st argument) and SBSA_ACS PATH (2nd argument) as the arguments to the script" - return 0 -fi - -export BSA_ACS_PATH=$1 -export SBSA_ACS_PATH=$2 -echo -e "BSA ACS_PATH is set to -> \e[93m $BSA_ACS_PATH\e[0m" -echo -e "SBSA ACS_PATH is set to -> \e[93m $SBSA_ACS_PATH\e[0m" - -cp -r $BSA_ACS_PATH/val . -cp -r $SBSA_ACS_PATH/test_pool .