diff --git a/Makefile b/Makefile
index a178a4aa6fbe8f26a1e40f06205a1d717409ac71..34d84e4bab08556544d6541e331067fccf5ba03b 100644
--- a/Makefile
+++ b/Makefile
@@ -21,34 +21,50 @@ export TOP=$(shell pwd)
# Library and executable names
LIB=scmi_test
PROGRAM=scmi_test_agent
+BAREMETAL=baremetal
+MOCKER=mocker
+LINUX=linux
-# Default version and verbose setting
-VERBOSE := 3
-VERSION := 1
-
-# Obtain PLAT command line argument and set platform directory
-# However PLAT is an optional variable hence conditionally set these
+#Set PLATFORM
ifneq ($(PLAT),)
- PLAT_DIR=platform/$(PLAT)
- EXE=$(PROGRAM)
+PLAT_DIR=platform/$(PLAT)
+APP_DIR=$(PLAT)_app
+EXE=$(PROGRAM)
endif
-APP_DIR=linux_app
+ifeq ($(PLAT),$(BAREMETAL))
+LIB_BM=$(LIB)
+undefine EXE
+else
+LIB_ALL=$(LIB)
+endif
+
+ifeq ($(PLAT),$(LINUX))
+PLAT_DIR=platform/sgm776
+endif
+
+# Set VERBOSE to default(TEST) if not set
+ifndef VERBOSE
+ VERBOSE=3
+endif
# Obtain PROTOCOLS command line argument
comma := ,
-ALL_PROTOCOLS=base common $(subst $(comma), ,$(PROTOCOLS))
+ALL_PROTOCOLS=base $(subst $(comma), ,$(PROTOCOLS))
ALL_PROTOCOLS_UPPER=$(shell echo $(ALL_PROTOCOLS) | tr a-z A-Z)
# List of subdirs to be built
DIRS=val $(PLAT_DIR) $(ALL_PROTOCOLS:%=test_pool/%) $(APP_DIR)
+ifeq ($(PLAT),$(MOCKER))
+DIRS+=$(PLAT_DIR)/$(PLAT)
+endif
BUILD_ALL=$(DIRS)
# Name for directory within each subdir that contains its header files
export HEADER_DIR=include
# List of directories to be searched for header files
-export I_DIRS=$(DIRS:%=-I$(TOP)/%/${HEADER_DIR}) -I$(TOP)/test_pool/${HEADER_DIR} -I$(TOP)/platform/${HEADER_DIR}
+export I_DIRS=$(DIRS:%=-I$(TOP)/%/${HEADER_DIR}) -I$(TOP)/val/${HEADER_DIR} -I$(TOP)/platform/$(PLAT)/${HEADER_DIR}
# Output objects directory
export APP_OBJ_DIR=$(TOP)/app_output
@@ -64,15 +80,14 @@ export VAL_OBJ_DIR=$(TOP)/val_output
# list of names to be converted as macros
export D_NAMES=$(ALL_PROTOCOLS_UPPER:%=-D%_PROTOCOL)
-export CFLAGS=-DVERBOSE_LEVEL=$(VERBOSE) -Wall -Werror
-export CFLAGS+=-DSCMI_VERSION_$(VERSION)
+export CFLAGS+=-DVERBOSE_LEVEL=$(VERBOSE) -Wall -Werror
# Location of external library directories
LIB_DIR=$(TOP)
all: all_makefiles # to avoid overriding all target
-all_makefiles: check_requirements $(BUILD_ALL) $(LIB) $(EXE)
+all_makefiles: check_requirements $(BUILD_ALL) $(LIB_ALL) $(LIB_BM) $(EXE)
@echo "### Built project successfully!!!###"
check_requirements:
@@ -88,15 +103,18 @@ $(BUILD_ALL):
$(PROGRAM):
echo "Building executable '$@' at `pwd`"
echo "$(CC) $(D_NAMES) $(CFLAGS) $(PLATFORM_OBJ_DIR)/*.o $(LDFLAGS) -L$(LIB_DIR) -l$(LIB) -o $@"
- $(CC) $(D_NAMES) $(CFLAGS) $(PLATFORM_OBJ_DIR)/*.o $(LDFLAGS) -L$(LIB_DIR) -l$(LIB) -o $@
+ $(CC) $(D_NAMES) $(CFLAGS) $(APP_OBJ_DIR)/*.o $(PLATFORM_OBJ_DIR)/*.o $(LDFLAGS) -L$(LIB_DIR) -l$(LIB) -o $@
+
+$(LIB_BM):
+ echo "Building library at `pwd`"
+ $(AR) -cvq lib$@.a $(VAL_OBJ_DIR)/*.o $(TEST_OBJ_DIR)/*.o $(APP_OBJ_DIR)/*.o $(PLATFORM_OBJ_DIR)/*.o
-$(LIB):
+$(LIB_ALL):
echo "Building library at `pwd`"
- $(AR) -cvq lib$@.a $(VAL_OBJ_DIR)/*.o $(TEST_OBJ_DIR)/*.o $(APP_OBJ_DIR)/*.o
+ $(AR) -cvq lib$@.a $(VAL_OBJ_DIR)/*.o $(TEST_OBJ_DIR)/*.o
help:
- @echo "### SUPPORTED PROTOCOLS : base power_domain system_domain performance clock sensor ###"
- @echo "### SUPPORTED VERSION : 1 (SCMI v1.0 test) , 2 (SCMI v2.0 test) ###"
+ @echo "### SUPPORTED PROTOCOLS : base power_domain system_domain performance clock sensor reset ###"
@echo "### SUPPORTED VERBOSE : 1 (ERR) 2 (WARN) 3 (TEST) 4 (DEBUG) 5 (INFO) ###"
clean: clean_all # to avoid overriding clean target
diff --git a/README.md b/README.md
index 3988eaab28ccad35e2f68a8fad23e03ce9244ae6..ecc34b01a65185ea5498565a8b557a4f94929c4b 100644
--- a/README.md
+++ b/README.md
@@ -1,42 +1,37 @@
-# System Control and Management Interface Compliance Suite
+
+# System Control and Management Interface - Compliance Suite
## Introduction
-**System Control and Management Interface** (SCMI) is a set of operating system-independent software interfaces that are used in system management.
+**System Control and Management Interface** (SCMI) is a set of Operating System-independent software interfaces that are used in system management.
-For more information, download the [SCMI Platform Design Document](http://infocenter.arm.com/help/topic/com.arm.doc.den0056b/DEN0056B_System_Control_and_Management_Interface_v2_0.pdf).
+For more information, download the [SCMI Platform Design Document](https://developer.arm.com/documentation/den0056/b/?lang=en).
-## SCMI compliance suite
-SCMI compliance suite is a collection of self-checking, portable C tests. It enables adopters of SCMI PDD \(Platform Design Document\) to test their own implementations. It provides a predefined library of tests and a test framework to execute these tests. The test suite can be adapted to different platforms. It also enables the extension of the current test library to include platform-specific custom commands and custom protocols.
+## SCMI Compliance suite
+SCMI compliance suite is a collection of self-checking, portable C tests. SCMI compliance suite enables adopters of SCMI Platform Design Document \(PDD\) to test their own implementations. It provides a predefined library of tests and a test framework to execute these tests. The test suite can be adapted to different platforms. It also enables the extension of the current test library to include platform-specific custom commands and custom protocols.
## Release details
- - Code quality: REL v2.0 Alpha.
+ - Code quality: REL v2.0.
- The tests are written for version 2.0 of the SCMI PDD.
- The compliance suite maintains backward compatibility with version 1.0 of the SCMI PDD.
- The compliance suite is not a substitute for design verification.
- - Refer to the [Test checklist] for the scenarios covered by the tests.
+ - The compliance suite is verified against [SCP-firmware](https://github.com/ARM-software/SCP-firmware).
+ - To know about the gaps in the test coverage, see the [Test checklist].
## GitHub branch
-
-To get the latest version of the code with bug fixes and new features, use the master branch.
+ Use the master branch to get the latest version of the code with bug fixes and new features.
## Test scenarios
-The mapping of the SCMI commands to the test cases are mentioned in the [Test checklist].
-
-## Future enhancements
-
-The following features or capability additions are planned as part of future releases:
-- Testing notifications and delayed responses for relevant commands.
-- Test library extension with new test cases for additional protocols as defined in the newer version of the PDD.
+The mapping of the rules in the specification to the test cases and the steps followed in the tests are mentioned in the [Test checklist].
## Getting started
-See the [User Guide] for instructions to adapt, build, and run the test suite.
+See the [User Guide] for instructions to adapt, build and run the test suite.
### Additional reading
-For details on the design of the SCMI test suite, see the [Validation Methodology Document].
+For details on the design of the SCMI test suite, see [Validation Methodology Document].
## License
-The software is provided under Apache 2.0 [License]. Contributions to this project are accepted under the same license.
+The software is provided under Apache 2.0 license. Contributions to this project are accepted under the same license.
## Feedback and support
Arm values and welcomes any feedback and contributions to this project.
@@ -49,9 +44,8 @@ Arm values and welcomes any feedback and contributions to this project.
- - - - - - - - - - - - - - - - - - - -
-_Copyright (c) 2019, Arm Limited and Contributors. All rights reserved._
+_Copyright (c) 2019-2020, Arm Limited and Contributors. All rights reserved._
-[User Guide]: ./docs/user_guide.md "SCMI Test Suite User Guide"
-[Validation Methodology Document]: ./docs/Arm_SCMI_Validation_Methodology.pdf "SCMI Test Suite Design"
-[Test checklist]: ./docs/scmi_testlist.md "SCMI Test Specification"
-[License]: ./LICENSE.md "License"
+[User Guide]: ./docs/user_guide.md "SCMI Test Suite User Guide"
+[Validation Methodology Document]: ./docs/Arm_SCMI_Validation_Methodology.pdf "SCMI Test Suite Design"
+[Test checklist]: ./docs/scmi_testlist.md "SCMI Test Specification"
diff --git a/baremetal_app/Makefile b/baremetal_app/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..1d65f5e705e56321049c22e37ed8fcede1e85ed7
--- /dev/null
+++ b/baremetal_app/Makefile
@@ -0,0 +1,35 @@
+#/** @file
+# * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+# * SPDX-License-Identifier : Apache-2.0
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# * http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+#**/
+
+C_FILES := $(wildcard *.c)
+H_FILES := $(wildcard $(HEADER_DIR)/*.h)
+OBJS := $(patsubst %.c,$(APP_OBJ_DIR)/%.o,$(C_FILES))
+
+all: all_baremetal_app
+
+all_baremetal_app: $(OBJS)
+ @echo "### Finished building with makefile at `pwd` ###"
+
+$(APP_OBJ_DIR)/%.o: %.c $(H_FILES)
+ echo "$(CC) $(D_NAMES) $(CFLAGS) $(I_DIRS) -c $< -o $@"
+ $(CC) $(D_NAMES) $(CFLAGS) $(I_DIRS) -g -c $< -o $@
+
+clean: clean_baremetal_app
+
+clean_baremetal_app:
+
+.PHONY: clean
diff --git a/baremetal_app/app.c b/baremetal_app/app.c
new file mode 100644
index 0000000000000000000000000000000000000000..6bd1fb6ee804c0a050ce6614d4597bdbe458a10a
--- /dev/null
+++ b/baremetal_app/app.c
@@ -0,0 +1,86 @@
+/** @file
+ * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+
+/**
+ @brief Entry point to SCMI suite
+ 1. Caller - Platform layer.
+ 2. Prerequisite - Power domain protocol info table.
+ @param none
+ @return none
+**/
+
+void arm_scmi_agent_execute(void *agent_info)
+{
+ uint32_t num_pass;
+ uint32_t num_fail;
+ uint32_t num_skip;
+
+ val_print(VAL_PRINT_ERR, "\n\n **** SCMI Compliance Suite **** ");
+
+ if (val_initialize_system(agent_info)) {
+ val_print(VAL_PRINT_ERR, "\n **** INIT FAILED ***");
+ return;
+ }
+
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting BASE tests ***");
+ val_base_execute_tests();
+
+#ifdef POWER_DOMAIN_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting POWER tests *** ");
+ val_power_domain_execute_tests();
+#endif
+
+#ifdef SYSTEM_POWER_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting SYSTEM POWER tests *** ");
+ val_system_power_execute_tests();
+#endif
+
+#ifdef PERFORMANCE_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting PERFORMANCE tests *** ");
+ val_performance_execute_tests();
+#endif
+
+ #ifdef CLOCK_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting CLOCK tests ***");
+ val_clock_execute_tests();
+#endif
+
+#ifdef SENSOR_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting SENSOR tests *** ");
+ val_sensor_execute_tests();
+#endif
+
+#ifdef RESET_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting RESET tests *** ");
+ val_reset_execute_tests();
+#endif
+
+ num_pass = val_get_test_passed();
+ num_fail = val_get_test_failed();
+ num_skip = val_get_test_skipped();
+
+ val_print(VAL_PRINT_ERR, "\n****************************************************", 0);
+ val_print(VAL_PRINT_ERR, "\n TOTAL TESTS: %d", num_pass + num_fail + num_skip);
+ val_print(VAL_PRINT_ERR, " PASSED: %d", num_pass);
+ val_print(VAL_PRINT_ERR, " FAILED: %d", num_fail);
+ val_print(VAL_PRINT_ERR, " SKIPPED: %d", num_skip);
+ val_print(VAL_PRINT_ERR, "\n****************************************************", 0);
+
+ val_print(VAL_PRINT_ERR, "\n\n **** SCMI tests complete **** \n ");
+}
diff --git a/docs/ARM_SCMI_Validation_Methodology.pdf b/docs/ARM_SCMI_Validation_Methodology.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..621f533018c713caf61066a8693b89250558577b
Binary files /dev/null and b/docs/ARM_SCMI_Validation_Methodology.pdf differ
diff --git a/docs/Arm_SCMI_Validation_Methodology.pdf b/docs/Arm_SCMI_Validation_Methodology.pdf
deleted file mode 100755
index 9c6d391f7b7757a2f6368e066c086f514f69a1c7..0000000000000000000000000000000000000000
Binary files a/docs/Arm_SCMI_Validation_Methodology.pdf and /dev/null differ
diff --git a/docs/guide_sgm_testing.md b/docs/guide_sgm_testing.md
index 0b9f5b33ff7b5600788e7d02c2357a196c014321..9bf88fbfc180cf6dd9f635c7a69a4af6d0e4cb2b 100644
--- a/docs/guide_sgm_testing.md
+++ b/docs/guide_sgm_testing.md
@@ -1,3 +1,4 @@
+
**Guide for testing on SGM platforms**
=================================
@@ -17,43 +18,43 @@ For an introduction to the System Guidance for Mobile (SGM) platforms, please re
Software Stack
-------
-Arm provides a [super-project] with guides for building and running a full software stack on Arm platforms. This project provides a convenient wrapper around the various build systems involved in the software stack. Please contact Arm for support on software stack for SGM platform.
+Arm provides a [super-project] with guides for building and running a full software stack on Arm platforms. This project provides a convenient wrapper around the various build systems involved in the software stack. Please contact Arm at support-connect@arm.com for support on software stack of SGM platform.
Linux kernel
-------
-The following changes must be made in the Linux kernel source code after downloading software stack for SGM.
+The following changes must be made in the Linux kernel source code after downloading the software stack for SGM.
### Mailbox test driver
-To use SCMI test agent on SGM platform, the Linux kernel must be rebuilt to include the mailbox test driver with mailbox doorbell support and additional changes. Doorbell support patches for mailbox and additional changes to enable mailbox test driver are tested against Linux kernel version 4.13.
+To use SCMI test agent on SGM platform, the Linux kernel must be rebuilt to include the mailbox test driver with mailbox doorbell support and additional changes. Doorbell support patches for mailbox, and additional changes to enable mailbox test driver are tested against Linux kernel version 4.13.
### Doorbell support patches for mailbox
-The doorbell support for mailbox driver is enabled by applying a patch series that is currently discussed in LKML. For more information, see [Mailbox doorbell support patches]. Pick up the relevant mailbox patches from [Mailbox doorbell support repo]. These patches must be applied to the linux kernel.
+The doorbell support for mailbox driver is enabled by applying a patch series that is currently discussed in LKML. For more information, see [Mailbox doorbell support patches]. These patches must be applied to the linux kernel.
### Additional changes to enable mailbox test driver
In addition to applying the patches, follow these steps before starting the kernel build.
`Enable mailbox test driver`: Set CONFIG_MAILBOX_TEST=y in kernel config to include mailbox test driver in the kernel.
-`Modify mailbox driver to prevent format conversion`: The current version of mailbox driver always converts raw binary data to hex format. For SCMI test agent, we expect raw data unmodified for processing. The change that is shown below prevents the format change.
+`Modify mailbox driver to prevent format conversion`: The current version of mailbox driver always converts raw binary data to hex format. For SCMI test agent, we expect raw data unmodified for processing. The change that is shown below prevents the format change.
The driver support to add this as a configurable option is planned for the future.
Until that change is added, the change that is shown below is required in the mbox_test_message_read function in drivers/mailbox/mailbox-test.c:
```
- }
- *(touser + l) = '\0';
+ }
+ *(touser + l) = '\0';
-+ ret = simple_read_from_buffer(userbuf, count, ppos, tdev->rx_buffer,
-+ MBOX_HEXDUMP_MAX_LEN);
++ ret = simple_read_from_buffer(userbuf, count, ppos, tdev->rx_buffer,
++ MBOX_HEXDUMP_MAX_LEN);
+
- memset(tdev->rx_buffer, 0, MBOX_MAX_MSG_LEN);
- mbox_data_ready = false;
+ memset(tdev->rx_buffer, 0, MBOX_MAX_MSG_LEN);
+ mbox_data_ready = false;
- spin_unlock_irqrestore(&tdev->lock, flags);
+ spin_unlock_irqrestore(&tdev->lock, flags);
-- ret = simple_read_from_buffer(userbuf, count, ppos, touser, MBOX_HEXDUMP_MAX_LEN);
+- ret = simple_read_from_buffer(userbuf, count, ppos, touser, MBOX_HEXDUMP_MAX_LEN);
waitq_err:
- __set_current_state(TASK_RUNNING);
- remove_wait_queue(&tdev->waitq, &wait);
+ __set_current_state(TASK_RUNNING);
+ remove_wait_queue(&tdev->waitq, &wait);
```
The current change in mailbox test driver is not an ideal solution. A better solution is to use sysfs entry for configurability. This enhancement will be upstreamed in the future, thereby making this change redundant.
@@ -64,10 +65,9 @@ For instructions to build the test suite for sgm platform and running it, see re
- - - - - - - - - - - - - - - -
-_Copyright (c) 2019, Arm Limited and Contributors. All rights reserved._
+_Copyright (c) 2019-2020, Arm Limited and Contributors. All rights reserved._
-[ARM Developer documentation]: https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms
-[Mailbox doorbell support patches]: https://lkml.org/lkml/2017/5/24/339
-[Mailbox doorbell support repo]: https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/log/?h=scmi_mhu_dt_changes
-[User Guide]: ./user_guide.md
+[ARM Developer documentation]: https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms
+[Mailbox doorbell support patches]: https://lkml.org/lkml/2017/5/24/339
+[User Guide]: ./user_guide.md
[super-project]: https://git.linaro.org/landing-teams/working/arm/arm-reference-platforms.git/about/docs/user-guide.rst
diff --git a/docs/scmi_testlist.md b/docs/scmi_testlist.md
index 6bb8a42ebf262c5f6b1bfb83feeb7db4564187e5..8e3f19b33640bc49760687addc078c9681bbd035 100644
--- a/docs/scmi_testlist.md
+++ b/docs/scmi_testlist.md
@@ -1,3 +1,4 @@
+
**SCMI Tests - Scenario document**
===================================
Table of Contents:
@@ -9,6 +10,7 @@ Table of Contents:
- [Performance Domain Management Protocol Tests](#performance-domain-management-protocol-tests)
- [Clock Management Protocol Tests](#clock-management-protocol-tests)
- [Sensor Management Protocol Tests](#sensor-management-protocol-tests)
+- [Reset Management Protocol Tests](#reset-management-protocol-tests)
Introduction
-------
@@ -21,11 +23,10 @@ In writing the tests, these rules have been followed:
----------
> All test case identifiers **must** be unique.
-> All test case have a payload function which has test algorithm.
----------
-> Every test case compares return values against expected results that are provided by the user through the platform properties to determine a PASS or FAIL verdict. In case some protocols are not supported by particular platform, those test cases needs to be skipped.
+> Every test case compares return values against expected results that are provided by the user through the platform properties to determine a PASS or FAIL verdict. In case some protocols are not supported by particular platform, those test cases need to be skipped.
----------
@@ -37,11 +38,11 @@ In writing the tests, these rules have been followed:
----------
-> Some tests might require a **pre-condition** or a **post-condition** check. These checks are captured as part of test cases that **must** come immediately preceding or just after the relevant test case payload function. The test in that case must have pre_condition or post_condition function.
+> Some tests might require a **pre-condition** or a **post-condition** check. These checks are captured as part of test cases that **must** come immediately preceding or just after the relevant test case payload function.
-> A typical example for a test case needing a precondition is the get command which has a set command as a precondition.
+> A typical example for a test case that needs a precondition is the get command which has a set command as a precondition.
-> A typical example for a test case needing a postcondition is a subscribe for notification command which has unsubscribe for notification command as the postcondition.
+> A typical example for a test case that needs a postcondition is a subscribe for notification command which has unsubscribe for notification command as the postcondition.
Base Protocol Tests
@@ -53,20 +54,21 @@ This section outlines the test specification for SCMI Base Protocol.
| test_b001 | Query the protocol version information. | Check Version against expected value. | PROTOCOL\_VERSION |
| test_b002 | Query the protocol attributes. | Check num\_agents and num\_protocols against expected value. | PROTOCOL\_ATTRIBUTES |
| test_b003 | Query for mandatory command support. | Check command implementation status. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
-| test_b004 | Query for vendor information. | Check vendor name against expected value. | BASE\_DISCOVER\_VENDOR |
-| test_b005 | Query for vendor specific implementation version. | Check implementation version against expected value. | BASE\_DISCOVER\_VENDOR |
-| test_b006 | Query for sub vendor information. | Check sub vendor name against expected value. | BASE\_DISCOVER\_SUB\_VENDOR |
-| test_b007 | Pre-Condition: BASE\_DISCOVER\_AGENT support.
Query for agent name with valid and invalid agent id. | 1. Check agent name starts with "platform" when agent id = 0.
2. Check agent name with expected value for valid agent id.
3. Check agent name matches expected value when agent_id = 0xFFFFFFFF.
4. Check NOT_FOUND return status for invalid agent id. | PROTOCOL\_MESSAGE\_ATTRIBUTES
BASE\_DISCOVER\_AGENT |
-| test_b008 | Pre-Condition: BASE\_NOTIFY\_ERRORS support.
1. Register and Unregister for error notification from platform.
2. Send command with invalid parameters. | 1. Check SUCCESS status returned for register and unregister.
2. Check INVALID\_PARAMETERS return status for invalid notify_enable. | PROTOCOL\_MESSAGE\_ATTRIBUTES
BASE\_NOTIFY\_ERRORS |
-| test_b009 | Query protocol list with valid and invalid skip value. | 1. Check protocol list against expected value for valid skip value.
2. Check INAVLID\_PARAMETERS return status for invalid skip value. | BASE\_DISCOVER\_LIST\_PROTOCOLS |
-| test_b010 | Send invalid command id for base protocol.
Query the protocol message attributes with invalid msg_id. | Check NOT\_FOUND status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
-| test_b011 | Pre-Condition: BASE\_SET\_PROTOCOL\_PERMISSIONS support.
1. Try setting protocol permission for invalid agent.
2. Try to remove access for base\_protocol.
3. Send command with invalid parameters. | 1. Check NOT\_FOUND status is returned.
2. Check NOT\_FOUND status is returned.
3. Check INVALID\_PARAMETERS is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES
BASE\_SET\_PROTOCOL\_PERMISSIONS |
-| test_b012 | Pre-Condition: BASE\_SET\_DEVICE\_PERMISSIONS support.
1. Try setting device permissions for invalid agent.
2. Send command with invalid parameters.
| 1. Check NOT_FOUND status is returned.
2. Check INVALID_PARAMETERS status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES
BASE\_SET\_DEVICE\_PERMISSIONS |
-| test_b013 | Pre-Condition: BASE\_RESET\_AGENT\_CONFIGURATION support.
1. Try resetting device and protocol permissions for invalid agent.
2. Send command with invalid flags value.
| 1. Check NOT_FOUND status is returned.
2. Check INVALID_PARAMETERS status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES
BASE\_RESET\_AGENT\_CONFIGURATION |
+| test_b004 | Send invalid command id for base protocol.
Query the protocol message attributes with invalid msg_id. | Check NOT\_FOUND status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
+| test_b005 | Query for vendor information. | Check vendor name against expected value. | BASE\_DISCOVER\_VENDOR |
+| test_b006 | Pre-Condition: BASE\_DISCOVER\_SUB\_VENDOR support.
Query for sub vendor information. | Check sub vendor name against expected value. | PROTOCOL\_MESSAGE\_ATTRIBUTES
BASE\_DISCOVER\_SUB\_VENDOR |
+| test_b007 | Query for vendor specific implementation version. | Check implementation version against expected value. | BASE\_DISCOVER\_IMPLEMENTATION\_VERSION|
+| test_b008 | Query protocol list with valid and invalid skip value. | 1. Check protocol list against expected value for valid skip value.
2. Check INAVLID\_PARAMETERS return status for invalid skip value. | BASE\_DISCOVER\_LIST\_PROTOCOLS |
+| test_b009 | Pre-Condition: BASE\_DISCOVER\_AGENT support.
Query for agent name with valid and invalid agent id. | 1. Check agent name starts with "platform" when agent id = 0.
2. Check agent name with expected value for valid agent id.
3. Check agent name matches expected value when agent_id = 0xFFFFFFFF.
4. Check NOT_FOUND return status for invalid agent id. | PROTOCOL\_MESSAGE\_ATTRIBUTES
BASE\_DISCOVER\_AGENT |
+| test_b010 | Pre-Condition: BASE\_NOTIFY\_ERRORS support.
1. Register and Unregister for error notification from platform.
2. Send command with invalid parameters. | 1. Check SUCCESS status returned for register and unregister.
2. Check INVALID\_PARAMETERS return status for invalid notify_enable. | PROTOCOL\_MESSAGE\_ATTRIBUTES
BASE\_NOTIFY\_ERRORS |
+| test_b011 | Pre-Condition: BASE\_SET\_DEVICE\_PERMISSIONS support.
1. Try setting device permissions for invalid agent.
2. Send command with invalid parameters.
3. Remove acces of a invalid device.
| 1. Check NOT_FOUND status is returned.
2. Check INVALID_PARAMETERS status is returned.
3. Check NOT_FOUND status is returned.| PROTOCOL\_MESSAGE\_ATTRIBUTES
BASE\_SET\_DEVICE\_PERMISSIONS |
+| test_b012 | Pre-Condition: BASE\_SET\_DEVICE\_PERMISSIONS support.
1. Deny agent access to a valid device.
2. Try accessing denied device.
3. Restore the protocol access with BASE\_SET\_DEVICE\_PERMISSIONS. | 1. Check NOT_FOUND status is returned when access denied agent.
2. Agent should be able to access device after permissions restored.
| BASE\_SET\_DEVICE\_PERMISSIONS |
+| test_b013 | Pre-Condition: BASE\_SET\_PROTOCOL\_PERMISSIONS support.
1. Try setting protocol permission for invalid agent.
2. Try to remove access for base\_protocol.
3. Send command with invalid parameters.
4. Remove access of invalid device. | 1. Check NOT\_FOUND status is returned.
2. Check NOT\_FOUND status is returned.
3. Check INVALID\_PARAMETERS is returned.
4. Check NOT_FOUND status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES
BASE\_SET\_PROTOCOL\_PERMISSIONS |
| test_b014 | Pre-Condition: BASE\_SET\_PROTOCOL\_PERMISSIONS support.
1. Deny agent access to a valid protocol.
2. Try accessing command of denied protocol.
3. Restore the protocol access with BASE\_SET\_PROTOCOL\_PERMISSIONS. | 1. Check NOT_FOUND status is returned when access denied protocol.
2. Agent should be able to access protocol after permissions restored.
| BASE\_SET\_PROTOCOL\_PERMISSIONS |
-| test_b015 | Pre-Condition: BASE\_SET\_PROTOCOL\_PERMISSIONS and BASE\_RESET\_AGENT\_CONFIGURATION support.
1. Deny agent access to a valid protocol.
2. Try accessing command of denied protocol.
3. Restore the protocol access with BASE\_RESET\_AGENT\_CONFIGURATION. | 1. Check NOT_FOUND status is returned when access denied protocol.
2. Agent should be able to access protocol after permissions restored.
| BASE\_SET\_PROTOCOL\_PERMISSIONS
BASE\_RESET\_AGENT\_CONFIGURATION |
-| test_b016 | Pre-Condition: BASE\_SET\_DEVICE\_PERMISSIONS support.
1. Deny agent access to a valid device.
2. Try accessing denied device.
3. Restore the protocol access with BASE\_SET\_DEVICE\_PERMISSIONS. | 1. Check NOT_FOUND status is returned when access denied agent.
2. Agent should be able to access device after permissions restored.
| BASE\_SET\_DEVICE\_PERMISSIONS |
-| test_b017 | Pre-Condition: BASE\_SET\_DEVICE\_PERMISSIONS and BASE\_RESET\_AGENT\_CONFIGURATION support.
1. Deny agent access to a valid device.
2. Try accessing denied device.
3. Restore the device access with BASE\_RESET\_AGENT\_CONFIGURATION. | 1. Check NOT_FOUND status is returned when access denied device.
2. Agent should be able to access device after permissions restored.
| BASE\_SET\_DEVICE\_PERMISSIONS
BASE\_RESET\_AGENT\_CONFIGURATION |
+| test_b015 | Pre-Condition: BASE\_RESET\_AGENT\_CONFIGURATION support.
1. Try resetting device and protocol permissions for invalid agent.
2. Send command with invalid flags value.
| 1. Check NOT_FOUND status is returned.
2. Check INVALID_PARAMETERS status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES
BASE\_RESET\_AGENT\_CONFIGURATION |
+| test_b016 | Pre-Condition: BASE\_SET\_DEVICE\_PERMISSIONS and BASE\_RESET\_AGENT\_CONFIGURATION support.
1. Deny agent access to a valid device.
2. Try accessing denied device.
3. Restore the device access with BASE\_RESET\_AGENT\_CONFIGURATION. | 1. Check NOT_FOUND status is returned when access denied device.
2. Agent should be able to access device after permissions restored.
| BASE\_SET\_DEVICE\_PERMISSIONS
BASE\_RESET\_AGENT\_CONFIGURATION |
+| test_b017 | Pre-Condition: BASE\_SET\_PROTOCOL\_PERMISSIONS and BASE\_RESET\_AGENT\_CONFIGURATION support.
1. Deny agent access to a valid protocol.
2. Try accessing command of denied protocol.
3. Restore the protocol access with BASE\_RESET\_AGENT\_CONFIGURATION. | 1. Check NOT_FOUND status is returned when access denied protocol.
2. Agent should be able to access protocol after permissions restored.
| BASE\_SET\_PROTOCOL\_PERMISSIONS
BASE\_RESET\_AGENT\_CONFIGURATION |
+
Power Domain Management Protocol Tests
---------
@@ -75,14 +77,21 @@ This section outlines the test specification for SCMI Power Domain Management Pr
| Test ID | Test Intent | Verification Step | Comments/Commands Used |
| ---------- | --------------------- | ------------------ | ----------------------- |
| test_p001 | Query the protocol version information. | Check Version against expected value. | PROTOCOL\_VERSION |
-| test_p002 | Query the protocol attributes. | Check num\_agents and num\_protocols against expected value. | PROTOCOL\_ATTRIBUTES |
+| test_p002 | Query the protocol attributes. | Check power domain protocol attributes against expected values. | PROTOCOL\_ATTRIBUTES |
| test_p003 | Query for mandatory command availability. | Check command implementation status. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
-| test_p004 | Query power domain attributes with valid and non-existent power domain id. | 1. Check power domain attributes with expected value for valid power domain id.
2. Check NOT_FOUND return status for non-existent power domain id. | POWER\_DOMAIN\_ATTRIBUTES |
-| test_p005 | 1. Try setting power state of non-existent power domain id.
2. Send command with invalid flags and power state value.
3. Set valid power state for valid power domain id.
4. Read the power state of domain whose state was changed | 1. Check NOT_FOUND status is returned.
2. Check INVALID_PARAMETERS status is returned.
3. Check SUCCESS is returned and verify state with power state get command. | POWER\_STATE\_SET
POWER\_STATE\_GET |
-| test_p006 | Query power state get for non-existent power domain id. | 1. Check NOT_FOUND return status for non-existent power domain id. | POWER\_STATE\_GET |
-| test_p007 | Pre-Condition: POWER\_STATE\_NOTIFY support.
1. Enable notification for power state changed.
2. Enable power state notification for non-existent domain.
3. Send command with invalid notify_enable.
4. Change power state of domain.
5. Disable the power state notification.
6. Change the power state | 1. Check SUCCESS status is returned.
2. Check NOT_FOUND status is returned.
3. Check INVALID_PARAMETERS status is returned.
4. Check power state is changed and power state notification is received.
5. Check SUCCESS status is returned.
6. Check no power state notification is generated | POWER\_STATE\_NOTIFY
POWER\_STATE\_GET
POWER_STATE_SET |
-| test_p008 | 1. Send invalid command id for power domain protocol.
2. Query the protocol message attributes with invalid msg_id. | Check NOT\_FOUND status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
-| test_p009 | Pre-Condition: POWER\_STATE\_CHANGE\_REQUESTED\_NOTIFY support
1. Set power state change notification for non-existent power domain.
2. Invoke command with invalid notify_enable. | 1. Check NOT\_FOUND status is returned.
2. Check INVALID\_PARAMETERS status is returned. | POWER\_STATE\_CHANGE\_REQUESTED\_NOTIFY |
+| test_p004 | 1. Send invalid command id for power domain protocol.
2. Query the protocol message attributes with invalid msg_id. | Check NOT\_FOUND status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
+| test_p005 | Query power domain attributes with valid power domain id. | Check power domain attributes with expected value for valid power domain id.| POWER\_DOMAIN\_ATTRIBUTES |
+| test_p006 | Query power domain attributes with non-existent power domain id. | Check NOT_FOUND return status for non-existent power domain id. | POWER\_DOMAIN\_ATTRIBUTES |
+| test_p007 | Pre-Condition: Power domain should support power state set.
Send command with invalid flags and power state value.| Check INVALID_PARAMETERS status is returned.| POWER\_STATE\_SET
POWER\_DOMAIN\_ATTRIBUTES |
+| test_p008 | Send power state set command for not supported domain.| Check NOT\_SUPPORTED status is returned.| POWER\_STATE\_SET
POWER\_DOMAIN\_ATTRIBUTES |
+| test_p009 | Try setting power state of non-existent power domain id | Check NOT_FOUND status is returned. | POWER\_STATE\_SET |
+| test_p010 | Query power state get for valid domain id. | Check SUCCESS return status. | POWER\_STATE\_GET |
+| test_p011 | Query power state get for non-existent power domain id. | Check NOT_FOUND return status for non-existent power domain id. | POWER\_STATE\_GET |
+| test_p012 | Pre-Condition: POWER\_STATE\_NOTIFY support.
Send command with invalid notify_enable. | Check INVALID\_PARAMETERS status is returned. | POWER\_STATE\_NOTIFY
POWER\_DOMAIN\_ATTRIBUTES |
+| test_p013 | Pre-Conditions: POWER\_STATE\_NOTIFY support.
Send command for not supported domain. | Check NOT\_SUPPORTED status is returned. | POWER\_STATE\_NOTIFY
POWER\_DOMAIN\_ATTRIBUTES |
+| test_p014 | Pre-Condition: POWER\_STATE\_NOTIFY support.
Enable power state notification for non-existent domain. | Check NOT_FOUND status is returned | POWER\_STATE\_NOTIFY |
+| test_p015 | Pre-Condition: POWER\_STATE\_CHANGE\_REQUESTED\_NOTIFY support
Invoke command with invalid notify_enable. | Check INVALID\_PARAMETERS status is returned. | POWER\_STATE\_CHANGE\_REQUESTED\_NOTIFY |
+| test_p016 | Pre-Condition: POWER\_STATE\_CHANGE\_REQUESTED\_NOTIFY support
Set power state change notification for non-existent power domain. | Check NOT\_FOUND status is returned. | POWER\_STATE\_CHANGE\_REQUESTED\_NOTIFY |
System Power Management Protocol Tests
---------
@@ -93,8 +102,10 @@ This section outlines the test specification for SCMI System Power Management Pr
| test_s001 | Query the protocol version information. | Check Version against expected value. | PROTOCOL\_VERSION |
| test_s002 | Query the protocol attributes. | Check attributes byte is zero. | PROTOCOL\_ATTRIBUTES |
| test_s003 | Query for mandatory command availability. | Check command implementation status. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
-| test_s004 | Pre-Condition: SYSTEM\_POWER\_STATE\_GET support.
Query system power state and check state with expected value. | Check SUCCESS status is returned. | SYSTEM_POWER_STATE_GET |
-| test_s005 | 1. Send invalid command id for system power domain protocol.
2. Query the protocol message attributes with invalid msg_id. | Check NOT\_FOUND status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
+| test_s004 | 1. Send invalid command id for system power protocol.
2. Query the protocol message attributes with invalid msg_id. | Check NOT\_FOUND status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
+| test_s005 | Pre-Condition: SYSTEM\_POWER\_STATE\_SET support.
Query system power state set with invalid flag. | Check INVALID\_PARAMETERS status is returned. | SYSTEM\_POWER\_STATE\_SET |
+| test_s006 | Pre-Condition: SYSTEM\_POWER\_STATE\_GET support.
Query system power state and check state with expected value. | Check SUCCESS status is returned. | SYSTEM_POWER_STATE_GET |
+| test_s007 | Pre-Condition: SYSTEM\_POWER\_STATE\_NOTIFY support.
Query system power state notify with invalid notify\_enable. | Check INVALID\_PARAMETERS status is returned. | SYSTEM\_POWER\_STATE\_NOTIFY |
Performance Domain Management Protocol Tests
---------
@@ -103,8 +114,32 @@ This section outlines the test specification for SCMI Performance Domain Managem
| Test ID | Test Intent | Verification Step | Comments/Commands Used |
| ---------- | --------------------- | ------------------ | ----------------------- |
| test_d001 | Query the protocol version information. | Check Version against expected value. | PROTOCOL\_VERSION |
-| test_d002 | Query the protocol attributes. | Check num\_performance\_domains against expected value. | PROTOCOL\_ATTRIBUTES |
+| test_d002 | Query the protocol attributes. | Check performance protocol attributes against expected values. | PROTOCOL\_ATTRIBUTES |
| test_d003 | Query for mandatory command availability. | Check command implementation status. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
+| test_d004 | 1. Send invalid command id for performance protocol.
2. Query the protocol message attributes with invalid msg_id. | Check NOT\_FOUND status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
+| test_d005 | Query performance domain attributes with valid performance domain id. | Check performance domain attributes with expected values.| PERFORMANCE\_DOMAIN\_ATTRIBUTES |
+| test_d006 | Query performance domain attributes with non-existent performance domain id. | Check NOT_FOUND return status for non-existent performance domain id. | PERFORMANCE\_DOMAIN\_ATTRIBUTES |
+| test_d007 | 1. Query performance describe level for all domains.
2. Query performance describe level with invalid level index | 1. Check SUCCESS status is returned.
2. Check INVALID\_PARAMETERS status is returned.| PERFORMANCE\_DESCRIBE\_LEVELS |
+| test_d008 | Query performance describe level for non-existing performance domain. | Check NOT\_FOUND status is returned.| PERFORMANCE\_DESCRIBE\_LEVELS |
+| test_d009 | 1. Get current performance limits.
2. Set new performance limits.
3.Read limits and verify with new performance limits.
4. Restore the default limits. | Check SUCCESS status is returned. | PERFORMANCE\_LIMITS\_SET
PERFORMANCE\_LIMITS\_GET |
+| test_d010 | 1. Query with invalid maximum limit.
2. Query with invalid minimum limit.
3. Query with invalid minimum greater than maximum limit. | 1 & 2. Check OUT\_OF\_RANGE status is returned.
3. Check INVALID\_PARAMETERS status is returned. | PERFORMANCE\_LIMITS\_SET |
+| test_d011 | 1. Query set limit with not-supported performance domain.
2. Query performance domain set limit with non-existent performance domain id. | 1. Check DENIED status is returned.
2. Check NOT\_FOUND status is returned. | PERFORMANCE\_LIMITS\_SET |
+| test_d012 | Query performance domain get limit with non-existent performance domain id. | Check NOT\_FOUND status is returned. | PERFORMANCE\_LIMITS\_GET |
+| test_d013 | 1. Get current performance level .
2. Set new performance level.
3.Read level and verify with new performance level.
4. Restore the default level. | Check SUCCESS status is returned. | PERFORMANCE\_LEVEL\_SET
PERFORMANCE\_LEVEL\_GET |
+| test_d014 | 1. Query with performance level greater than maximum limit.
2. Query with performance level less than minimum limit. | Check OUT\_OF\_RANGE status is returned. | PERFORMANCE\_LEVEL\_SET |
+| test_d015 | 1. Query set level with not-supported performance domain.
2. Query performance domain set level with non-existent performance domain id. | 1. Check DENIED status is returned.
2. Check NOT\_FOUND status is returned. | PERFORMANCE\_LEVEL\_SET |
+| test_d016 | Query performance domain get level with non-existent performance domain id. | Check NOT\_FOUND status is returned. | PERFORMANCE\_LEVEL\_GET |
+| test_d017 | Pre-Condition: PERFORMANCE\_NOTIFY\_LIMITS command support.
Query with invalid notify_enable. | Check INVALID\_PARAMETERS status is returned. | PERFORMANCE\_NOTIFY\_LIMITS |
+| test_d018 | Pre-Condition: PERFORMANCE\_NOTIFY\_LIMITS command support.
1. Query notify limit with not-supported performance domain.
2. Query performance domain notify limit with non-existent performance domain id. | 1. Check NOT\_SUPPORTED status is returned.
2. Check NOT\_FOUND status is returned. | PERFORMANCE\_NOTIFY\_LIMITS |
+| test_d019 | Pre-Condition: PERFORMANCE\_NOTIFY\_LEVEL command support.
Query with invalid notify_enable. | Check INVALID\_PARAMETERS status is returned. | PERFORMANCE\_NOTIFY\_LEVEL |
+| test_d020 | Pre-Condition: PERFORMANCE\_NOTIFY\_LEVEL command support.
1. Query notify level with not-supported performance domain.
2. Query performance domain notify level with non-existent performance domain id. | 1. Check NOT\_SUPPORTED status is returned.
2. Check NOT\_FOUND status is returned. | PERFORMANCE\_NOTIFY\_LEVEL |
+| test_d021 | Pre-Condition: PERFORMANCE\_DESCRIBE\_FASTCHANNEL command support.
Query describe fast channel for all valid domains. | Check SUCCESS status is returned.| PERFORMANCE\_DESCRIBE\_FASTCHANNEL |
+| test_d022 | Pre-Condition: PERFORMANCE\_DESCRIBE\_FASTCHANNEL command support.
Query describe fast channel with non-existent performance domain id. | Check NOT\_FOUND status is returned. | PERFORMANCE\_DESCRIBE\_FASTCHANNEL |
+| test_d023 | Pre-Condition: PERFORMANCE\_DESCRIBE\_FASTCHANNEL command support.
Query describe fast channel with non-existent performance message id. | Check NOT\_FOUND status is returned. | PERFORMANCE\_DESCRIBE\_FASTCHANNEL |
+| test_d024 | Pre-Condition: PERFORMANCE\_DESCRIBE\_FASTCHANNEL command support.
Query describe fast channel with not-supported performance domain. | Check NOT\_SUPPORTED status is returned. | PERFORMANCE\_DESCRIBE\_FASTCHANNEL |
+| test_d025 | Pre-Condition: PERFORMANCE\_DESCRIBE\_FASTCHANNEL command support.
Query describe fast channel with not-supported message id. | Check NOT\_SUPPORTED status is returned. | PERFORMANCE\_DESCRIBE\_FASTCHANNEL |
+| test_d026 | 1. Get the domain which has limit change notify and set limit support.
2. Enable limit notification.
3. Get current performance limits for the domain.
4. Set new performance limits.
5. Check if notification of new limit is received & verify limits.
6. Disable limit change notification.
7. Restore the default limits | Check SUCCESS status is returned. | PERFORMANCE\_LIMITS\_SET
PERFORMANCE\_LIMITS\_GET
PERFORMANCE\_NOTIFY\_LIMITS |
+| test_d027 | 1. Get the domain which has level change notify and set level support.
2. Enable level notification.
3. Get current performance level for the domain.
4. Set new performance level.
5. Check if notification of new level is received & verify level.
6. Disable level change notification.
7. Restore the default level | Check SUCCESS status is returned. | PERFORMANCE\_LEVEL\_SET
PERFORMANCE\_LEVEL\_GET
PERFORMANCE\_NOTIFY\_LEVEL |
Clock Management Protocol Tests
---------
@@ -113,12 +148,22 @@ This section outlines the test specification for SCMI Clock Management Protocol.
| Test ID | Test Intent | Verification Step | Comments/Commands Used |
| ---------- | --------------------- | ------------------ | ----------------------- |
| test_c001 | Query the protocol version information. | Check Version against expected value. | PROTOCOL\_VERSION |
-| test_c002 | Query the protocol attributes. | Check num\_clocks against expected value. | PROTOCOL\_ATTRIBUTES |
+| test_c002 | Query the protocol attributes. | Check clock protocol attributes against expected values. | PROTOCOL\_ATTRIBUTES |
| test_c003 | Query for mandatory command availability. | Check command implementation status. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
-| test_c004 | 1. Query clock attributes with invalid clock id.
2. Query clock attributes for all system clocks. | 1. Check NOT\_FOUND status is returned.
2. Check clock attributes are returned. | CLOCK\_ATTRIBUTES |
-| test_c005 | 1. Query clock rate for invalid clock id.
2. Query clock rates for all system clocks. | 1. Check NOT\_FOUND status is returned.
2. Check clock rates are returned. | CLOCK\_RATE\_GET |
-| test_c006 | 1. Configure clock rate for invalid clock id.
2. Configure clock rate with invalid attributes. | 1. Check NOT\_FOUND status is returned.
2. Check INVALID\_PARAMETERS status is returned. | CLOCK\_CONFIG\_SET |
-| test_c007 | 1. Send invalid command id for clock protocol.
2. Query the protocol message attributes with invalid msg_id. | Check NOT\_FOUND status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
+| test_c004 | 1. Send invalid command id for clock protocol.
2. Query the protocol message attributes with invalid msg_id. | Check NOT\_FOUND status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
+| test_c005 | Query clock attributes for all system clocks. | Check clock attributes are returned. | CLOCK\_ATTRIBUTES |
+| test_c006 | Query clock attributes with invalid clock id. | Check NOT\_FOUND status is returned.| CLOCK\_ATTRIBUTES |
+| test_c007 | 1. Query clock describe rate for all system clocks.
2. Query clock describe rate with invalid rate index | 1. Check SUCCESS status is returned.
2. Check OUT\_OF\_RANGE status is returned.| CLOCK\_DESCRIBE\_RATES |
+| test_c008 | Query clock describe rate for non-existing clock id. | Check NOT\_FOUND status is returned.| CLOCK\_DESCRIBE\_RATES |
+| test_c009 | 1. Get current clock rates.
2. Set new clock rates in synchronous mode.
3. Get clock rates and verify with new rates.
4. Restore the default clock rates. | Check SUCCESS status is returned. | CLOCK\_RATE\_SET
CLOCK\_RATE\_GET |
+| test_c010 | 1. Get current clock rates.
2. Set new clock rates in asynchronous mode.
3. Wait for delayed response and verify with new rates.
4. Restore the default clock rates. | Check SUCCESS status is returned. | CLOCK\_RATE\_SET
CLOCK\_RATE\_GET |
+| test_c011 | 1. Query set clock rate with invalid rates.
2. Query set clock rate with invalid flags. | Check INVALID\_PARAMETERS status is returned. | CLOCK\_RATE\_SET |
+| test_c012 | Set clock rate for invalid clock id. | Check NOT\_FOUND status is returned. | CLOCK\_RATE\_SET |
+| test_c013 | Query clock rates for all system clocks. | Check clock rates are returned. | CLOCK\_RATE\_GET |
+| test_c014 | Query clock rate for invalid clock id. | Check NOT\_FOUND status is returned. | CLOCK\_RATE\_GET |
+| test_c015 | Configure clock with invalid attributes. | Check INVALID\_PARAMETERS status is returned. | CLOCK\_CONFIG\_SET |
+| test_c016 | Configure clock for invalid clock id. | Check NOT\_FOUND status is returned. | CLOCK\_CONFIG\_SET |
+| test_c017 | 1.Configure clock device with new state.
2. Get clock attributes and verify clock device state.
3. Restore the default clock device state | Check SUCCESS status is returned. | CLOCK\_CONFIG\_SET
CLOCK\_ATTRIBUTES |
Sensor Management Protocol Tests
---------
@@ -130,7 +175,36 @@ This section outlines the test specification for SCMI Sensor Management Protocol
| test_m002 | Query the protocol attributes. | Check num\_sensors against expected value. | PROTOCOL\_ATTRIBUTES |
| test_m003 | Query for mandatory command availability. | Check command implementation status. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
| test_m004 | 1. Send invalid command id for sensor protocol.
2. Query the protocol message attributes with invalid msg_id. | Check NOT\_FOUND status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
-| test_m005 | 1. Read sensor data for invalid sensor id.
2. Pass invalid flags value for sensor read. | 1. Check NOT\_FOUND status is returned.
2. Check NOT\_FOUND status is returned. | SENSOR\_READING\_GET |
+| test_m005 | 1. Query sensor descriptor.
2. Query sensor descriptor with invalid descriptor index. | 1. Check descriptor values against expected values.
2.Check INVALID\_PARAMETERS status is returned. | SENSOR\_DESCRIPTION\_GET |
+| test_m006 | Pre-Condition: SENSOR\_TRIP\_POINT\_NOTIFY support.
Query sensor trip point notify with invalid event control. | Check INVALID\_PARAMETERS status is returned. | SENSOR\_TRIP\_POINT\_NOTIFY |
+| test_m007 | Pre-Condition: SENSOR\_TRIP\_POINT\_NOTIFY support.
Query sensor trip point notify with invalid sensor id. | Check NOT\_FOUND status is returned. | SENSOR\_TRIP\_POINT\_NOTIFY |
+| test_m008 | Pre-Condition: SENSOR\_TRIP\_POINT\_CONFIG support.
1. Query trip point config with incorrect reserve bits.
2. Query trip point config with invalid trip point id| Check INVALID\_PARAMETERS status is returned. | SENSOR\_TRIP\_POINT\_CONFIG |
+| test_m009 | Pre-Condition: SENSOR\_TRIP\_POINT\_CONFIG support.
Query trip point config with invalid sensor id| Check NOT\_FOUND status is returned. | SENSOR\_TRIP\_POINT\_CONFIG |
+| test_m010 | Pre-Condition: SENSOR\_TRIP\_POINT\_CONFIG support.
Query trip point config with valid parameters| Check SUCCESS status is returned. | SENSOR\_TRIP\_POINT\_CONFIG |
+| test_m011 | Pass invalid flags value for sensor read. | Check INVALID\_PARAMETERS status is returned.| SENSOR\_READING\_GET |
+| test_m012 | Read sensor data for invalid sensor id. | Check NOT\_FOUND status is returned. | SENSOR\_READING\_GET |
+| test_m013 | Read sensor data in sync mode. | Check SUCCESS status is returned. | SENSOR\_READING\_GET |
+| test_m014 | Pre-Condition: Sensor should support async read.
Read sensor data in async mode. | 1. Check SUCCESS status is returned.
2. Wait for delayed response | SENSOR\_READING\_GET |
+| test_m015 | Read sensor data in async mode for unsupported sensors. | Check NOT\_SUPPORTED status is returned. | SENSOR\_READING\_GET |
+
+Reset Management Protocol Tests
+---------
+This section outlines the test specification for SCMI Reset Management Protocol.
+
+| Test ID | Test Intent | Verification Step | Comments/Commands Used |
+| ---------- | --------------------- | ------------------ | ----------------------- |
+| test_r001 | Query the protocol version information. | Check Version against expected value. | PROTOCOL\_VERSION |
+| test_r002 | Query the protocol attributes. | Check num of reset domains against expected value. | PROTOCOL\_ATTRIBUTES |
+| test_r003 | Query for mandatory command availability. | Check command implementation status. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
+| test_r004 | 1. Send invalid command id for reset protocol.
2. Query the protocol message attributes with invalid msg_id. | Check NOT\_FOUND status is returned. | PROTOCOL\_MESSAGE\_ATTRIBUTES |
+| test_r005 | Query reset domain attributes. | Check attributes values against expected values. | RESET\_DOMAIN\_ATTRIBUTES |
+| test_r006 | Query reset domain attributes with invalid domain id. | Check NOT\_FOUND status is returned. | RESET\_DOMAIN\_ATTRIBUTES |
+| test_r007 | Query reset protocol reset command with invalid domain id. | Check NOT\_FOUND status is returned. | RESET |
+| test_r008 | 1. Query reset protocol reset command with invalid reserved bits.
2. Query reset protocol reset command with invalid flags. | 1. Check INVALID\_PARAMETERS status is returned.
2. Check NOT\_SUPPORTED status is returned. | RESET |
+| test_r009 | Query reset protocol reset command with invalid reset_state. | Check INVALID\_PARAMETERS status is returned. | RESET |
+| test_r010 | Pre-Condition: RESET\_PROTOCOL\_NOTIFY support.
Query reset protocol notify with invalid domain id. | Check NOT\_FOUND status is returned. | RESET\_PROTOCOL\_NOTIFY |
+| test_r011 | Pre-Condition: RESET\_PROTOCOL\_NOTIFY support.
Query reset protocol notify with invalid notify enable. | Check INVALID\_PARAMETERS status is returned. | RESET\_PROTOCOL\_NOTIFY |
+
- - - - - - - - - - - - - - - - - - - -
-_Copyright (c) 2019, Arm Limited and Contributors. All rights reserved._
+_Copyright (c) 2019-2020, Arm Limited and Contributors. All rights reserved._
diff --git a/docs/user_guide.md b/docs/user_guide.md
index 5246fda3eb8e8d2b383d7da195954679384f1777..5873622508651f808efb4474e9806a31d9f8452c 100644
--- a/docs/user_guide.md
+++ b/docs/user_guide.md
@@ -1,3 +1,4 @@
+
**SCMI Compliance Suite User Guide**
==============================
@@ -9,17 +10,18 @@ Table of Contents:
- [Getting SCMI test suite source code](#getting-scmi-test-suite-source-code)
- [Complaince suite design and library of tests](#test-suite-design-and-library-of-tests)
- [Build steps](#build-steps)
- * [1. Build the test suite as a library](#build-the-test-suite-as-a-library)
- * [2. Build the test suite as a test agent](#build-the-test-suite-as-a-test-agent)
+ * [1. Build the test suite as a library](#building-the-test-suite-as-a-library)
+ * [2. Build the test suite as a test agent](#building-the-test-suite-as-a-test-agent)
- [Test suite execution](#test-suite-execution)
* [Running the test agent on host machine](#running-the-test-agent-on-host-machine)
- * [Running the test agent on SGM platform](#running-the-test-agent-on-sgm-platform)
+ * [Running as OSPM test agent ](#running-as-ospm-test-agent )
+ * [Running in Baremetal environment](#running-in-baremetal-environment)
- [Test execution report](#test-execution-report)
Introduction
-------
-This document outlines how to fetch, adapt, and build the SCMI test suite. The steps to build and run the test suite for a mocker platform on host machine and System Guidance for Mobile (SGM) [System Guidance] are provided as reference.
+This document outlines how to fetch, adapt, and build the SCMI test suite. The steps to build and run the test suite for a mocker platform on host machine, OSPM agent on System Guidance for Mobile (SGM) [System Guidance] and as baremetal library.
## Prerequisites
The following are the prerequisites to build the SCMI test suite.
@@ -28,13 +30,13 @@ The following are the prerequisites to build the SCMI test suite.
-------
The software is built on Ubuntu 16.04 LTS (64-bit).
-Packages used for building the software are installed from this distribution unless otherwise specified. Though it is tested only on Ubuntu 16.04, it is expected to also work on later versions of Ubuntu.
+Packages used for building the software are installed from this distribution unless specified. Though it is tested only on Ubuntu 16.04, it is expected to also work on later versions of Ubuntu.
Install the following tools with the command:
>`sudo apt-get install build-essential gcc make git`
-Download and install the AArch64 little-endian GCC cross compiler as specified in [Linaro Release Notes].
+Download and install the AArch64 little-endian GCC cross compiler as specified in [Linaro Release].
Downloading the SCMI test suite source code
-------
@@ -53,8 +55,8 @@ For details on the tests that are included in the test suite, see [Test checklis
Build steps
-------
-The compliance suite can be built as a library which can be linked to your execution enviroment or as an Operating System Power Management (OSPM) agent running on Linux.
-The tests are designed for SCMI version 2.0, but backward compatibility is maintained with version 1.0. You can choose the version while building the tests.
+The compliance suite can be built as a library which can be linked to your execution environment or as an Operating System Power Management (OSPM) agent running on Linux.
+The tests are designed for SCMI version 2.0, but backward compatibility is maintained with version 1.0. Test suit will internally check the version and do the tests accordingly.
### 1. Building the test suite as a library
@@ -62,19 +64,18 @@ To start the build, perform the following steps from the ``CROSS_COMPILE=/aarch64-linux-gnu- make clean`
>
->`CROSS_COMPILE=/aarch64-linux-gnu- make PROTOCOLS= VERSION= VERBOSE=`
+>`CROSS_COMPILE=/aarch64-linux-gnu- make PROTOCOLS= VERBOSE=`
Example:
>`CROSS_COMPILE=/aarch64-linux-gnu- make clean`
>
->`CROSS_COMPILE=/aarch64-linux-gnu- make PROTOCOLS=base,clock,power,system_power,performance,sensor VERSION=1 VERBOSE=1`
+>`CROSS_COMPILE=/aarch64-linux-gnu- make PROTOCOLS=base,clock,power_domain,system_power,performance,sensor,reset VERBOSE=1`
If you do not specify the PROTOCOLS variable when invoking the make command, Base Protocol test library alone is generated by default.
-If you do not specify the VERSION variable when invoking the make command, SCMI version 1.0 tests are generated by default.
The output of this make command is the libscmi_test.a library that includes the tests for all the specified protocols and version . The library will be generated in the ``. The arguments passed to the PROTOCOLS parameter are the subfolder names that are found in `/test_pool` folder.
-If there are memory constraints on the platform, fewer tests can be included by modifying the PROTOCOLS variable. The library can be linked to your execution enviroment.
+If there are memory constraints on the platform, fewer tests can be included by modifying the PROTOCOLS variable. The library can be linked to your execution environment.
### 2. Building the test suite as a test agent
A test agent is an execution wrapper for libscmi_test.a. Currently, support is provided for the following two platforms.
@@ -85,24 +86,35 @@ A self-test framework is implemented on a mocker platform that provides a simula
>`make clean`
>
->`make PLAT=mocker PROTOCOLS=base,clock,performance,power,system_power,sensor VERSION=1 VERBOSE=1`
+>`make PLAT=mocker PROTOCOLS=base,clock,performance,power_domain,system_power,sensor,reset VERBOSE=1`
The output will be libscmi_test.a and scmi_test_agent in the ``.
When the test library is extended to support new protocols or commands, it is **not** necessary to support the same in the mocker platform, unless it is warranted for testing the framework changes.
-#### 2.2 OSPM agent for SGM
+#### 2.2 OSPM agent
-A reference implementation for SGM is provided in the suite. In addition to building the library, the build also enables the SCMI test suite to run as an OSPM agent running from Linux using publicly available mailbox test driver interface. To start the build, perform the following steps from the ``.
+In addition to building the library, the build also enables the SCMI test suite to run as an OSPM agent running from Linux using publicly available mailbox test driver interface.A reference implementation for SGM is provided in the suite. To start the build, perform the following steps from the ``.
>`CROSS_COMPILE=/aarch64-linux-gnu- make clean`
>
->`CROSS_COMPILE=/aarch64-linux-gnu- make PLAT=sgm776 PROTOCOLS=base,clock,power,performance,system_power,sensor VERSION=1 VERBOSE=1`
+>`CROSS_COMPILE=/aarch64-linux-gnu- make PLAT=linux PROTOCOLS=base,clock,power_domain,performance,system_power,sensor,reset VERBOSE=1`
+
+The output will be libscmi_test.a and scmi_test_agent for the Linux platform in the ``.
-The output will be libscmi_test.a and scmi_test_agent for the mocker platform in the ``.
-**NOTE**:
+**NOTE**:
* The same executable can be used on SGM-775 or SGM-776
* You must rebuild the Linux kernel and device trees for SGM by following the [Guide to test SCMI on SGM].
+#### 2.3 Baremetal
+
+The SCMI test suite can be complied as libscmi_test.a and integrated with your baremetal test framework. Please refer to [Validation Methodology Document] for PAL API's which needs to be ported for baremetal.
+
+>`CROSS_COMPILE=/aarch64-linux-gnu- make clean`
+>
+>`CROSS_COMPILE=/aarch64-linux-gnu- make PLAT=baremetal PROTOCOLS=base,clock,power_domain,performance,system_power,sensor,reset VERBOSE=1`
+>
+The output will be libscmi_test.a for baremetal platform and available in the ``.
+
Test suite execution
-------
@@ -114,9 +126,9 @@ To run the test suite on the host machine, execute the command:
For the self_test/mocker platform, the test logs are dumped on the console itself.
-### Running the test agent on SGM platform
+### Running as OSPM test agent
-To run the test suite on the SGM platform, execute the following command in the filesystem that is mounted on SGM:
+To run the test suite on the SGM Linux platform, execute the following command in the filesystem that is mounted on SGM:
>`cd `
>
@@ -124,25 +136,92 @@ To run the test suite on the SGM platform, execute the following command in the
The test logs are captured in a report file arm\_scmi\_test\_log.txt in the same directory as the executable.
+### Running in Baremetal environment
+
+To run the test suite on the baremetal environment, invoke to `arm_scmi_agent_execute()` from test framework. For more details, refer to [Validation Methodology Document].
+
Test execution report
-------
The test report lists results per test case. The tests are organized as a collection within individual protocol. For every test case, the following verification steps occur:
-`Message Header`: The message header that is received from the platform is checked against what was in the send command.
+`Message Header`: The message header that is received from the platform is checked against what is in the send command.
-`Status`: The platform returns a status for a command that is issued by the agent and this is checked as per specification or as per expected values provided by you.
+`Status`: The platform returns a status for a command that is issued by the agent and this is checked as per specification or as per the expected values provided by you.
-`Return Values - if relevant`: The remaining return values for a command response are valid based on status return value. Checks are performed only if status return value returned SUCCESS and expected values were given by the user.
+`Return Values - if relevant`: The remaining return values for a command response are valid based on the status return value. Checks are performed only if the status return value returned SUCCESS and expected values were given by the user.
Each individual check delivers a PASS, FAIL, or SKIPPED.
+* Sample report with minimum verbosity (VERBOSE=1)
+
+ 101: Base protocol version check
+ VERSION : 0x00020000 : CONFORMANT
+ 102: Base protocol attributes check : CONFORMANT
+ 103: Base msg attributes mandatory cmd check : CONFORMANT
+ 104: Base msg attributes invalid msg id check : CONFORMANT
+ 105: Base query vendor name check : CONFORMANT
+ 106: Base query subvendor name check : CONFORMANT
+ 107: Base query implementation version check : CONFORMANT
+
+
+* Sample report with maximum verbosity (VERBOSE=5)
+
+ 101: Base protocol version check
+ [Check 1] Query protocol version
+ MSG HDR : 0x00004000
+ NUM PARAM : 0
+ CHECK STATUS : PASSED [SCMI_STATUS_SUCCES]
+ CHECK HEADER : PASSED [0x00004000]
+ RETURN COUNT : 1
+ RETURN[00] : 0x00020000
+ VERSION : 0x00020000 : CONFORMANT
+ 102: Base protocol attributes check
+ [Check 1] Query protocol attributes
+ MSG HDR : 0x00004001
+ NUM PARAM : 0
+ CHECK STATUS : PASSED [SCMI_STATUS_SUCCES]
+ CHECK HEADER : PASSED [0x00004001]
+ RETURN COUNT : 1
+ RETURN[00] : 0x00000206
+ CHECK RSVD BITS: PASSED
+ CHECK NUM AGENTS: PASSED [0x00000002]
+ CHECK NUM PROTOCOLS: PASSED [0x00000006] : CONFORMANT
+ 103: Base msg attributes mandatory cmd check
+ [Check 1] BASE DISCOVER VENDOR support
+ MSG HDR : 0x00004002
+ NUM PARAM : 1
+ PARAMETER[00] : 0x00000003
+ CHECK STATUS : PASSED [SCMI_STATUS_SUCCES]
+ CHECK HEADER : PASSED [0x00004002]
+ RETURN COUNT : 1
+ RETURN[00] : 0x00000000
+ CHECK RSVD BITS: PASSED
+ [Check 2] BASE DISCOVER IMPL VERSION support
+ MSG HDR : 0x00004002
+ NUM PARAM : 1
+ PARAMETER[00] : 0x00000005
+ CHECK STATUS : PASSED [SCMI_STATUS_SUCCES]
+ CHECK HEADER : PASSED [0x00004002]
+ RETURN COUNT : 1
+ RETURN[00] : 0x00000000
+ CHECK RSVD BITS: PASSED
+ [Check 3] BASE DISCOVER LIST PROTOCOLS support
+ MSG HDR : 0x00004002
+ NUM PARAM : 1
+ PARAMETER[00] : 0x00000006
+ CHECK STATUS : PASSED [SCMI_STATUS_SUCCES]
+ CHECK HEADER : PASSED [0x00004002]
+ RETURN COUNT : 1
+ RETURN[00] : 0x00000000
+ CHECK RSVD BITS: PASSED : CONFORMANT
+
- - - - - - - - - - - - - - - - -
-_Copyright (c) 2019, Arm Limited and Contributors. All rights reserved._
+_Copyright (c) 2019-2020, Arm Limited and Contributors. All rights reserved._
-[Linaro Release Notes]: https://community.arm.com/dev-platforms/b/documents/posts/linaro-release-notes-current
-[Validation Methodology Document]: ./Arm_SCMI_Validation_Methodology.pdf "SCMI Test Suite Design"
-[Test checklist]: ./scmi_testlist.md "SCMI Test Specification"
-[System Guidance]: https://developer.arm.com/ip-products/system-ip/reference-design
+[Linaro Release]: https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/
+[Validation Methodology Document]: ./Arm_SCMI_Validation_Methodology.pdf "SCMI Test Suite Design"
+[Test checklist]: ./scmi_testlist.md "SCMI Test Specification"
+[System Guidance]: https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms
[Guide to test SCMI on SGM]: ./guide_sgm_testing.md
diff --git a/linux_app/app.c b/linux_app/app.c
index aeef6066947ad4ce217f1c40babda35ef6bdb757..49d1a408726b4981c45c4a2aadfbdb2ca9b802dc 100644
--- a/linux_app/app.c
+++ b/linux_app/app.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,57 +17,6 @@
#include "val_interface.h"
-/**
- @brief This API executes all the SCMI tests
- 1. Caller - Application layer.
- 2. Prerequisite - val_gic_create_info_table()
- @param protocol_identifier identifier of protocol
- @return none
-**/
-void suite_execute_tests(uint32_t protocol_identifier)
-{
- uint32_t status = VAL_STATUS_PASS;
- uint32_t num_fail = 0;
- uint32_t num_pass = 0;
- uint32_t num_skip = 0;
- uint32_t index = 0;
- uint32_t num_tests = 0;
- test_fn_ptr *testlist_array = NULL;
-
- testlist_array = val_get_testlist(protocol_identifier, &num_tests);
-
- if (testlist_array != NULL) {
-
- val_print(VAL_PRINT_ERR, "\n *** Starting %s tests *** \n",
- val_get_protocol_str(protocol_identifier));
-
- while (index < num_tests) {
- status = testlist_array[index]();
-
- switch (status)
- {
- case VAL_STATUS_PASS:
- num_pass++;
- break;
- case VAL_STATUS_FAIL:
- num_fail++;
- break;
- case VAL_STATUS_SKIP:
- num_skip++;
- break;
- }
- val_print(VAL_PRINT_ERR, ": Result: %s", val_get_result_string(status));
- index++;
- }
- val_print(VAL_PRINT_ERR, "\n*************Report *********************");
- val_print(VAL_PRINT_ERR, "\n\tTOTAL TESTS : %d", num_pass + num_fail + num_skip);
- val_print(VAL_PRINT_ERR, "\n\tTOTAL PASSED : %d", num_pass);
- val_print(VAL_PRINT_ERR, "\n\tTOTAL FAILED : %d", num_fail);
- val_print(VAL_PRINT_ERR, "\n\tTOTAL SKIPPED : %d", num_skip);
- val_print(VAL_PRINT_ERR, "\n******************************************", 0);
- }
-}
-
/**
@brief Entry point to SCMI suite
1. Caller - Platform layer.
@@ -76,16 +25,64 @@ void suite_execute_tests(uint32_t protocol_identifier)
@return none
**/
-void suite_entry(void)
+int main(int argc, char *argv[])
{
- uint32_t protocol_id;
+ uint32_t num_pass;
+ uint32_t num_fail;
+ uint32_t num_skip;
+
+ val_print(VAL_PRINT_ERR, "\n\n **** SCMI Compliance Suite **** ");
+
+ if (val_initialize_system((void *) NULL)) {
+ val_print(VAL_PRINT_ERR, "\n **** INIT FAILED ***");
+ return 0;
+ }
+
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting BASE tests ***");
+ val_base_execute_tests();
+
+#ifdef POWER_DOMAIN_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting POWER tests *** ");
+ val_power_domain_execute_tests();
+#endif
+
+#ifdef SYSTEM_POWER_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting SYSTEM POWER tests *** ");
+ val_system_power_execute_tests();
+#endif
+
+#ifdef PERFORMANCE_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting PERFORMANCE tests *** ");
+ val_performance_execute_tests();
+#endif
+
+ #ifdef CLOCK_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting CLOCK tests ***");
+ val_clock_execute_tests();
+#endif
+
+#ifdef SENSOR_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting SENSOR tests *** ");
+ val_sensor_execute_tests();
+#endif
+
+#ifdef RESET_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting RESET tests *** ");
+ val_reset_execute_tests();
+#endif
- val_initialize_system();
+ num_pass = val_get_test_passed();
+ num_fail = val_get_test_failed();
+ num_skip = val_get_test_skipped();
- val_print(VAL_PRINT_ERR, "\n SCMI Compliance Suite \n ");
+ val_print(VAL_PRINT_ERR, "\n****************************************************", 0);
+ val_print(VAL_PRINT_ERR, "\n TOTAL TESTS: %d", num_pass + num_fail + num_skip);
+ val_print(VAL_PRINT_ERR, " PASSED: %d", num_pass);
+ val_print(VAL_PRINT_ERR, " FAILED: %d", num_fail);
+ val_print(VAL_PRINT_ERR, " SKIPPED: %d", num_skip);
+ val_print(VAL_PRINT_ERR, "\n****************************************************", 0);
- for (protocol_id = PROTOCOL_BASE; protocol_id <= PROTOCOL_MAX; protocol_id++)
- suite_execute_tests(protocol_id);
+ val_print(VAL_PRINT_ERR, "\n\n **** SCMI tests complete **** \n ");
- val_print(VAL_PRINT_ERR, "\n *** SCMI tests complete. *** \n");
+ return 1;
}
diff --git a/mocker_app/Makefile b/mocker_app/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..35a732dc8b445d316ff5ce80127977f09bf532d0
--- /dev/null
+++ b/mocker_app/Makefile
@@ -0,0 +1,35 @@
+#/** @file
+# * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+# * SPDX-License-Identifier : Apache-2.0
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# * http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+#**/
+
+C_FILES := $(wildcard *.c)
+H_FILES := $(wildcard $(HEADER_DIR)/*.h)
+OBJS := $(patsubst %.c,$(APP_OBJ_DIR)/%.o,$(C_FILES))
+
+all: all_mocker_app
+
+all_mocker_app: $(OBJS)
+ @echo "### Finished building with makefile at `pwd` ###"
+
+$(APP_OBJ_DIR)/%.o: %.c $(H_FILES)
+ echo "$(CC) $(D_NAMES) $(CFLAGS) $(I_DIRS) -c $< -o $@"
+ $(CC) $(D_NAMES) $(CFLAGS) $(I_DIRS) -g -c $< -o $@
+
+clean: clean_mocker_app
+
+clean_mocker_app:
+
+.PHONY: clean
diff --git a/mocker_app/app.c b/mocker_app/app.c
new file mode 100644
index 0000000000000000000000000000000000000000..48a6f9f356a74985531f991b406988cf3fc5975b
--- /dev/null
+++ b/mocker_app/app.c
@@ -0,0 +1,88 @@
+/** @file
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+
+/**
+ @brief Entry point to SCMI suite
+ 1. Caller - Platform layer.
+ 2. Prerequisite - Power domain protocol info table.
+ @param none
+ @return none
+**/
+
+int main(int argc, char *argv[])
+{
+ uint32_t num_pass;
+ uint32_t num_fail;
+ uint32_t num_skip;
+
+ val_print(VAL_PRINT_ERR, "\n\n **** SCMI Compliance Suite **** ");
+
+ if (val_initialize_system((void *) NULL)) {
+ val_print(VAL_PRINT_ERR, "\n **** INIT FAILED ***");
+ return 0;
+ }
+
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting BASE tests ***");
+ val_base_execute_tests();
+
+#ifdef POWER_DOMAIN_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting POWER tests *** ");
+ val_power_domain_execute_tests();
+#endif
+
+#ifdef SYSTEM_POWER_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting SYSTEM POWER tests *** ");
+ val_system_power_execute_tests();
+#endif
+
+#ifdef PERFORMANCE_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting PERFORMANCE tests *** ");
+ val_performance_execute_tests();
+#endif
+
+ #ifdef CLOCK_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting CLOCK tests ***");
+ val_clock_execute_tests();
+#endif
+
+#ifdef SENSOR_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting SENSOR tests *** ");
+ val_sensor_execute_tests();
+#endif
+
+#ifdef RESET_PROTOCOL
+ val_print(VAL_PRINT_ERR, "\n\n *** Starting RESET tests *** ");
+ val_reset_execute_tests();
+#endif
+
+ num_pass = val_get_test_passed();
+ num_fail = val_get_test_failed();
+ num_skip = val_get_test_skipped();
+
+ val_print(VAL_PRINT_ERR, "\n****************************************************", 0);
+ val_print(VAL_PRINT_ERR, "\n TOTAL TESTS: %d", num_pass + num_fail + num_skip);
+ val_print(VAL_PRINT_ERR, " PASSED: %d", num_pass);
+ val_print(VAL_PRINT_ERR, " FAILED: %d", num_fail);
+ val_print(VAL_PRINT_ERR, " SKIPPED: %d", num_skip);
+ val_print(VAL_PRINT_ERR, "\n****************************************************", 0);
+
+ val_print(VAL_PRINT_ERR, "\n\n **** SCMI tests complete **** \n ");
+
+ return 1;
+}
diff --git a/test_pool/common/Makefile b/platform/baremetal/Makefile
similarity index 94%
rename from test_pool/common/Makefile
rename to platform/baremetal/Makefile
index d2789aac232903a031ec2db0d38f34891605caa3..b3821a96448d4b92f7f1782bafa6cbb645e879c1 100644
--- a/test_pool/common/Makefile
+++ b/platform/baremetal/Makefile
@@ -15,4 +15,4 @@
# * limitations under the License.
#**/
-include ${TOP}/test_pool/build_protocol.mk
+include ${TOP}/platform/build_platform.mk
diff --git a/platform/baremetal/include/pal_base_expected.h b/platform/baremetal/include/pal_base_expected.h
new file mode 100644
index 0000000000000000000000000000000000000000..a8ae81b28865dc3a7042a55dad80f1e693bd5e6a
--- /dev/null
+++ b/platform/baremetal/include/pal_base_expected.h
@@ -0,0 +1,91 @@
+/** @file
+ * Copyright (c) 2017-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifndef __PAL_BASE_EXPECTED_H__
+#define __PAL_BASE_EXPECTED_H__
+
+#include
+#include
+
+#define VENDOR_ID_SIZE 16
+#define SUB_VENDOR_ID_SIZE 16
+#define NONE 0
+
+struct arm_scmi_base_expected {
+ /*
+ * This enum specifies the bit position in the flags_mask field
+ * indicating if the expected value is given (bit set) or ignored
+ * (bit unset).
+ */
+ enum {
+ BASE_PROTOCOL_VERSION,
+ VENDOR_IDENTIFIER,
+ SUBVENDOR_IDENTIFIER,
+ IMPLEMENTATION_VERSION,
+ NUM_PROTOCOLS_IMPLEMENTED,
+ SUPPORTED_PROTOCOLS,
+ NUMBER_AGENTS,
+ AGENT_NAMES,
+ ERROR_NOTIFICATION_SUPPORTED,
+ SUBVENDOR_CMD_SUPPORTED,
+ DISCOVER_AGENT_CMD_SUPPORTED
+ } FLAGS;
+ /*
+ * The expectation is that there is no more
+ * than 32 elements specified via this expected results data structure.
+ * This mask is used to indicate which of the structure members hold valid
+ * data.
+ */
+ uint32_t flags_mask;
+ uint32_t protocol_version;
+ /* The name of the vendor as a string */
+ char vendor_identifier[VENDOR_ID_SIZE];
+ /* The name of the sub vendor as a string */
+ char subvendor_identifier[SUB_VENDOR_ID_SIZE];
+ uint32_t implementation_version;
+ uint32_t num_protocols_implemented;
+ /*
+ * This should have the list of protocol_ids for the commands expected to be
+ * supported in this platform limited by the num_protocols_implemented
+ * variable.
+ */
+ uint32_t *supported_protocols;
+ uint32_t num_agents;
+ /*
+ * This should have the list of agent names for the all the agents in the
+ * platform limited by the num_agents variable, if agent_discoverable is
+ * set to non-zero value
+ */
+ char **agent_names;
+ /*
+ * This specifies if the error notification is expected to be supported in
+ * the platform.
+ */
+ bool notify_error_cmd_supported;
+ /*
+ * This specifies if the sub vendor command is expected to be supported in
+ * the platform.
+ */
+ bool subvendor_cmd_supported;
+ /*
+ * This specifies if the discover agent command is expected to be supported
+ * in the platform.
+ */
+ bool discover_agent_cmd_supported;
+};
+
+#endif /* __PAL_BASE_EXPECTED_H__ */
diff --git a/platform/baremetal/include/pal_clock_expected.h b/platform/baremetal/include/pal_clock_expected.h
new file mode 100644
index 0000000000000000000000000000000000000000..c331973b52db3ca97fed536ca6776fc03c56837c
--- /dev/null
+++ b/platform/baremetal/include/pal_clock_expected.h
@@ -0,0 +1,109 @@
+/** @file
+ * Copyright (c) 2017-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+#ifndef __PAL_CLOCK_EXPECTED_H__
+#define __PAL_CLOCK_EXPECTED_H__
+
+struct arm_scmi_clock_rate {
+ uint32_t lower;
+ uint32_t upper;
+};
+
+struct arm_scmi_clock_expected {
+ /*
+ * This enum is to specify the flag_mask and have to be ensured that
+ * it is in the same order as the below structure elements after
+ * flags_mask member.
+ */
+ enum {
+ CLOCK_PROTOCOL_VERSION,
+ NUMBER_CLOCKS,
+ MAX_NUM_PENDING_ASYNC_RATE_CHG_SUPPORTED,
+ RATE_FORMAT_SUPPORTED,
+ THREE_TUPLE_CLOCK_RATES,
+ DISCRETE_CLOCK_RATES,
+ CLOCK_NUM_RATES,
+ CLOCK_NAMES
+ } FLAGS;
+ /*
+ * The expectation is that there is no more
+ * than 32 elements specified via this expected results data structure.
+ * This mask is used to indicate which of the structure members hold valid
+ * data.
+ */
+ uint32_t flags_mask;
+ uint32_t protocol_version;
+ uint32_t number_clocks;
+ uint32_t max_num_pending_async_rate_chg_supported;
+
+ /*
+ * 1 for this field specifies if the rate format returned is a 3 tuple
+ * (low, high, num_of_rates), 0 are discrete clock rates.
+ */
+ uint32_t *rate_format_supported;
+
+ /*
+ * This should have the low clock rate of the 3 tuple value for each clock
+ * in this platform bounded by the num_clocks variable. This is valid only
+ * when three_tuple_rate_format_supported is set.
+ */
+ struct arm_scmi_clock_rate *low_clock_rate;
+
+ /*
+ * This should have the high clock rate of the 3 tuple value for each clock
+ * in this platform bounded by the num_clocks variable. This is valid only
+ * when three_tuple_rate_format_supported is set.
+ */
+ struct arm_scmi_clock_rate *high_clock_rate;
+
+ /*
+ * This should have the step clock rate of the 3 tuple value for each clock
+ * in this platform bounded by the num_clocks variable. This is valid only
+ * when three_tuple_rate_format_supported is set.
+ */
+ struct arm_scmi_clock_rate *step_clock_rate;
+
+ /*
+ * This should have the number of discrete supported clock rates
+ * for each clock in this platform bounded by the num_clocks variable. This
+ * is only valid when three_tuple_rate_format_supported is set.
+ */
+ struct arm_scmi_clock_rate **discrete_clock_rates;
+
+ /*
+ * This should have the number of rates info for each clock in this platform
+ * bounded by the num_clocks variable.
+ */
+ uint32_t *num_rates;
+
+ /*
+ * This should have the list of clock names in the platform bounded by the
+ * num_clocks variable.
+ */
+ const char **clock_name;
+
+ /*
+ * This should have the array of always on clocks
+ */
+ uint32_t *always_on_clocks;
+
+ /*
+ * This should have the array size of always on clocks
+ */
+ uint32_t num_of_on_clocks;
+};
+
+#endif /* __PAL_CLOCK_EXPECTED_H__ */
diff --git a/platform/baremetal/include/pal_performance_expected.h b/platform/baremetal/include/pal_performance_expected.h
new file mode 100644
index 0000000000000000000000000000000000000000..7e73661d0578a6ea17905412b40b4d6302649832
--- /dev/null
+++ b/platform/baremetal/include/pal_performance_expected.h
@@ -0,0 +1,159 @@
+/** @file
+ * Copyright (c) 2017-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifndef __PAL_PERFORMANCE_EXPECTED_H__
+#define __PAL_PERFORMANCE_EXPECTED_H__
+
+struct arm_scmi_performance_expected {
+ /*This enum is to easily specify the flag_mask and have to be ensured that
+ * it is in the same order as the below structure elements after flags_mask
+ * member
+ * */
+ enum {
+ PERFORMANCE_PROTOCOL_VERSION,
+ PERFORMANCE_STATISTICS_SUPPORTED,
+ PERFORMANCE_STATISTICS_ADDRESS_LOW,
+ PERFORMANCE_STATISTICS_ADDRESS_HIGH,
+ PERFORMANCE_STATISTICS_LENGTH,
+ PERFORMANCE_POWER_VALUE_IN_MW,
+ PERFORMANCE_NUM_PERFORMANCE_DOMAINS,
+ PERFORMANCE_SET_LIMIT_CAPABLE,
+ PERFORMANCE_SET_PERFORMANCE_LEVEL_CAPABLE,
+ PERFORMANCE_LIMIT_NOTIFICATION_SUPPORT,
+ PERFORMANCE_LEVEL_NOTIFICATION_SUPPORT,
+ PERFORMANCE_RATE_LIMIT,
+ PERFORMANCE_SUSTAINED_FREQ,
+ PERFORMANCE_SUSTAINED_LEVEL,
+ PERFORMANCE_DOMAIN_NAMES,
+ PERFORMANCE_NUM_PERFORMANCE_LEVELS,
+ PERFORMANCE_LEVEL_VALUE,
+ PERFORMANCE_LEVEL_POWER_COST,
+ PERFORMANCE_LEVEL_WORST_LATENCY,
+ PERFORMANCE_LIMIT_NOTIFICATION_SUPPORTED,
+ PERFORMANCE_LEVEL_NOTIFICATION_SUPPORTED
+ } FLAGS;
+ /* The expectation is that there is no more than 32 elements specified via
+ * this expected results data structure. This mask is used to indicate
+ * which of the structure members hold valid data
+ * */
+ uint32_t flags_mask;
+ uint32_t protocol_version;
+ /* Set to non-zero value to indicate statistics shared memory region
+ * supported
+ * */
+ uint8_t statistics_supported;
+ /*Relevant only when statistics supported is set as True*/
+ uint32_t statistics_address_low;
+ uint32_t statistics_address_high;
+ uint32_t statistics_length;
+ /* Set to non-zero value to indicate power value is reported in mW units */
+ uint8_t power_value_in_milliwatts;
+
+ uint32_t num_performance_domains;
+ /*This should confirm if this agent is capable of setting limit on the given
+ * performance domain in this platform bounded by the num_performance_domains
+ * variable*/
+ uint8_t *set_limit_capable;
+ /*This should confirm if this agent is capable of setting performance level
+ * on the given performance domain in this platform bounded by the
+ * num_performance_domains variable*/
+ uint8_t *set_performance_level_capable;
+ /*This should confirm if this agent is capable of setting performance limit
+ * change notifications on the given performance domain in this platform
+ * bounded by the num_performance_domains variable*/
+ uint8_t *performance_limit_notification_support;
+ /*This should confirm if this agent is capable of setting performance level
+ * change notifications on the given performance domain in this platform
+ * bounded by the num_performance_domains variable*/
+ uint8_t *performance_level_notification_support;
+ /*This should have the list of performance rate limits in the platform
+ * bounded by the num_performance_domains variable*/
+ uint32_t *performance_rate_limit;
+ /*This should have the list of performance sustained freqs in the platform
+ * bounded by the num_performance_domains variable*/
+ uint32_t *performance_sustained_freq;
+ /*This should have the list of performance sustained levels in the platform
+ * bounded by the num_performance_domains variable*/
+ uint32_t *performance_sustained_level;
+ /*This should have the list of performance domain names in the platform
+ * bounded by the num_performance_domains variable*/
+ char **performance_domain_names;
+ /*This should have the list of performance levels in the platform
+ * bounded by the num_performance_domains variable*/
+ uint32_t *num_performance_levels;
+ /*This should have performance value info for each performance level in this
+ * platform bounded by the num_performance_levels variable*/
+ uint32_t **performance_level_value;
+ /*This should have power cost info for each performance level in this
+ * platform bounded by the num_performance_levels variable*/
+ uint32_t **performance_level_power_cost;
+ /*This should have worst case latency info for each performance level in
+ * this platform bounded by the num_performance_levels variable*/
+ uint32_t **performance_level_worst_latency;
+ /*This specifies if the performance level notification is expected to be
+ * supported in the platform*/
+ uint8_t performance_limit_notification_supported;
+ /*This specifies if the performance level notification is expected to be
+ * supported in the platform*/
+ uint8_t performance_level_notification_supported;
+ /*This specifies if the fast channel is expected to be supported by messages
+ *bounded by the number of messages */
+ uint8_t *performance_message_fast_channel_support;
+ /*This specifies if the fast channel is expected to be supported by platform
+ *bounded by the number of domains */
+ uint8_t *performance_domain_fast_channel_support;
+ /*This should have door bell support of each command in
+ * this platform bounded by the number of domain*/
+ uint8_t **door_bell_support;
+ /*This should have doorbell data width of each command in
+ * this platform bounded by the number of domain*/
+ uint8_t **door_bell_data_width;
+ /*This should have fast channel rate limit of each command in
+ * this platform bounded by the number of domain*/
+ uint32_t **fast_channel_rate_limit;
+ /*This should have Lower 32 bits of the FastChannel address of each command in
+ * this platform bounded by the number of domain*/
+ uint32_t **fast_chan_addr_low;
+ /*This should have upper 32 bits of the FastChannel address of each command in
+ * this platform bounded by the number of domain*/
+ uint32_t **fast_chan_addr_high;
+ /*This should have size of FastChannel in bytes for each command in
+ * this platform bounded by the number of domain*/
+ uint32_t **fast_chan_size;
+ /* Lower 32 bits of the doorbell address. This field is not used if
+ * doorbell is not supported, bounded by the number of domain*/
+ uint32_t **doorbell_addr_low;
+ /* Upper 32 bits of the doorbell address. This field is not used if
+ * doorbell is not supported, bounded by the number of domain*/
+ uint32_t **doorbell_addr_high;
+ /* Contains a mask of lower 32 bits to set when writing to the doorbell register.
+ * If the doorbell register width, n, is less than 32 bits, then only n
+ * lower bits are considered from this mask*/
+ uint32_t **doorbell_set_mask_low;
+ /* Contains a mask of upper 32 bits to set when writing to the doorbell register.
+ * This field is only valid if the doorbell register width is 64 bits.*/
+ uint32_t **doorbell_set_mask_high;
+ /* Contains a mask of lower 32 bits to preserve when writing to the doorbell register.
+ * If the doorbell register width, n, is less than 32 bits, then only n lower bits are
+ * considered from this mask*/
+ uint32_t **doorbell_preserve_mask_low;
+ /* Contains a mask of higher 32 bits to preserve when writing to the doorbell register.
+ * This field is only valid if the doorbell register width is 64 bits. */
+ uint32_t **doorbell_preserve_mask_high;
+};
+
+#endif /* __PAL_PERFORMANCE_EXPECTED_H__ */
diff --git a/platform/baremetal/include/pal_platform.h b/platform/baremetal/include/pal_platform.h
new file mode 100644
index 0000000000000000000000000000000000000000..edc4e0db32defce00a893a27048acf9a38db933e
--- /dev/null
+++ b/platform/baremetal/include/pal_platform.h
@@ -0,0 +1,96 @@
+/** @file
+ * Copyright (c) 2017-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifndef _PAL_PLATFORM_H_
+#define _PAL_PLATFORM_H_
+
+#include
+#include
+
+/* Frequently used constants */
+#define NO_ERROR 0
+#define MAX_RETURNS_SIZE 32
+#define LOG_STR_SIZE 96
+/*
+ * Structure to pass information from the platform to arm_scmi_agent_execute
+ */
+struct arm_scmi_platform_protocol_info {
+ unsigned int protocol_id;
+ const void *expected_return_values;
+};
+
+struct arm_scmi_platform_info {
+ size_t platform_protocol_info_count;
+ struct arm_scmi_platform_protocol_info *platform_protocol_info_table;
+};
+
+/*!
+ * @brief Send an SCMI command and return the reply.
+ *
+ * @param message_header_send Outgoing SCMI message header.
+ * @param parameter_count Number of outgoing SCMI parameters.
+ * @param parameters Outgoing SCMI parameters.
+ * @param message_header_rcv Storage for the SCMI message header returned.
+ * @param status Storage for the SCMI status returned.
+ * @param return_values_count Storage for the number of SCMI parameters
+ * returned.
+ * @param return_values Storage for the SCMI parameters returned.
+ *
+ * @return NO_ERROR if no error occurred, or any other value otherwise.
+ */
+int arm_scmi_send_message(uint32_t message_header_send,
+ size_t parameter_count, const uint32_t *parameters,
+ uint32_t *message_header_rcv, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values);
+
+/*!
+ * @brief Return an SCMI delayed response.
+ *
+ * @param message_header_rcv Storage for the SCMI message header returned.
+ * @param status Storage for the SCMI status returned.
+ * @param return_values_count Storage for the number of parameters returned.
+ * @param return_values Storage for the SCMI parameters returned.
+ *
+ * @return NO_ERROR if no error occurred, or any other value otherwise.
+ */
+int arm_scmi_wait_for_response(uint32_t *message_header_rcv,
+ int32_t *status, size_t *return_values_count, uint32_t *return_values);
+
+/*!
+ * @brief Return an SCMI notification.
+ *
+ * @param message_header_rcv Storage for the SCMI message header returned.
+ * @param status Storage for the SCMI status returned.
+ * @param return_values_count Storage for the number of parameters returned.
+ * @param return_values Storage for the SCMI parameters returned.
+ *
+ * @return NO_ERROR if no error occurred, or any other value otherwise.
+ */
+int arm_scmi_wait_for_notification(uint32_t *message_header_rcv,
+ size_t *return_values_count, uint32_t *return_values);
+
+/*!
+ * @brief Interface function used to handle output from the test agent.
+ *
+ * @param output Pointer to the formatted output string buffer.
+ *
+ */
+void arm_scmi_log_output(const char *output);
+
+int arm_scmi_agent_execute(void *agent_info);
+
+#endif /* _PAL_PLATFORM_H_ */
diff --git a/platform/baremetal/include/pal_power_domain_expected.h b/platform/baremetal/include/pal_power_domain_expected.h
new file mode 100644
index 0000000000000000000000000000000000000000..dfe1031e37ab443ce0410f94656cd19634c5c98c
--- /dev/null
+++ b/platform/baremetal/include/pal_power_domain_expected.h
@@ -0,0 +1,72 @@
+/** @file
+ * Copyright (c) 2017-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifndef __PAL_POWER_DOMAIN_EXPECTED_H__
+#define __PAL_POWER_DOMAIN_EXPECTED_H__
+
+#include
+#include
+
+struct arm_scmi_power_expected {
+ /*
+ * This enum specifies the bit position in the flags_mask field
+ * indicating if the expected value is given (bit set) or ignored
+ * (bit unset).
+ */
+ enum {
+ POWER_PROTOCOL_VERSION,
+ STATISTICS_ADDRESS_LOW,
+ STATISTICS_ADDRESS_HIGH,
+ STATISTICS_LEN,
+ NUM_POWER_DOMAINS,
+ POWER_STATE_NOTIFICATION_SUPPORT,
+ POWER_SYNCHRONOUS_SUPPORT,
+ POWER_ASYNCHRONOUS_SUPPORT,
+ POWER_DOMAIN_NAMES,
+ POWER_STATE_NOTIFY_CMD_SUPPORTED
+ } FLAGS;
+ /*
+ * The expectation is that there is no more
+ * than 32 elements specified via this expected results data structure.
+ * This mask is used to indicate which of the structure members hold valid
+ * data.
+ */
+ uint32_t flags_mask;
+ uint32_t protocol_version;
+ /* Relevant only when statistics supported is set as True */
+ uint32_t statistics_address_low;
+ uint32_t statistics_address_high;
+ uint32_t statistics_length;
+ uint32_t num_power_domains;
+ /*This should have notification support info for each power domain in this
+ * platform bounded by the num_power_domains variable*/
+ uint8_t *power_state_notification_support;
+ /* This should have power synchronous support info for each power domain in
+ * this platform bounded by the num_power_domains variable */
+ uint8_t *power_synchronous_support;
+ /* This should have power asynchronous support info for each power domain in
+ * this platform bounded by the num_power_domains variable */
+ uint8_t *power_asynchronous_support;
+ /* This should have the list of power domain names in the platform bounded
+ * by the num_power_domains variable */
+ char **power_domain_names;
+ /* This specifies if the power state notify command is expected to be
+ * supported in the platform or not available to the agent */
+ bool power_state_notify_cmd_supported;
+};
+
+#endif /* __PAL_POWER_DOMAIN_EXPECTED_H__ */
diff --git a/platform/baremetal/include/pal_reset_expected.h b/platform/baremetal/include/pal_reset_expected.h
new file mode 100644
index 0000000000000000000000000000000000000000..2fedf5c2be4b2a4aaaabe2b9b4f568f10bcf821e
--- /dev/null
+++ b/platform/baremetal/include/pal_reset_expected.h
@@ -0,0 +1,71 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifndef __PAL_RESET_EXPECTED_H__
+#define __PAL_RESET_EXPECTED_H__
+
+struct arm_scmi_reset_expected {
+ /*
+ * This enum is to specify the flag_mask and have to be ensured that
+ * it is in the same order as the below structure elements after
+ * flags_mask member.
+ */
+ enum {
+ RESET_PROTOCOL_VERSION = 1,
+ RESET_NUMBER_DOMAINS,
+ RESET_ASYNCHRONOUS_RESET_SUPPORTED,
+ RESET_NOTIFY_SUPPORTED,
+ RESET_LATENCY,
+ RESET_DOMAIN_NAME
+ } FLAGS;
+ /*
+ * The expectation is that there is no more
+ * than 32 elements specified via this expected results data structure.
+ * This mask is used to indicate which of the structure members hold valid
+ * data.
+ */
+ uint32_t flags_mask;
+ uint32_t protocol_version;
+
+ uint32_t number_domains;
+
+ /*
+ * This should have the Asynchronous reset support in this platform
+ * bounded by the number of domains.
+ */
+ uint32_t *asynchronous_reset_supported;
+
+ /*
+ * This should have the reset notify support in this platform
+ * bounded by the number of domains.
+ */
+ uint32_t *reset_notify_supported;
+
+ /*
+ * Maximum time (in microseconds) required for the reset to
+ * take effect on the given domain.
+ */
+ uint32_t *reset_latency;
+
+ /*
+ * This should have the names of the domains in this platform bounded by the
+ * number of domains descriptors.
+ */
+ char **reset_domain_name;
+};
+
+#endif /* __PAL_RESET_EXPECTED_H__ */
diff --git a/platform/baremetal/include/pal_sensor_expected.h b/platform/baremetal/include/pal_sensor_expected.h
new file mode 100644
index 0000000000000000000000000000000000000000..e08755f749dfa26ac4179eda652388a4e07b0713
--- /dev/null
+++ b/platform/baremetal/include/pal_sensor_expected.h
@@ -0,0 +1,90 @@
+/** @file
+ * Copyright (c) 2017-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifndef __PAL_SENSOR_EXPECTED_H__
+#define __PAL_SENSOR_EXPECTED_H__
+
+struct arm_scmi_sensor_expected {
+ /*
+ * This enum is to specify the flag_mask and have to be ensured that
+ * it is in the same order as the below structure elements after
+ * flags_mask member.
+ */
+ enum {
+ SENSOR_PROTOCOL_VERSION = 1,
+ NUMBER_SENSORS,
+ MAX_NUM_PENDING_ASYNC_CMDS_SUPPORTED,
+ SENSOR_REG_ADDRESS_LOW,
+ SENSOR_REG_ADDRESS_HIGH,
+ SENSOR_REG_LENGTH,
+ SENSOR_ASYNCHRONOUS_READ_SUPPORT,
+ SENSOR_NUMBER_OF_TRIP_POINTS_SUPPORTED,
+ SENSOR_TYPE,
+ SENSOR_TRIP_POINT_NOTIFY_SUPPORTED,
+ SENSOR_TRIP_POINT_CONFIG_SUPPORTED
+ } FLAGS;
+ /*
+ * The expectation is that there is no more
+ * than 32 elements specified via this expected results data structure.
+ * This mask is used to indicate which of the structure members hold valid
+ * data.
+ */
+ uint32_t flags_mask;
+ uint32_t protocol_version;
+
+ uint32_t number_sensors;
+ uint32_t max_num_pending_async_cmds_supported;
+
+ /*Lower sensor register shared memory address*/
+ uint32_t sensor_reg_address_low;
+ /*Higher sensor register shared memory address*/
+ uint32_t sensor_reg_address_high;
+ /*length of the sensor register shared memory*/
+ uint32_t sensor_reg_length;
+
+ /*
+ * This should have the Asynchronous sensor read support in this platform
+ * bounded by the number of sensor descriptors.
+ */
+ uint8_t *asynchronous_sensor_read_support;
+
+ /*
+ * This should have the Number of trip points supported in this platform
+ * bounded by the number of sensor descriptors.
+ */
+ uint8_t *number_of_trip_points_supported;
+
+ /*
+ * This should have the type of sensor and the measurement system it
+ * implements in this platform bounded by the number of sensor descriptors.
+ */
+ uint8_t *sensor_type;
+
+ /*
+ * This should have the names of the sensors in this platform bounded by the
+ * number of sensor descriptors.
+ */
+ char **sensor_name;
+
+ /*Platform support for each command in sensor protocol*/
+ bool sensor_trip_point_notify_supported;
+
+ /*Platform support for each command in sensor protocol*/
+ bool sensor_trip_point_config_supported;
+};
+
+#endif /* __PAL_SENSOR_EXPECTED_H__ */
diff --git a/platform/baremetal/include/pal_system_power_expected.h b/platform/baremetal/include/pal_system_power_expected.h
new file mode 100644
index 0000000000000000000000000000000000000000..ffb7ffaedecbf01657cff9764fb6211f3df490bb
--- /dev/null
+++ b/platform/baremetal/include/pal_system_power_expected.h
@@ -0,0 +1,46 @@
+/** @file
+ * Copyright (c) 2017-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifndef __PAL_SYSTEM_POWER_EXPECTED_H__
+#define __PAL_SYSTEM_POWER_EXPECTED_H__
+
+#include
+#include
+
+struct arm_scmi_system_power_expected {
+ /*
+ * This enum specifies the bit position in the flags_mask field
+ * indicating if the expected value is given (bit set) or ignored
+ * (bit unset).
+ */
+ enum {
+ SYSTEM_POWER_PROTOCOL_VERSION,
+ SYSTEM_POWER_STATE_NOTIFY_CMD_SUPPORTED
+ } FLAGS;
+ /*
+ * The expectation is that there is no more
+ * than 32 elements specified via this expected results data structure.
+ * This mask is used to indicate which of the structure members hold valid
+ * data.
+ */
+ uint32_t flags_mask;
+ uint32_t protocol_version;
+
+ bool system_power_state_notify_cmd_supported;
+};
+
+#endif /* __PAL_SYSTEM_POWER_EXPECTED_H__ */
diff --git a/platform/baremetal/pal_base.c b/platform/baremetal/pal_base.c
new file mode 100644
index 0000000000000000000000000000000000000000..b278a295f0a09a2d7def64c234fc06d029035b2d
--- /dev/null
+++ b/platform/baremetal/pal_base.c
@@ -0,0 +1,127 @@
+/** @file
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "pal_interface.h"
+#include "pal_base_expected.h"
+
+void pal_base_set_expected(const void *);
+static struct arm_scmi_base_expected *g_base_info;
+
+/**
+ @brief Sets base protocol info
+ @param platform base protocol info
+ @return none
+**/
+void pal_base_set_expected(const void *info)
+{
+ if (info == NULL)
+ return;
+ g_base_info = (struct arm_scmi_base_expected *)info;
+}
+
+/*----------- Common PAL API's across platforms ----------*/
+
+/**
+ @brief This API is used to check vendor name
+ @param none
+ @return vendor name
+**/
+char *pal_base_get_expected_vendor_name(void)
+{
+ return &(g_base_info->vendor_identifier[0]);
+}
+
+/**
+ @brief This API is used for checking subvendor name
+ @param none
+ @return subvendor name
+**/
+char *pal_base_get_expected_subvendor_name(void)
+{
+ return &(g_base_info->subvendor_identifier[0]);
+}
+
+/**
+ @brief This API is used for checking implementation version
+ @param none
+ @return implementation version
+**/
+uint32_t pal_base_get_expected_implementation_version(void)
+{
+ return g_base_info->implementation_version;
+}
+
+/**
+ @brief This API is used for checking num of agents
+ @param none
+ @return num of agents
+**/
+uint32_t pal_base_get_expected_num_agents(void)
+{
+ return g_base_info->num_agents;
+}
+
+/**
+ @brief This API is used for checking num of protocols agent have access
+ @param none
+ @return num of protocols
+**/
+uint32_t pal_base_get_expected_num_protocols(void)
+{
+ return g_base_info->num_protocols_implemented;
+}
+
+/**
+ @brief This API is used for checking if agent is trusted
+ @param agent id
+ @return true/false
+**/
+uint32_t pal_check_trusted_agent(uint32_t agent_id)
+{
+ return NONE;
+}
+
+/**
+ @brief This API is used to get device which agent can access
+ @param agent id
+ @return device id
+**/
+uint32_t pal_agent_get_accessible_device(uint32_t agent_id)
+{
+ return NONE;
+}
+
+/**
+ @brief This API is used to get device which agent cannot access
+ @param agent id
+ @return device id
+**/
+uint32_t pal_agent_get_inaccessible_device(uint32_t agent_id)
+{
+ return NONE;
+}
+
+/**
+ @brief This API is used to get protocol by which given device can be access
+ @param device id
+ @return protocol id
+**/
+uint32_t pal_device_get_accessible_protocol(uint32_t device_id)
+{
+ return NONE;
+}
+
diff --git a/platform/baremetal/pal_clock.c b/platform/baremetal/pal_clock.c
new file mode 100644
index 0000000000000000000000000000000000000000..03cd629d54e9e7f0fa8feb2d1ebb60ce0d671006
--- /dev/null
+++ b/platform/baremetal/pal_clock.c
@@ -0,0 +1,87 @@
+/** @file
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifdef CLOCK_PROTOCOL
+
+#include "pal_interface.h"
+#include "pal_clock_expected.h"
+
+extern void pal_clock_set_expected(const void *);
+static struct arm_scmi_clock_expected *g_clock_info;
+
+/**
+ @brief Sets clock protocol info
+ @param platform clock protocol info
+ @return none
+**/
+void pal_clock_set_expected(const void *info)
+{
+ if (info == NULL)
+ return;
+ g_clock_info = (struct arm_scmi_clock_expected *)info;
+}
+
+/*----------- Common PAL API's across platforms ----------*/
+
+/**
+ @brief This API is used for checking num of clocks
+ @param none
+ @return num of clocks
+**/
+uint32_t pal_clock_get_expected_num_clocks(void)
+{
+ return g_clock_info->number_clocks;
+}
+
+/**
+ @brief This API is used for checking max num of pending async cmd support for clock
+ @param none
+ @return max num of pending async cmd
+**/
+uint32_t pal_clock_get_expected_max_async_cmd(void)
+{
+ return g_clock_info->max_num_pending_async_rate_chg_supported;
+}
+
+/**
+ @brief This API is used for checking num of rates a clock supports
+ @param clock id
+ @return num of rates a clock supports
+**/
+uint32_t pal_clock_get_expected_number_of_rates(uint32_t clock_id)
+{
+ return g_clock_info->num_rates[clock_id];
+}
+
+/**
+ @brief This API checks if clock supports config change
+ @param clock id
+ @return supported / unsupported
+**/
+uint32_t pal_check_clock_config_change_support(uint32_t clock_id)
+{
+ int32_t i;
+
+ for (i = 0; i < g_clock_info->num_of_on_clocks; i++)
+ {
+ if (clock_id == g_clock_info->always_on_clocks[i])
+ return 1;
+ }
+ return 0;
+}
+
+#endif
diff --git a/platform/baremetal/pal_performance.c b/platform/baremetal/pal_performance.c
new file mode 100644
index 0000000000000000000000000000000000000000..0028792f64240a50487ed70160b3e53d36c88356
--- /dev/null
+++ b/platform/baremetal/pal_performance.c
@@ -0,0 +1,100 @@
+/** @file
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifdef PERFORMANCE_PROTOCOL
+
+#include "pal_interface.h"
+#include "pal_performance_expected.h"
+
+extern void pal_performance_set_expected(const void *);
+static struct arm_scmi_performance_expected *g_performance_info;
+
+/**
+ @brief Sets performance protocol info
+ @param platform performance protocol info
+ @return none
+**/
+void pal_performance_set_expected(const void *info)
+{
+ if (info == NULL)
+ return;
+ g_performance_info = (struct arm_scmi_performance_expected *)info;
+}
+
+/*----------- Common PAL API's across platforms ----------*/
+
+/**
+ @brief This API is used for checking number of perf domains
+ @param none
+ @return num of perf domains
+**/
+uint32_t pal_performance_get_expected_num_domains(void)
+{
+ return g_performance_info->num_performance_domains;
+}
+
+/**
+ @brief This API is used for checking perf statistics addr low
+ @param none
+ @return statistics addr low
+**/
+uint32_t pal_performance_get_expected_stats_addr_low(void)
+{
+ return g_performance_info->statistics_address_low;
+}
+
+/**
+ @brief This API is used for checking perf statistics addr high
+ @param none
+ @return statistics addr high
+**/
+uint32_t pal_performance_get_expected_stats_addr_high(void)
+{
+ return g_performance_info->statistics_address_high;
+}
+
+/**
+ @brief This API is used for checking statistics addr len
+ @param none
+ @return statistics addr len
+**/
+uint32_t pal_performance_get_expected_stats_addr_len(void)
+{
+ return g_performance_info->statistics_length;
+}
+
+/**
+ @brief This API is used for checking domain name
+ @param perf domain id
+ @return perf domain name
+**/
+uint8_t *pal_performance_get_expected_name(uint32_t domain_id)
+{
+ return (uint8_t *)&g_performance_info->performance_domain_names[domain_id][0];
+}
+
+/**
+ @brief This API is used for checking num of level for perf domain
+ @param perf domain id
+ @return num of level for perf domain
+**/
+uint32_t pal_performance_get_expected_number_of_level(uint32_t domain_id)
+{
+ return g_performance_info->num_performance_levels[domain_id];
+}
+
+#endif
diff --git a/platform/baremetal/pal_platform.c b/platform/baremetal/pal_platform.c
new file mode 100644
index 0000000000000000000000000000000000000000..7c97ccd9e292b5117fb02b3e5735145a8104a64e
--- /dev/null
+++ b/platform/baremetal/pal_platform.c
@@ -0,0 +1,157 @@
+/** @file
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "pal_interface.h"
+#include "pal_platform.h"
+
+extern void pal_base_set_expected(const void *);
+#ifdef POWER_DOMAIN_PROTOCOL
+extern void pal_power_set_expected(const void *);
+#endif
+#ifdef SYSTEM_POWER_PROTOCOL
+extern void pal_system_power_set_expected(const void *);
+#endif
+#ifdef CLOCK_PROTOCOL
+extern void pal_clock_set_expected(const void *);
+#endif
+#ifdef SENSOR_PROTOCOL
+extern void pal_sensor_set_expected(const void *);
+#endif
+#ifdef PERFORMANCE_PROTOCOL
+extern void pal_performance_set_expected(const void *);
+#endif
+#ifdef RESET_PROTOCOL
+extern void pal_reset_set_expected(const void *);
+#endif
+
+/**
+ @brief This API is used to call platform function to send command
+ @param cmd message header
+ @param num of cmd parameter
+ @param parameter list
+ @param response message header
+ @param cmd status
+ @param return values count
+ @param return values list
+ @return vendor name
+**/
+void pal_send_message(uint32_t message_header_send, size_t parameter_count,
+ const uint32_t *parameters, uint32_t *message_header_rcv, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values)
+{
+ arm_scmi_send_message(message_header_send, parameter_count, parameters,
+ message_header_rcv, status, return_values_count, return_values);
+}
+
+/**
+ @brief This API is used to receive delayed response
+ @param message header received
+ @param status of command processed
+ @param return values count
+ @param return values list
+ **/
+void pal_receive_delayed_response(uint32_t *message_header_rcv, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values)
+{
+ arm_scmi_wait_for_response(message_header_rcv, status, return_values_count, return_values);
+}
+
+/**
+ @brief This API is used to receive notifications from platform
+ @param message header received
+ @param return values count
+ @param return values list
+ **/
+void pal_receive_notification(uint32_t *message_header_rcv, size_t *return_values_count,
+ uint32_t *return_values)
+{
+ arm_scmi_wait_for_notification(message_header_rcv, return_values_count, return_values);
+}
+
+/**
+ @brief This API is used to initialize platform to run tests if needed
+ @param platform info
+ @return success / failure
+**/
+uint32_t pal_initialize_system(void *info)
+{
+ struct arm_scmi_platform_info *platform_info;
+ struct arm_scmi_platform_protocol_info *protocol_info;
+ uint32_t index = 0;
+
+ if (info == NULL)
+ return PAL_STATUS_FAIL;
+ platform_info = (struct arm_scmi_platform_info *) info;
+
+ if (platform_info->platform_protocol_info_table == NULL)
+ return PAL_STATUS_FAIL;
+ protocol_info = (struct arm_scmi_platform_protocol_info *)
+ platform_info->platform_protocol_info_table;
+
+ while (index < platform_info->platform_protocol_info_count) {
+ switch (protocol_info->protocol_id)
+ {
+ case 0x10:
+ pal_base_set_expected(protocol_info->expected_return_values);
+ break;
+#ifdef POWER_DOMAIN_PROTOCOL
+ case 0x11:
+ pal_power_set_expected(protocol_info->expected_return_values);
+ break;
+#endif
+#ifdef SYSTEM_POWER_PROTOCOL
+ case 0x12:
+ pal_system_power_set_expected(protocol_info->expected_return_values);
+ break;
+#endif
+#ifdef PERFORMANCE_PROTOCOL
+ case 0x13:
+ pal_performance_set_expected(protocol_info->expected_return_values);
+ break;
+#endif
+#ifdef CLOCK_PROTOCOL
+ case 0x14:
+ pal_clock_set_expected(protocol_info->expected_return_values);
+ break;
+#endif
+#ifdef SENSOR_PROTOCOL
+ case 0x15:
+ pal_sensor_set_expected(protocol_info->expected_return_values);
+ break;
+#endif
+#ifdef RESET_PROTOCOL
+ case 0x16:
+ pal_reset_set_expected(protocol_info->expected_return_values);
+ break;
+#endif
+ }
+ protocol_info++; index++;
+ }
+ return PAL_STATUS_PASS;
+}
+
+/**
+ @brief This API is used to print test log
+ @param args values to be printed
+ @return none
+**/
+void pal_print(uint32_t print_level, const char *format, va_list args)
+{
+ char p_str[LOG_STR_SIZE];
+ vsprintf(p_str, format, args);
+ arm_scmi_log_output(p_str);
+}
diff --git a/platform/baremetal/pal_power_domain.c b/platform/baremetal/pal_power_domain.c
new file mode 100644
index 0000000000000000000000000000000000000000..0fe3b97d44119cb5f7290a30ee9990781365d0d5
--- /dev/null
+++ b/platform/baremetal/pal_power_domain.c
@@ -0,0 +1,80 @@
+/** @file
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifdef POWER_DOMAIN_PROTOCOL
+
+#include "pal_interface.h"
+#include "pal_power_domain_expected.h"
+
+extern void pal_power_set_expected(const void *);
+static struct arm_scmi_power_expected *g_power_info;
+
+/**
+ @brief Sets power domain protocol info
+ @param platform power domain protocol info
+ @return none
+**/
+void pal_power_set_expected(const void *info)
+{
+ if (info == NULL)
+ return;
+ g_power_info = (struct arm_scmi_power_expected *)info;
+}
+
+/*----------- Common PAL API's across platforms ----------*/
+
+/**
+ @brief This API is used for checking num of power domain
+ @param none
+ @return num of power domain
+**/
+uint32_t pal_power_get_expected_num_domains(void)
+{
+ return g_power_info->num_power_domains;
+}
+
+/**
+ @brief This API is used for checking power domain statistics addr low
+ @param none
+ @return statistics addr low
+**/
+uint32_t pal_power_get_expected_stats_addr_low(void)
+{
+ return g_power_info->statistics_address_low;
+}
+
+/**
+ @brief This API is used for checking power domain statistics addr high
+ @param none
+ @return statistics addr high
+**/
+uint32_t pal_power_get_expected_stats_addr_high(void)
+{
+ return g_power_info->statistics_address_high;
+}
+
+/**
+ @brief This API is used for checking power domain statistics addr len
+ @param none
+ @return statistics addr len
+**/
+uint32_t pal_power_get_expected_stats_addr_len(void)
+{
+ return g_power_info->statistics_length;
+}
+
+#endif
diff --git a/platform/baremetal/pal_reset.c b/platform/baremetal/pal_reset.c
new file mode 100644
index 0000000000000000000000000000000000000000..61697528b4060e7bf69073678b9724a34d247191
--- /dev/null
+++ b/platform/baremetal/pal_reset.c
@@ -0,0 +1,60 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifdef RESET_PROTOCOL
+
+#include "pal_interface.h"
+#include "pal_reset_expected.h"
+
+extern void pal_reset_set_expected(const void *);
+static struct arm_scmi_reset_expected *g_reset_info;
+
+/**
+ @brief Sets reset domain protocol info
+ @param platform reset domain protocol info
+ @return none
+**/
+void pal_reset_set_expected(const void *info)
+{
+ if (info == NULL)
+ return;
+ g_reset_info = (struct arm_scmi_reset_expected *)info;
+}
+
+/*----------- Common PAL API's across platforms ----------*/
+
+/**
+ @brief This API is used for checking num of reset domain
+ @param none
+ @return num of reset domain
+**/
+uint32_t pal_reset_get_expected_num_domains(void)
+{
+ return g_reset_info->number_domains;
+}
+
+/**
+ @brief This API is used for checking reset domain name
+ @param domain id
+ @return reset domain name
+**/
+uint8_t *pal_reset_get_expected_name(uint32_t domain_id)
+{
+ return (uint8_t *)g_reset_info->reset_domain_name[domain_id];
+}
+
+#endif
diff --git a/platform/baremetal/pal_sensor.c b/platform/baremetal/pal_sensor.c
new file mode 100644
index 0000000000000000000000000000000000000000..641db8a6edd618aa9a672c7749451db25b84dcbf
--- /dev/null
+++ b/platform/baremetal/pal_sensor.c
@@ -0,0 +1,80 @@
+/** @file
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifdef SENSOR_PROTOCOL
+
+#include "pal_interface.h"
+#include "pal_sensor_expected.h"
+
+extern void pal_sensor_set_expected(const void *);
+static struct arm_scmi_sensor_expected *g_sensor_info;
+
+/**
+ @brief Sets sensor protocol info
+ @param platform sensor protocol info
+ @return none
+**/
+void pal_sensor_set_expected(const void *info)
+{
+ if (info == NULL)
+ return;
+ g_sensor_info = (struct arm_scmi_sensor_expected *)info;
+}
+
+/*----------- Common PAL API's across platforms ----------*/
+
+/**
+ @brief This API is used for checking num of sensors
+ @param none
+ @return num of sensors
+**/
+uint32_t pal_sensor_get_expected_num_sensors(void)
+{
+ return g_sensor_info->number_sensors;
+}
+
+/**
+ @brief This API is used for checking sensor statistics addr low
+ @param none
+ @return statistics addr low
+**/
+uint32_t pal_sensor_get_expected_stats_addr_low(void)
+{
+ return g_sensor_info->sensor_reg_address_low;
+}
+
+/**
+ @brief This API is used for checking sensor statistics addr high
+ @param none
+ @return statistics addr high
+**/
+uint32_t pal_sensor_get_expected_stats_addr_high(void)
+{
+ return g_sensor_info->sensor_reg_address_high;
+}
+
+/**
+ @brief This API is used for checking sensor statistics addr len
+ @param none
+ @return statistics addr len
+**/
+uint32_t pal_sensor_get_expected_stats_addr_len(void)
+{
+ return g_sensor_info->sensor_reg_length;
+}
+
+#endif
diff --git a/platform/baremetal/pal_system_power.c b/platform/baremetal/pal_system_power.c
new file mode 100644
index 0000000000000000000000000000000000000000..0b3e89a8d93e84cd844ccac20a7952150b958620
--- /dev/null
+++ b/platform/baremetal/pal_system_power.c
@@ -0,0 +1,41 @@
+/** @file
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifdef SYSTEM_POWER_PROTOCOL
+
+#include "pal_interface.h"
+#include "pal_system_power_expected.h"
+
+extern void pal_system_power_set_expected(const void *);
+static struct arm_scmi_system_power_expected *g_system_power_info;
+
+/**
+ @brief Sets system power protocol info
+ @param platform system power protocol info
+ @return none
+**/
+void pal_system_power_set_expected(const void *info)
+{
+ if (info == NULL)
+ return;
+ g_system_power_info = (struct arm_scmi_system_power_expected *)info;
+}
+
+
+/*----------- Common PAL API's across platforms ----------*/
+
+#endif
diff --git a/platform/common/pal_interface.h b/platform/common/pal_interface.h
deleted file mode 100644
index b1bffd08a520231aee38a52cdbf750143e95959a..0000000000000000000000000000000000000000
--- a/platform/common/pal_interface.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
- * SPDX-License-Identifier : Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-**/
-
-#ifndef __PAL_INTERFACE_H__
-#define __PAL_INTERFACE_H__
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/* set PRINT_LEVEL to one of the below values in your application entry
- to control the verbosity of the prints */
-#define PAL_PRINT_ERR 1 /* Only errors, test and results description log */
-#define PAL_PRINT_WARN 2 /* Only warnings & errors */
-#define PAL_PRINT_TEST 3 /* Test description and result descriptions. THIS is DEFAULT */
-#define PAL_PRINT_DEBUG 4 /* For Debug statements. contains register dumps etc */
-#define PAL_PRINT_INFO 5 /* Print all statements. Do not use unless really needed */
-
-#define PAL_STATUS_FAIL 0x90000000
-#define PAL_STATUS_SKIP 0X10000000
-#define PAL_STATUS_PASS 0x0
-#define PAL_STATUS_NO_TESTS 0x1
-
-#define SCMI_NAME_STR_SIZE 16
-#define NUM_ELEMS(x) (sizeof(x) / sizeof((x)[0]))
-
-/* Generic pal functions used by all protocols test */
-void pal_send_message(uint32_t message_header_send, uint32_t parameter_count,
- const uint32_t *parameters, uint32_t *message_header_rcv, int32_t *status,
- uint32_t *return_values_count, uint32_t *return_values);
-void pal_fill_protocols_database(void);
-uint32_t pal_strcpy(uint8_t *dst_ptr, uint8_t *src_ptr);
-uint32_t pal_strcmp(uint8_t *dst_ptr, uint8_t *src_ptr, uint32_t len);
-void pal_print(uint32_t level, const char *string, va_list args);
-void pal_memset_zero(uint32_t length, uint32_t *buffer);
-void pal_initialize_system(void);
-uint32_t pal_agent_get_accessible_device(uint32_t agent_id);
-uint32_t pal_device_get_accessible_protocol(uint32_t device_id);
-uint32_t pal_agent_get_inaccessible_device(uint32_t agent_id);
-
-/* Base protocol test specific pal functions */
-uint32_t pal_base_get_expected_protocol_version(void);
-char *pal_base_get_expected_vendor_name(void);
-char *pal_base_get_expected_subvendor_name(void);
-uint32_t pal_base_get_expected_implementation_version(void);
-uint32_t pal_base_get_expected_num_agents(void);
-
-/* Power domain protoocol test specific pal functions */
-uint32_t pal_pwr_domain_get_expected_protocol_version(void);
-uint32_t pal_pwr_domain_get_expected_num_domains(void);
-uint32_t pal_get_expected_num_supported_protocols(void);
-
-/* Clock protocol test specific pal functions */
-uint32_t pal_clock_get_expected_num_clocks(void);
-
-#endif
diff --git a/platform/mocker/include/pal_expected.h b/platform/mocker/include/pal_base_expected.h
similarity index 55%
rename from platform/mocker/include/pal_expected.h
rename to platform/mocker/include/pal_base_expected.h
index 7ed161b3e65bdb37d4786398426fd09f46ed127c..73be99f51e499d37310f05bfc7a27e475ac66c07 100644
--- a/platform/mocker/include/pal_expected.h
+++ b/platform/mocker/include/pal_base_expected.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,43 +15,28 @@
* limitations under the License.
**/
-#ifndef __PAL_TARGET_H__
-#define __PAL_TARGET_H__
+#ifndef __PAL_BASE_EXPECTED_H__
+#define __PAL_BASE_EXPECTED_H__
-/***** This file contains platform specific data which is needed during test verification ****/
+#include
-#define BASE_PROTOCOL_ID 0x10
-#define POWER_DOMAIN_PROTOCOL_ID 0x11
-
-static uint32_t supported_protocols[] = {
- BASE_PROTOCOL_ID,
+static uint8_t supported_protocols[] = {
POWER_DOMAIN_PROTOCOL_ID,
+ SYSTEM_POWER_PROTOCOL_ID,
+ PERFORMANCE_PROTOCOL_ID,
+ CLOCK_PROTOCOL_ID,
+ SENSOR_PROTOCOL_ID,
+ RESET_PROTOCOL_ID,
};
+/* Expected BASE parameters */
+
static char *agents[] = {
"OSPM", "PSCI"
};
-/* Expected BASE parameters */
-
static char *vendor_name = "mocker";
static char *subvendor_name = "mocker";
static uint32_t implementation_version = 1;
-/* Expected POWER DOMAIN parameters */
-
-static uint32_t num_power_domains = 3;
-
-/* Expected SENSOR parameters */
-
-static uint32_t num_sensors = 2;
-
-/* Expected PERFORMANCE parameters */
-
-static uint32_t num_performance_domains = 4;
-
-/* Expected CLOCK parameters */
-
-static uint32_t num_clocks = 8;
-
-#endif /* PAL_TARGET_H_ */
+#endif /* __PAL_BASE_EXPECTED_H__ */
diff --git a/test_pool/performance/performance_testlist.c b/platform/mocker/include/pal_clock_expected.h
similarity index 57%
rename from test_pool/performance/performance_testlist.c
rename to platform/mocker/include/pal_clock_expected.h
index c44a167d8afdcbb7f4231fb7e60aba19c52ebbbb..3308564b4677180e5ef9f2d5c551da37ff405a7c 100644
--- a/test_pool/performance/performance_testlist.c
+++ b/platform/mocker/include/pal_clock_expected.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,17 +14,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
-#include "val_interface.h"
-#include "performance_testlist.h"
-test_fn_ptr performance_test[] = {
- performance_query_protocol_version,
- performance_query_protocol_attributes,
- performance_query_mandatory_command_support
+#ifndef __PAL_CLOCK_EXPECTED_H__
+#define __PAL_CLOCK_EXPECTED_H__
+
+/* Expected CLOCK parameters */
+
+static uint32_t max_num_pending_async_rate_chg_supported = 0;
+static uint32_t num_of_clock_rates[] = {
+ 0x03, /* Clock 0 */
+ 0x04, /* Clock 1 */
+ 0x05, /* Clock 2 */
};
-test_fn_ptr *val_performance_get_testlist(uint32_t *num_tests)
-{
- *num_tests = NUM_ELEMS(performance_test);
- return performance_test;
-}
+static uint32_t num_clocks = sizeof(num_of_clock_rates) / sizeof(num_of_clock_rates[0]);
+
+#endif /* PAL_TARGET_H_ */
diff --git a/platform/mocker/include/pal_performance_expected.h b/platform/mocker/include/pal_performance_expected.h
new file mode 100644
index 0000000000000000000000000000000000000000..9edc712522bdf57acd89f0527888e40ae69073f8
--- /dev/null
+++ b/platform/mocker/include/pal_performance_expected.h
@@ -0,0 +1,483 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifndef __PAL_PERFORMANCE_EXPECTED_H__
+#define __PAL_PERFORMANCE_EXPECTED_H__
+
+/* Expected PERFORMANCE parameters */
+#define PERF_EXPECTED_NUM_OF_DOMAIN 4
+static uint32_t num_performance_domains = PERF_EXPECTED_NUM_OF_DOMAIN;
+
+static uint32_t statistics_address_low_perf = 0x1234;
+static uint32_t statistics_address_len_perf = 0xFF;
+
+static uint8_t set_limit_capable[] = {1, 1, 1 ,0};
+static uint8_t set_performance_level_capable[] = {1, 1, 1 ,0};
+static uint8_t performance_level_notification_support[] = {0, 0, 0 ,0};
+static uint8_t performance_limit_notification_support[] = {0, 0, 0 ,0};
+static uint32_t performance_rate_limit[] = {10, 20, 30 ,40};
+static uint32_t performance_sustained_freq[] = {100, 200, 300 ,400};
+static uint32_t performance_sustained_level[] = {110, 120, 130 ,140};
+
+static char* performance_domain_names[] = {
+ "Domain_0",
+ "Domain_1",
+ "Domain_2",
+ "Domain_3"
+};
+
+static uint32_t perf_num_performance_levels[] = {
+ 3, /* Domain 0 */
+ 4, /* Domain 1 */
+ 5, /* Domain 2 */
+ 6, /* Domain 3 */
+};
+
+static uint32_t *perf_performance_level_values[] = {
+ (uint32_t[]) { /* Domain 0 */
+ 665000000, /* 665MHz */
+ 998000000, /* 998MHz */
+ 1330000000, /* 1330MHz */
+ },
+ (uint32_t[]) { /* 1 */
+ 1313000000, /* 1313MHz */
+ 1531000000, /* 1531MHz */
+ 1750000000, /* 1750MHz */
+ 2100000000, /* 2100MHz */
+ },
+ (uint32_t[]) { /* 2 */
+ 450000000, /* 450MHz */
+ 487500000, /* 487.5MHz */
+ 525000000, /* 525MHz */
+ 562500000, /* 562.5MHz */
+ 600000000, /* 600MHz */
+ },
+ (uint32_t[]) { /* 3 */
+ 550000000, /* 550MHz */
+ 687500000, /* 687.5MHz */
+ 725000000, /* 725MHz */
+ 862500000, /* 862.5MHz */
+ 900000000, /* 900MHz */
+ 910000000, /* 910MHz */
+ },
+};
+
+static uint32_t *perf_performance_level_power_costs[] = {
+ (uint32_t[]) { /* 0 */
+ 4 * 0.110 * 665 * (800 * 800) / 1000000,
+ 4 * 0.110 * 998 * (850 * 850) / 1000000,
+ 4 * 0.110 * 1330 * (900 * 900) / 1000000,
+ },
+ (uint32_t[]) { /* 1 */
+ 4 * 0.453 * 1313 * (800 * 800) / 1000000,
+ 4 * 0.453 * 1531 * (850 * 850) / 1000000,
+ 4 * 0.453 * 1750 * (900 * 900) / 1000000,
+ 4 * 0.453 * 2100 * (950 * 950) / 1000000,
+ },
+ (uint32_t[]) { /* 2 */
+ 16 * 0.640 * 450 * (800 * 800) / 1000000,
+ 16 * 0.640 * 487 * (850 * 850) / 1000000,
+ 16 * 0.640 * 525 * (900 * 900) / 1000000,
+ 16 * 0.640 * 562 * (950 * 950) / 1000000,
+ 16 * 0.640 * 600 * (1000 * 1000) / 1000000,
+ },
+ (uint32_t[]) { /* 3 */
+ 8 * 0.640 * 450 * (800 * 800) / 1000000,
+ 8 * 0.640 * 487 * (850 * 850) / 1000000,
+ 8 * 0.640 * 525 * (900 * 900) / 1000000,
+ 8 * 0.640 * 562 * (950 * 950) / 1000000,
+ 8 * 0.640 * 600 * (1000 * 1000) / 1000000,
+ 8 * 0.453 * 2100 * (950 * 950) / 1000000,
+ },
+};
+
+static uint32_t * perf_performance_level_worst_latency[] = {
+ (uint32_t[]) {
+ 1100,
+ 1200,
+ 1300,
+ },
+ (uint32_t[]) {
+ 1400,
+ 1500,
+ 1600,
+ 1700,
+ },
+ (uint32_t[]) {
+ 100,
+ 110,
+ 120,
+ 130,
+ 140,
+ },
+ (uint32_t[]) {
+ 150,
+ 160,
+ 170,
+ 180,
+ 190,
+ 200,
+ },
+};
+
+static uint8_t perf_msg_fast_ch_support[] = {
+ 0, /* Version*/
+ 0, /* Protocol attr*/
+ 0, /* Msg attr*/
+ 0, /* Domain attr*/
+ 0, /* Describe level*/
+ 1, /* Limit set*/
+ 1, /* limit get*/
+ 1, /* Level set*/
+ 1, /* Level get*/
+ 0, /* Notify limit*/
+ 0, /* Notify level*/
+ 0, /* Describe fast ch*/
+};
+
+static uint8_t perf_domain_fast_ch_support[] = {
+ 1, /* Domain 0 */
+ 1, /* Domain 1 */
+ 0, /* Domain 2 */
+ 1, /* Domain 3 */
+};
+
+static uint8_t * perf_performance_fast_ch_doorbell_support[] = {
+ (uint8_t[]) { /* Domain 0 */
+ 1, /* Limit set*/
+ 1, /* Limit get*/
+ 0, /* Level set*/
+ 1, /* Level get*/
+ },
+ (uint8_t[]) { /* Domain 1 */
+ 0, /* Limit set*/
+ 1, /* Limit get*/
+ 0, /* Level set*/
+ 1, /* Level get*/
+ },
+ (uint8_t[]) { /* Domain 2*/
+ 0, /* Limit set*/
+ 1, /* Limit get*/
+ 1, /* Level set*/
+ 1, /* Level get*/
+ },
+ (uint8_t[]) { /* Domain 3 */
+ 0, /* Limit set*/
+ 1, /* Limit get*/
+ 0, /* Level set*/
+ 1, /* Level get*/
+ },
+};
+
+static uint8_t * perf_performance_fast_ch_doorbell_data_width[] = {
+ (uint8_t[]) { /* Domain 0 */
+ 0, /* Limit set*/
+ 0, /* Limit get*/
+ 0, /* Level set*/
+ 0, /* Level get*/
+ },
+ (uint8_t[]) { /* Domain 1 */
+ 0, /* Limit set*/
+ 1, /* Limit get*/
+ 0, /* Level set*/
+ 0, /* Level get*/
+ },
+ (uint8_t[]) { /* Domain 2*/
+ 0, /* Limit set*/
+ 0, /* Limit get*/
+ 2, /* Level set*/
+ 0, /* Level get*/
+ },
+ (uint8_t[]) { /* Domain 3 */
+ 0, /* Limit set*/
+ 0, /* Limit get*/
+ 0, /* Level set*/
+ 3, /* Level get*/
+ },
+};
+
+static uint32_t * perf_performance_fast_chan_addr_low[] = {
+ (uint32_t[]) { /* Domain 0 */
+ 1000, /* Limit set*/
+ 2000, /* Limit get*/
+ 3000, /* Level set*/
+ 4000, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 1 */
+ 5000, /* Limit set*/
+ 6000, /* Limit get*/
+ 7000, /* Level set*/
+ 8000, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 2*/
+ 9000, /* Limit set*/
+ 10000, /* Limit get*/
+ 11000, /* Level set*/
+ 12000, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 3 */
+ 13000, /* Limit set*/
+ 14000, /* Limit get*/
+ 15000, /* Level set*/
+ 16000, /* Level get*/
+ },
+};
+
+static uint32_t * perf_performance_fast_chan_addr_high[] = {
+ (uint32_t[]) { /* Domain 0 */
+ 100000, /* Limit set*/
+ 200000, /* Limit get*/
+ 300000, /* Level set*/
+ 400000, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 1 */
+ 500000, /* Limit set*/
+ 600000, /* Limit get*/
+ 700000, /* Level set*/
+ 800000, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 2*/
+ 900000, /* Limit set*/
+ 1000000, /* Limit get*/
+ 1100000, /* Level set*/
+ 1200000, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 3 */
+ 1300000, /* Limit set*/
+ 1400000, /* Limit get*/
+ 1500000, /* Level set*/
+ 1600000, /* Level get*/
+ },
+};
+
+static uint32_t * perf_performance_fast_chan_size[] = {
+ (uint32_t[]) { /* Domain 0 */
+ 10, /* Limit set*/
+ 20, /* Limit get*/
+ 30, /* Level set*/
+ 40, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 1 */
+ 50, /* Limit set*/
+ 60, /* Limit get*/
+ 70, /* Level set*/
+ 80, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 2*/
+ 90, /* Limit set*/
+ 100, /* Limit get*/
+ 110, /* Level set*/
+ 120, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 3 */
+ 130, /* Limit set*/
+ 140, /* Limit get*/
+ 150, /* Level set*/
+ 160, /* Level get*/
+ },
+};
+
+static uint32_t * perf_performance_fast_chan_rate_limit[] = {
+ (uint32_t[]) { /* Domain 0 */
+ 1500, /* Limit set*/
+ 2500, /* Limit get*/
+ 3500, /* Level set*/
+ 4500, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 1 */
+ 5500, /* Limit set*/
+ 6500, /* Limit get*/
+ 7500, /* Level set*/
+ 8500, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 2*/
+ 9500, /* Limit set*/
+ 10500, /* Limit get*/
+ 11500, /* Level set*/
+ 12500, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 3 */
+ 13500, /* Limit set*/
+ 14500, /* Limit get*/
+ 15500, /* Level set*/
+ 16500, /* Level get*/
+ },
+};
+
+static uint32_t * perf_performance_fast_chan_doorbell_addr_low[] = {
+ (uint32_t[]) { /* Domain 0 */
+ 100000, /* Limit set*/
+ 200000, /* Limit get*/
+ 300000, /* Level set*/
+ 400000, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 1 */
+ 500000, /* Limit set*/
+ 600000, /* Limit get*/
+ 700000, /* Level set*/
+ 800000, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 2*/
+ 900000, /* Limit set*/
+ 1000000, /* Limit get*/
+ 1100000, /* Level set*/
+ 1200000, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 3 */
+ 1300000, /* Limit set*/
+ 1400000, /* Limit get*/
+ 1500000, /* Level set*/
+ 1600000, /* Level get*/
+ },
+};
+
+static uint32_t * perf_performance_fast_chan_doorbell_addr_high[] = {
+ (uint32_t[]) { /* Domain 0 */
+ 1000000, /* Limit set*/
+ 2000000, /* Limit get*/
+ 3000000, /* Level set*/
+ 4000000, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 1 */
+ 5000000, /* Limit set*/
+ 6000000, /* Limit get*/
+ 7000000, /* Level set*/
+ 8000000, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 2*/
+ 9000000, /* Limit set*/
+ 10000000, /* Limit get*/
+ 11000000, /* Level set*/
+ 12000000, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 3 */
+ 13000000, /* Limit set*/
+ 14000000, /* Limit get*/
+ 15000000, /* Level set*/
+ 16000000, /* Level get*/
+ },
+};
+
+static uint32_t * perf_performance_fast_chan_doorbell_set_mask_low[] = {
+ (uint32_t[]) { /* Domain 0 */
+ 100001, /* Limit set*/
+ 200001, /* Limit get*/
+ 300001, /* Level set*/
+ 400001, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 1 */
+ 500001, /* Limit set*/
+ 600001, /* Limit get*/
+ 700001, /* Level set*/
+ 800001, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 2*/
+ 900001, /* Limit set*/
+ 1000001, /* Limit get*/
+ 1100001, /* Level set*/
+ 1200001, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 3 */
+ 1300001, /* Limit set*/
+ 1400001, /* Limit get*/
+ 1500001, /* Level set*/
+ 1600001, /* Level get*/
+ },
+};
+
+static uint32_t * perf_performance_fast_chan_doorbell_set_mask_high[] = {
+ (uint32_t[]) { /* Domain 0 */
+ 1000001, /* Limit set*/
+ 2000001, /* Limit get*/
+ 3000001, /* Level set*/
+ 4000001, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 1 */
+ 5000001, /* Limit set*/
+ 6000001, /* Limit get*/
+ 7000001, /* Level set*/
+ 8000001, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 2*/
+ 9000001, /* Limit set*/
+ 10000001, /* Limit get*/
+ 11000001, /* Level set*/
+ 12000001, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 3 */
+ 13000001, /* Limit set*/
+ 14000001, /* Limit get*/
+ 15000001, /* Level set*/
+ 16000001, /* Level get*/
+ },
+};
+
+static uint32_t * perf_performance_fast_chan_doorbell_preserve_mask_low[] = {
+ (uint32_t[]) { /* Domain 0 */
+ 100002, /* Limit set*/
+ 200002, /* Limit get*/
+ 300002, /* Level set*/
+ 400002, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 1 */
+ 500002, /* Limit set*/
+ 600002, /* Limit get*/
+ 700002, /* Level set*/
+ 800002, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 2*/
+ 900002, /* Limit set*/
+ 1000002, /* Limit get*/
+ 1100002, /* Level set*/
+ 1200002, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 3 */
+ 1300002, /* Limit set*/
+ 1400002, /* Limit get*/
+ 1500002, /* Level set*/
+ 1600002, /* Level get*/
+ },
+};
+
+static uint32_t * perf_performance_fast_chan_doorbell_preserve_mask_high[] = {
+ (uint32_t[]) { /* Domain 0 */
+ 1000002, /* Limit set*/
+ 2000002, /* Limit get*/
+ 3000002, /* Level set*/
+ 4000002, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 1 */
+ 5000002, /* Limit set*/
+ 6000002, /* Limit get*/
+ 7000002, /* Level set*/
+ 8000002, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 2*/
+ 9000002, /* Limit set*/
+ 10000002, /* Limit get*/
+ 11000002, /* Level set*/
+ 12000002, /* Level get*/
+ },
+ (uint32_t[]) { /* Domain 3 */
+ 13000000, /* Limit set*/
+ 14000000, /* Limit get*/
+ 15000000, /* Level set*/
+ 16000000, /* Level get*/
+ },
+};
+
+#endif /* __PAL_PERFORMANCE_EXPECTED_H__ */
diff --git a/platform/mocker/include/pal_platform.h b/platform/mocker/include/pal_platform.h
index 5a2bc5c4a675cc10f21575ed77b14913a2f48813..9860bad1c61cc95df6e549e15d94de65a3d274f1 100644
--- a/platform/mocker/include/pal_platform.h
+++ b/platform/mocker/include/pal_platform.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,17 +15,80 @@
* limitations under the License.
**/
-#ifndef __PAL_PLATFORM_H__
-#define __PAL_PLATFORM_H__
+#ifndef __PAL_PLATFORM__
+#define __PAL_PLATFORM__
#include
+#include
+#include
+
+#define BASE_PROTOCOL_ID 0x10
+#define POWER_DOMAIN_PROTOCOL_ID 0x11
+#define SYSTEM_POWER_PROTOCOL_ID 0x12
+#define PERFORMANCE_PROTOCOL_ID 0x13
+#define CLOCK_PROTOCOL_ID 0x14
+#define SENSOR_PROTOCOL_ID 0x15
+#define RESET_PROTOCOL_ID 0x16
+
+enum BITS_HEADER {
+ RESERVED_LOW = 28,
+ RESERVED_HIGH = 31,
+ TOKEN_LOW = 18,
+ TOKEN_HIGH = 27,
+ PROTOCOL_ID_LOW = 10,
+ PROTOCOL_ID_HIGH = 17,
+ MESSAGE_TYPE_LOW = 8,
+ MESSAGE_TYPE_HIGH = 9,
+ MESSAGE_ID_LOW = 0,
+ MESSAGE_ID_HIGH = 7
+};
+
+#define SCMI_EXRACT_BITS(data, bit_upper, bit_lower)\
+ ({\
+ uint32_t mask, bits;\
+ mask = ((1 << (bit_upper - bit_lower + 1)) - 1) << bit_lower;\
+ bits = (data & mask) >> bit_lower;\
+ bits;\
+ })
uint32_t agent_get_accessible_device(uint32_t agent_id);
uint32_t agent_get_inaccessible_device(uint32_t agent_id);
uint32_t device_get_accessible_protocol(uint32_t device_id);
-void mocker_send_message(uint32_t message_header_send, uint32_t parameter_count,
- const uint32_t *parameters, uint32_t *message_header_rcv,
- int32_t *status, uint32_t *return_values_count, uint32_t *return_values);
-void mocker_fill_protocols_database(void);
+uint32_t check_trusted_agent(uint32_t agent_id);
+
+void base_send_message(uint32_t message_id, uint32_t parameter_count,
+ const uint32_t *parameters, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values);
+
+void system_power_send_message(uint32_t message_id, uint32_t parameter_count,
+ const uint32_t *parameters, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values);
+
+void sensor_send_message(uint32_t message_id, uint32_t parameter_count,
+ const uint32_t *parameters, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values);
+
+void clock_send_message(uint32_t message_id, uint32_t parameter_count,
+ const uint32_t *parameters, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values);
+
+void performance_send_message(uint32_t message_id, uint32_t parameter_count,
+ const uint32_t *parameters, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values);
+
+void power_send_message(uint32_t message_id, uint32_t parameter_count,
+ const uint32_t *parameters, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values);
+
+void reset_send_message(uint32_t message_id, uint32_t parameter_count,
+ const uint32_t *parameters, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values);
+
+void fill_base_protocol(void);
+void fill_power_protocol(void);
+void fill_clock_protocol(void);
+void fill_sensor_protocol(void);
+void fill_performance_protocol(void);
+void fill_reset_protocol(void);
-#endif
+#endif /*__PAL_PLATFORM__*/
diff --git a/test_pool/system_power/system_power_testlist.h b/platform/mocker/include/pal_power_domain_expected.h
similarity index 60%
rename from test_pool/system_power/system_power_testlist.h
rename to platform/mocker/include/pal_power_domain_expected.h
index df65719a3c275b8f9ac509b0261b2c498b68cbc3..c60cebe44e3bb17db944538eb44523ee44c47f5f 100644
--- a/test_pool/system_power/system_power_testlist.h
+++ b/platform/mocker/include/pal_power_domain_expected.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,13 +15,15 @@
* limitations under the License.
**/
-#ifndef __SYSTEM_POWER_TESTLIST_H__
-#define __SYSTEM_POWER_TESTLIST_H__
+#ifndef __PAL_POWER_DOMAIN_EXPECTED_H__
+#define __PAL_POWER_DOMAIN_EXPECTED_H__
-uint32_t system_power_query_protocol_version(void);
-uint32_t system_power_query_protocol_attributes(void);
-uint32_t system_power_query_mandatory_command_support(void);
-uint32_t system_power_state_get_check(void);
-uint32_t system_power_invalid_messageid_call(void);
+#include
-#endif
+/* Expected POWER DOMAIN parameters */
+
+static uint32_t num_power_domains = 3;
+static uint32_t statistics_address_low_pow = 0x1234;
+static uint32_t statistics_address_len_pow = 0xFF;
+
+#endif /* __PAL_POWER_DOMAIN_EXPECTED_H__ */
diff --git a/platform/mocker/include/pal_reset_expected.h b/platform/mocker/include/pal_reset_expected.h
new file mode 100644
index 0000000000000000000000000000000000000000..b22a91ac4f041dea36d80e09e799a48a5f2cb5d0
--- /dev/null
+++ b/platform/mocker/include/pal_reset_expected.h
@@ -0,0 +1,61 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifndef __PAL_RESET_EXPECTED_H__
+#define __PAL_RESET_EXPECTED_H__
+
+/* Expected RESET parameters */
+
+/* Rest Mocker defines*/
+#define RESET_ASYNC_SUPPORTED 1
+#define RESET_ASYNC_NOT_SUPPORTED 0
+
+#define RESET_NOTIFY_SUPPORTED 1
+#define RESET_NOTIFY_NOT_SUPPORTED 0
+
+/* Expected RESET parameters */
+static uint32_t num_reset_domains = 0x3;
+
+static char* reset_domain_names[] =
+{
+ "Reset_0",
+ "Reset_1",
+ "Reset_2"
+};
+
+static uint32_t async_reset_support[] =
+{
+ RESET_ASYNC_SUPPORTED,
+ RESET_ASYNC_NOT_SUPPORTED,
+ RESET_ASYNC_SUPPORTED
+};
+
+static uint32_t reset_notify_support[] =
+{
+ RESET_NOTIFY_NOT_SUPPORTED,
+ RESET_NOTIFY_SUPPORTED,
+ RESET_NOTIFY_SUPPORTED
+};
+
+static uint32_t reset_latency[] =
+{
+ 10000,
+ 100000,
+ 2000000,
+};
+
+#endif /* __PAL_RESET_EXPECTED_H__ */
diff --git a/platform/mocker/include/pal_sensor_expected.h b/platform/mocker/include/pal_sensor_expected.h
new file mode 100644
index 0000000000000000000000000000000000000000..2b5c6e6a61267da49a2b0053366e761e3434a5a5
--- /dev/null
+++ b/platform/mocker/include/pal_sensor_expected.h
@@ -0,0 +1,50 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifndef __PAL_SENSOR_EXPECTED_H__
+#define __PAL_SENSOR_EXPECTED_H__
+
+/* Expected SENSOR parameters */
+#define NUM_OF_SENSORS_SUPPORTED 2
+#define SENOR_ASYNC_READ_SUPPORTED 1
+#define SENOR_ASYNC_READ_NOT_SUPPORTED 0
+/*
+ * This should have the Asynchronous sensor read support in this platform
+ * bounded by the number of sensor descriptors.
+ */
+static uint8_t async_sensor_read_support[] =
+{
+ SENOR_ASYNC_READ_NOT_SUPPORTED,
+ SENOR_ASYNC_READ_NOT_SUPPORTED
+};
+
+/*
+ * This should have the Number of trip points supported in this platform
+ * bounded by the number of sensor descriptors.
+ */
+static uint8_t number_of_trip_points_supported[] =
+{
+ 0,
+ 2
+};
+
+static uint32_t num_sensors = NUM_OF_SENSORS_SUPPORTED;
+
+static uint32_t statistics_address_low_snsr = 0x1234;
+static uint32_t statistics_address_len_snsr = 0xFF;
+
+#endif /* __PAL_SENSOR_EXPECTED_H__ */
diff --git a/platform/mocker/mocker/Makefile b/platform/mocker/mocker/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..b3821a96448d4b92f7f1782bafa6cbb645e879c1
--- /dev/null
+++ b/platform/mocker/mocker/Makefile
@@ -0,0 +1,18 @@
+#/** @file
+# * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+# * SPDX-License-Identifier : Apache-2.0
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# * http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+#**/
+
+include ${TOP}/platform/build_platform.mk
diff --git a/platform/mocker/include/base_common.h b/platform/mocker/mocker/include/base_common.h
similarity index 100%
rename from platform/mocker/include/base_common.h
rename to platform/mocker/mocker/include/base_common.h
diff --git a/platform/mocker/include/base_protocol.h b/platform/mocker/mocker/include/base_protocol.h
similarity index 100%
rename from platform/mocker/include/base_protocol.h
rename to platform/mocker/mocker/include/base_protocol.h
diff --git a/platform/mocker/include/clock_common.h b/platform/mocker/mocker/include/clock_common.h
similarity index 97%
rename from platform/mocker/include/clock_common.h
rename to platform/mocker/mocker/include/clock_common.h
index b8bbd390032bbd3862b4e56fbac11f597b7bcb5c..98d74fa4b84a0622bbc311213e791d79f48ae866 100644
--- a/platform/mocker/include/clock_common.h
+++ b/platform/mocker/mocker/include/clock_common.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/platform/mocker/include/clock_protocol.h b/platform/mocker/mocker/include/clock_protocol.h
similarity index 100%
rename from platform/mocker/include/clock_protocol.h
rename to platform/mocker/mocker/include/clock_protocol.h
diff --git a/platform/mocker/include/performance_common.h b/platform/mocker/mocker/include/performance_common.h
similarity index 73%
rename from platform/mocker/include/performance_common.h
rename to platform/mocker/mocker/include/performance_common.h
index 122b90ee29040afd0fd68bbe12f867be4314d1ad..7fcaa9377fe705b32fc3362e0da8cb95bc4eae79 100644
--- a/platform/mocker/include/performance_common.h
+++ b/platform/mocker/mocker/include/performance_common.h
@@ -137,5 +137,56 @@ struct arm_scmi_performance_levels_get {
uint32_t performance_level;
} returns;
};
+struct arm_scmi_performance_notify_limits {
+ struct {
+ uint32_t domain_id;
+ uint32_t notify_enable;
+ } parameters;
+ enum {
+ PERFORMANCE_NOTIFY_LIMIT_ENABLED=0,
+ PERFORMANCE_NOTIFY_LIMIT_RESERVED_LOW=1,
+ PERFORMANCE_NOTIFY_LIMIT_RESERVED_HIGH=31,
+ } notify_limits_enable_bits;
+};
+struct arm_scmi_performance_notify_level {
+ struct {
+ uint32_t domain_id;
+ uint32_t notify_enable;
+ } parameters;
+ enum {
+ PERFORMANCE_NOTIFY_LEVEL_ENABLED = 0,
+ PERFORMANCE_NOTIFY_LEVEL_RESERVED_LOW = 1,
+ PERFORMANCE_NOTIFY_LEVEL_RESERVED_HIGH = 31,
+ } notify_level_enable_bits;
+};
+/*
+ * PERFORMANCE_DESCRIBE_FASTCHANNEL
+ */
+struct arm_scmi_performance_describe_fast_channel {
+ struct {
+ uint32_t domain_id;
+ uint32_t message_id;
+ } parameters;
+ struct {
+ uint32_t attributes;
+ uint32_t rate_limit;
+ uint32_t chan_addr_low;
+ uint32_t chan_addr_high;
+ uint32_t chan_size;
+ uint32_t doorbell_addr_low;
+ uint32_t doorbell_addr_high;
+ uint32_t doorbell_set_mask_low;
+ uint32_t doorbell_set_mask_high;
+ uint32_t doorbell_preserve_mask_low;
+ uint32_t doorbell_preserve_mask_high;
+ } returns;
+ enum {
+ PERFORMANCE_DESCRIBE_FAST_CH_ATTR_RSRV_HIGH = 31,
+ PERFORMANCE_DESCRIBE_FAST_CH_ATTR_RSRV_LOW = 3,
+ PERFORMANCE_DESCRIBE_FAST_CH_ATTR_DOORBELL_DATA_WIDTH_HIGH = 2,
+ PERFORMANCE_DESCRIBE_FAST_CH_ATTR_DOORBELL_DATA_WIDTH_LOW = 1,
+ PERFORMANCE_DESCRIBE_FAST_CH_ATTR_DOORBELL_SUPPORT = 0,
+ }arm_scmi_performance_describe_fst_ch_attributes_bits;
+};
#endif /* PERFORMANCE_COMMON_H_ */
diff --git a/platform/mocker/include/performance_protocol.h b/platform/mocker/mocker/include/performance_protocol.h
similarity index 67%
rename from platform/mocker/include/performance_protocol.h
rename to platform/mocker/mocker/include/performance_protocol.h
index 5d07a31ad26bf0a63f488f0081f54c7c0ffd46e9..eb8f8f1f38cb09ac2f239a9d43ddc5e0654335b1 100644
--- a/platform/mocker/include/performance_protocol.h
+++ b/platform/mocker/mocker/include/performance_protocol.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, 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,6 +18,9 @@
#ifndef PERFORMANCE_EXPECTED_H_
#define PERFORMANCE_EXPECTED_H
+#include
+#include
+
#ifdef SCMI_VERSION_1
#define PERFORMANCE_VERSION 0x00010000
#else
@@ -36,6 +39,7 @@
#define PERF_LVL_GET_MSG_ID 0x8
#define PERF_NOTIFY_LIMIT_MSG_ID 0x9
#define PERF_NOTIFY_LVL_MSG_ID 0xA
+#define PERF_DESCRIBE_FASTCHANNEL 0xB
#define MAX_PERFORMANCE_DOMAIN_COUNT 10
@@ -96,11 +100,11 @@ struct arm_scmi_performance_protocol {
/*This should confirm if this agent is capable of setting performance limit
* change notifications on the given performance domain in this platform
* bounded by the num_performance_domains variable*/
- bool performance_limit_notification_support;
+ uint8_t *performance_limit_notification_support;
/*This should confirm if this agent is capable of setting performance level
* change notifications on the given performance domain in this platform
* bounded by the num_performance_domains variable*/
- bool performance_level_notification_support;
+ uint8_t *performance_level_notification_support;
/*This should have the list of performance rate limits in the platform
* bounded by the num_performance_domains variable*/
uint32_t *performance_rate_limit;
@@ -131,8 +135,50 @@ struct arm_scmi_performance_protocol {
/*This specifies if the performance level notification is expected to be
* supported in the platform*/
uint8_t performance_level_notification_supported;
+ /*This specifies if the fast channel is expected to be supported by messages
+ *bounded by the number of messages */
+ uint8_t *performance_message_fast_channel_support;
+ /*This specifies if the fast channel is expected to be supported by platform
+ *bounded by the number of domains */
+ uint8_t *performance_domain_fast_channel_support;
+ /*This should have door bell support of each command in
+ * this platform bounded by the number of domain*/
+ uint8_t **door_bell_support;
+ /*This should have doorbell data width of each command in
+ * this platform bounded by the number of domain*/
+ uint8_t **door_bell_data_width;
+ /*This should have fast channel rate limit of each command in
+ * this platform bounded by the number of domain*/
+ uint32_t **fast_channel_rate_limit;
+ /*This should have Lower 32 bits of the FastChannel address of each command in
+ * this platform bounded by the number of domain*/
+ uint32_t **fast_chan_addr_low;
+ /*This should have upper 32 bits of the FastChannel address of each command in
+ * this platform bounded by the number of domain*/
+ uint32_t **fast_chan_addr_high;
+ /*This should have size of FastChannel in bytes for each command in
+ * this platform bounded by the number of domain*/
+ uint32_t **fast_chan_size;
+ /* Lower 32 bits of the doorbell address. This field is not used if
+ * doorbell is not supported, bounded by the number of domain*/
+ uint32_t **doorbell_addr_low;
+ /* Upper 32 bits of the doorbell address. This field is not used if
+ * doorbell is not supported, bounded by the number of domain*/
+ uint32_t **doorbell_addr_high;
+ /* Contains a mask of lower 32 bits to set when writing to the doorbell register.
+ * If the doorbell register width, n, is less than 32 bits, then only n lower bits
+ * are considered from this mask*/
+ uint32_t **doorbell_set_mask_low;
+ /* Contains a mask of upper 32 bits to set when writing to the doorbell register.
+ * This field is only valid if the doorbell register width is 64 bits.*/
+ uint32_t **doorbell_set_mask_high;
+ /* Contains a mask of lower 32 bits to preserve when writing to the doorbell register.
+ * If the doorbell register width, n, is less than 32 bits, then only n lower bits are
+ * considered from this mask*/
+ uint32_t **doorbell_preserve_mask_low;
+ /* Contains a mask of higher 32 bits to preserve when writing to the doorbell register.
+ * This field is only valid if the doorbell register width is 64 bits. */
+ uint32_t **doorbell_preserve_mask_high;
};
-
-
#endif /* PERFORMANCE_EXPECTED_H_ */
diff --git a/platform/mocker/include/power_domain_common.h b/platform/mocker/mocker/include/power_domain_common.h
similarity index 100%
rename from platform/mocker/include/power_domain_common.h
rename to platform/mocker/mocker/include/power_domain_common.h
diff --git a/platform/mocker/include/power_domain_protocol.h b/platform/mocker/mocker/include/power_domain_protocol.h
similarity index 100%
rename from platform/mocker/include/power_domain_protocol.h
rename to platform/mocker/mocker/include/power_domain_protocol.h
diff --git a/platform/mocker/include/protocol_common.h b/platform/mocker/mocker/include/protocol_common.h
similarity index 87%
rename from platform/mocker/include/protocol_common.h
rename to platform/mocker/mocker/include/protocol_common.h
index f2581724c30c53cb1fb7bbe2a78b9281caaaf4cc..2a293263d3c42806ee0f2dab4342eecb8930b6ad 100644
--- a/platform/mocker/include/protocol_common.h
+++ b/platform/mocker/mocker/include/protocol_common.h
@@ -32,19 +32,6 @@
#define SCMI_NAME_STR_SIZE 16
#define NUM_ELEMS(x) (sizeof(x) / sizeof((x)[0]))
-enum BITS_HEADER {
- RESERVED_LOW = 28,
- RESERVED_HIGH = 31,
- TOKEN_LOW = 18,
- TOKEN_HIGH = 27,
- PROTOCOL_ID_LOW = 10,
- PROTOCOL_ID_HIGH = 17,
- MESSAGE_TYPE_LOW = 8,
- MESSAGE_TYPE_HIGH = 9,
- MESSAGE_ID_LOW = 0,
- MESSAGE_ID_HIGH = 7
-};
-
/*
* These macros are used to compute the offset values of return and parameters
* fields.
diff --git a/platform/mocker/mocker/include/reset_common.h b/platform/mocker/mocker/include/reset_common.h
new file mode 100644
index 0000000000000000000000000000000000000000..5cd734f4807b6a2398cad200e71d6c33ab6053fb
--- /dev/null
+++ b/platform/mocker/mocker/include/reset_common.h
@@ -0,0 +1,99 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifndef RESET_COMMON_H_
+#define RESET_COMMON_H_
+
+#include
+
+/* Structure for reset protocol version*/
+struct arm_scmi_reset_protocol_version {
+ struct {
+ uint32_t version;
+ } returns;
+};
+
+/* Structure for reset protocol attributes*/
+struct arm_scmi_reset_protocol_attributes {
+ struct {
+ uint32_t attributes;
+ } returns;
+ /* all the enums must be at the end */
+ enum {
+ RESET_NUMBER_DOMAIN_LOW = 0,
+ RESET_NUMBER_DOMAIN_HIGH = 15,
+ } attributes_bits;
+};
+
+/* Structure for reset message attributes*/
+struct arm_scmi_reset_protocol_message_attributes {
+ struct {
+ uint32_t message_id;
+ } parameters;
+ struct {
+ uint32_t attributes;
+ } returns;
+};
+
+/* Structure for reset domain attributes*/
+struct arm_scmi_reset_protocol_domain_attributes {
+ struct {
+ uint32_t domain_id;
+ } parameters;
+ struct {
+ uint32_t attributes;
+ uint32_t latency;
+ char domain_name[SCMI_NAME_STR_SIZE];
+ } returns;
+
+ /* all the enums must be at the end */
+ enum {
+ RESET_ASYNC_SUPPORT_BIT = 31,
+ RESET_NOTIFY_SUPPORT_BIT = 30
+ } attributes_bits;
+};
+
+/* Structure for reset command*/
+struct arm_scmi_reset_protocol_reset {
+ struct {
+ uint32_t domain_id;
+ uint32_t flags;
+ uint32_t reset_state;
+ } parameters;
+
+ /* all the enums must be at the end */
+ enum {
+ RESET_FLAG_ASYNC_RESET_BIT = 2,
+ RESET_FLAG_EXPLICIT_SIGNAL_BIT = 1,
+ RESET_FLAG_AUTONOMOUS_RESET_BIT = 0
+ } flags_bits;
+};
+
+/* Structure for notify enable command*/
+struct arm_scmi_reset_protocol_notify_enable {
+ struct {
+ uint32_t domain_id;
+ uint32_t notify_enable;
+ } parameters;
+
+ /* all the enums must be at the end */
+ enum {
+ RESET_NOTIFY_ENABLE_BIT = 0
+ } notify_en_bits;
+};
+
+#endif /* RESET_COMMON_H_ */
diff --git a/platform/mocker/mocker/include/reset_protocol.h b/platform/mocker/mocker/include/reset_protocol.h
new file mode 100644
index 0000000000000000000000000000000000000000..fb6445430f3356135ad771d00318deed56e3969f
--- /dev/null
+++ b/platform/mocker/mocker/include/reset_protocol.h
@@ -0,0 +1,84 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifndef RESET_PROTOCOL_H_
+#define RESET_PROTOCOL_H_
+
+#include
+#include
+
+#define RESET_VERSION 0x00020000
+
+#define RESET_PROTO_ID 0x16
+#define RESET_PROTO_VER_MSG_ID 0x0
+#define RESET_PROTO_ATTRIB_MSG_ID 0x1
+#define RESET_PROTO_MSG_ATTRIB_MSG_ID 0x2
+#define RESET_PROTO_DOMAIN_ATTRIB_MSG_ID 0x3
+#define RESET_PROTO_RESET_MSG_ID 0x4
+#define RESET_PROTO_NOTIFY_MSG_ID 0x5
+
+struct arm_scmi_reset_protocol {
+ /*
+ * This enum is to specify the flag_mask and have to be ensured that
+ * it is in the same order as the below structure elements after
+ * flags_mask member.
+ */
+ enum {
+ RESET_PROTOCOL_VERSION = 1,
+ RESET_NUMBER_DOMAINS,
+ RESET_ASYNCHRONOUS_RESET_SUPPORTED,
+ RESET_NOTIFY_SUPPORTED,
+ RESET_LATENCY,
+ RESET_DOMAIN_NAME
+ } FLAGS;
+ /*
+ * The expectation is that there is no more
+ * than 32 elements specified via this expected results data structure.
+ * This mask is used to indicate which of the structure members hold valid
+ * data.
+ */
+ uint32_t flags_mask;
+ uint32_t protocol_version;
+
+ uint32_t number_domains;
+
+ /*
+ * This should have the Asynchronous reset support in this platform
+ * bounded by the number of domains.
+ */
+ uint32_t *asynchronous_reset_supported;
+
+ /*
+ * This should have the reset notify support in this platform
+ * bounded by the number of domains.
+ */
+ uint32_t *reset_notify_supported;
+
+ /*
+ * Maximum time (in microseconds) required for the reset to
+ * take effect on the given domain.
+ */
+ uint32_t *reset_latency;
+
+ /*
+ * This should have the names of the domains in this platform bounded by the
+ * number of domains descriptors.
+ */
+ char **reset_domain_name;
+};
+
+#endif /* RESET_PROTOCOL_H_ */
diff --git a/platform/mocker/include/sensor_common.h b/platform/mocker/mocker/include/sensor_common.h
similarity index 98%
rename from platform/mocker/include/sensor_common.h
rename to platform/mocker/mocker/include/sensor_common.h
index 7f8b982c62153e2269a0227e368f427aa33434a2..4a2f0f53ad4beb5eeba7ee917494ee12c936f3d0 100644
--- a/platform/mocker/include/sensor_common.h
+++ b/platform/mocker/mocker/include/sensor_common.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/platform/mocker/include/sensor_protocol.h b/platform/mocker/mocker/include/sensor_protocol.h
similarity index 98%
rename from platform/mocker/include/sensor_protocol.h
rename to platform/mocker/mocker/include/sensor_protocol.h
index ca5f1d696fe7ffb650e7cf4749eee2dfa4fe389f..fcc1ae32ffbd1ff57c6975c4de77af432089fd22 100644
--- a/platform/mocker/include/sensor_protocol.h
+++ b/platform/mocker/mocker/include/sensor_protocol.h
@@ -18,6 +18,9 @@
#ifndef SENSOR_PROTOCOL_H_
#define SENSOR_PROTOCOL_H_
+#include
+#include
+
#define SENSOR_VERSION 0x00010000
#define SNSR_PROTO_ID 0x15
diff --git a/platform/mocker/include/system_power_common.h b/platform/mocker/mocker/include/system_power_common.h
similarity index 83%
rename from platform/mocker/include/system_power_common.h
rename to platform/mocker/mocker/include/system_power_common.h
index 7a6682a1cd2b4cc0de73bde39875b36b7f7a7e8d..8bf02753b86ec97ff3ddcefd505028aa27a83878 100644
--- a/platform/mocker/include/system_power_common.h
+++ b/platform/mocker/mocker/include/system_power_common.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -65,4 +65,14 @@ struct arm_scmi_system_power_state_set {
} system_power_request_flags;
};
+struct arm_scmi_system_power_state_set_notify {
+ struct {
+ uint32_t notify_enable;
+ } parameters;
+ enum {
+ SYSTEM_POWER_SET_NOTIFY_ENABLED=0,
+ SYSTEM_POWER_SET_NOTIFY_RESERVED_LOW=1,
+ SYSTEM_POWER_SET_NOTIFY_RESERVED_HIGH=31,
+ } notify_sys_pwr_set_enable_bits;
+};
#endif /* SYSTEM_POWER_COMMON_H_ */
diff --git a/platform/mocker/include/system_power_protocol.h b/platform/mocker/mocker/include/system_power_protocol.h
similarity index 100%
rename from platform/mocker/include/system_power_protocol.h
rename to platform/mocker/mocker/include/system_power_protocol.h
diff --git a/platform/mocker/mocker/transport_base.c b/platform/mocker/mocker/transport_base.c
new file mode 100644
index 0000000000000000000000000000000000000000..f9e0a41c9e60c0a42e124938933dca2acf1e0ea4
--- /dev/null
+++ b/platform/mocker/mocker/transport_base.c
@@ -0,0 +1,355 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include
+#include
+#include
+
+struct arm_scmi_base_protocol base_protocol;
+#define SCMI_AGENT_ID_MAX 0xFF
+#define TRUSTED_AGENT 1
+
+void fill_base_protocol()
+{
+ base_protocol.protocol_version = BASE_VERSION;
+ base_protocol.num_protocols_implemented = NUM_ELEMS(supported_protocols);
+ sprintf(base_protocol.vendor_identifier, "%s", vendor_name);
+ sprintf(base_protocol.subvendor_identifier, "%s", subvendor_name);
+ base_protocol.implementation_version = implementation_version;
+ base_protocol.supported_protocols = (uint32_t *)supported_protocols;
+ /* Setting of base protocol optional cmd support */
+ base_protocol.notify_error_cmd_supported = true;
+ base_protocol.subvendor_cmd_supported = true;
+ base_protocol.discover_agent_cmd_supported = true;
+ base_protocol.device_permissions_cmd_supported = true;
+ base_protocol.protocol_permissions_cmd_supported = true;
+ base_protocol.reset_agent_config_cmd_supported = true;
+ base_protocol.num_agents = NUM_ELEMS(agents);
+}
+
+uint32_t get_unsupported_protocol()
+{
+ return supported_protocols[NUM_ELEMS(supported_protocols) - 1] + 1;
+}
+
+static char* devices[] =
+{
+ "DEVICE 1", "DEVICE 2"
+};
+
+static struct device_access_info agent1_device_access[] =
+{
+ {"DEVICE_0", true, 0},
+ {"DEVICE_1", true, 1}
+};
+
+static struct device_protocol_access_info agent_protocol_access[] =
+{
+ {POWER_DOMAIN_PROTOCOL_ID, true},
+};
+
+char *agent_name_get(uint32_t agent_id)
+{
+ if (agent_id == 0)
+ return agents[0];
+ if (agent_id > NUM_ELEMS(agents))
+ return NULL;
+ return agents[agent_id - 1];
+}
+
+uint32_t agent_get_accessible_device(uint32_t agent_id)
+{
+ return agent1_device_access[0].device_id;
+}
+
+bool device_access_permitted (void)
+{
+ return agent1_device_access[0].device_access;
+}
+
+bool protocol_access_permitted (uint32_t protocol_id)
+{
+ int32_t i;
+
+ for(i = 0; i < NUM_ELEMS(agent_protocol_access); i++) {
+ if(agent_protocol_access[i].protocol_id == protocol_id)
+ return agent_protocol_access[i].protocol_access;
+ }
+ return false;
+}
+
+uint32_t agent_get_inaccessible_device(uint32_t agent_id)
+{
+ return agent1_device_access[NUM_ELEMS(agent1_device_access)].device_id + 1;
+
+}
+
+uint32_t device_get_accessible_protocol(uint32_t device_id)
+{
+ return POWER_DOMAIN_PROTOCOL_ID;
+}
+
+uint32_t check_trusted_agent(uint32_t agent_id)
+{
+ return TRUSTED_AGENT;
+}
+
+void base_send_message(uint32_t message_id, uint32_t parameter_count,
+ const uint32_t *parameters, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values)
+{
+ uint32_t parameter_idx, return_idx, i;
+ uint32_t agent_id, device_id, flags, command_id;
+
+ switch (message_id)
+ {
+ case BASE_PROTO_VERSION_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_idx = OFFSET_RET(struct arm_scmi_base_protocol_version, version);
+ return_values[return_idx] =
+ base_protocol.protocol_version;
+ break;
+ case BASE_PROTO_ATTR_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_idx = OFFSET_RET(struct arm_scmi_base_protocol_attributes, attributes);
+ return_values[return_idx] = (base_protocol.num_agents << 8) +
+ base_protocol.num_protocols_implemented;
+ break;
+ case BASE_PROTO_MSG_ATTR_MSG_ID:
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_base_protocol_message_attributes, message_id);
+ if(parameters[parameter_idx] > BASE_RESET_AGENT_CONFIGURATION_MSG_ID) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ }
+ else if (parameters[parameter_idx] > BASE_DISC_AGENT_MSG_ID)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ switch (parameters[parameter_idx])
+ {
+ case 0x8:
+ if (base_protocol.notify_error_cmd_supported == true)
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ case 0x9:
+ if (base_protocol.device_permissions_cmd_supported == true)
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ case 0xA:
+ if (base_protocol.protocol_permissions_cmd_supported == true)
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ case 0xB:
+ if (base_protocol.reset_agent_config_cmd_supported == true)
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ case 0x7:
+ if (base_protocol.discover_agent_cmd_supported == true)
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ default:
+ *status = SCMI_STATUS_SUCCESS;
+ }
+ }
+ else {
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_idx = OFFSET_RET(struct arm_scmi_base_protocol_message_attributes,
+ attributes);
+ return_values[return_idx] = 0x0;
+ }
+ break;
+ case BASE_DISC_VENDOR_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ sprintf((char *)return_values, "%s", base_protocol.vendor_identifier);
+ *return_values_count = strlen((const char*)return_values);
+ break;
+ case BASE_DISC_SUBVENDOR_MSG_ID:
+ if(base_protocol.subvendor_cmd_supported == false)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ sprintf((char *)return_values, "%s", base_protocol.subvendor_identifier);
+ *return_values_count = strlen((const char*)return_values);
+ break;
+ case BASE_DISC_IMPLEMENTATION_VERSION_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_idx = OFFSET_RET(struct arm_scmi_base_discover_implementation_version,
+ implementation_version);
+ return_values[return_idx] = base_protocol.implementation_version;
+ break;
+ case BASE_DISC_PROTO_LIST_MSG_ID:
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_base_discover_list_protocols, skip);
+ if (parameters[parameter_idx] > base_protocol.num_protocols_implemented) {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ } else {
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 2 + ((base_protocol.num_protocols_implemented -
+ parameters[parameter_idx]) + 4)/4;
+ return_values[0] = base_protocol.num_protocols_implemented -
+ parameters[parameter_idx];
+ memcpy(&return_values[1], &base_protocol.supported_protocols
+ [parameters[parameter_idx]],
+ (base_protocol.num_protocols_implemented -
+ parameters[parameter_idx]));
+ }
+ break;
+ case BASE_DISC_AGENT_MSG_ID:
+ if(base_protocol.discover_agent_cmd_supported == false)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_base_discover_agent, agent_id);
+ if ((parameters[parameter_idx] != 0xFFFFFFFF) &&
+ (parameters[parameter_idx] > base_protocol.num_agents))
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ }
+ else
+ {
+ *status = SCMI_STATUS_SUCCESS;
+ if (parameters[parameter_idx] == 0xFFFFFFFF)
+ {
+ return_values[0] = 0;
+ sprintf((char *)&return_values[1], "%s", agent_name_get(0));
+ }
+ else
+ {
+ return_values[0] = parameters[parameter_idx];
+ sprintf((char *)&return_values[1], "%s",
+ (parameters[parameter_idx] == 0 ?
+ "platform_mock" : agent_name_get(parameters[parameter_idx])));
+ }
+ *return_values_count = strlen((const char*)return_values) + 1;
+ }
+ break;
+ case BASE_NOTIFY_ERRORS_MSG_ID:
+ if (base_protocol.notify_error_cmd_supported == false)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_base_notify_error, notify_enable);
+ if (parameters[parameter_idx] > 0x1) {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ }
+ else
+ {
+ base_protocol.notify_error_cmd_supported = (bool)parameters[parameter_idx];
+ *status = SCMI_STATUS_SUCCESS;
+ }
+ break;
+ case BASE_SET_DEVICE_PERMISSIONS_MSG_ID:
+ if (base_protocol.device_permissions_cmd_supported == false) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ parameter_idx = OFFSET_PARAM(struct arm_scmi_base_set_device_permissions,
+ agent_id);
+ agent_id = parameters[parameter_idx];
+ parameter_idx = OFFSET_PARAM(struct arm_scmi_base_set_device_permissions,
+ device_id);
+ device_id = parameters[parameter_idx];
+ parameter_idx = OFFSET_PARAM(struct arm_scmi_base_set_device_permissions,
+ flags);
+ flags = parameters[parameter_idx];
+ if (flags > 0x1) {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ if ((agent_id > base_protocol.num_agents) || (device_id > NUM_ELEMS(devices))) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+
+ if (device_id > NUM_ELEMS(agent1_device_access)) {
+ *status = SCMI_STATUS_DENIED;
+ break;
+ }
+ agent1_device_access[device_id].device_access = flags;
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ case BASE_SET_PROTOCOL_PERMISSIONS_MSG_ID:
+ if (base_protocol.protocol_permissions_cmd_supported == false)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ agent_id = OFFSET_PARAM(struct arm_scmi_base_set_protocol_permissions,
+ agent_id);
+ device_id = OFFSET_PARAM(struct arm_scmi_base_set_protocol_permissions,
+ device_id);
+ flags = OFFSET_PARAM(struct arm_scmi_base_set_protocol_permissions, flags);
+ command_id = OFFSET_PARAM(struct arm_scmi_base_set_protocol_permissions,
+ command_id);
+ if (parameters[command_id] == BASE_PROTO_ID) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ if ((parameters[agent_id] > base_protocol.num_agents) ||
+ (parameters[device_id] > NUM_ELEMS(devices)) ||
+ (parameters[command_id] >= get_unsupported_protocol())) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ if (parameters[flags] > 0x1) {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ for(i = 0; i < NUM_ELEMS(agent_protocol_access); i++) {
+ if(agent_protocol_access[i].protocol_id == parameters[command_id])
+ agent_protocol_access[i].protocol_access = parameters[flags];
+ }
+ break;
+ case BASE_RESET_AGENT_CONFIGURATION_MSG_ID:
+ if (base_protocol.reset_agent_config_cmd_supported == false)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ agent_id = OFFSET_PARAM(struct arm_scmi_base_reset_agent_configuration,
+ agent_id);
+ flags = OFFSET_PARAM(struct arm_scmi_base_reset_agent_configuration, flags);
+ if (parameters[agent_id] > base_protocol.num_agents) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ if (parameters[flags] > 0x1) {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ if(parameters[flags] == 1) {
+ agent1_device_access[0].device_access = true;
+ for(i = 0; i < NUM_ELEMS(agent_protocol_access); i++) {
+ agent_protocol_access[i].protocol_access = true;
+ }
+ }
+ break;
+ default:
+ *status = SCMI_STATUS_NOT_FOUND;
+ }
+}
diff --git a/platform/mocker/mocker/transport_clock.c b/platform/mocker/mocker/transport_clock.c
new file mode 100644
index 0000000000000000000000000000000000000000..b3986512a54f9c024cbb3f24ba64bae6cde1a6bc
--- /dev/null
+++ b/platform/mocker/mocker/transport_clock.c
@@ -0,0 +1,190 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include
+#include
+#include
+
+struct arm_scmi_clock_protocol clock_protocol;
+static unsigned int clock_status[MAX_NUM_CLOCK];
+struct arm_scmi_clock_rate clock_rate[MAX_NUM_CLOCK];
+
+void fill_clock_protocol()
+{
+ clock_protocol.protocol_version = CLOCK_VERSION;
+ clock_protocol.number_clocks = num_clocks;
+ clock_protocol.max_num_pending_async_rate_chg_supported =
+ max_num_pending_async_rate_chg_supported;
+ clock_protocol.num_rates = num_of_clock_rates;
+}
+
+void clock_send_message(uint32_t message_id, uint32_t parameter_count,
+ const uint32_t *parameters, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values)
+{
+
+ uint32_t parameter_idx, return_idx, clock_id;
+ char * str;
+ int i, j;
+
+ switch(message_id)
+ {
+ case CLK_PROTO_VER_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[0] = clock_protocol.protocol_version;
+ break;
+ case CLK_PROTO_ATTRIB_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_idx = OFFSET_RET(struct arm_scmi_clock_protocol_attributes,
+ attributes);
+ return_values[return_idx] = (clock_protocol.number_clocks << CLK_NUMBER_CLOCKS_LOW) |
+ (clock_protocol.max_num_pending_async_rate_chg_supported <<
+ CLK_MAX_NUM_PENDING_ASYNC_RATE_CHGS_SPRT_LOW);
+ break;
+ case CLK_PROTO_MSG_ATTRIB_MSG_ID:
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_clock_protocol_message_attributes,
+ message_id);
+ if(parameters[parameter_idx] > CLK_CONFIG_SET_MSG_ID)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ return;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[OFFSET_RET(
+ struct arm_scmi_clock_protocol_message_attributes,
+ attributes)] = 0x0;
+ break;
+ case CLK_ATTRIB_MSG_ID:
+ parameter_idx = OFFSET_PARAM(struct arm_scmi_clock_attributes,
+ clock_id);
+ clock_id = parameters[parameter_idx];
+ if (clock_id >= clock_protocol.number_clocks) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 6;
+ return_idx = OFFSET_RET(struct arm_scmi_clock_attributes, attributes);
+ return_values[return_idx] = clock_status[clock_id] & 0x1;
+ str = (char *)
+ (&return_values[OFFSET_RET(
+ struct arm_scmi_clock_attributes,
+ clock_name)]);
+ sprintf(str, "CLOCK_%d", parameters[0]);
+ break;
+ case CLK_DESC_RATE_MSG_ID:
+ clock_id = parameters[OFFSET_PARAM(struct arm_scmi_clock_describe_rates,
+ clock_id)];
+ if (clock_id >= clock_protocol.number_clocks) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ if (parameters[OFFSET_PARAM(struct arm_scmi_clock_describe_rates,
+ rate_index)] >= clock_protocol.num_rates[clock_id])
+ {
+ *status = SCMI_STATUS_OUT_OF_RANGE;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ j = 100;
+ return_values[OFFSET_RET(
+ struct arm_scmi_clock_describe_rates,
+ num_rates_flags)] = (clock_protocol.num_rates[clock_id] <<
+ CLK_DESC_RATE_NUM_RATES_RETURNED_LOW);
+ for (i = 0; i < clock_protocol.num_rates[clock_id]; ++i) {
+ return_values[OFFSET_RET(
+ struct arm_scmi_clock_describe_rates,
+ rates) + 2 * i] = j * (i + 1);
+ return_values[OFFSET_RET(
+ struct arm_scmi_clock_describe_rates,
+ rates) + 2 * i + 1] = j * (i + 1) + 50;
+ }
+ break;
+ case CLK_RATE_SET_MSG_ID:
+ clock_id = parameters[OFFSET_PARAM(struct arm_scmi_clock_rate_set, clock_id)];
+ if (clock_id >= clock_protocol.number_clocks) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ j = 100;
+ for (i = 0; i < clock_protocol.num_rates[clock_id]; ++i) {
+ if ((parameters[OFFSET_PARAM(struct arm_scmi_clock_rate_set, rate)] ==
+ (j * (i + 1))) &&
+ (parameters[OFFSET_PARAM(struct arm_scmi_clock_rate_set, rate) + 1] ==
+ (j * (i + 1) + 50)))
+ break;
+ }
+ if(i == clock_protocol.num_rates[clock_id]) {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ clock_rate[clock_id].lower = parameters[OFFSET_PARAM(
+ struct arm_scmi_clock_rate_set, rate)];
+ clock_rate[clock_id].upper = parameters[OFFSET_PARAM(
+ struct arm_scmi_clock_rate_set, rate) + 1];
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ case CLK_RATE_GET_MSG_ID:
+ clock_id = parameters[OFFSET_PARAM(struct arm_scmi_clock_rate_get, clock_id)];
+ if (clock_id >= clock_protocol.number_clocks) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ if (clock_rate[clock_id].lower == 0) {
+ j = 100;
+ return_values[OFFSET_RET(
+ struct arm_scmi_clock_rate_get,
+ rate)] = j * (clock_id + 1);
+ return_values[OFFSET_RET(
+ struct arm_scmi_clock_rate_get,
+ rate) + 1] = j * (clock_id + 1) + 50;
+ }
+ else {
+ return_values[OFFSET_RET(
+ struct arm_scmi_clock_rate_get,
+ rate)] = clock_rate[clock_id].lower;
+ return_values[OFFSET_RET(
+ struct arm_scmi_clock_rate_get,
+ rate) + 1] = clock_rate[clock_id].upper;
+ }
+ break;
+ case CLK_CONFIG_SET_MSG_ID:
+ parameter_idx = OFFSET_PARAM(struct arm_scmi_clock_config_set, clock_id);
+ clock_id = parameters[parameter_idx];
+ if (clock_id >= clock_protocol.number_clocks)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ parameter_idx = OFFSET_PARAM(struct arm_scmi_clock_config_set, attributes);
+ if (parameters[parameter_idx] > 1)
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ clock_status[clock_id] = parameters[parameter_idx];
+ break;
+ default:
+ *status = SCMI_STATUS_NOT_FOUND;
+ }
+}
diff --git a/platform/mocker/mocker/transport_performance.c b/platform/mocker/mocker/transport_performance.c
new file mode 100644
index 0000000000000000000000000000000000000000..5303af01ff046d3dbbea2ff6fc1abaeb120f5622
--- /dev/null
+++ b/platform/mocker/mocker/transport_performance.c
@@ -0,0 +1,406 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include
+#include
+#include
+
+struct arm_scmi_performance_protocol performance_protocol;
+
+static unsigned int perf_level_max_limit[MAX_PERFORMANCE_DOMAIN_COUNT];
+static unsigned int perf_level_min_limit[MAX_PERFORMANCE_DOMAIN_COUNT];
+static unsigned int perf_level_current[MAX_PERFORMANCE_DOMAIN_COUNT];
+
+void fill_performance_protocol()
+{
+ performance_protocol.protocol_version = PERFORMANCE_VERSION;
+ performance_protocol.num_performance_domains = num_performance_domains;
+ performance_protocol.statistics_address_low = statistics_address_low_perf;
+ performance_protocol.statistics_length = statistics_address_len_perf;
+ performance_protocol.statistics_address_high =
+ performance_protocol.statistics_address_low + performance_protocol.statistics_length;
+ performance_protocol.set_limit_capable = set_limit_capable;
+ performance_protocol.set_performance_level_capable = set_performance_level_capable;
+ performance_protocol.performance_level_notification_support =
+ performance_level_notification_support;
+ performance_protocol.performance_limit_notification_support =
+ performance_limit_notification_support;
+ performance_protocol.performance_rate_limit = performance_rate_limit;
+ performance_protocol.performance_sustained_freq = performance_sustained_freq;
+ performance_protocol.performance_sustained_level = performance_sustained_level;
+ performance_protocol.performance_domain_names = performance_domain_names;
+ performance_protocol.num_performance_levels = perf_num_performance_levels;
+ performance_protocol.performance_level_power_cost = perf_performance_level_power_costs;
+ performance_protocol.performance_level_value = perf_performance_level_values;
+ performance_protocol.performance_level_worst_latency = perf_performance_level_worst_latency;
+ performance_protocol.performance_domain_fast_channel_support = perf_domain_fast_ch_support;
+ performance_protocol.performance_message_fast_channel_support = perf_msg_fast_ch_support;
+ performance_protocol.door_bell_support = perf_performance_fast_ch_doorbell_support;
+ performance_protocol.door_bell_data_width = perf_performance_fast_ch_doorbell_data_width;
+ performance_protocol.fast_channel_rate_limit = perf_performance_fast_chan_rate_limit;
+ performance_protocol.fast_chan_addr_low = perf_performance_fast_chan_addr_low;
+ performance_protocol.fast_chan_addr_high = perf_performance_fast_chan_addr_high;
+ performance_protocol.fast_chan_size = perf_performance_fast_chan_size;
+ performance_protocol.doorbell_addr_low = perf_performance_fast_chan_doorbell_addr_low;
+ performance_protocol.doorbell_addr_high = perf_performance_fast_chan_doorbell_addr_high;
+ performance_protocol.doorbell_set_mask_low =
+ perf_performance_fast_chan_doorbell_set_mask_low;
+ performance_protocol.doorbell_set_mask_high =
+ perf_performance_fast_chan_doorbell_set_mask_high;
+ performance_protocol.doorbell_preserve_mask_low =
+ perf_performance_fast_chan_doorbell_preserve_mask_low;
+ performance_protocol.doorbell_preserve_mask_high =
+ perf_performance_fast_chan_doorbell_preserve_mask_high;
+}
+
+void performance_send_message(uint32_t message_id, uint32_t parameter_count,
+ const uint32_t *parameters, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values)
+{
+
+ uint32_t parameter_idx, return_idx;
+ char * str;
+ int i, domain_id, messageid;
+
+ switch(message_id)
+ {
+ case PERF_MGMT_PROTO_VER_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[0] = performance_protocol.protocol_version;
+ break;
+ case PERF_MGMT_PROTO_ATTRIB_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+
+ return_idx = OFFSET_RET(struct arm_scmi_performance_protocol_attributes,
+ attributes);
+ return_values[return_idx] = (1 << PERFORMANCE_PROT_POWER_VALUES_LOW) +
+ (performance_protocol.num_performance_domains <<
+ PERFORMANCE_PROT_ATTR_NUMBER_DOMAINS_LOW);
+
+ return_idx = OFFSET_RET(struct arm_scmi_performance_protocol_attributes,
+ statistics_address_low);
+ return_values[return_idx] = performance_protocol.statistics_address_low;
+
+ return_idx = OFFSET_RET(struct arm_scmi_performance_protocol_attributes,
+ statistics_address_high);
+ return_values[return_idx] = performance_protocol.statistics_address_high;
+
+ return_idx = OFFSET_RET(struct arm_scmi_performance_protocol_attributes,
+ statistics_len);
+ return_values[return_idx] = performance_protocol.statistics_address_high -
+ performance_protocol.statistics_address_low;
+ *return_values_count = 4;
+ break;
+ case PERF_MGMT_PROTO_MSG_ATTRIB_MSG_ID:
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_performance_protocol_message_attributes, message_id);
+ if(parameters[parameter_idx] > PERF_DESCRIBE_FASTCHANNEL) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ } else {
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[OFFSET_RET(
+ struct arm_scmi_performance_protocol_message_attributes,
+ attributes)] =
+ performance_protocol.
+ performance_message_fast_channel_support
+ [parameters[parameter_idx]]
+ << PERFORMANCE_PROT_MSG_ATTR_FASTCHANNEL_ENABLED;
+ *return_values_count = 1;
+ }
+ break;
+ case PERF_DOMAIN_ATTRIB_MSG_ID:
+ *status = (parameters[OFFSET_PARAM(
+ struct arm_scmi_performance_domain_attributes,
+ domain_id)] >= performance_protocol.num_performance_domains ?
+ SCMI_STATUS_NOT_FOUND: SCMI_STATUS_SUCCESS);
+ domain_id = parameters[OFFSET_PARAM(
+ struct arm_scmi_performance_domain_attributes, domain_id)];
+ return_values[OFFSET_RET(
+ struct arm_scmi_performance_domain_attributes, attributes)] =
+ (performance_protocol.set_limit_capable[domain_id] <<
+ PERFORMANCE_DOMAIN_ATTR_LIMIT_SET) |
+ (performance_protocol.set_performance_level_capable[domain_id] <<
+ PERFORMANCE_DOMAIN_ATTR_LEVEL_SET) |
+ (performance_protocol.performance_limit_notification_support[domain_id] <<
+ PERFORMANCE_DOMAIN_ATTR_LIMIT_NOTIFY) |
+ (performance_protocol.performance_level_notification_support[domain_id] <<
+ PERFORMANCE_DOMAIN_ATTR_LEVEL_NOTIFY) |
+ (performance_protocol.performance_domain_fast_channel_support[domain_id] <<
+ PERFORMANCE_DOMAIN_ATTR_FASTCHANNEL_SUPPORT);
+ return_values[OFFSET_RET(
+ struct arm_scmi_performance_domain_attributes, rate_limit)] =
+ (performance_protocol.performance_rate_limit[domain_id] <<
+ PERFORMANCE_DOMAIN_ATTR_RATE_LIMIT_LOW);
+ return_values[OFFSET_RET(
+ struct arm_scmi_performance_domain_attributes, sustained_perf_level)] =
+ (performance_protocol.performance_sustained_level[domain_id]);
+ return_values[OFFSET_RET(
+ struct arm_scmi_performance_domain_attributes,sustained_freq)] =
+ (performance_protocol.performance_sustained_freq[domain_id]);
+ str = (char *)
+ (&return_values[OFFSET_RET(struct arm_scmi_performance_domain_attributes, name)]);
+ sprintf(str, "Domain_%d", domain_id);
+ *return_values_count = 5;
+ break;
+ case PERF_DESC_LVL_MSG_ID:
+ domain_id = parameters[OFFSET_PARAM(struct arm_scmi_performance_describe_levels,domain_id)];
+ if(domain_id >= performance_protocol.num_performance_domains)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ return;
+ }
+ if(parameters[OFFSET_PARAM(
+ struct arm_scmi_performance_describe_levels,level_index)] >=
+ performance_protocol.num_performance_levels[domain_id])
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ return;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ return_values[OFFSET_RET(struct arm_scmi_performance_describe_levels,num_levels)] =
+ performance_protocol.num_performance_levels[domain_id] << PERFORMANCE_DESC_LEVELS_NUM_LEVELS_LOW;
+ *return_values_count = 1;
+ for(i = 0; i < performance_protocol.num_performance_levels[domain_id]; i++)
+ {
+ return_values[OFFSET_RET(struct arm_scmi_performance_describe_levels,perf_levels)+i*3] =
+ performance_protocol.performance_level_value[domain_id][i];
+ return_values[OFFSET_RET(struct arm_scmi_performance_describe_levels,perf_levels)+i*3+1] =
+ performance_protocol.performance_level_power_cost[domain_id][i];
+ return_values[OFFSET_RET(struct arm_scmi_performance_describe_levels,perf_levels)+i*3+2] =
+ performance_protocol.performance_level_worst_latency[domain_id][i];
+ *return_values_count += 3;
+ }
+ break;
+ case PERF_LIMIT_SET_MSG_ID:
+ domain_id = parameters[OFFSET_PARAM(struct arm_scmi_performance_limits_set,domain_id)];
+ if(domain_id >= performance_protocol.num_performance_domains)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ return;
+ }
+ if(performance_protocol.set_limit_capable[domain_id] == 0)
+ {
+ *status = SCMI_STATUS_DENIED;
+ return;
+ }
+ if((parameters[OFFSET_PARAM(struct arm_scmi_performance_limits_set,range_max)] >
+ performance_protocol.performance_level_value[domain_id]
+ [performance_protocol.num_performance_levels[domain_id] - 1]) ||
+ (parameters[OFFSET_PARAM(struct arm_scmi_performance_limits_set,range_min)] <
+ performance_protocol.performance_level_value[domain_id][0]))
+ {
+ *status = SCMI_STATUS_OUT_OF_RANGE;
+ return;
+ }
+ if((parameters[OFFSET_PARAM(struct arm_scmi_performance_limits_set,range_max)]) <
+ (parameters[OFFSET_PARAM(struct arm_scmi_performance_limits_set,range_min)]))
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ return;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ perf_level_max_limit[domain_id] =
+ parameters[OFFSET_PARAM(struct arm_scmi_performance_limits_set,range_max)];
+ perf_level_min_limit[domain_id] =
+ parameters[OFFSET_PARAM(struct arm_scmi_performance_limits_set,range_min)] ;
+ break;
+ case PERF_LIMIT_GET_MSG_ID:
+ domain_id = parameters[OFFSET_PARAM(struct arm_scmi_performance_limits_get,domain_id)];
+ if(domain_id >= performance_protocol.num_performance_domains)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ return;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ return_values[OFFSET_RET(struct arm_scmi_performance_limits_get,range_max)] =
+ perf_level_max_limit[domain_id];
+ return_values[OFFSET_RET(struct arm_scmi_performance_limits_get,range_min)] =
+ perf_level_min_limit[domain_id];
+ if( return_values[OFFSET_RET(struct arm_scmi_performance_limits_get,range_max)] == 0 &&
+ return_values[OFFSET_RET(struct arm_scmi_performance_limits_get,range_min)] == 0)
+ {
+ return_values[OFFSET_RET(struct arm_scmi_performance_limits_get,range_max)] =
+ performance_protocol.performance_level_value[domain_id]
+ [performance_protocol.num_performance_levels[domain_id] - 1];
+
+ return_values[OFFSET_RET(struct arm_scmi_performance_limits_get,range_min)] =
+ performance_protocol.performance_level_value[domain_id][0];
+ }
+ *return_values_count = 2;
+ break;
+ case PERF_LVL_SET_MSG_ID:
+ domain_id = parameters[OFFSET_PARAM(struct arm_scmi_performance_levels_set,domain_id)];
+ if (domain_id >= performance_protocol.num_performance_domains) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ return;
+ }
+ if(performance_protocol.set_performance_level_capable[domain_id] == 0)
+ {
+ *status = SCMI_STATUS_DENIED;
+ return;
+ }
+ if((perf_level_max_limit[domain_id] <
+ parameters[OFFSET_PARAM(struct arm_scmi_performance_levels_set,performance_level)])||
+ (perf_level_min_limit[domain_id] >
+ parameters[OFFSET_PARAM(struct arm_scmi_performance_levels_set,performance_level)]))
+ {
+ *status = SCMI_STATUS_OUT_OF_RANGE;
+ return;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ perf_level_current[domain_id] =
+ parameters[OFFSET_PARAM(struct arm_scmi_performance_levels_set,performance_level)];
+ break;
+ case PERF_LVL_GET_MSG_ID:
+ domain_id = parameters[OFFSET_PARAM(struct arm_scmi_performance_levels_get,domain_id)];
+ if (domain_id >= performance_protocol.num_performance_domains) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ return;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ if(perf_level_current[domain_id] == 0)
+ return_values[OFFSET_RET(struct arm_scmi_performance_levels_get,performance_level)] =
+ performance_protocol.performance_level_value[domain_id][0];
+ else
+ return_values[OFFSET_RET(struct arm_scmi_performance_levels_get,performance_level)] =
+ perf_level_current[domain_id];
+ *return_values_count = 1;
+ break;
+ case PERF_NOTIFY_LIMIT_MSG_ID :
+ domain_id = parameters[OFFSET_PARAM(struct arm_scmi_performance_notify_limits,domain_id)];
+ if(domain_id >= performance_protocol.num_performance_domains)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ return;
+ }
+ if(performance_protocol.performance_limit_notification_support[domain_id] == 0)
+ {
+ *status = SCMI_STATUS_NOT_SUPPORTED;
+ return;
+ }
+ if((parameters[OFFSET_PARAM(struct arm_scmi_performance_notify_limits,notify_enable)]) >>
+ PERFORMANCE_NOTIFY_LIMIT_RESERVED_LOW) /* Check reserved bits*/
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ return;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ case PERF_NOTIFY_LVL_MSG_ID:
+ domain_id = parameters[OFFSET_PARAM(struct arm_scmi_performance_notify_level,domain_id)];
+ if(domain_id >= performance_protocol.num_performance_domains)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ return;
+ }
+ if(performance_protocol.performance_level_notification_support[domain_id] == 0)
+ {
+ *status = SCMI_STATUS_NOT_SUPPORTED;
+ return;
+ }
+ if((parameters[OFFSET_PARAM(struct arm_scmi_performance_notify_level,notify_enable)]) >>
+ PERFORMANCE_NOTIFY_LEVEL_RESERVED_LOW) /* Check reserved bits*/
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ return;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ case PERF_DESCRIBE_FASTCHANNEL:
+ parameter_idx = OFFSET_PARAM(struct arm_scmi_performance_describe_fast_channel, domain_id);
+ if(parameters[parameter_idx] > performance_protocol.num_performance_domains) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ return;
+ }
+ domain_id = parameters[parameter_idx];
+ parameter_idx = OFFSET_PARAM(struct arm_scmi_performance_describe_fast_channel, message_id);
+ if(parameters[parameter_idx] > PERF_DESCRIBE_FASTCHANNEL) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ return;
+ }
+ messageid = parameters[parameter_idx];
+ if(performance_protocol.performance_domain_fast_channel_support[domain_id] == 0)
+ {
+ *status = SCMI_STATUS_NOT_SUPPORTED;
+ return;
+ }
+ if(performance_protocol.performance_message_fast_channel_support[messageid] == 0)
+ {
+ *status = SCMI_STATUS_NOT_SUPPORTED;
+ return;
+ }
+ if(messageid < PERF_LIMIT_SET_MSG_ID || messageid > PERF_LVL_GET_MSG_ID)
+ {
+ *status = SCMI_STATUS_NOT_SUPPORTED;
+ return;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ return_values[OFFSET_RET(struct arm_scmi_performance_describe_fast_channel,attributes)] =
+ (((performance_protocol.door_bell_support[domain_id]
+ [messageid - PERF_LIMIT_SET_MSG_ID])
+ << PERFORMANCE_DESCRIBE_FAST_CH_ATTR_DOORBELL_SUPPORT) +
+ ((performance_protocol.door_bell_data_width[domain_id]
+ [messageid - PERF_LIMIT_SET_MSG_ID])
+ << PERFORMANCE_DESCRIBE_FAST_CH_ATTR_DOORBELL_DATA_WIDTH_LOW));
+ return_values[OFFSET_RET(struct arm_scmi_performance_describe_fast_channel,rate_limit)] =
+ performance_protocol.fast_channel_rate_limit[domain_id]
+ [messageid - PERF_LIMIT_SET_MSG_ID];
+ return_values[OFFSET_RET(
+ struct arm_scmi_performance_describe_fast_channel,chan_addr_low)] =
+ performance_protocol.fast_chan_addr_low[domain_id]
+ [messageid - PERF_LIMIT_SET_MSG_ID];
+ return_values[OFFSET_RET(
+ struct arm_scmi_performance_describe_fast_channel,chan_addr_high)] =
+ performance_protocol.fast_chan_addr_high[domain_id]
+ [messageid - PERF_LIMIT_SET_MSG_ID];
+ return_values[OFFSET_RET(
+ struct arm_scmi_performance_describe_fast_channel,chan_size)] =
+ performance_protocol.fast_chan_size[domain_id]
+ [messageid - PERF_LIMIT_SET_MSG_ID];
+ return_values[OFFSET_RET(
+ struct arm_scmi_performance_describe_fast_channel,doorbell_addr_low)] =
+ performance_protocol.doorbell_addr_low[domain_id]
+ [messageid - PERF_LIMIT_SET_MSG_ID];
+ return_values[OFFSET_RET(
+ struct arm_scmi_performance_describe_fast_channel,doorbell_addr_high)] =
+ performance_protocol.doorbell_addr_high[domain_id]
+ [messageid - PERF_LIMIT_SET_MSG_ID];
+ return_values[OFFSET_RET(
+ struct arm_scmi_performance_describe_fast_channel,doorbell_set_mask_low)] =
+ performance_protocol.doorbell_set_mask_low[domain_id]
+ [messageid - PERF_LIMIT_SET_MSG_ID];
+ return_values[OFFSET_RET(
+ struct arm_scmi_performance_describe_fast_channel,doorbell_set_mask_high)] =
+ performance_protocol.doorbell_set_mask_high[domain_id]
+ [messageid - PERF_LIMIT_SET_MSG_ID];
+ return_values[OFFSET_RET(
+ struct arm_scmi_performance_describe_fast_channel,doorbell_preserve_mask_low)] =
+ performance_protocol.doorbell_preserve_mask_low[domain_id]
+ [messageid - PERF_LIMIT_SET_MSG_ID];
+ return_values[OFFSET_RET(
+ struct arm_scmi_performance_describe_fast_channel,doorbell_preserve_mask_high)] =
+ performance_protocol.doorbell_preserve_mask_high[domain_id]
+ [messageid - PERF_LIMIT_SET_MSG_ID];
+ *return_values_count = 11;
+ break;
+ default:
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+}
diff --git a/platform/mocker/mocker/transport_power_domain.c b/platform/mocker/mocker/transport_power_domain.c
new file mode 100644
index 0000000000000000000000000000000000000000..50fed9dbcc497dc9a7857ca3b8d97c90b0a5c750
--- /dev/null
+++ b/platform/mocker/mocker/transport_power_domain.c
@@ -0,0 +1,191 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include
+#include
+#include
+
+struct arm_scmi_power_protocol power_protocol;
+extern bool device_access_permitted (void);
+extern bool protocol_access_permitted (uint32_t protocol_id);
+
+void fill_power_protocol()
+{
+ power_protocol.protocol_version = POWER_DOMAIN_VERSION;
+ power_protocol.num_power_domains = num_power_domains;
+ power_protocol.statistics_address_low = statistics_address_low_pow;
+ power_protocol.statistics_length = statistics_address_len_pow;
+ power_protocol.statistics_address_high =
+ power_protocol.statistics_address_low + power_protocol.statistics_length;
+ power_protocol.power_state_notify_cmd_supported = true;
+ power_protocol.power_state_change_requested_notify_cmd_supported = true;
+}
+
+void power_send_message(uint32_t message_id, uint32_t parameter_count,
+ const uint32_t *parameters, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values)
+{
+
+ uint32_t parameter_idx, return_idx;
+ char * str;
+ int num_power_domains = 3;
+ int stats_low = 0x1234, stats_high = stats_low + 0xff;
+
+ if(device_access_permitted() == false ||
+ protocol_access_permitted(POWER_DOMAIN_PROTOCOL_ID) == false) {
+ *status = SCMI_STATUS_DENIED;
+ return;
+ }
+ switch(message_id)
+ {
+ case PWR_PROTO_VER_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[0] = power_protocol.protocol_version;
+ break;
+ case PWR_PROTO_ATTR_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_idx = OFFSET_RET(struct arm_scmi_power_protocol_attributes,
+ attributes);
+ return_values[return_idx] =
+ (num_power_domains << POWER_PROT_ATTR_NUMBER_DOMAINS_LOW);
+ return_idx = OFFSET_RET(struct arm_scmi_power_protocol_attributes,
+ statistics_address_low);
+ return_values[return_idx] = stats_low;
+ return_idx = OFFSET_RET(struct arm_scmi_power_protocol_attributes,
+ statistics_address_high);
+ return_values[return_idx] = stats_high;
+ return_idx = OFFSET_RET(struct arm_scmi_power_protocol_attributes,
+ statistics_len);
+ return_values[return_idx] = stats_high - stats_low;
+ break;
+ case PWR_PROTO_MSG_ATTR_MSG_ID:
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_power_protocol_message_attributes, message_id);
+ if(parameters[parameter_idx] > PWR_STATE_CHANGE_REQUESTED_NOTIFY_MSG_ID) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ } else {
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[OFFSET_RET(
+ struct arm_scmi_power_protocol_message_attributes, attributes)] = 0x0;
+ }
+ break;
+ case PWR_DOMAIN_ATTRIB_MSG_ID:
+ *status = (parameters[OFFSET_PARAM(
+ struct arm_scmi_power_domain_attributes,
+ domain_id)] > num_power_domains ?
+ SCMI_STATUS_NOT_FOUND: SCMI_STATUS_SUCCESS);
+ *return_values_count = 3;
+ if(parameters[OFFSET_PARAM(
+ struct arm_scmi_power_domain_attributes,
+ domain_id)] == 0)
+ {
+ return_values[OFFSET_RET(
+ struct arm_scmi_power_domain_attributes,
+ attributes)] =
+ (1 << POWER_DOMAIN_ATTR_SYNC_LOW) +
+ (1 << POWER_DOMAIN_ATTR_ASYNC_LOW) +
+ (0 << POWER_DOMAIN_ATTR_STATE_NOTIFICATIONS_LOW);
+ }
+ else
+ {
+ return_values[OFFSET_RET(
+ struct arm_scmi_power_domain_attributes,
+ attributes)] =
+ (1 << POWER_DOMAIN_ATTR_SYNC_LOW) +
+ (1 << POWER_DOMAIN_ATTR_ASYNC_LOW) +
+ (1 << POWER_DOMAIN_ATTR_STATE_NOTIFICATIONS_LOW);
+ }
+ str = (char *)
+ (&return_values[OFFSET_RET(
+ struct arm_scmi_power_domain_attributes, name)]);
+ sprintf(str, "Domain_%d", parameters[
+ OFFSET_PARAM(struct arm_scmi_power_domain_attributes,
+ domain_id)]);
+ break;
+ case PWR_STATE_SET_MSG_ID:
+ if ((parameters[OFFSET_PARAM(struct arm_scmi_power_state_set,
+ power_state)] & (1 << POWER_STATE_SET_RESERVED_HIGH)) != 0) {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ if (parameters[OFFSET_PARAM(struct arm_scmi_power_state_set,
+ flags)] > 1) {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ if (parameters[OFFSET_PARAM(struct arm_scmi_power_state_set,
+ domain_id)] >= num_power_domains) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ case PWR_STATE_GET_MSG_ID:
+ if (parameters[OFFSET_PARAM(
+ struct arm_scmi_power_state_get, domain_id)] >=
+ num_power_domains) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[OFFSET_RET(struct arm_scmi_power_state_get,
+ power_state)] = 0xf;
+ break;
+ case PWR_STATE_NOTIFY_MSG_ID:
+ if (parameters[OFFSET_PARAM(
+ struct arm_scmi_power_state_notify,
+ notify_enable)] > 1) {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ if (parameters[OFFSET_PARAM(
+ struct arm_scmi_power_state_notify,
+ domain_id)] >= num_power_domains) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ if (parameters[OFFSET_PARAM(
+ struct arm_scmi_power_state_notify,
+ domain_id)] == 0) {
+ *status = SCMI_STATUS_NOT_SUPPORTED;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ case PWR_STATE_CHANGE_REQUESTED_NOTIFY_MSG_ID:
+ if (parameters[OFFSET_PARAM(
+ struct arm_scmi_power_state_change_requested_notify,
+ notify_enable)] > 1) {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ if (parameters[OFFSET_PARAM(
+ struct arm_scmi_power_state_change_requested_notify,
+ domain_id)] >= num_power_domains) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ default:
+ *status = SCMI_STATUS_NOT_FOUND;
+ }
+}
diff --git a/platform/mocker/mocker/transport_reset.c b/platform/mocker/mocker/transport_reset.c
new file mode 100644
index 0000000000000000000000000000000000000000..d2b0245d76bd89ab480cd765a2d974bad42fbc3c
--- /dev/null
+++ b/platform/mocker/mocker/transport_reset.c
@@ -0,0 +1,169 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include
+#include
+#include
+
+struct arm_scmi_reset_protocol reset_protocol;
+
+void fill_reset_protocol()
+{
+ reset_protocol.protocol_version = RESET_VERSION;
+ reset_protocol.number_domains = num_reset_domains;
+ reset_protocol.reset_domain_name = reset_domain_names;
+ reset_protocol.asynchronous_reset_supported = async_reset_support;
+ reset_protocol.reset_notify_supported = reset_notify_support;
+ reset_protocol.reset_latency = reset_latency;
+}
+
+void reset_send_message(uint32_t message_id, uint32_t parameter_count,
+ const uint32_t *parameters, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values)
+{
+
+ uint32_t parameter_idx, domain_id, return_idx;
+ char * str;
+ uint32_t reset_flag, reset_state , notify_en;
+
+ switch(message_id)
+ {
+ case RESET_PROTO_VER_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[0] = reset_protocol.protocol_version;
+ break;
+ case RESET_PROTO_ATTRIB_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[OFFSET_RET(
+ struct arm_scmi_reset_protocol_attributes,
+ attributes)] =
+ (reset_protocol.number_domains <<
+ RESET_NUMBER_DOMAIN_LOW);
+ break;
+ case RESET_PROTO_MSG_ATTRIB_MSG_ID:
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_reset_protocol_message_attributes, message_id);
+ if (parameters[parameter_idx] > RESET_PROTO_NOTIFY_MSG_ID)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ }
+ else
+ {
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[OFFSET_RET(
+ struct arm_scmi_reset_protocol_message_attributes, attributes)] = 0x0;
+ }
+ break;
+ case RESET_PROTO_DOMAIN_ATTRIB_MSG_ID:
+ /* get domain id */
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_reset_protocol_domain_attributes, domain_id);
+ domain_id = parameters[parameter_idx];
+ if (domain_id >= reset_protocol.number_domains)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+
+ /* Domain attributes*/
+ return_idx = OFFSET_RET(struct arm_scmi_reset_protocol_domain_attributes,
+ attributes);
+ return_values[return_idx] =
+ reset_protocol.asynchronous_reset_supported[domain_id] << RESET_ASYNC_SUPPORT_BIT |
+ reset_protocol.reset_notify_supported[domain_id] << RESET_NOTIFY_SUPPORT_BIT;
+
+ /* Reset Latency*/
+ return_idx = OFFSET_RET(struct arm_scmi_reset_protocol_domain_attributes,
+ latency);
+ return_values[return_idx] = reset_protocol.reset_latency[domain_id];
+
+ /* Reset domain name*/
+ return_idx = OFFSET_RET(struct arm_scmi_reset_protocol_domain_attributes,
+ domain_name);
+
+ str = (char *)&return_values[return_idx];
+ sprintf(str, "Reset_%d", domain_id);
+
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = (return_idx + (SCMI_NAME_STR_SIZE/4)) + 1;
+ break;
+ case RESET_PROTO_RESET_MSG_ID:
+ /* get domain id */
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_reset_protocol_reset, domain_id);
+ domain_id = parameters[parameter_idx];
+ if (domain_id >= reset_protocol.number_domains)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ /* get reset flag */
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_reset_protocol_reset, flags);
+ reset_flag = parameters[parameter_idx];
+ /* Only 3 bits are valid*/
+ if (reset_flag > 0x7)
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ if (((reset_flag >> RESET_FLAG_ASYNC_RESET_BIT) & 0x1) &&
+ reset_protocol.asynchronous_reset_supported[domain_id] == 0)
+ {
+ *status = SCMI_STATUS_NOT_SUPPORTED;
+ break;
+ }
+ /* get reset state */
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_reset_protocol_reset, reset_state);
+ reset_state = parameters[parameter_idx];
+ if(reset_state > 0) /* Mocker supported only cold reset */
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ case RESET_PROTO_NOTIFY_MSG_ID:
+ /* get domain id */
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_reset_protocol_notify_enable, domain_id);
+ domain_id = parameters[parameter_idx];
+ if (domain_id >= reset_protocol.number_domains)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ /* get notify_enable */
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_reset_protocol_notify_enable, notify_enable);
+ notify_en = parameters[parameter_idx];
+ if(notify_en > 1) /* invalid notify enable */
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ default:
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+}
diff --git a/platform/mocker/mocker/transport_sensor.c b/platform/mocker/mocker/transport_sensor.c
new file mode 100644
index 0000000000000000000000000000000000000000..669e33446f09c6e2be637939f09a63a6a2eaaf8e
--- /dev/null
+++ b/platform/mocker/mocker/transport_sensor.c
@@ -0,0 +1,201 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include
+#include
+#include
+
+struct arm_scmi_sensor_protocol sensor_protocol;
+#define SENSOR_DESC_LEN 7
+
+void fill_sensor_protocol()
+{
+ sensor_protocol.protocol_version = SENSOR_VERSION;
+ sensor_protocol.number_sensors = num_sensors;
+ sensor_protocol.sensor_trip_point_notify_supported = true;
+ sensor_protocol.sensor_trip_point_config_supported = true;
+ sensor_protocol.sensor_reg_address_low = statistics_address_low_snsr;
+ sensor_protocol.sensor_reg_length = statistics_address_len_snsr;
+ sensor_protocol.sensor_reg_address_high =
+ sensor_protocol.sensor_reg_address_low + sensor_protocol.sensor_reg_length;
+ sensor_protocol.asynchronous_sensor_read_support =
+ async_sensor_read_support;
+ sensor_protocol.number_of_trip_points_supported =
+ number_of_trip_points_supported;
+}
+
+void sensor_send_message(uint32_t message_id, uint32_t parameter_count,
+ const uint32_t *parameters, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values)
+{
+
+ uint32_t parameter_idx, return_idx;
+ char * str;
+ int i;
+
+ switch(message_id)
+ {
+ case SNSR_PROTO_VER_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[0] = sensor_protocol.protocol_version;
+ break;
+ case SNSR_PROTO_ATTRIB_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 4;
+ return_idx = OFFSET_RET(struct arm_scmi_sensor_protocol_attributes,
+ attributes);
+ return_values[return_idx] = (sensor_protocol.number_sensors << SNR_NUMBER_SENSORS_LOW) +
+ (sensor_protocol.max_num_pending_async_cmds_supported <<
+ SNR_MAX_NUM_PENDING_ASYNC_CMDS_SPRT_LOW) +
+ (RESERVED << SNR_RESERVED_LOW);
+ return_values[OFFSET_RET(
+ struct arm_scmi_sensor_protocol_attributes,
+ sensor_reg_address_low)] = sensor_protocol.sensor_reg_address_low;
+ return_values[OFFSET_RET(
+ struct arm_scmi_sensor_protocol_attributes,
+ sensor_reg_address_high)] = sensor_protocol.sensor_reg_address_high;
+ return_values[OFFSET_RET(
+ struct arm_scmi_sensor_protocol_attributes,
+ sensor_reg_len)] = sensor_protocol.sensor_reg_length;
+ break;
+ case SNSR_PROTO_MSG_ATTRIB_MSG_ID:
+ parameter_idx = OFFSET_PARAM(
+ struct arm_scmi_sensor_protocol_message_attributes,
+ message_id);
+ if(parameters[parameter_idx] > SNSR_READING_GET_MSG_ID)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[OFFSET_RET(
+ struct arm_scmi_sensor_protocol_message_attributes,
+ attributes)] = 0x0;
+ break;
+ case SNSR_DESC_GET_MSG_ID:
+ parameter_idx = parameters[OFFSET_PARAM(
+ struct arm_scmi_sensor_description_get,
+ desc_index)];
+ if(parameter_idx >= sensor_protocol.number_sensors)
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ return_values[OFFSET_RET(
+ struct arm_scmi_sensor_description_get,
+ num_sensor_flags)] = sensor_protocol.number_sensors;
+ for (i = 0; i < sensor_protocol.number_sensors; i++)
+ {
+ return_values[OFFSET_RET(
+ struct arm_scmi_sensor_description_get,
+ sensor_descriptors) + SENSOR_DESC_LEN * i] = i;
+ return_values[OFFSET_RET(
+ struct arm_scmi_sensor_description_get,
+ sensor_descriptors) + (SENSOR_DESC_LEN * i) + 1] =
+ (sensor_protocol.asynchronous_sensor_read_support[i] <<
+ SNR_DESC_ATTRLOW_ASYNC_READ_SUPPORT) |
+ (sensor_protocol.number_of_trip_points_supported[i] <<
+ SNR_DESC_ATTRLOW_NUM_TRIPPOINT_SPRT_LOW);
+ return_values[OFFSET_RET(
+ struct arm_scmi_sensor_description_get,
+ sensor_descriptors) + (SENSOR_DESC_LEN * i) + 2] = 0;
+ str = (char *)
+ (&return_values[OFFSET_RET(
+ struct arm_scmi_sensor_description_get,
+ sensor_descriptors) + (SENSOR_DESC_LEN * i) + 3]);
+ sprintf(str, "SENSOR_%d", i);
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1 +
+ (sensor_protocol.number_sensors * SENSOR_DESC_LEN);
+ break;
+ case SNSR_TRIP_POINT_NOTIFY_ID:
+ if (parameters[OFFSET_PARAM(
+ struct arm_scmi_sensor_trip_point_notify, sensor_id)] >=
+ sensor_protocol.number_sensors)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ if (parameters[OFFSET_PARAM(
+ struct arm_scmi_sensor_trip_point_notify, sensor_event_control)] >
+ 1)
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ case SNSR_TRIP_POINT_CONFIG_ID:
+ if (parameters[OFFSET_PARAM(
+ struct arm_scmi_sensor_trip_point_config, sensor_id)] >=
+ sensor_protocol.number_sensors)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ if (((parameters[OFFSET_PARAM(
+ struct arm_scmi_sensor_trip_point_config, trip_point_ev_ctrl)] >>
+ SNR_TRIP_POINT_ID_LOW) & 0xFF) >
+ sensor_protocol.number_of_trip_points_supported[
+ parameters[OFFSET_PARAM(
+ struct arm_scmi_sensor_trip_point_config, sensor_id)]])
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ if ((parameters[OFFSET_PARAM(
+ struct arm_scmi_sensor_trip_point_config, trip_point_ev_ctrl)] >>
+ SNR_TRIP_POINT_EV_CTRL_LOWER_RESVD_LOW) & 0x3)
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ case SNSR_READING_GET_MSG_ID:
+ if (parameters[OFFSET_PARAM(
+ struct arm_scmi_sensor_reading_get, sensor_id)] >=
+ sensor_protocol.number_sensors)
+ {
+ *status = SCMI_STATUS_NOT_FOUND;
+ break;
+ }
+ if (parameters[OFFSET_PARAM(
+ struct arm_scmi_sensor_reading_get, flags)] > 1)
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ break;
+ }
+ if( (parameters[OFFSET_PARAM(
+ struct arm_scmi_sensor_reading_get, flags)] == 1) &&
+ ((sensor_protocol.asynchronous_sensor_read_support[
+ parameters[OFFSET_PARAM(
+ struct arm_scmi_sensor_reading_get, sensor_id)]]) == 0))
+ {
+ *status = SCMI_STATUS_NOT_SUPPORTED;
+ break;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 2;
+ break;
+ default:
+ *status = SCMI_STATUS_NOT_FOUND;
+ }
+}
diff --git a/platform/mocker/mocker/transport_system_power.c b/platform/mocker/mocker/transport_system_power.c
new file mode 100644
index 0000000000000000000000000000000000000000..eedefe87d8bd1e39e174b5704515e740d9323e57
--- /dev/null
+++ b/platform/mocker/mocker/transport_system_power.c
@@ -0,0 +1,104 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include
+#include
+
+struct arm_scmi_system_power_protocol system_power_protocol;
+
+void system_power_send_message(uint32_t message_id, uint32_t parameter_count,
+ const uint32_t *parameters, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values)
+{
+
+ uint32_t parameter_idx;
+ int warm_reset_support = 1, system_suspend_support = 1;
+
+ switch(message_id)
+ {
+ case SYSTEM_POWER_PROTO_VER_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[0] = 0x00010000; //PROTOCOL_VERSION;
+ break;
+ case SYSTEM_POWER_PROTO_ATTRIB_MSG_ID:
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[0] = 0x0;
+ break;
+ case SYSTEM_POWER_PROTO_MSG_ATTRIB_MSG_ID:
+ parameter_idx = OFFSET_PARAM(struct arm_scmi_system_power_protocol_message_attributes,
+ message_id);
+ if (parameters[parameter_idx] > SYSTEM_POWER_STATE_NOTIFY_MSG_ID) {
+ *status = SCMI_STATUS_NOT_FOUND;
+ return;
+ }
+ parameter_idx = OFFSET_PARAM(struct arm_scmi_system_power_protocol_message_attributes,
+ message_id);
+ if (parameters[parameter_idx] != SYSTEM_POWER_STATE_SET_MSG_ID) {
+ /*except for SYSPWR_PROTO_MSG_ATTRIB_MSG_ID, return 0*/
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ return_values[0] = 0x0;
+ }
+ else {
+ *status = SCMI_STATUS_SUCCESS;
+ *return_values_count = 1;
+ /*System warm reset and suspend are supported*/
+ return_values[0] = (warm_reset_support << 31) +
+ (system_suspend_support << 30) + 0;
+ }
+ break;
+ case SYSTEM_POWER_STATE_SET_MSG_ID:
+ parameter_idx = OFFSET_PARAM(struct arm_scmi_system_power_state_set,
+ system_state);
+ if ((parameters[parameter_idx] >= 0x5) &&
+ (parameters[OFFSET_PARAM(
+ struct arm_scmi_system_power_state_set,
+ system_state)] <= 0x7fffffff)) {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ return;
+ }
+ if ((parameters[OFFSET_PARAM(
+ struct arm_scmi_system_power_state_set,
+ flags)] > 0x1))
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ return;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ case SYSTEM_POWER_STATE_GET_MSG_ID:
+ *status = SCMI_STATUS_NOT_SUPPORTED;
+ *return_values_count = 1;
+ return_values[0] = 0x3;
+ break;
+ case SYSTEM_POWER_STATE_NOTIFY_MSG_ID:
+ if ((parameters[OFFSET_PARAM(
+ struct arm_scmi_system_power_state_set_notify,
+ notify_enable)] > 0x1))
+ {
+ *status = SCMI_STATUS_INVALID_PARAMETERS;
+ return;
+ }
+ *status = SCMI_STATUS_SUCCESS;
+ break;
+ default:
+ *status = SCMI_STATUS_NOT_FOUND;
+ }
+
+}
diff --git a/platform/mocker/pal_base.c b/platform/mocker/pal_base.c
new file mode 100644
index 0000000000000000000000000000000000000000..b6c42ef2276ff6e6ce6ca3c0c655fbca2a07f6d6
--- /dev/null
+++ b/platform/mocker/pal_base.c
@@ -0,0 +1,67 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+#include
+#include
+#include
+
+/*----------- Common PAL_BASE API's across platforms ----------*/
+
+uint32_t pal_agent_get_accessible_device(uint32_t agent_id)
+{
+ return agent_get_accessible_device(agent_id);
+}
+
+uint32_t pal_agent_get_inaccessible_device(uint32_t agent_id)
+{
+ return agent_get_inaccessible_device(agent_id);
+}
+
+uint32_t pal_device_get_accessible_protocol(uint32_t device_id)
+{
+ return device_get_accessible_protocol(device_id);
+}
+
+uint32_t pal_check_trusted_agent(uint32_t agent_id)
+{
+ return check_trusted_agent(agent_id);
+}
+
+char *pal_base_get_expected_vendor_name(void)
+{
+ return &(vendor_name[0]);
+}
+
+char *pal_base_get_expected_subvendor_name(void)
+{
+ return &(subvendor_name[0]);
+}
+
+uint32_t pal_base_get_expected_implementation_version(void)
+{
+ return implementation_version;
+}
+
+uint32_t pal_base_get_expected_num_agents(void)
+{
+ return NUM_ELEMS(agents);
+}
+
+uint32_t pal_base_get_expected_num_protocols(void)
+{
+ return NUM_ELEMS(supported_protocols);
+}
+
diff --git a/test_pool/sensor/sensor_testlist.c b/platform/mocker/pal_clock.c
similarity index 52%
rename from test_pool/sensor/sensor_testlist.c
rename to platform/mocker/pal_clock.c
index 5b229e4e90e6d0c61e001c1a5b80ac2228d9c45c..948db320b02855c4527bb00ce11287d5b1f65c43 100644
--- a/test_pool/sensor/sensor_testlist.c
+++ b/platform/mocker/pal_clock.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,19 +14,28 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
-#include "val_interface.h"
-#include "sensor_testlist.h"
-test_fn_ptr sensor_test[] = {
- sensor_query_protocol_version,
- sensor_query_protocol_attributes,
- sensor_query_mandatory_command_support,
- sensor_invalid_messageid_call,
- sensor_reading_get_check
-};
+#include
+#include
-test_fn_ptr *val_sensor_get_testlist(uint32_t *num_tests)
+/*----------- Common CLOCK API's across platforms ----------*/
+
+uint32_t pal_clock_get_expected_num_clocks(void)
+{
+ return num_clocks;
+}
+
+uint32_t pal_clock_get_expected_max_async_cmd(void)
+{
+ return max_num_pending_async_rate_chg_supported;
+}
+
+uint32_t pal_clock_get_expected_number_of_rates(uint32_t clock_id)
+{
+ return num_of_clock_rates[clock_id];
+}
+
+uint32_t pal_check_clock_config_change_support(uint32_t clock_id)
{
- *num_tests = NUM_ELEMS(sensor_test);
- return sensor_test;
+ return 0;
}
diff --git a/platform/mocker/pal_performance.c b/platform/mocker/pal_performance.c
new file mode 100644
index 0000000000000000000000000000000000000000..50eb03d74a005cc75aa10df9dfb774cffe506fea
--- /dev/null
+++ b/platform/mocker/pal_performance.c
@@ -0,0 +1,208 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include
+#include
+#include
+
+/*----------- Common PERFORMANCE API's across platforms ----------*/
+
+uint32_t pal_performance_get_expected_num_domains(void)
+{
+ return num_performance_domains;
+}
+
+uint32_t pal_performance_get_expected_stats_addr_low(void)
+{
+ return statistics_address_low_perf;
+}
+
+uint32_t pal_performance_get_expected_stats_addr_high(void)
+{
+ return (statistics_address_low_perf + statistics_address_len_perf);
+}
+
+uint32_t pal_performance_get_expected_stats_addr_len(void)
+{
+ return statistics_address_len_perf;
+}
+
+uint32_t pal_performance_get_expected_command_fast_ch_support(uint32_t message_id)
+{
+ return perf_msg_fast_ch_support[message_id];
+}
+
+uint32_t pal_performance_get_expected_set_limit_support(uint32_t domain_id)
+{
+ return set_limit_capable[domain_id];
+}
+
+uint32_t pal_performance_get_expected_set_level_support(uint32_t domain_id)
+{
+ return set_performance_level_capable[domain_id];
+}
+
+uint32_t pal_performance_get_expected_level_notification_support(uint32_t domain_id)
+{
+ return performance_level_notification_support[domain_id];
+}
+
+uint32_t pal_performance_get_expected_limit_notification_support(uint32_t domain_id)
+{
+ return performance_limit_notification_support[domain_id];
+}
+
+uint32_t pal_performance_get_expected_fast_channel_support(uint32_t domain_id)
+{
+ return perf_domain_fast_ch_support[domain_id];
+}
+
+uint32_t pal_performance_get_expected_rate_limit(uint32_t domain_id)
+{
+ return performance_rate_limit[domain_id];
+}
+
+uint32_t pal_performance_get_expected_sustaind_freq(uint32_t domain_id)
+{
+ return performance_sustained_freq[domain_id];
+}
+
+uint32_t pal_performance_get_expected_sustaind_level(uint32_t domain_id)
+{
+ return performance_sustained_level[domain_id];
+}
+
+uint32_t pal_performance_get_expected_performance_level(uint32_t domain_id, uint32_t index)
+{
+ return perf_performance_level_values[domain_id][index];
+}
+
+uint32_t pal_performance_get_expected_power_cost(uint32_t domain_id, uint32_t index)
+{
+ return perf_performance_level_power_costs[domain_id][index];
+}
+
+uint32_t pal_performance_get_expected_latency(uint32_t domain_id, uint32_t index)
+{
+ return perf_performance_level_worst_latency[domain_id][index];
+}
+
+uint8_t* pal_performance_get_expected_name(uint32_t domain_id)
+{
+ return (uint8_t*)&performance_domain_names[domain_id][0];
+}
+
+uint32_t pal_performance_get_expected_number_of_level(uint32_t domain_id)
+{
+ return perf_num_performance_levels[domain_id];
+}
+
+uint8_t pal_performance_get_expected_fast_ch_doorbell_support(uint32_t domain_id,uint32_t message_id)
+{
+ if(message_id < PERF_LIMIT_SET_MSG_ID || message_id > PERF_LVL_GET_MSG_ID)
+ return 0;
+
+ return perf_performance_fast_ch_doorbell_support[domain_id][message_id-PERF_LIMIT_SET_MSG_ID];
+}
+
+uint8_t pal_performance_get_expected_fast_ch_doorbell_data_width(uint32_t domain_id,uint32_t message_id)
+{
+ if(message_id < PERF_LIMIT_SET_MSG_ID || message_id > PERF_LVL_GET_MSG_ID)
+ return 0;
+
+ return perf_performance_fast_ch_doorbell_data_width[domain_id][message_id-PERF_LIMIT_SET_MSG_ID];
+}
+
+uint32_t pal_performance_get_expected_fast_ch_addr_low(uint32_t domain_id,uint32_t message_id)
+{
+ if(message_id < PERF_LIMIT_SET_MSG_ID || message_id > PERF_LVL_GET_MSG_ID)
+ return 0;
+
+ return perf_performance_fast_chan_addr_low[domain_id][message_id-PERF_LIMIT_SET_MSG_ID];
+}
+
+uint32_t pal_performance_get_expected_fast_ch_addr_high(uint32_t domain_id,uint32_t message_id)
+{
+ if(message_id < PERF_LIMIT_SET_MSG_ID || message_id > PERF_LVL_GET_MSG_ID)
+ return 0;
+
+ return perf_performance_fast_chan_addr_high[domain_id][message_id-PERF_LIMIT_SET_MSG_ID];
+}
+
+uint32_t pal_performance_get_expected_fast_ch_size(uint32_t domain_id,uint32_t message_id)
+{
+ if(message_id < PERF_LIMIT_SET_MSG_ID || message_id > PERF_LVL_GET_MSG_ID)
+ return 0;
+
+ return perf_performance_fast_chan_size[domain_id][message_id-PERF_LIMIT_SET_MSG_ID];
+}
+
+uint32_t pal_performance_get_expected_fast_ch_rate_limit(uint32_t domain_id,uint32_t message_id)
+{
+ if(message_id < PERF_LIMIT_SET_MSG_ID || message_id > PERF_LVL_GET_MSG_ID)
+ return 0;
+
+ return perf_performance_fast_chan_rate_limit[domain_id][message_id-PERF_LIMIT_SET_MSG_ID];
+}
+
+uint32_t pal_performance_get_expected_fast_ch_doorbell_addr_low(uint32_t domain_id,uint32_t message_id)
+{
+ if(message_id < PERF_LIMIT_SET_MSG_ID || message_id > PERF_LVL_GET_MSG_ID)
+ return 0;
+
+ return perf_performance_fast_chan_doorbell_addr_low[domain_id][message_id-PERF_LIMIT_SET_MSG_ID];
+}
+
+uint32_t pal_performance_get_expected_fast_ch_doorbell_addr_high(uint32_t domain_id,uint32_t message_id)
+{
+ if(message_id < PERF_LIMIT_SET_MSG_ID || message_id > PERF_LVL_GET_MSG_ID)
+ return 0;
+
+ return perf_performance_fast_chan_doorbell_addr_high[domain_id][message_id-PERF_LIMIT_SET_MSG_ID];
+}
+
+uint32_t pal_performance_get_expected_fast_ch_doorbell_set_mask_low(uint32_t domain_id,uint32_t message_id)
+{
+ if(message_id < PERF_LIMIT_SET_MSG_ID || message_id > PERF_LVL_GET_MSG_ID)
+ return 0;
+
+ return perf_performance_fast_chan_doorbell_set_mask_low[domain_id][message_id-PERF_LIMIT_SET_MSG_ID];
+}
+
+uint32_t pal_performance_get_expected_fast_ch_doorbell_set_mask_high(uint32_t domain_id,uint32_t message_id)
+{
+ if(message_id < PERF_LIMIT_SET_MSG_ID || message_id > PERF_LVL_GET_MSG_ID)
+ return 0;
+
+ return perf_performance_fast_chan_doorbell_set_mask_high[domain_id][message_id-PERF_LIMIT_SET_MSG_ID];
+}
+
+uint32_t pal_performance_get_expected_fast_ch_doorbell_preserve_mask_low(uint32_t domain_id,uint32_t message_id)
+{
+ if(message_id < PERF_LIMIT_SET_MSG_ID || message_id > PERF_LVL_GET_MSG_ID)
+ return 0;
+
+ return perf_performance_fast_chan_doorbell_preserve_mask_low[domain_id][message_id-PERF_LIMIT_SET_MSG_ID];
+}
+
+uint32_t pal_performance_get_expected_fast_ch_doorbell_preserve_mask_high(uint32_t domain_id,uint32_t message_id)
+{
+ if(message_id < PERF_LIMIT_SET_MSG_ID || message_id > PERF_LVL_GET_MSG_ID)
+ return 0;
+
+ return perf_performance_fast_chan_doorbell_preserve_mask_high[domain_id][message_id-PERF_LIMIT_SET_MSG_ID];
+}
diff --git a/platform/mocker/pal_platform.c b/platform/mocker/pal_platform.c
index 2933c49359f57e7a9d3a1415d3ee3a5a5bce7758..3b9b0dd9d2cf1be6bde55e1268c8367357015f15 100644
--- a/platform/mocker/pal_platform.c
+++ b/platform/mocker/pal_platform.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,84 +16,90 @@
**/
#include
-#include
#include
-void pal_send_message(uint32_t message_header_send, uint32_t parameter_count,
+void pal_send_message(uint32_t message_header_send, size_t parameter_count,
const uint32_t *parameters, uint32_t *message_header_rcv, int32_t *status,
- uint32_t *return_values_count, uint32_t *return_values)
+ size_t *return_values_count, uint32_t *return_values)
{
- mocker_send_message(message_header_send, parameter_count, parameters,
- message_header_rcv, status, return_values_count,
- return_values);
+ int message_id;
+ int protocol_id;
+
+ *message_header_rcv = message_header_send;
+ protocol_id = SCMI_EXRACT_BITS(message_header_send,
+ PROTOCOL_ID_HIGH, PROTOCOL_ID_LOW);
+ message_id = SCMI_EXRACT_BITS(message_header_send,
+ MESSAGE_ID_HIGH, MESSAGE_ID_LOW);
+
+ switch (protocol_id)
+ {
+ case BASE_PROTOCOL_ID:
+ base_send_message(message_id, parameter_count, parameters, status,
+ return_values_count, return_values);
+ break;
+ case POWER_DOMAIN_PROTOCOL_ID:
+ power_send_message(message_id, parameter_count, parameters, status,
+ return_values_count, return_values);
+ break;
+ case SYSTEM_POWER_PROTOCOL_ID:
+ system_power_send_message(message_id, parameter_count, parameters, status,
+ return_values_count, return_values);
+ break;
+ case PERFORMANCE_PROTOCOL_ID:
+ performance_send_message(message_id, parameter_count, parameters, status,
+ return_values_count, return_values);
+ break;
+ case CLOCK_PROTOCOL_ID:
+ clock_send_message(message_id, parameter_count, parameters, status,
+ return_values_count, return_values);
+ break;
+ case SENSOR_PROTOCOL_ID:
+ sensor_send_message(message_id, parameter_count, parameters, status,
+ return_values_count, return_values);
+ break;
+ case RESET_PROTOCOL_ID:
+ reset_send_message(message_id, parameter_count, parameters, status,
+ return_values_count, return_values);
+ break;
+ default:
+ printf("\nProtocol: %d\n", message_id);
+ assert(!"\nUnknown protocol id\n");
+ break;
+ }
}
-void pal_initialize_system(void)
+void pal_receive_delayed_response(uint32_t *message_header_rcv, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values)
{
- mocker_fill_protocols_database();
+ return ;
}
-void pal_print(uint32_t print_level, const char *format, va_list args)
-{
- vprintf(format, args);
-}
-
-char *pal_base_get_protocol_vendor_name(void)
-{
- return vendor_name;
-}
-
-char *pal_base_get_expected_subvendor_name(void)
+void pal_receive_notification(uint32_t *message_header_rcv, size_t *return_values_count,
+ uint32_t *return_values)
{
- return subvendor_name;
+ return ;
}
-uint32_t pal_base_get_expected_implementation_version(void)
+uint32_t pal_initialize_system(void *info)
{
- return implementation_version;
+ fill_base_protocol();
+ fill_power_protocol();
+ fill_performance_protocol();
+ fill_sensor_protocol();
+ fill_clock_protocol();
+ fill_reset_protocol();
+
+ return PAL_STATUS_PASS;
}
-uint32_t pal_base_get_expected_num_agents(void)
-{
- return NUM_ELEMS(agents);
-}
-
-uint32_t pal_pwr_domain_get_expected_num_domains(void)
-{
- return num_power_domains;
-}
-
-uint32_t pal_get_expected_num_supported_protocols(void)
-{
- return NUM_ELEMS(supported_protocols);
-}
-
-uint32_t pal_agent_get_accessible_device(uint32_t agent_id)
-{
- return agent_get_accessible_device(agent_id);
-}
-
-uint32_t pal_agent_get_inaccessible_device(uint32_t agent_id)
-{
- return agent_get_inaccessible_device(agent_id);
-}
-
-uint32_t pal_device_get_accessible_protocol(uint32_t device_id)
-{
- return device_get_accessible_protocol(device_id);
-}
-
-uint32_t pal_clock_get_expected_num_clocks(void)
-{
- return num_clocks;
-}
-
-uint32_t pal_performance_get_expected_num_domains(void)
+void pal_print(uint32_t print_level, const char *format, va_list args)
{
- return num_performance_domains;
+ vprintf(format, args);
}
-uint32_t pal_sensors_get_expected_num_sensors(void)
+void *pal_memcpy(void *dest, const void *src, size_t size)
{
- return num_sensors;
+ if (dest == NULL || src == NULL || size == 0)
+ return NULL;
+ return memcpy(dest, src, size);
}
diff --git a/platform/mocker/pal_power_domain.c b/platform/mocker/pal_power_domain.c
new file mode 100644
index 0000000000000000000000000000000000000000..ff6121595a59f843782ff0a8689d53b16f1ac0ac
--- /dev/null
+++ b/platform/mocker/pal_power_domain.c
@@ -0,0 +1,41 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include
+#include
+
+/*----------- Common POWER API's across platforms ----------*/
+
+uint32_t pal_power_get_expected_num_domains(void)
+{
+ return num_power_domains;
+}
+
+uint32_t pal_power_get_expected_stats_addr_low(void)
+{
+ return statistics_address_low_pow;
+}
+
+uint32_t pal_power_get_expected_stats_addr_high(void)
+{
+ return (statistics_address_len_pow + statistics_address_low_pow);
+}
+
+uint32_t pal_power_get_expected_stats_addr_len(void)
+{
+ return statistics_address_len_pow;
+}
diff --git a/platform/mocker/pal_reset.c b/platform/mocker/pal_reset.c
new file mode 100644
index 0000000000000000000000000000000000000000..eed3440851f1f3fef0a3d67e6c87fe1d9e831a28
--- /dev/null
+++ b/platform/mocker/pal_reset.c
@@ -0,0 +1,46 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include
+#include
+
+/*----------- Common RESET API's across platforms ----------*/
+
+uint32_t pal_reset_get_expected_num_domains(void)
+{
+ return num_reset_domains;
+}
+
+uint8_t *pal_reset_get_expected_name(uint32_t domain_id)
+{
+ return (uint8_t *)reset_domain_names[domain_id];
+}
+
+uint32_t pal_reset_get_expected_async_support(uint32_t domain_id)
+{
+ return async_reset_support[domain_id];
+}
+
+uint32_t pal_reset_get_expected_notify_support(uint32_t domain_id)
+{
+ return reset_notify_support[domain_id];
+}
+
+uint32_t pal_reset_get_expected_latency(uint32_t domain_id)
+{
+ return reset_latency[domain_id];
+}
diff --git a/platform/mocker/pal_sensor.c b/platform/mocker/pal_sensor.c
new file mode 100644
index 0000000000000000000000000000000000000000..ac1cda29d1d50db29cc73c7a229a38893d17c88b
--- /dev/null
+++ b/platform/mocker/pal_sensor.c
@@ -0,0 +1,51 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include
+#include
+
+/*----------- Common SENSOR API's across platforms ----------*/
+
+uint32_t pal_sensor_get_expected_num_sensors(void)
+{
+ return num_sensors;
+}
+
+uint32_t pal_sensor_get_expected_stats_addr_low(void)
+{
+ return statistics_address_low_snsr;
+}
+
+uint32_t pal_sensor_get_expected_stats_addr_high(void)
+{
+ return (statistics_address_len_snsr + statistics_address_low_snsr);
+}
+
+uint32_t pal_sensor_get_expected_stats_addr_len(void)
+{
+ return statistics_address_len_snsr;
+}
+
+uint8_t pal_sensor_get_expected_async_support(uint32_t sensor_id)
+{
+ return async_sensor_read_support[sensor_id];
+}
+
+uint8_t pal_sensor_get_expected_trip_points(uint32_t sensor_id)
+{
+ return number_of_trip_points_supported[sensor_id];
+}
diff --git a/platform/mocker/protocols.c b/platform/mocker/protocols.c
deleted file mode 100644
index 5424d8f1caec3faff9d7a8560f7f3122a10a1965..0000000000000000000000000000000000000000
--- a/platform/mocker/protocols.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
- * SPDX-License-Identifier : Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-**/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-struct arm_scmi_base_protocol base_protocol;
-struct arm_scmi_power_protocol power_protocol;
-struct arm_scmi_sensor_protocol sensor_protocol;
-struct arm_scmi_performance_protocol performance_protocol;
-struct arm_scmi_system_power_protocol system_power_protocol;
-struct arm_scmi_clock_protocol clock_protocol;
-
-static uint32_t statistics_address_low = 0x1234;
-static uint32_t statistics_address_len = 0xFF;
-
-uint32_t get_unsupported_protocol()
-{
- return supported_protocols[NUM_ELEMS(supported_protocols) - 1] + 1;
-}
-
-void fill_base_protocol()
-{
- base_protocol.protocol_version = BASE_VERSION;
- base_protocol.num_protocols_implemented = NUM_ELEMS(supported_protocols);
- sprintf(base_protocol.vendor_identifier, "%s", vendor_name);
- sprintf(base_protocol.subvendor_identifier, "%s", subvendor_name);
- base_protocol.implementation_version = implementation_version;
- base_protocol.supported_protocols = supported_protocols;
- /* Setting of base protocol optional cmd support */
- base_protocol.notify_error_cmd_supported = true;
- base_protocol.subvendor_cmd_supported = true;
- base_protocol.discover_agent_cmd_supported = true;
- base_protocol.device_permissions_cmd_supported = true;
- base_protocol.protocol_permissions_cmd_supported = true;
- base_protocol.reset_agent_config_cmd_supported = true;
- base_protocol.num_agents = NUM_ELEMS(agents);
-}
-
-void fill_power_protocol()
-{
- power_protocol.protocol_version = POWER_DOMAIN_VERSION;
- power_protocol.num_power_domains = num_power_domains;
- power_protocol.statistics_address_low = statistics_address_low;
- power_protocol.statistics_length = statistics_address_len;
- power_protocol.statistics_address_high =
- power_protocol.statistics_address_low + power_protocol.statistics_length;
- power_protocol.power_state_notify_cmd_supported = true;
- power_protocol.power_state_change_requested_notify_cmd_supported = true;
-}
-
-void fill_sensor_protocol()
-{
- sensor_protocol.protocol_version = SENSOR_VERSION;
- sensor_protocol.number_sensors = num_sensors;
- sensor_protocol.sensor_trip_point_notify_supported = true;
- sensor_protocol.sensor_trip_point_config_supported = true;
-}
-
-void fill_performance_protocol()
-{
- performance_protocol.protocol_version = PERFORMANCE_VERSION;
- performance_protocol.num_performance_domains = num_performance_domains;
- performance_protocol.performance_limit_notification_support = true;
- performance_protocol.performance_level_notification_support = true;
-}
-
-void fill_clock_protocol()
-{
- clock_protocol.protocol_version = CLOCK_VERSION;
- clock_protocol.number_clocks = num_clocks;
-}
-
-void mocker_fill_protocols_database()
-{
- fill_base_protocol();
- fill_power_protocol();
- fill_performance_protocol();
- fill_sensor_protocol();
- fill_clock_protocol();
-}
diff --git a/platform/mocker/transport.c b/platform/mocker/transport.c
deleted file mode 100644
index 5b79b9af9ecc5b0758563de01884d497008a00c9..0000000000000000000000000000000000000000
--- a/platform/mocker/transport.c
+++ /dev/null
@@ -1,792 +0,0 @@
-/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
- * SPDX-License-Identifier : Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-**/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-extern struct arm_scmi_base_protocol base_protocol;
-extern struct arm_scmi_power_protocol power_protocol;
-extern struct arm_scmi_sensor_protocol sensor_protocol;
-extern struct arm_scmi_performance_protocol performance_protocol;
-extern struct arm_scmi_system_power_protocol system_power_protocol;
-extern struct arm_scmi_clock_protocol clock_protocol;
-extern uint32_t get_unsupported_protocol();
-
-#define SCMI_AGENT_ID_MAX 0xFF
-
-static char* devices[] =
-{
- "DEVICE 1", "DEVICE 2"
-};
-
-static struct device_access_info agent1_device_access[] =
-{
- {"DEVICE_1", true, 1},
- {"DEVICE_2", true, 3}
-};
-
-static struct device_access_info agent2_device_access[] =
-{
- {"DEVICE_2", true, 2}
-};
-
-static char *agents[] = {
- "OSPM", "PSCI"
-};
-/*
-static struct device_protocol_access_info device2_protocol_access[] =
-{
- {BASE_PROTOCOL_ID, true}
-};
-
-static struct device_protocol_access_info device1_protocol_access[] =
-{
- {BASE_PROTOCOL_ID, true},
- {PWR_DOMAIN_PROTOCOL_ID, true}
-};
-*/
-
-uint32_t agent_get_accessible_device(uint32_t agent_id)
-{
- switch (agent_id)
- {
- case 0:
- return agent1_device_access[0].device_id;
- case 1:
- return agent2_device_access[0].device_id;
- default:
- printf("\n\tInvalid Agent id--->%-1x", agent_id);
- return SCMI_AGENT_ID_MAX;
- }
-}
-
-uint32_t agent_get_inaccessible_device(uint32_t agent_id)
-{
- switch (agent_id)
- {
- case 0:
- return agent1_device_access[NUM_ELEMS(agent1_device_access)].device_id + 1;
- case 1:
- return agent2_device_access[NUM_ELEMS(agent2_device_access)].device_id + 1;
- default:
- printf("\n\tInvalid Agent id--->%-1x", agent_id);
- return SCMI_AGENT_ID_MAX;
- }
-}
-
-uint32_t device_get_accessible_protocol(uint32_t device_id)
-{
- return PWR_PROTO_ID;
-}
-
-char *agent_name_get(uint32_t agent_id)
-{
- if (agent_id == 0)
- return agents[0];
- if (agent_id > NUM_ELEMS(agents))
- return NULL;
- return agents[agent_id - 1];
-}
-
-/*!
- * @brief Get the bits from a range of positions within an integer of type
- * uint32_t.
- *
- * This function is used for extracting the data bits from an upper and lower
- * range from an integer of type uint32_t. The bits are then shifted to the
- * right to return the normalised value.
- *
- * @param data Integer of type uin32_t from which the bits are extracted.
- * @param bit_upper Upper bit position.
- * @param bit_lower Lower bit position.
- *
- * @return The normalised unsigned value from the bits range.
- *
- */
-uint32_t arm_scmi_get_norm_bits(uint32_t data, uint8_t bit_upper, uint8_t bit_lower)
-{
- uint32_t mask;
- uint32_t bits;
- mask = ((1 << (bit_upper - bit_lower + 1)) - 1) << bit_lower;
- bits = (data & mask) >> bit_lower;
- return bits;
-}
-
-/**
- * @brief Interface function that sends a
- * command and receives a platform
- * message.
- *
- * This is the mocker platform implementation of the send_message interface
- * which is used by the test_agent to send commands to the platform over A2P
- * channel. In this case it fakes some dummy data and returns that data to the
- * calling test_agent to enable testing of the test harness.
- *
- **/
-void mocker_send_message(uint32_t message_header_send, uint32_t parameter_count,
- const uint32_t *parameters, uint32_t *message_header_rcv, int32_t *status,
- uint32_t *return_values_count, uint32_t *return_values)
-{
- char *str;
- int agent_id, device_id, protocol_id, flags, command_id;
- int message_id;
- int parameter_id;
-
- /*power domainprotocol*/
- int num_power_domains = 3;
- int stats_low = 0x1234, stats_high = stats_low + 0xff;
- /*system power management protocol*/
- /*Mocker platform supports warm reset and system suspend
- * 0 for not supporting
- * 1 for supporting
- * */
- int warm_reset_support = 1, system_suspend_support = 1;
-
- *message_header_rcv = message_header_send;
- protocol_id = arm_scmi_get_norm_bits(message_header_send,
- PROTOCOL_ID_HIGH, PROTOCOL_ID_LOW);
- message_id = arm_scmi_get_norm_bits(message_header_send,
- MESSAGE_ID_HIGH, MESSAGE_ID_LOW);
-
- switch (protocol_id)
- {
- case BASE_PROTO_ID:
- switch (message_id)
- {
- case BASE_PROTO_VERSION_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[OFFSET_RET(struct arm_scmi_base_protocol_version, version)] =
- base_protocol.protocol_version;
- break;
- case BASE_PROTO_ATTR_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[OFFSET_RET(struct arm_scmi_base_protocol_attributes, attributes)]
- = (base_protocol.num_agents << 8) + base_protocol.num_protocols_implemented;
- break;
- case BASE_PROTO_MSG_ATTR_MSG_ID:
- parameter_id = OFFSET_PARAM(
- struct arm_scmi_base_protocol_message_attributes, message_id);
- if(parameters[parameter_id] > BASE_RESET_AGENT_CONFIGURATION_MSG_ID) {
- *status = SCMI_STATUS_NOT_FOUND;
- } else if (parameters[parameter_id] > BASE_DISC_AGENT_MSG_ID)
- {
- *status = SCMI_STATUS_NOT_FOUND;
- switch (parameters[parameter_id])
- {
- case 0x8:
- if (base_protocol.notify_error_cmd_supported == true)
- *status = SCMI_STATUS_SUCCESS;
- break;
- case 0x9:
- if (base_protocol.device_permissions_cmd_supported == true)
- *status = SCMI_STATUS_SUCCESS;
- break;
- case 0xA:
- if (base_protocol.protocol_permissions_cmd_supported == true)
- *status = SCMI_STATUS_SUCCESS;
- break;
- case 0xB:
- if (base_protocol.reset_agent_config_cmd_supported == true)
- *status = SCMI_STATUS_SUCCESS;
- break;
- case 0x7:
- if (base_protocol.discover_agent_cmd_supported == true)
- *status = SCMI_STATUS_SUCCESS;
- break;
- default:
- *status = SCMI_STATUS_SUCCESS;
-
- }
- }
- else {
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[OFFSET_RET(struct arm_scmi_base_protocol_message_attributes,
- attributes)] = 0x0;
- }
- break;
- case BASE_DISC_VENDOR_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- sprintf((char *)return_values, "%s", base_protocol.vendor_identifier);
- *return_values_count = strlen((const char*)return_values);
- break;
- case BASE_DISC_SUBVENDOR_MSG_ID:
- if(base_protocol.subvendor_cmd_supported == false)
- {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- *status = SCMI_STATUS_SUCCESS;
- sprintf((char *)return_values, "%s", base_protocol.subvendor_identifier);
- *return_values_count = strlen((const char*)return_values);
- break;
- case BASE_DISC_IMPLEMENTATION_VERSION_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[OFFSET_RET(struct arm_scmi_base_discover_implementation_version,
- implementation_version)] = base_protocol.implementation_version;
- break;
- case BASE_DISC_PROTO_LIST_MSG_ID:
- parameter_id = OFFSET_PARAM(
- struct arm_scmi_base_discover_list_protocols, skip);
- if (parameters[parameter_id] > base_protocol.num_protocols_implemented) {
- *status = SCMI_STATUS_INVALID_PARAMETERS;
- } else {
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 2 + (base_protocol.num_protocols_implemented -
- parameters[parameter_id]);
- return_values[0] = base_protocol.num_protocols_implemented -
- parameters[parameter_id];
- return_values[1] = 0x11;
- }
- break;
- case BASE_DISC_AGENT_MSG_ID:
- if(base_protocol.discover_agent_cmd_supported == false)
- {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- parameter_id = OFFSET_PARAM(
- struct arm_scmi_base_discover_agent, agent_id);
- if ((parameters[parameter_id] != 0xFFFFFFFF) &&
- (parameters[parameter_id] > base_protocol.num_agents))
- {
- *status = SCMI_STATUS_NOT_FOUND;
- }
- else
- {
- *status = SCMI_STATUS_SUCCESS;
- if (parameters[parameter_id] == 0xFFFFFFFF)
- {
- return_values[0] = 0;
- sprintf((char *)&return_values[1], "%s", agent_name_get(0));
- }
- else
- {
- return_values[0] = parameters[parameter_id];
- sprintf((char *)&return_values[1], "%s",
- (parameters[parameter_id] == 0 ?
- "platform_mock" : agent_name_get(parameters[parameter_id])));
- }
- *return_values_count = strlen((const char*)return_values) + 1;
- }
- break;
- case BASE_NOTIFY_ERRORS_MSG_ID:
- if (base_protocol.notify_error_cmd_supported == false)
- {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- parameter_id = OFFSET_PARAM(
- struct arm_scmi_base_notify_error, notify_enable);
- if (parameters[parameter_id] > 0x1) {
- *status = SCMI_STATUS_INVALID_PARAMETERS;
- }
- else
- {
- base_protocol.notify_error_cmd_supported = (bool)parameters[parameter_id];
- *status = SCMI_STATUS_SUCCESS;
- }
- break;
- case BASE_SET_DEVICE_PERMISSIONS_MSG_ID:
- if (base_protocol.device_permissions_cmd_supported == false)
- {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- agent_id = OFFSET_PARAM(struct arm_scmi_base_set_device_permissions,
- agent_id);
- device_id = OFFSET_PARAM(struct arm_scmi_base_set_device_permissions,
- device_id);
- flags = OFFSET_PARAM(struct arm_scmi_base_set_device_permissions, flags);
- if (parameters[flags] > 0x1)
- *status = SCMI_STATUS_INVALID_PARAMETERS;
- else if ((parameters[agent_id] > base_protocol.num_agents) || (parameters[device_id]
- > NUM_ELEMS(devices)))
- *status = SCMI_STATUS_NOT_FOUND;
- switch (agent_id)
- {
- case 1:
- if (parameters[device_id] > NUM_ELEMS(agent1_device_access))
- *status = SCMI_STATUS_DENIED;
- agent1_device_access[parameters[device_id]].device_access =
- parameters[flags];
- *status = SCMI_STATUS_SUCCESS;
- break;
- case 2:
- if (parameters[device_id] > NUM_ELEMS(agent2_device_access))
- *status = SCMI_STATUS_DENIED;
- agent2_device_access[parameters[device_id]].device_access =
- parameters[flags];
- *status = SCMI_STATUS_SUCCESS;
- break;
- }
- break;
- case BASE_SET_PROTOCOL_PERMISSIONS_MSG_ID:
- if (base_protocol.protocol_permissions_cmd_supported == false)
- {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- *status = SCMI_STATUS_SUCCESS;
- agent_id = OFFSET_PARAM(struct arm_scmi_base_set_protocol_permissions,
- agent_id);
- device_id = OFFSET_PARAM(struct arm_scmi_base_set_protocol_permissions,
- device_id);
- flags = OFFSET_PARAM(struct arm_scmi_base_set_protocol_permissions, flags);
- command_id = OFFSET_PARAM(struct arm_scmi_base_set_protocol_permissions,
- command_id);
- if (parameters[command_id] == BASE_PROTO_ID)
- *status = SCMI_STATUS_NOT_FOUND;
- else if ((parameters[agent_id] > base_protocol.num_agents) || (parameters[device_id]
- > NUM_ELEMS(devices)) || (parameters[command_id]
- > get_unsupported_protocol()))
- *status = SCMI_STATUS_NOT_FOUND;
- else if (parameters[flags] > 0x1)
- *status = SCMI_STATUS_INVALID_PARAMETERS;
- /*
- switch (agent_id)
- {
- case 1:
- if (command_id > agent1_protocol_access[NUM_ELEMS
- (agent1_protocol_access)].protocol_id)
- *status = SCMI_STATUS_NOT_SUPPORTED;
- break;
- case 2:
- if (command_id > agent2_protocol_access[NUM_ELEMS
- (agent2_protocol_access)].protocol_id)
- *status = SCMI_STATUS_NOT_SUPPORTED;
- break;
- }
- */
- break;
- case BASE_RESET_AGENT_CONFIGURATION_MSG_ID:
- if (base_protocol.reset_agent_config_cmd_supported == false)
- {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- *status = SCMI_STATUS_SUCCESS;
- agent_id = OFFSET_PARAM(struct arm_scmi_base_reset_agent_configuration,
- agent_id);
- flags = OFFSET_PARAM(struct arm_scmi_base_reset_agent_configuration, flags);
- if (parameters[agent_id] > base_protocol.num_agents)
- *status = SCMI_STATUS_NOT_FOUND;
- else if (parameters[flags] > 0x1)
- *status = SCMI_STATUS_INVALID_PARAMETERS;
- break;
- default:
- *status = SCMI_STATUS_NOT_FOUND;
- }
- break;
- case PWR_PROTO_ID:
- switch (message_id)
- {
- case PWR_PROTO_VER_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[0] = power_protocol.protocol_version;
- break;
- case PWR_PROTO_ATTR_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[OFFSET_RET(
- struct arm_scmi_power_protocol_attributes,
- attributes)] =
- (num_power_domains <<
- POWER_PROT_ATTR_NUMBER_DOMAINS_LOW);
- return_values[OFFSET_RET(
- struct arm_scmi_power_protocol_attributes,
- statistics_address_low)] = stats_low;
- return_values[OFFSET_RET(
- struct arm_scmi_power_protocol_attributes,
- statistics_address_high)] = stats_high;
- return_values[OFFSET_RET(
- struct arm_scmi_power_protocol_attributes,
- statistics_len)] = stats_high - stats_low;
- break;
- case PWR_PROTO_MSG_ATTR_MSG_ID:
- parameter_id = OFFSET_PARAM(
- struct arm_scmi_power_protocol_message_attributes, message_id);
- if(parameters[parameter_id] > PWR_STATE_CHANGE_REQUESTED_NOTIFY_MSG_ID) {
- *status = SCMI_STATUS_NOT_FOUND;
- } else {
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[OFFSET_RET(
- struct arm_scmi_power_protocol_message_attributes, attributes)] = 0x0;
- }
- break;
- case PWR_DOMAIN_ATTRIB_MSG_ID:
- *status = (parameters[OFFSET_PARAM(
- struct arm_scmi_power_domain_attributes,
- domain_id)] > num_power_domains ?
- SCMI_STATUS_NOT_FOUND: SCMI_STATUS_SUCCESS);
- *return_values_count = 3;
- return_values[OFFSET_RET(
- struct arm_scmi_power_domain_attributes,
- attributes)] =
- (1 << POWER_DOMAIN_ATTR_SYNC_LOW) +
- (1 << POWER_DOMAIN_ATTR_ASYNC_LOW) +
- (1 << POWER_DOMAIN_ATTR_STATE_NOTIFICATIONS_LOW);
- str = (char *)
- (&return_values[OFFSET_RET(
- struct arm_scmi_power_domain_attributes, name)]);
- sprintf(str, "Domain_%d", parameters[
- OFFSET_PARAM(struct arm_scmi_power_domain_attributes,
- domain_id)]);
- break;
- case PWR_STATE_SET_MSG_ID:
- if ((parameters[OFFSET_PARAM(struct arm_scmi_power_state_set,
- power_state)] & (1 < 31)) != 0) {
- *status = SCMI_STATUS_INVALID_PARAMETERS;
- break;
- }
- if (parameters[OFFSET_PARAM(struct arm_scmi_power_state_set,
- flags)] >= 1) {
- *status = SCMI_STATUS_INVALID_PARAMETERS;
- break;
- }
- if (parameters[OFFSET_PARAM(struct arm_scmi_power_state_set,
- domain_id)] >= num_power_domains) {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- *status = SCMI_STATUS_SUCCESS;
- break;
- case PWR_STATE_GET_MSG_ID:
- if (parameters[OFFSET_PARAM(
- struct arm_scmi_power_state_get, domain_id)] >=
- num_power_domains) {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[OFFSET_RET(struct arm_scmi_power_state_get,
- power_state)] = 0xf;
- break;
- case PWR_STATE_NOTIFY_MSG_ID:
- if (parameters[OFFSET_PARAM(
- struct arm_scmi_power_state_notify,
- notify_enable)] > 1) {
- *status = SCMI_STATUS_INVALID_PARAMETERS;
- break;
- }
- if (parameters[OFFSET_PARAM(
- struct arm_scmi_power_state_notify,
- domain_id)] >= num_power_domains) {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- *status = SCMI_STATUS_SUCCESS;
- break;
- case PWR_STATE_CHANGE_REQUESTED_NOTIFY_MSG_ID:
- if (parameters[OFFSET_PARAM(
- struct arm_scmi_power_state_change_requested_notify,
- notify_enable)] > 1) {
- *status = SCMI_STATUS_INVALID_PARAMETERS;
- break;
- }
- if (parameters[OFFSET_PARAM(
- struct arm_scmi_power_state_change_requested_notify,
- domain_id)] >= num_power_domains) {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- *status = SCMI_STATUS_SUCCESS;
- break;
- default:
- *status = SCMI_STATUS_NOT_FOUND;
- }
- break;
- case SYSTEM_POWER_PROTO_ID:
- switch (message_id)
- {
- case SYSTEM_POWER_PROTO_VER_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[0] = 0x00010000; //PROTOCOL_VERSION;
- break;
- case SYSTEM_POWER_PROTO_ATTRIB_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[0] = 0x0;
- break;
- case SYSTEM_POWER_PROTO_MSG_ATTRIB_MSG_ID:
- if (parameters[OFFSET_PARAM(
- struct arm_scmi_system_power_protocol_message_attributes,
- message_id)] > SYSTEM_POWER_STATE_NOTIFY_MSG_ID) {
- *status = SCMI_STATUS_NOT_FOUND;
- return;
- }
- if (parameters[OFFSET_PARAM(
- struct arm_scmi_system_power_protocol_message_attributes,
- message_id)] != SYSTEM_POWER_STATE_SET_MSG_ID) {
- /*except for SYSPWR_PROTO_MSG_ATTRIB_MSG_ID, return 0*/
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[0] = 0x0;
- }
- else {
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- /*System warm reset and suspend are supported*/
- return_values[0] = (warm_reset_support << 31) +
- (system_suspend_support << 30) + 0;
- }
- break;
-/*
- case SYSTEM_POWER_STATE_SET_MSG_ID:
- if ((parameters[OFFSET_PARAM(
- struct arm_scmi_system_power_state_set,
- system_state)] >= 0x5) &&
- (parameters[OFFSET_PARAM(
- struct arm_scmi_system_power_state_set,
- system_state)] <= 0x7fffffff)) {
- *status = SCMI_STATUS_INVALID_PARAMETERS;
- }
- break;
-*/
- case SYSTEM_POWER_STATE_GET_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[0] = 0x3;
- break;
- default:
- *status = SCMI_STATUS_NOT_FOUND;
- }
- break;
- case PERF_MGMT_PROTO_ID:
- switch (message_id)
- {
- case PERF_MGMT_PROTO_VER_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[0] = performance_protocol.protocol_version;
- break;
- case PERF_MGMT_PROTO_ATTRIB_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[OFFSET_RET(
- struct arm_scmi_performance_protocol_attributes,
- attributes)] =
- (1 << PERFORMANCE_PROT_POWER_VALUES_LOW) +
- (performance_protocol.num_performance_domains <<
- PERFORMANCE_PROT_ATTR_NUMBER_DOMAINS_LOW);
- return_values[OFFSET_RET(
- struct arm_scmi_performance_protocol_attributes,
- statistics_address_low)] = performance_protocol.statistics_address_low;
- return_values[OFFSET_RET(
- struct arm_scmi_performance_protocol_attributes,
- statistics_address_high)] = performance_protocol.statistics_address_high;
- return_values[OFFSET_RET(
- struct arm_scmi_performance_protocol_attributes,
- statistics_len)] = performance_protocol.statistics_address_high -
- performance_protocol.statistics_address_low;
- break;
- case PERF_MGMT_PROTO_MSG_ATTRIB_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[OFFSET_RET(
- struct arm_scmi_performance_protocol_message_attributes,
- attributes)] = 0x0;
- break;
- case PERF_DOMAIN_ATTRIB_MSG_ID:
- *status = (parameters[OFFSET_PARAM(
- struct arm_scmi_performance_domain_attributes,
- domain_id)] >= performance_protocol.num_performance_domains ?
- SCMI_STATUS_NOT_FOUND: SCMI_STATUS_SUCCESS);
- return_values[OFFSET_RET(
- struct arm_scmi_performance_domain_attributes,
- attributes)] =
- (1 << PERFORMANCE_DOMAIN_ATTR_LIMIT_SET) |
- (1 << PERFORMANCE_DOMAIN_ATTR_LEVEL_SET);
- return_values[OFFSET_RET(
- struct arm_scmi_performance_domain_attributes,
- rate_limit)] = 0;
- return_values[OFFSET_RET(
- struct arm_scmi_performance_domain_attributes,
- sustained_perf_level)] = (parameters[0] + 1) * 11;
- return_values[OFFSET_RET(
- struct arm_scmi_performance_domain_attributes,
- sustained_freq)] = (parameters[0] + 1) * 10;
- str = (char *)
- (&return_values[OFFSET_RET(
- struct arm_scmi_performance_domain_attributes, name)]);
- sprintf(str, "Domain_%d", parameters[
- OFFSET_PARAM(struct arm_scmi_performance_domain_attributes,
- domain_id)]);
- break;
- default:
- *status = SCMI_STATUS_NOT_FOUND;
- }
- break;
- case CLK_PROTO_ID:
- switch (message_id)
- {
- case CLK_PROTO_VER_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[0] = clock_protocol.protocol_version;
- break;
- case CLK_PROTO_ATTRIB_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[OFFSET_RET(
- struct arm_scmi_clock_protocol_attributes,
- attributes)] =
- (clock_protocol.protocol_version << CLK_NUMBER_CLOCKS_LOW);
- break;
- case CLK_PROTO_MSG_ATTRIB_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[OFFSET_RET(
- struct arm_scmi_clock_protocol_message_attributes,
- attributes)] = 0x0;
- break;
-/*
- case CLK_ATTRIB_MSG_ID:
- if (parameters[OFFSET_PARAM(struct arm_scmi_clock_attributes,
- clock_id)] >= NUMBER_CLOCKS) {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- *status = SCMI_STATUS_SUCCESS;
- str = (char *)
- (&return_values[OFFSET_RET(
- struct arm_scmi_clock_attributes,
- clock_name)]);
- sprintf(str, "CLOCK_%d", parameters[0]);
- break;
- case CLK_DESC_RATE_MSG_ID:
- if (parameters[OFFSET_PARAM(struct arm_scmi_clock_describe_rates,
- clock_id)] >= NUMBER_CLOCKS) {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- *status = SCMI_STATUS_SUCCESS;
- j = 100;k=0;
- return_values[OFFSET_RET(
- struct arm_scmi_clock_describe_rates,
- num_rates_flags)] = (clock_rates[parameters[0]] <<
- CLK_DESCRATE_NUM_RATES_RETURNED_LOW);
- for (i = 0; i < clock_rates[parameters[0]]; ++i) {
- return_values[OFFSET_RET(
- struct arm_scmi_clock_describe_rates,
- rates) + 2 * i] = j * (i + 1);
- return_values[OFFSET_RET(
- struct arm_scmi_clock_describe_rates,
- rates) + 2 * i + 1] = j * (i + 1) + 50;
- }
- break;
- case CLK_RATE_SET_MSG_ID:
- if (parameters[OFFSET_PARAM(
- struct arm_scmi_clock_rate_set, clock_id)] >=
- NUMBER_CLOCKS) {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- *status = SCMI_STATUS_SUCCESS;
- break;
- case CLK_RATE_GET_MSG_ID:
- if (parameters[OFFSET_PARAM(
- struct arm_scmi_clock_rate_get, clock_id)] >=
- NUMBER_CLOCKS) {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- *status = SCMI_STATUS_SUCCESS;
- return_values[OFFSET_RET(
- struct arm_scmi_clock_rate_get,
- rate)] = 100;
- return_values[OFFSET_RET(
- struct arm_scmi_clock_rate_get,
- rate) + 1] = 150;
- break;
- case CLK_CONFIG_SET_MSG_ID:
- if (parameters[OFFSET_PARAM(
- struct arm_scmi_clock_config_set, clock_id)] >=
- NUMBER_CLOCKS) {
- *status = SCMI_STATUS_NOT_FOUND;
- break;
- }
- *status = SCMI_STATUS_SUCCESS;
- break;
-*/
- default:
- *status = SCMI_STATUS_NOT_FOUND;
- }
- break;
- case SNSR_PROTO_ID:
- switch(message_id)
- {
- case SNSR_PROTO_VER_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[0] = sensor_protocol.protocol_version;
- break;
- case SNSR_PROTO_ATTRIB_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 4;
- return_values[OFFSET_RET(
- struct arm_scmi_sensor_protocol_attributes,
- attributes)] =
- (sensor_protocol.number_sensors << SNR_NUMBER_SENSORS_LOW) +
- (sensor_protocol.max_num_pending_async_cmds_supported <<
- SNR_MAX_NUM_PENDING_ASYNC_CMDS_SPRT_LOW) +
- (RESERVED << SNR_RESERVED_LOW);
- return_values[OFFSET_RET(
- struct arm_scmi_sensor_protocol_attributes,
- sensor_reg_address_low)] = sensor_protocol.sensor_reg_address_low;
- return_values[OFFSET_RET(
- struct arm_scmi_sensor_protocol_attributes,
- sensor_reg_address_high)] = sensor_protocol.sensor_reg_address_high;
- return_values[OFFSET_RET(
- struct arm_scmi_sensor_protocol_attributes,
- sensor_reg_len)] = sensor_protocol.sensor_reg_length;
- break;
- case SNSR_PROTO_MSG_ATTRIB_MSG_ID:
- *status = SCMI_STATUS_SUCCESS;
- *return_values_count = 1;
- return_values[OFFSET_RET(
- struct arm_scmi_sensor_protocol_message_attributes,
- attributes)] = 0x0;
- break;
- default:
- *status = SCMI_STATUS_NOT_FOUND;
- }
- break;
- default:
- printf("\nProtocol: %d\n", message_id);
- assert(!"\nUnknown protocol id\n");
- break;
- }
-}
diff --git a/platform/sgm776/include/pal_expected.h b/platform/sgm776/include/pal_base_expected.h
similarity index 56%
rename from platform/sgm776/include/pal_expected.h
rename to platform/sgm776/include/pal_base_expected.h
index c21c660572f283439f531c4712edc2d0d40279dc..df49105069543019d7738c6dd77c5b4ecbb30b29 100644
--- a/platform/sgm776/include/pal_expected.h
+++ b/platform/sgm776/include/pal_base_expected.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,20 +15,20 @@
* limitations under the License.
**/
-#ifndef __PAL_TARGET_H__
-#define __PAL_TARGET_H__
+#ifndef __PAL_BASE_EXPECTED_H__
+#define __PAL_BASE_EXPECTED_H__
-/***** This file contains platform specific data which is needed during test verification ****/
+#include
-#define VERSION_ENCODE32(MAJOR, MINOR, PATCH) (((MAJOR & 0xff) << 24) | \
- ((MINOR & 0xff) << 16)| \
- (PATCH & 0xffff))
-#define BASE_PROTOCOL_ID 0x10
-#define PWR_DOMAIN_PROTOCOL_ID 0x11
+#define UNTRUSTED 0
static uint32_t supported_protocols[] = {
BASE_PROTOCOL_ID,
PWR_DOMAIN_PROTOCOL_ID,
+ SYSTEM_POWER_PROTOCOL_ID,
+ PERFORMANCE_PROTOCOL_ID,
+ CLOCK_PROTOCOL_ID,
+ SENSOR_PROTOCOL_ID,
};
static char *agents[] = {
@@ -39,10 +39,6 @@ static char *agents[] = {
static char *vendor_name = "arm";
static char *subvendor_name = "arm";
-static uint32_t implementation_version = VERSION_ENCODE32(2, 0, 0);
+static uint32_t implementation_version = VERSION_ENCODE32(2, 7, 0);
-/* Expected POWER DOMAIN parameters */
-
-static uint32_t num_power_domains = 3;
-
-#endif /* PAL_TARGET_H_ */
+#endif /* __PAL_BASE_EXPECTED_H__ */
diff --git a/test_pool/clock/clock_testlist.h b/platform/sgm776/include/pal_clock_expected.h
similarity index 56%
rename from test_pool/clock/clock_testlist.h
rename to platform/sgm776/include/pal_clock_expected.h
index 4e51760d72d7436d3ecc9c12316bef1d35a093a5..cf980e02bbf2703df09273d15950591f33f9b890 100644
--- a/test_pool/clock/clock_testlist.h
+++ b/platform/sgm776/include/pal_clock_expected.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,15 +15,24 @@
* limitations under the License.
**/
-#ifndef __CLOCK_TESTLIST_H__
-#define __CLOCK_TESTLIST_H__
+#ifndef __PAL_CLOCK_EXPECTED_H__
+#define __PAL_CLOCK_EXPECTED_H__
-uint32_t clock_query_protocol_version(void);
-uint32_t clock_query_protocol_attributes(void);
-uint32_t clock_query_mandatory_command_support(void);
-uint32_t clock_attributes_check(void);
-uint32_t clock_rate_get_check(void);
-uint32_t clock_config_set_check(void);
-uint32_t clock_invalid_messageid_call(void);
+/* Expected CLOCK parameters */
+#ifdef CLOCK_PROTOCOL
+
+#define UNSUPPORTED 1
+
+static uint32_t num_clocks = 0x04;
+static uint32_t num_of_clock_rates[] = {
+ 0x01, /* Clock 0 */
+ 0x01, /* Clock 1 */
+ 0x01, /* Clock 2 */
+ 0x01 /* Clock 3 */
+};
+
+uint32_t max_num_pending_async_rate_chg_supported = 0;
#endif
+
+#endif /* __PAL_CLOCK_EXPECTED_H__ */
diff --git a/test_pool/common/protocol_testlist.h b/platform/sgm776/include/pal_performance_expected.h
similarity index 54%
rename from test_pool/common/protocol_testlist.h
rename to platform/sgm776/include/pal_performance_expected.h
index ad181e49b7a1bdae7796d9f2a0048d8011b790b6..25ce6644230dfa291b544c8fb074d71ed1a8e5d0 100644
--- a/test_pool/common/protocol_testlist.h
+++ b/platform/sgm776/include/pal_performance_expected.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,21 +15,27 @@
* limitations under the License.
**/
+#ifndef __PAL_PERFORMANCE_EXPECTED_H__
+#define __PAL_PERFORMANCE_EXPECTED_H__
-
-test_fn_ptr *val_base_get_testlist(uint32_t *num_tests);
-#ifdef POWER_DOMAIN_PROTOCOL
-test_fn_ptr *val_power_domain_get_testlist(uint32_t *num_tests);
-#endif
-#ifdef SYSTEM_POWER_PROTOCOL
-test_fn_ptr *val_system_power_get_testlist(uint32_t *num_tests);
-#endif
-#ifdef CLOCK_PROTOCOL
-test_fn_ptr *val_clock_get_testlist(uint32_t *num_tests);
-#endif
-#ifdef SENSOR_PROTOCOL
-test_fn_ptr *val_sensor_get_testlist(uint32_t *num_tests);
-#endif
+/* Expected PERFORMANCE parameters */
#ifdef PERFORMANCE_PROTOCOL
-test_fn_ptr *val_performance_get_testlist(uint32_t *num_tests);
+static uint32_t num_perf_domains = 0x03;
+
+static uint32_t perf_num_performance_levels[] = {
+ 5, /* LITTLE */
+ 5, /* BIG */
+ 5 /* GPU */
+};
+
+static char *performance_domain_names[] = {
+ "CPU_GROUP_LITTL",
+ "CPU_GROUP_BIG",
+ "GPU"
+};
+
+uint32_t statistics_address_low_perf = 0;
+uint32_t statistics_address_len_perf = 0;
#endif
+
+#endif /* __PAL_PERFORMANCE_EXPECTED_H__ */
diff --git a/platform/sgm776/include/pal_platform.h b/platform/sgm776/include/pal_platform.h
index ed5a2c9ba7f22bfb6420b38507c81c28ff383ba7..44358459768c4fe5e0750f9fcbdc8208538e5ca6 100644
--- a/platform/sgm776/include/pal_platform.h
+++ b/platform/sgm776/include/pal_platform.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, 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,13 +18,37 @@
#ifndef __PAL_PLATFORM_H__
#define __PAL_PLATFORM_H__
+#include
+#include
#include
#define LOG_FILE "arm_scmi_test_log.txt"
-int32_t sgm_send_message(uint32_t message_header_send, uint32_t parameter_count,
+#define VERSION_ENCODE32(MAJOR, MINOR, PATCH) (((MAJOR & 0xff) << 24) | \
+ ((MINOR & 0xff) << 16)| \
+ (PATCH & 0xffff))
+#define BASE_PROTOCOL_ID 0x10
+#define PWR_DOMAIN_PROTOCOL_ID 0x11
+#define SYSTEM_POWER_PROTOCOL_ID 0x12
+#define PERFORMANCE_PROTOCOL_ID 0x13
+#define CLOCK_PROTOCOL_ID 0x14
+#define SENSOR_PROTOCOL_ID 0x15
+#define RESET_PROTOCOL_ID 0x16
+#define APCORE_PROTOCOL_ID 0x09
+
+#define TIMEOUT 100
+
+int32_t sgm_send_message(uint32_t message_header_send, size_t parameter_count,
const uint32_t *parameters, uint32_t *message_header_rcv, int32_t *status,
- uint32_t *return_values_count, uint32_t *return_values);
+ size_t *return_values_count, uint32_t *return_values);
+
+int sgm_wait_for_notification(uint32_t *message_header_rcv,
+ size_t *return_values_count, uint32_t *return_values,
+ uint32_t timeout);
+
+int sgm_wait_for_response(uint32_t *message_header_rcv,
+ int32_t *status, size_t *return_values_count, uint32_t *return_values,
+ bool *message_ready, uint32_t timeout);
uint32_t sgm_agent_get_accessible_device(uint32_t agent_id);
uint32_t sgm_agent_get_inaccessible_device(uint32_t agent_id);
diff --git a/test_pool/sensor/sensor_testlist.h b/platform/sgm776/include/pal_power_domain_expected.h
similarity index 61%
rename from test_pool/sensor/sensor_testlist.h
rename to platform/sgm776/include/pal_power_domain_expected.h
index b0bafb586f830c27e0291649030d2a710b6b9ac7..ec8c43f488bc70fe8a7ead25d0c0157ae7d64a26 100644
--- a/test_pool/sensor/sensor_testlist.h
+++ b/platform/sgm776/include/pal_power_domain_expected.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,8 +15,15 @@
* limitations under the License.
**/
-uint32_t sensor_query_protocol_version(void);
-uint32_t sensor_query_protocol_attributes(void);
-uint32_t sensor_query_mandatory_command_support(void);
-uint32_t sensor_invalid_messageid_call(void);
-uint32_t sensor_reading_get_check(void);
+#ifndef __PAL_POWER_DOMAIN_EXPECTED_H__
+#define __PAL_POWER_DOMAIN_EXPECTED_H__
+
+/* Expected POWER DOMAIN parameters */
+#ifdef POWER_DOMAIN_PROTOCOL
+static uint32_t num_power_domains = 0x0e;
+uint32_t statistics_address_low_pow = 0;
+uint32_t statistics_address_len_pow = 0;
+
+#endif
+
+#endif /* __PAL_POWER_DOMAIN_EXPECTED_H__ */
diff --git a/linux_app/main.c b/platform/sgm776/include/pal_reset_expected.h
similarity index 68%
rename from linux_app/main.c
rename to platform/sgm776/include/pal_reset_expected.h
index b82612686b70b32f39b82a0b73d840d6bb473df5..76f8a8d369f2783aafb078d34f76a7e382b72618 100644
--- a/linux_app/main.c
+++ b/platform/sgm776/include/pal_reset_expected.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,10 +15,17 @@
* limitations under the License.
**/
-extern void suite_entry(void);
+#ifndef __PAL_RESET_EXPECTED_H__
+#define __PAL_RESET_EXPECTED_H__
-int main(int argc, char *argv[])
+#ifdef RESET_PROTOCOL
+
+uint32_t num_reset_domains = 0x0;
+
+static char *reset_domain_names[] =
{
- suite_entry();
- return 0;
-}
+ NULL,
+};
+#endif
+
+#endif /* __PAL_RESET_EXPECTED_H__ */
diff --git a/test_pool/performance/performance_testlist.h b/platform/sgm776/include/pal_sensor_expected.h
similarity index 65%
rename from test_pool/performance/performance_testlist.h
rename to platform/sgm776/include/pal_sensor_expected.h
index 6d33fe57629598ae57fe432b9f8c9923c55d008c..810410e5ba92e0526c2171d680754b2453a327e7 100644
--- a/test_pool/performance/performance_testlist.h
+++ b/platform/sgm776/include/pal_sensor_expected.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,6 +15,15 @@
* limitations under the License.
**/
-uint32_t performance_query_protocol_version(void);
-uint32_t performance_query_protocol_attributes(void);
-uint32_t performance_query_mandatory_command_support(void);
+#ifndef __PAL_SENSOR_EXPECTED_H__
+#define __PAL_SENSOR_EXPECTED_H__
+
+#ifdef SENSOR_PROTOCOL
+
+static uint32_t num_sensors = 0x01;
+uint32_t statistics_address_low_snsr = 0;
+uint32_t statistics_address_len_snsr = 0;
+
+#endif
+
+#endif /* __PAL_SENSOR_EXPECTED_H__ */
diff --git a/platform/sgm776/pal_base.c b/platform/sgm776/pal_base.c
new file mode 100644
index 0000000000000000000000000000000000000000..295b10d0af4df3245c24c73fbb6d385ddb91af75
--- /dev/null
+++ b/platform/sgm776/pal_base.c
@@ -0,0 +1,109 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "pal_interface.h"
+#include "pal_base_expected.h"
+
+/**
+ @brief This API is used to check vendor name
+ @param none
+ @return vendor name
+**/
+char *pal_base_get_expected_vendor_name(void)
+{
+ return vendor_name;
+}
+
+/**
+ @brief This API is used for checking subvendor name
+ @param none
+ @return subvendor name
+**/
+char *pal_base_get_expected_subvendor_name(void)
+{
+ return subvendor_name;
+}
+
+/**
+ @brief This API is used for checking implementation version
+ @param none
+ @return implementation version
+**/
+uint32_t pal_base_get_expected_implementation_version(void)
+{
+ return implementation_version;
+}
+
+/**
+ @brief This API is used for checking num of agents
+ @param none
+ @return num of agents
+**/
+uint32_t pal_base_get_expected_num_agents(void)
+{
+ return NUM_ELEMS(agents);
+}
+
+/**
+ @brief This API is used for checking num of protocols agent have access
+ @param none
+ @return num of protocols
+**/
+uint32_t pal_base_get_expected_num_protocols(void)
+{
+ return NUM_ELEMS(supported_protocols);
+}
+
+/**
+ @brief This API is used for checking if agent is trusted
+ @param agent id
+ @return true/false
+**/
+uint32_t pal_check_trusted_agent(uint32_t agent_id)
+{
+ return UNTRUSTED;
+}
+
+/**
+ @brief This API is used to get device which agent can access
+ @param agent id
+ @return device id
+**/
+uint32_t pal_agent_get_accessible_device(uint32_t agent_id)
+{
+ return sgm_agent_get_accessible_device(agent_id);
+}
+
+/**
+ @brief This API is used to get device which agent cannot access
+ @param agent id
+ @return device id
+**/
+uint32_t pal_agent_get_inaccessible_device(uint32_t agent_id)
+{
+ return sgm_agent_get_inaccessible_device(agent_id);
+}
+
+/**
+ @brief This API is used to get protocol by which given device can be access
+ @param device id
+ @return protocol id
+**/
+uint32_t pal_device_get_accessible_protocol(uint32_t device_id)
+{
+ return sgm_device_get_accessible_protocol(device_id);
+}
diff --git a/platform/sgm776/pal_clock.c b/platform/sgm776/pal_clock.c
new file mode 100644
index 0000000000000000000000000000000000000000..fcf49bbd06701d276751c2bc3816089906d9b9dc
--- /dev/null
+++ b/platform/sgm776/pal_clock.c
@@ -0,0 +1,62 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+#ifdef CLOCK_PROTOCOL
+
+#include "pal_interface.h"
+#include "pal_clock_expected.h"
+
+/**
+ @brief This API is used for checking num of clocks
+ @param none
+ @return num of clocks
+**/
+uint32_t pal_clock_get_expected_num_clocks(void)
+{
+ return num_clocks;
+}
+
+/**
+ @brief This API is used for checking max num of pending async cmd support for clock
+ @param none
+ @return max num of pending async cmd
+**/
+uint32_t pal_clock_get_expected_max_async_cmd(void)
+{
+ return max_num_pending_async_rate_chg_supported;
+}
+
+/**
+ @brief This API is used for checking num of rates a clock supports
+ @param clock id
+ @return num of rates a clock supports
+**/
+uint32_t pal_clock_get_expected_number_of_rates(uint32_t clock_id)
+{
+ return num_of_clock_rates[clock_id];
+}
+
+/**
+ @brief This API checks if clock supports config change
+ @param clock id
+ @return supported / unsupported
+**/
+uint32_t pal_check_clock_config_change_support(uint32_t clock_id)
+{
+ return UNSUPPORTED;
+}
+
+#endif
diff --git a/platform/sgm776/pal_performance.c b/platform/sgm776/pal_performance.c
new file mode 100644
index 0000000000000000000000000000000000000000..72cee3e43b735153d9e1d142737be276186c9fba
--- /dev/null
+++ b/platform/sgm776/pal_performance.c
@@ -0,0 +1,82 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+#ifdef PERFORMANCE_PROTOCOL
+
+#include "pal_interface.h"
+#include "pal_performance_expected.h"
+
+/**
+ @brief This API is used for checking number of perf domains
+ @param none
+ @return num of perf domains
+**/
+uint32_t pal_performance_get_expected_num_domains(void)
+{
+ return num_perf_domains;
+}
+
+/**
+ @brief This API is used for checking perf statistics addr low
+ @param none
+ @return statistics addr low
+**/
+uint32_t pal_performance_get_expected_stats_addr_low(void)
+{
+ return statistics_address_low_perf;
+}
+
+/**
+ @brief This API is used for checking perf statistics addr high
+ @param none
+ @return statistics addr high
+**/
+uint32_t pal_performance_get_expected_stats_addr_high(void)
+{
+ return (statistics_address_low_perf + statistics_address_len_perf);
+}
+
+/**
+ @brief This API is used for checking statistics addr len
+ @param none
+ @return statistics addr len
+**/
+uint32_t pal_performance_get_expected_stats_addr_len(void)
+{
+ return statistics_address_len_perf;
+}
+
+/**
+ @brief This API is used for checking domain name
+ @param perf domain id
+ @return perf domain name
+**/
+uint8_t *pal_performance_get_expected_name(uint32_t domain_id)
+{
+ return (uint8_t *)&performance_domain_names[domain_id][0];
+}
+
+/**
+ @brief This API is used for checking num of level for perf domain
+ @param perf domain id
+ @return num of level for perf domain
+**/
+uint32_t pal_performance_get_expected_number_of_level(uint32_t domain_id)
+{
+ return perf_num_performance_levels[domain_id];
+}
+
+#endif
diff --git a/platform/sgm776/pal_platform.c b/platform/sgm776/pal_platform.c
index 8d1ab3227739d28585b7d7b776fdb332c6600ee1..1042794a702db561e903bcc5de6d54d6f5d5f15c 100644
--- a/platform/sgm776/pal_platform.c
+++ b/platform/sgm776/pal_platform.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,22 +17,42 @@
#include "pal_platform.h"
#include "pal_interface.h"
-#include "pal_expected.h"
-void pal_send_message(uint32_t message_header_send, uint32_t parameter_count,
+/**
+ @brief This API is used to call platform function to send command
+ @param cmd message header
+ @param num of cmd parameter
+ @param parameter list
+ @param response message header
+ @param cmd status
+ @param return values count
+ @param return values list
+ @return vendor name
+**/
+void pal_send_message(uint32_t message_header_send, size_t parameter_count,
const uint32_t *parameters, uint32_t *message_header_rcv, int32_t *status,
- uint32_t *return_values_count, uint32_t *return_values)
+ size_t *return_values_count, uint32_t *return_values)
{
sgm_send_message(message_header_send, parameter_count, parameters,
message_header_rcv, status, return_values_count,
return_values);
}
-void pal_initialize_system(void)
+/**
+ @brief This API is used to initialize platform to run tests if needed
+ @param platform info
+ @return success / failure
+**/
+uint32_t pal_initialize_system(void *info)
{
- return;
+ return 0; /* No initialization needed for SGM to run test */
}
+/**
+ @brief This API is used to print test log
+ @param args values to be printed
+ @return none
+**/
void pal_print(uint32_t print_level, const char *format, va_list args)
{
FILE *file_ptr = fopen(LOG_FILE, "a");
@@ -45,47 +65,34 @@ void pal_print(uint32_t print_level, const char *format, va_list args)
printf("ERROR: Log File opening failed");
}
-char *pal_base_get_protocol_vendor_name(void)
+/**
+ @brief This API is used to receive delayed response
+ @param message header received
+ @param status of command processed
+ @param return values count
+ @param return values list
+ **/
+void pal_receive_delayed_response(uint32_t *message_header_rcv, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values)
{
- return vendor_name;
-}
+ uint32_t timeout = TIMEOUT; /* In ms*/
-char *pal_base_get_expected_subvendor_name(void)
-{
- return subvendor_name;
+ sgm_wait_for_response(message_header_rcv, status,
+ return_values_count, return_values, NULL, timeout);
}
-uint32_t pal_base_get_expected_implementation_version(void)
+/**
+ @brief This API is used to receive notifications from platform
+ @param message header received
+ @param return values count
+ @param return values list
+ **/
+void pal_receive_notification(uint32_t *message_header_rcv, size_t *return_values_count,
+ uint32_t *return_values)
{
- return implementation_version;
-}
+ uint32_t timeout = TIMEOUT; /* In ms*/
-uint32_t pal_base_get_expected_num_agents(void)
-{
- return NUM_ELEMS(agents);
+ sgm_wait_for_notification(message_header_rcv,
+ return_values_count, return_values, timeout);
}
-uint32_t pal_pwr_domain_get_expected_num_domains(void)
-{
- return num_power_domains;
-}
-
-uint32_t pal_get_expected_num_supported_protocols(void)
-{
- return NUM_ELEMS(supported_protocols);
-}
-
-uint32_t pal_agent_get_accessible_device(uint32_t agent_id)
-{
- return sgm_agent_get_accessible_device(agent_id);
-}
-
-uint32_t pal_agent_get_inaccessible_device(uint32_t agent_id)
-{
- return sgm_agent_get_inaccessible_device(agent_id);
-}
-
-uint32_t pal_device_get_accessible_protocol(uint32_t device_id)
-{
- return sgm_device_get_accessible_protocol(device_id);
-}
diff --git a/platform/sgm776/pal_power_domain.c b/platform/sgm776/pal_power_domain.c
new file mode 100644
index 0000000000000000000000000000000000000000..274e07ffa8130c51093514667873ac6d46e21722
--- /dev/null
+++ b/platform/sgm776/pal_power_domain.c
@@ -0,0 +1,62 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+#ifdef POWER_DOMAIN_PROTOCOL
+
+#include "pal_interface.h"
+#include "pal_power_domain_expected.h"
+
+/**
+ @brief This API is used for checking num of power domain
+ @param none
+ @return num of power domain
+**/
+uint32_t pal_power_get_expected_num_domains(void)
+{
+ return num_power_domains;
+}
+
+/**
+ @brief This API is used for checking power domain statistics addr low
+ @param none
+ @return statistics addr low
+**/
+uint32_t pal_power_get_expected_stats_addr_low(void)
+{
+ return statistics_address_low_pow;
+}
+
+/**
+ @brief This API is used for checking power domain statistics addr high
+ @param none
+ @return statistics addr high
+**/
+uint32_t pal_power_get_expected_stats_addr_high(void)
+{
+ return (statistics_address_low_pow + statistics_address_len_pow);
+}
+
+/**
+ @brief This API is used for checking power domain statistics addr len
+ @param none
+ @return statistics addr len
+**/
+uint32_t pal_power_get_expected_stats_addr_len(void)
+{
+ return statistics_address_len_pow;
+}
+
+#endif
diff --git a/test_pool/clock/clock_testlist.c b/platform/sgm776/pal_reset.c
similarity index 51%
rename from test_pool/clock/clock_testlist.c
rename to platform/sgm776/pal_reset.c
index f22852fefb2a359ece7d3171bd51471662b5ebba..da2e9db7b447729955fa953efe7da38dfa11a1fd 100644
--- a/test_pool/clock/clock_testlist.c
+++ b/platform/sgm776/pal_reset.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,21 +14,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
-#include "val_interface.h"
-#include "clock_testlist.h"
+#ifdef RESET_PROTOCOL
-test_fn_ptr clock_test[] = {
- clock_query_protocol_version,
- clock_query_protocol_attributes,
- clock_query_mandatory_command_support,
- clock_attributes_check,
- clock_rate_get_check,
- clock_config_set_check,
- clock_invalid_messageid_call
-};
+#include "pal_interface.h"
+#include "pal_reset_expected.h"
-test_fn_ptr *val_clock_get_testlist(uint32_t *num_tests)
+/**
+ @brief This API is used for checking num of reset domain
+ @param none
+ @return num of reset domain
+**/
+uint32_t pal_reset_get_expected_num_domains(void)
{
- *num_tests = NUM_ELEMS(clock_test);
- return clock_test;
+ return num_reset_domains;
}
+
+/**
+ @brief This API is used for checking reset domain name
+ @param domain id
+ @return reset domain name
+**/
+uint8_t *pal_reset_get_expected_name(uint32_t domain_id)
+{
+ return (uint8_t *)reset_domain_names[domain_id];
+}
+
+#endif
+
diff --git a/platform/sgm776/pal_sensor.c b/platform/sgm776/pal_sensor.c
new file mode 100644
index 0000000000000000000000000000000000000000..c9d7126b6e94ce99780e044495553d7fd21a1d2c
--- /dev/null
+++ b/platform/sgm776/pal_sensor.c
@@ -0,0 +1,62 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+#ifdef SENSOR_PROTOCOL
+
+#include "pal_interface.h"
+#include "pal_sensor_expected.h"
+
+/**
+ @brief This API is used for checking num of sensors
+ @param none
+ @return num of sensors
+**/
+uint32_t pal_sensor_get_expected_num_sensors(void)
+{
+ return num_sensors;
+}
+
+/**
+ @brief This API is used for checking sensor statistics addr low
+ @param none
+ @return statistics addr low
+**/
+uint32_t pal_sensor_get_expected_stats_addr_low(void)
+{
+ return statistics_address_low_snsr;
+}
+
+/**
+ @brief This API is used for checking sensor statistics addr high
+ @param none
+ @return statistics addr high
+**/
+uint32_t pal_sensor_get_expected_stats_addr_high(void)
+{
+ return (statistics_address_low_snsr + statistics_address_len_snsr);
+}
+
+/**
+ @brief This API is used for checking sensor statistics addr len
+ @param none
+ @return statistics addr len
+**/
+uint32_t pal_sensor_get_expected_stats_addr_len(void)
+{
+ return statistics_address_len_snsr;
+}
+
+#endif
diff --git a/platform/sgm776/transport_mailbox.c b/platform/sgm776/transport_mailbox.c
index 2ce0d2c5bb9584f3c4821a66e6435b5e808fbe1f..e6fee65276b2318027be8ff897b00b704780a72a 100644
--- a/platform/sgm776/transport_mailbox.c
+++ b/platform/sgm776/transport_mailbox.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,7 +13,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-**/
+ **/
#include
#include
@@ -66,9 +66,9 @@ enum {
* Mailbox Memory in the SCMI specification.
*
*/
-int32_t sgm_send_message(uint32_t message_header_send, uint32_t parameter_count,
+int32_t sgm_send_message(uint32_t message_header_send, size_t parameter_count,
const uint32_t *parameters, uint32_t *message_header_rcv, int32_t *status,
- uint32_t *return_values_count, uint32_t *return_values)
+ size_t *return_values_count, uint32_t *return_values)
{
/* variables to be used in this function */
uint32_t fd_signal, fd_message; // file descriptors for each mailbox interface
@@ -119,6 +119,7 @@ int32_t sgm_send_message(uint32_t message_header_send, uint32_t parameter_count,
* */
fd_message = open(MB_MESSAGE_FILE, 0x0002);
if (fd_message < 0) {
+ free(buffer);
return ERROR;
}
write(fd_message, buffer, MAX_MEMORY_LENGTH);
@@ -128,6 +129,7 @@ int32_t sgm_send_message(uint32_t message_header_send, uint32_t parameter_count,
* */
fd_signal = open(MB_SIGNAL_FILE, 0x0001);
if (fd_signal < 0) {
+ free(buffer);
return ERROR;
}
memset(buffer, 0x0, MAX_MEMORY_LENGTH);
@@ -141,6 +143,7 @@ int32_t sgm_send_message(uint32_t message_header_send, uint32_t parameter_count,
// non-negative indicates successful completion
if (ret < 0) {
+ free(buffer);
return ERROR;
}
@@ -166,40 +169,200 @@ int32_t sgm_send_message(uint32_t message_header_send, uint32_t parameter_count,
// extract payload
// plus 1 to skip the Length
// return_values starts from 0, hence subtract 2 here
- return_values[(counter - 2)] = *(header_payload_length + 1 + counter);
+ return_values[(counter - 2)] = *(header_payload_length + 1 + counter);
+ (*return_values_count)++;
}
}
-
+ free(buffer);
return NO_ERROR;
}
/*!
* @brief Interface function that waits for
* delayed response.
- *
- * This is the mocker platform implementation of the receive_platform_response
- * interface which will be called by the test_agent when it is expecting to
- * receive either a delayed_response or notification from the platform over the
- * P2A channel.
- *
*/
int sgm_wait_for_response(uint32_t *message_header_rcv,
int32_t *status, size_t *return_values_count, uint32_t *return_values,
bool *message_ready, uint32_t timeout)
{
+ /* variables to be used in this function */
+ uint32_t fd_message; // file descriptors for each mailbox interface
+ uint32_t ret = 0; // return polling signal
+ uint8_t *buffer; // pointer to access mailbox memory
+ uint32_t counter;
+ uint32_t *header_payload_length; // pointer to read payload length
+ struct pollfd pfd;
+
+ /* initialise buffer */
+ buffer = (uint8_t *)malloc(MAX_MEMORY_LENGTH);
+ if (buffer == NULL)
+ return ERROR;
+ memset(buffer, 0x0, MAX_MEMORY_LENGTH);
+
+ /* prepare the message to be sent to mailbox driver interfaces in the following order:
+ * - RESERVED 1 (skipped as it has already been defaulted to zero)
+ * - CHANNEL STATUS (skipped as it has already been defaulted to zero)
+ * - RESERVED 2 (skipped as it has already been defaulted to zero)
+ * - MAILBOX FLAGS (always set to 1 to indicate completion via an interrupt)
+ * - LENGTH (this will be particularly useful to dertermine the returned payload length)
+ * - MESSAGE HEADER (as the data passed in)
+ * - MESSAGE PAYLOAD (used to hold parameter when sending OR return values upon receipt)
+ * */
+
+ buffer[MB_FLAGS] = 0x1; // populating MAILBOX_FLAGS
+
+ /* Send message to the mailbox driver interface
+ * defined by the MB_MESSAGE_FILE macro
+ * */
+ fd_message = open(MB_MESSAGE_FILE, 0x0002);
+ if (fd_message < 0) {
+ free(buffer);
+ return ERROR;
+ }
+
+ /* polling */
+ pfd.fd = fd_message;
+ pfd.revents = POLLIN;
+ ret = poll(&pfd, 1, timeout);
+
+ // non-negative indicates successful completion
+ if (ret < 0) {
+ free(buffer);
+ return ERROR;
+ }
+
+ /* read returned message into the buffer */
+ read(fd_message, buffer, MAX_MEMORY_LENGTH);
+
+ /* Extract bytes using an uint32_t pointer. */
+ header_payload_length = (uint32_t *) &buffer[MB_HEADER_PAYLOAD_LENGTH];
+
+ /* read the payload part */
+ for (counter = 0; counter < (*(header_payload_length) / 4); ++counter) {
+ if (counter == 0) {
+ // extract header
+ // plus 1 to skip the Length
+ *message_header_rcv = *(header_payload_length + 1 + counter);
+ }
+ else if (counter == 1) {
+ // extract status
+ // plus 1 to skip the Length
+ *status = *(header_payload_length + 1 + counter);
+ }
+ else {
+ // extract payload
+ // plus 1 to skip the Length
+ // return_values starts from 0, hence subtract 2 here
+ return_values[(counter - 2)] = *(header_payload_length + 1 + counter);
+ (*return_values_count)++;
+ }
+ }
+
+ free(buffer);
+
+ return NO_ERROR;
+}
+
+/*!
+ * @brief Interface function that waits for
+ * notification.
+ */
+int sgm_wait_for_notification(uint32_t *message_header_rcv,
+ size_t *return_values_count, uint32_t *return_values,
+ uint32_t timeout)
+{
+ /* variables to be used in this function */
+ uint32_t fd_message; // file descriptors for each mailbox interface
+ uint32_t ret = 0; // return polling signal
+ uint8_t *buffer; // pointer to access mailbox memory
+ uint32_t counter;
+ uint32_t *header_payload_length; // pointer to read payload length
+ struct pollfd pfd;
+
+ /* initialise buffer */
+ buffer = (uint8_t *)malloc(MAX_MEMORY_LENGTH);
+ if (buffer == NULL)
+ return ERROR;
+ memset(buffer, 0x0, MAX_MEMORY_LENGTH);
+
+ /* prepare the message to be sent to mailbox driver interfaces in the following order:
+ * - RESERVED 1 (skipped as it has already been defaulted to zero)
+ * - CHANNEL STATUS (skipped as it has already been defaulted to zero)
+ * - RESERVED 2 (skipped as it has already been defaulted to zero)
+ * - MAILBOX FLAGS (always set to 1 to indicate completion via an interrupt)
+ * - LENGTH (this will be particularly useful to dertermine the returned payload length)
+ * - MESSAGE HEADER (as the data passed in)
+ * - MESSAGE PAYLOAD (used to hold parameter when sending OR return values upon receipt)
+ * */
+
+ buffer[MB_FLAGS] = 0x1; // populating MAILBOX_FLAGS
+
+ /* Send message to the mailbox driver interface
+ * defined by the MB_MESSAGE_FILE macro
+ * */
+ fd_message = open(MB_MESSAGE_FILE, 0x0002);
+ if (fd_message < 0) {
+ free(buffer);
+ return ERROR;
+ }
+
+ /* polling */
+ pfd.fd = fd_message;
+ pfd.revents = POLLIN;
+ ret = poll(&pfd, 1, timeout);
+
+ // non-negative indicates successful completion
+ if (ret < 0) {
+ free(buffer);
+ return ERROR;
+ }
+
+ /* read returned message into the buffer */
+ read(fd_message, buffer, MAX_MEMORY_LENGTH);
+
+ /* Extract bytes using an uint32_t pointer. */
+ header_payload_length = (uint32_t *) &buffer[MB_HEADER_PAYLOAD_LENGTH];
+
+ /* read the payload part */
+ for (counter = 0; counter < (*(header_payload_length) / 4); ++counter) {
+ if (counter == 0) {
+ // extract header
+ // plus 1 to skip the Length
+ *message_header_rcv = *(header_payload_length + 1 + counter);
+ }
+ else {
+ // extract payload
+ // plus 1 to skip the Length
+ // return_values starts from 0, hence subtract 2 here
+ return_values[(counter - 2)] = *(header_payload_length + 1 + counter);
+ (*return_values_count)++;
+ }
+ }
+
+ free(buffer);
+
return NO_ERROR;
}
+/*!
+ * @brief Interface function that gets accessible device for given agent
+ */
uint32_t sgm_agent_get_accessible_device(uint32_t agent_id)
{
- return NO_ERROR;
+ return NO_ERROR;
}
+/*!
+ * @brief Interface function that gets inaccessible device for given agent
+ */
uint32_t sgm_agent_get_inaccessible_device(uint32_t agent_id)
{
return NO_ERROR;
}
+/*!
+ * @brief Interface function that gets protocol which can access given device
+ */
uint32_t sgm_device_get_accessible_protocol(uint32_t device_id)
{
return NO_ERROR;
diff --git a/test_pool/base/base_testlist.c b/test_pool/base/base_testlist.c
deleted file mode 100644
index 04ee17f26edc65dcfbe85274038da396024d33bd..0000000000000000000000000000000000000000
--- a/test_pool/base/base_testlist.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
- * SPDX-License-Identifier : Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-**/
-
-#include "val_interface.h"
-#include "base_testlist.h"
-
-test_fn_ptr base_test[] = {
- base_query_protocol_version,
- base_query_protocol_attributes,
- base_query_mandatory_command_support,
- base_query_vendor_name,
- base_query_implementation_version,
- base_query_subvendor_info,
-#ifdef SCMI_VERSION_1
- base_discover_agent_v1,
-#else
- base_discover_agent,
-#endif
- base_query_notify_error_support,
- base_query_protocol_list,
- base_invalid_messageid_call,
-#ifndef SCMI_VERSION_1
- base_set_protocol_permissions_check,
- base_set_device_permissions_check,
- base_reset_agent_configuration_check,
- base_deny_restore_protocol_access,
- base_restore_protocol_access_with_reset_agent_configuration,
- base_deny_restore_device_access,
- base_restore_device_access_with_reset_agent_configuration
-#endif
-};
-
-test_fn_ptr *val_base_get_testlist(uint32_t *num_tests)
-{
- *num_tests = NUM_ELEMS(base_test);
- return base_test;
-}
diff --git a/test_pool/base/base_testlist.h b/test_pool/base/base_testlist.h
deleted file mode 100644
index fab94e3a8f85bbca3b6c96f418cec47483314937..0000000000000000000000000000000000000000
--- a/test_pool/base/base_testlist.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
- * SPDX-License-Identifier : Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-**/
-
-#ifndef __BASE_TESTLIST_H__
-#define __BASE_TESTLIST_H__
-
-uint32_t base_query_protocol_version(void);
-uint32_t base_query_protocol_attributes(void);
-uint32_t base_query_mandatory_command_support(void);
-uint32_t base_query_vendor_name(void);
-uint32_t base_query_implementation_version(void);
-uint32_t base_query_subvendor_info(void);
-#ifdef SCMI_VERSION_1
-uint32_t base_discover_agent_v1(void);
-#else
-uint32_t base_discover_agent(void);
-#endif
-uint32_t base_query_notify_error_support(void);
-uint32_t base_query_protocol_list(void);
-uint32_t base_invalid_messageid_call(void);
-#ifndef SCMI_VERSION_1
-uint32_t base_set_protocol_permissions_check(void);
-uint32_t base_set_device_permissions_check(void);
-uint32_t base_reset_agent_configuration_check(void);
-uint32_t base_deny_restore_protocol_access(void);
-uint32_t base_restore_protocol_access_with_reset_agent_configuration(void);
-uint32_t base_deny_restore_device_access(void);
-uint32_t base_restore_device_access_with_reset_agent_configuration(void);
-#endif
-
-#endif
diff --git a/test_pool/base/test_b001.c b/test_pool/base/test_b001.c
index 21c06a14ef6522e36c431acc787377c63fa15a87..05e6fdf46b8dcbf16722da1a620c953f90f42508 100644
--- a/test_pool/base/test_b001.c
+++ b/test_pool/base/test_b001.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,32 +15,34 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 1)
-#define TEST_DESC "Base Protocol Version check "
+#define TEST_DESC "Base protocol version check "
+#define RETURN_VALUE_COUNT 1
-uint32_t base_query_protocol_version(void)
+uint32_t base_query_protocol_version(uint32_t *version)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters;
- uint32_t return_value_count, version;
- uint32_t expected_version;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Check protocol version is as expected value */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query protocol version");
+ /* Query the implemented protocol version of base protocol */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query protocol version");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters = NULL; /* No parameters for this command */
- version = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_VERSION, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &version);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -48,9 +50,13 @@ uint32_t base_query_protocol_version(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- expected_version = val_base_get_expected_protocol_version();
- if (val_protocol_version_check(expected_version, version) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (return_value_count != RETURN_VALUE_COUNT)
return VAL_STATUS_FAIL;
+ *version = return_values[VERSION_OFFSET];
+ val_print(VAL_PRINT_ERR, "\n VERSION : 0x%08x ", *version);
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/base/test_b002.c b/test_pool/base/test_b002.c
index 16f473840e0bf1885a74ca4f2a13296290d87020..c224da1891e297959c76a85b261b67b31be35ab2 100644
--- a/test_pool/base/test_b002.c
+++ b/test_pool/base/test_b002.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,32 +15,34 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 2)
-#define TEST_DESC "Base Protocol Attributes check "
+#define TEST_DESC "Base protocol attributes check "
uint32_t base_query_protocol_attributes(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters;
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
+ uint32_t num_agents, num_protocols, attributes;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Query base protocol attributes and check number of agent and number of protocols
- values */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query protocol attributes");
+ /* Query protocol attributes and check number of agent and number of protocols */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query protocol attributes");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters = NULL; /* No parameters for this command */
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -48,17 +50,25 @@ uint32_t base_query_protocol_attributes(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 16, 31) != VAL_STATUS_PASS))
return VAL_STATUS_FAIL;
+ num_agents = VAL_EXTRACT_BITS(attributes, 8, 15);
+ if (val_compare("NUM AGENTS", num_agents, val_base_get_expected_num_agents()))
+ return VAL_STATUS_FAIL;
+
+ num_protocols = VAL_EXTRACT_BITS(attributes, 0, 7);
+ if (val_compare("NUM PROTOCOLS", num_protocols, val_base_get_expected_num_protocols()))
+ return VAL_STATUS_FAIL;
+
/* Save the number of agents */
val_base_save_info(BASE_NUM_AGENTS, VAL_EXTRACT_BITS(attributes, 8, 15));
- val_print(VAL_PRINT_INFO, "\n\tNUM AGENTS: %d", VAL_EXTRACT_BITS(attributes, 8, 15));
/* Save the protocols implemented */
val_base_save_info(BASE_NUM_PROTOCOLS, VAL_EXTRACT_BITS(attributes, 0, 7));
- val_print(VAL_PRINT_INFO, "\n\tNUM PROTOCOLS: %d ",
- VAL_EXTRACT_BITS(attributes, 0, 7));
return VAL_STATUS_PASS;
}
diff --git a/test_pool/base/test_b003.c b/test_pool/base/test_b003.c
index 0210135bc03daadb5a20ff6c0ee8835b99d1640e..c2098f661be80cc8c33527d560b2e620df42cd48 100644
--- a/test_pool/base/test_b003.c
+++ b/test_pool/base/test_b003.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,32 +15,34 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 3)
-#define TEST_DESC "Base Protocol mandatory command support check "
+#define TEST_DESC "Base msg attributes mandatory cmd check "
uint32_t base_query_mandatory_command_support(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id;
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
/* Mandatory cmd BASE DISCOVER VENDOR should be supported */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] BASE DISCOVER VENDOR support");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] BASE DISCOVER VENDOR support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = BASE_DISCOVER_VENDOR;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -48,20 +50,20 @@ uint32_t base_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
/* Mandatory cmd BASE DISCOVER IMPLEMENTATION VERSION should be supported */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] BASE DISCOVER IMPL VERSION support");
+ val_print(VAL_PRINT_TEST, "\n [Check 2] BASE DISCOVER IMPL VERSION support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = BASE_DISCOVER_IMPLEMENTATION_VERSION;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -69,20 +71,21 @@ uint32_t base_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
/* Mandatory cmd BASE DISCOVER LIST PROTOCOLS should be supported */
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 3] BASE DISCOVER LIST PROTOCOLS support");
+ val_print(VAL_PRINT_TEST, "\n [Check 3] BASE DISCOVER LIST PROTOCOLS support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = BASE_DISCOVER_LIST_PROTOCOLS;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -90,7 +93,9 @@ uint32_t base_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
return VAL_STATUS_PASS;
diff --git a/test_pool/base/test_b004.c b/test_pool/base/test_b004.c
index 80d0330c5dea1063df1fe315002c16c7ef6e6a49..864b798e5c3fe5aca863a6bbfdc74c2bb757e453 100644
--- a/test_pool/base/test_b004.c
+++ b/test_pool/base/test_b004.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, 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,38 +18,56 @@
#include"val_interface.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 4)
-#define TEST_DESC "Base query vendor name check "
+#define TEST_DESC "Base msg attributes invalid msg id check "
-uint32_t base_query_vendor_name(void)
+uint32_t base_invalid_messageid_call(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters;
- uint32_t return_value_count, vendor_identifier[SCMI_NAME_STR_SIZE/4];
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
+ uint32_t message_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Check the vendor name */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query vendor name");
+ /* Sending invalid base protocol cmd should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Invalid command invocation");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters = NULL; /* No parameters for this command */
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_VENDOR, COMMAND_MSG);
+ parameters = NULL;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_INVALID_COMMAND, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, vendor_identifier);
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ /* Query support for invalid base protocol command should return status NOT_FOUND */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query undefined command support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = BASE_INVALID_COMMAND;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
- if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Save the vendor name */
- val_base_save_name(BASE_VENDOR_NAME, (uint8_t *) vendor_identifier);
- val_print(VAL_PRINT_INFO, "\n\tVENDOR NAME: %s ",
- (uint8_t *) vendor_identifier);
+ val_print_return_values(return_value_count, return_values);
return VAL_STATUS_PASS;
}
diff --git a/test_pool/base/test_b005.c b/test_pool/base/test_b005.c
index ec4667eae52970f6368728067c60ac2f98f65e4f..92b2253fbd891eb754be1f6a9debaecc98ac3027 100644
--- a/test_pool/base/test_b005.c
+++ b/test_pool/base/test_b005.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,32 +15,33 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 5)
-#define TEST_DESC "Base query implementation version check "
+#define TEST_DESC "Base query vendor name check "
-uint32_t base_query_implementation_version(void)
+uint32_t base_query_vendor_name(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters;
- uint32_t return_value_count, implementation_version;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Check the implementation version */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query Implementation Version");
+ /* Check the vendor name */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query vendor name");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters = NULL; /* No parameters for this command */
- implementation_version = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_IMPLEMENTATION_VERSION,
- COMMAND_MSG);
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_VENDOR, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &implementation_version);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -48,9 +49,14 @@ uint32_t base_query_implementation_version(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Save the implementation version */
- val_print(VAL_PRINT_INFO, "\n\tIMPLEMENTATION_VERSION: %x ",
- implementation_version);
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_compare_str("VENDOR NAME", (char *)&return_values[VENDOR_ID_OFFSET],
+ val_base_get_expected_vendor_name(), SCMI_NAME_STR_SIZE))
+ return VAL_STATUS_FAIL;
+
+ /* Save the vendor name */
+ val_base_save_name(BASE_VENDOR_NAME, (uint8_t *)&return_values[VENDOR_ID_OFFSET]);
return VAL_STATUS_PASS;
}
diff --git a/test_pool/base/test_b006.c b/test_pool/base/test_b006.c
index 93b19f4ced84766641a1cad8ac96028170ed0347..d39aeb3917cd0dfc582d4f329525bd2a4ee73a38 100644
--- a/test_pool/base/test_b006.c
+++ b/test_pool/base/test_b006.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,44 +15,47 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 6)
-#define TEST_DESC "Base query subvendor name check "
+#define TEST_DESC "Base query subvendor name check "
uint32_t base_query_subvendor_info(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters, message_id;
- uint32_t return_value_count, attributes, vendor_identifier[SCMI_NAME_STR_SIZE/4];
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id, *parameters;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
/* If DISCOVER SUB VENDOR cmd is not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Check discover subvendor cmd support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = BASE_DISCOVER_SUB_VENDOR;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tBASE_SUBVENDOR_NAME not supported ");
+ val_print(VAL_PRINT_ERR, "\n BASE_SUBVENDOR_NAME not supported ");
return VAL_STATUS_SKIP;
}
/* DISCOVER SUB VENDOR cmd is supported, query the sub vendor name */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query subvendor name");
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query subvendor name");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters = NULL;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_SUB_VENDOR, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, vendor_identifier);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -60,10 +63,14 @@ uint32_t base_query_subvendor_info(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_compare_str("SUBVENDOR NAME", (char *)&return_values[VENDOR_ID_OFFSET],
+ val_base_get_expected_subvendor_name(), SCMI_NAME_STR_SIZE))
+ return VAL_STATUS_FAIL;
+
/* Save the sub-vendor name */
- val_base_save_name(BASE_SUBVENDOR_NAME, (uint8_t *) vendor_identifier);
- val_print(VAL_PRINT_INFO, "\n\tSUBVENDOR NAME: %s ",
- (uint8_t *) vendor_identifier);
+ val_base_save_name(BASE_SUBVENDOR_NAME, (uint8_t *)&return_values[VENDOR_ID_OFFSET]);
return VAL_STATUS_PASS;
}
diff --git a/test_pool/base/test_b007.c b/test_pool/base/test_b007.c
index 3ae1aaa342f7da575c3db87170c88ff2512e340c..d14a20fdd524dbcd23e5ec55b188516147267de7 100644
--- a/test_pool/base/test_b007.c
+++ b/test_pool/base/test_b007.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,49 +16,33 @@
**/
#include"val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 7)
-#define TEST_DESC "Base discover agent check "
-#define MAX_RETURN_VALUE_SIZE 5
+#define TEST_DESC "Base query implementation version check "
-uint32_t base_discover_agent(void)
+uint32_t base_query_implementation_version(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id, agent_id, num_agents;
- uint32_t return_value_count, attributes, return_value[MAX_RETURN_VALUE_SIZE];
- uint8_t *name;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* If BASE DISCOVER AGENT not supported, skip the test */
+ /* Check the implementation version */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query Implementation Version");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- message_id = BASE_DISCOVER_AGENT;
- param_count++;
- attributes = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
-
- if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tBASE_DISCOVER_AGENT not supported ");
- return VAL_STATUS_SKIP;
- }
-
- /* Agent name for platform agent id should start with "platform" */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query with agent id %d", 0);
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- agent_id = 0; /* agent id 0 is for platform */
- param_count++;
- val_memset_zero(return_value, MAX_RETURN_VALUE_SIZE);
-
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_AGENT, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &agent_id, &rsp_msg_hdr, &status,
- &return_value_count, return_value);
+ parameters = NULL; /* No parameters for this command */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_IMPLEMENTATION_VERSION,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -66,87 +50,10 @@ uint32_t base_discover_agent(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (agent_id != return_value[0]) {
- val_print(VAL_PRINT_ERR, "\n\tCHECK AGENT ID: FAILED");
- val_print(VAL_PRINT_ERR, "\n\tAgent id expected: %d", agent_id);
- val_print(VAL_PRINT_ERR, "\n\tAgent id received: %d", return_value[0]);
- return VAL_STATUS_FAIL;
- } else {
- val_print(VAL_PRINT_DEBUG, "\n\tCHECK AGENT ID: PASSED [%d]", return_value[0]);
- }
-
- name = (uint8_t *) &return_value[1];
- if (val_strcmp((uint8_t *)"platform", name, 8) != VAL_STATUS_PASS) {
- val_print(VAL_PRINT_ERR, "\n\tCHECK AGENT NAME: FAILED");
- val_print(VAL_PRINT_ERR, "\n\tAgent name expected: %s", "platform*");
- val_print(VAL_PRINT_ERR, "\n\tAgent name received: %s", name);
- return VAL_STATUS_FAIL;
- } else {
- val_print(VAL_PRINT_DEBUG, "\n\tCHECK AGENT NAME: PASSED [%s]", name);
- }
-
- /* Agent id 0xFFFFFFFF should return agent own name */
-
- agent_id = 0xFFFFFFFF; /* agent id 0xFFFFFFFF is for self */
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Query with agent id %x", agent_id);
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- param_count++;
- val_memset_zero(return_value, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_AGENT, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &agent_id, &rsp_msg_hdr, &status,
- &return_value_count, return_value);
-
- if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- val_base_save_info(BASE_TEST_AGENT_ID, return_value[0]);
- val_base_save_name(BASE_TEST_AGENT_NAME, (uint8_t *)&return_value[1]);
- val_print(VAL_PRINT_INFO, "\n\tTEST_AGENT_ID: %d", return_value[0]);
- val_print(VAL_PRINT_INFO, "\n\tTEST_AGENT_NAME: %s", (uint8_t *) &return_value[1]);
-
- /* base discover agent cmd for invalid agent id should return NOT_FOUND status */
-
- agent_id = 0;
- num_agents = val_base_get_info(BASE_NUM_AGENTS);
- while (++agent_id <= num_agents)
- {
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Query with agent id %x", agent_id);
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- val_memset_zero(return_value, MAX_RETURN_VALUE_SIZE);
- param_count++;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_AGENT, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &agent_id, &rsp_msg_hdr, &status,
- &return_value_count, return_value);
-
- if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- if (agent_id != return_value[0]) {
- val_print(VAL_PRINT_ERR, "\n\tCHECK AGENT ID: FAILED");
- val_print(VAL_PRINT_ERR, "\n\tAgent id expected: %x", agent_id);
- val_print(VAL_PRINT_ERR, "\n\tAgent id received: %x", return_value[0]);
- return VAL_STATUS_FAIL;
- } else {
- val_print(VAL_PRINT_DEBUG, "\n\tCHECK AGENT ID: PASSED [%d]", return_value[0]);
- }
- val_print(VAL_PRINT_INFO, "\n\tAGENT_NAME: %s", (uint8_t *) &return_value[1]);
- }
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 3] Query invalid agent id %d", agent_id);
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- param_count++;
- val_memset_zero(return_value, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_AGENT, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &agent_id, &rsp_msg_hdr, &status,
- &return_value_count, return_value);
+ val_print_return_values(return_value_count, return_values);
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ if (val_compare("IMPL VERSION", return_values[IMPLEMENTATION_VERSION_OFFSET],
+ val_base_get_expected_implementation_version()))
return VAL_STATUS_FAIL;
return VAL_STATUS_PASS;
diff --git a/test_pool/base/test_b008.c b/test_pool/base/test_b008.c
index 88deca4b172955bd10756fdff3552b13b77e5bc0..fce56935d91fd4bd8282250d28f4cc8d8255cd21 100644
--- a/test_pool/base/test_b008.c
+++ b/test_pool/base/test_b008.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,49 +16,87 @@
**/
#include"val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 8)
-#define TEST_DESC "Base notify errors check "
+#define TEST_DESC "Base query protocol list "
-uint32_t base_query_notify_error_support(void)
+uint32_t base_query_protocol_list(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, notify_enable, message_id;
- uint32_t return_value_count, attributes, return_values;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t num_protocols_returned, total_num_protocols;
+ uint32_t i, protocol_list = 0;
+ uint32_t skip = 0;
+ uint32_t *protocols = NULL;
+ uint8_t prot;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* If BASE NOTIFY ERRORS not supported, skip the test */
+ /* Reset protocol list, if test failed or skipped*/
+ val_agent_set_supported_protocol_list(0);
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- message_id = BASE_NOTIFY_ERRORS;
- param_count++;
- attributes = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
-
- if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tBASE_NOTIFY_ERRORS not supported. ");
+ total_num_protocols = val_base_get_info(BASE_NUM_PROTOCOLS);
+ if (total_num_protocols == 0) {
+ val_print(VAL_PRINT_ERR, "\n No protocols supported for agent ");
return VAL_STATUS_SKIP;
}
- /* BASE NOTIFY ERRORS with invalid notify_enable should return status INVALID PARAMETERS */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query with valid skip values ");
+
+ /* Query list of all supported protocols */
+ do
+ {
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_LIST_PROTOCOLS, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &skip, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query base notify error with invalid notify_enable");
+ val_print_return_values(return_value_count, return_values);
+
+ num_protocols_returned = return_values[NUM_OF_PROTOCOLS_OFFSET];
+ val_print(VAL_PRINT_DEBUG, "\n NUM OF PROTOCOLS: %d", num_protocols_returned);
+
+ protocols = &return_values[PROTOCOL_LIST_OFFSET];
+ for (i = 0; i < num_protocols_returned; i++) {
+ prot = (uint8_t)(protocols[i/4] >> ((i % 4) * 8));
+ /* Add to protocol list */
+ protocol_list |= (1 << prot);
+ skip++;
+ }
+ } while (skip < total_num_protocols);
+
+ /* Save supported protocol list*/
+ val_print(VAL_PRINT_ERR, "\n PROTOCOL LIST : 0x%08x ", protocol_list);
+ val_agent_set_supported_protocol_list(protocol_list);
+
+ /* DISCOVER_LIST_PROTOCOLS with invalid skip value should return INVALID PARAMETERS status */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Send invalid skip value : %d", skip);
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- notify_enable = 0x4; /* Invalid notify enable value */
param_count++;
- return_values = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_NOTIFY_ERRORS, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, ¬ify_enable, &rsp_msg_hdr, &status,
- &return_value_count, &return_values);
+ skip = (PROTOCOL_MAX - PROTOCOL_BASE) + 1; /* skip value is set > total num of protocols */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_LIST_PROTOCOLS, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &skip, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/base/test_b009.c b/test_pool/base/test_b009.c
index 2d5be35e2a61e764fff8ae37527aa2d6ff5abf55..f7c9976d70759bddccf5966dd47c8b92816d2efc 100644
--- a/test_pool/base/test_b009.c
+++ b/test_pool/base/test_b009.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,31 +16,48 @@
**/
#include"val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 9)
-#define TEST_DESC "Base query protocol list "
-#define MAX_RETURN_VALUE_SIZE 4
+#define TEST_DESC "Base discover agent check "
-uint32_t base_query_protocol_list(void)
+uint32_t base_discover_agent(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, skip, num_protocols;
- uint32_t return_value_count, return_values[MAX_RETURN_VALUE_SIZE];
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id, agent_id, num_agents;
+ uint8_t *name;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Query list of all supported protocols */
+ /* If BASE DISCOVER AGENT not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Check discover agent cmd support");
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Send valid skip value 0");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = BASE_DISCOVER_AGENT;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n BASE_DISCOVER_AGENT not supported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Agent name for platform agent id should start with "platform" */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query with platform agent id %d", 0);
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- skip = 0;
+ agent_id = 0; /* agent id 0 is for platform */
param_count++;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_LIST_PROTOCOLS, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &skip, &rsp_msg_hdr, &status,
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_AGENT, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &agent_id, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
@@ -49,28 +66,97 @@ uint32_t base_query_protocol_list(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- num_protocols = val_base_get_info(BASE_NUM_PROTOCOLS);
- if (num_protocols == return_values[0])
- val_print(VAL_PRINT_DEBUG, "\n\tCHECK NUM PROTOCOLS: PASSED [%d]", num_protocols);
- else {
- val_print(VAL_PRINT_ERR, "\n\tCHECK NUM PROTOCOLS: FAILED ");
+ val_print_return_values(return_value_count, return_values);
+
+ if (agent_id != return_values[AGENT_ID_OFFSET]) {
+ val_print(VAL_PRINT_ERR, "\n CHECK AGENT ID : FAILED");
+ val_print(VAL_PRINT_ERR, "\n EXPECTED : 0x%08x ", agent_id);
+ val_print(VAL_PRINT_ERR, "\n RECEIVED : 0x%08x ",
+ return_values[AGENT_ID_OFFSET]);
+ return VAL_STATUS_FAIL;
+ }
+ val_print(VAL_PRINT_TEST, "\n CHECK AGENT ID : PASSED [%d]",
+ return_values[AGENT_ID_OFFSET]);
+
+ name = (uint8_t *) &return_values[AGENT_NAME_OFFSET];
+ if (val_strcmp((uint8_t *)"platform", name, 8) != VAL_STATUS_PASS) {
+ val_print(VAL_PRINT_ERR, "\n CHECK NAME : FAILED");
+ val_print(VAL_PRINT_ERR, "\n EXPECTED : %s", "platform*");
+ val_print(VAL_PRINT_ERR, "\n RECEIVED : %20s", name);
return VAL_STATUS_FAIL;
}
+ val_print(VAL_PRINT_TEST, "\n CHECK NAME : PASSED [%s]", name);
- /* DISCOVER_LIST_PROTOCOLS with invalid skip value should return INVALID PARAMETERS status */
+ /* Agent id 0xFFFFFFFF should return agent own name */
+ agent_id = 0xFFFFFFFF; /* agent id 0xFFFFFFFF is for self */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Query with agent id %x", agent_id);
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_AGENT, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &agent_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Send invalid skip value");
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ val_base_save_info(BASE_TEST_AGENT_ID, return_values[AGENT_ID_OFFSET]);
+ val_base_save_name(BASE_TEST_AGENT_NAME, (uint8_t *)&return_values[AGENT_NAME_OFFSET]);
+ val_print(VAL_PRINT_INFO, "\n TEST_AGENT_ID : %d", return_values[AGENT_ID_OFFSET]);
+ val_print(VAL_PRINT_INFO, "\n TEST_AGENT_NAME: %s",
+ (uint8_t *) &return_values[AGENT_NAME_OFFSET]);
+
+ /* base discover agent cmd for invalid agent id should return NOT_FOUND status */
+ agent_id = 0;
+ num_agents = val_base_get_info(BASE_NUM_AGENTS);
+ while (++agent_id <= num_agents)
+ {
+ val_print(VAL_PRINT_TEST, "\n [Check 4] Query with agent id %x", agent_id);
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_AGENT, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &agent_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (agent_id != return_values[AGENT_ID_OFFSET]) {
+ val_print(VAL_PRINT_ERR, "\n CHECK AGENT ID : FAILED");
+ val_print(VAL_PRINT_ERR, "\n EXPECTED : %x", agent_id);
+ val_print(VAL_PRINT_ERR, "\n RECEIVED : %x",
+ return_values[AGENT_ID_OFFSET]);
+ return VAL_STATUS_FAIL;
+ }
+ val_print(VAL_PRINT_TEST, "\n CHECK AGENT ID : PASSED [%d]",
+ return_values[AGENT_ID_OFFSET]);
+ val_print(VAL_PRINT_INFO, "\n AGENT_NAME : %s",
+ (uint8_t *) &return_values[AGENT_NAME_OFFSET]);
+ }
+
+ val_print(VAL_PRINT_TEST, "\n [Check 5] Query invalid agent id %d", agent_id);
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- skip = 8; /* skip value 8 is invalid as SCMI v2 specifications has only 7 protocols */
param_count++;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_LIST_PROTOCOLS, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &skip, &rsp_msg_hdr, &status,
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_AGENT, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &agent_id, &rsp_msg_hdr, &status,
&return_value_count, return_values);
- if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/base/test_b018.c b/test_pool/base/test_b009_v1.c
similarity index 63%
rename from test_pool/base/test_b018.c
rename to test_pool/base/test_b009_v1.c
index a7e08918e9e9fd17e68db2abc24b83a307677608..ab5327a4d41f5240c0bd251e6362dc8f2f0767aa 100644
--- a/test_pool/base/test_b018.c
+++ b/test_pool/base/test_b009_v1.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,49 +16,49 @@
**/
#include"val_interface.h"
+#include"val_base.h"
-#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 7)
-#define TEST_DESC "Base discover agent check "
-#define MAX_RETURN_VALUE_SIZE 4
+#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 9)
+#define TEST_DESC "Base discover agent check "
uint32_t base_discover_agent_v1(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id, agent_id, num_agents;
- uint32_t return_value_count, attributes, return_value[MAX_RETURN_VALUE_SIZE];
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id, agent_id, num_agents;
uint8_t *name;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
/* If BASE DISCOVER AGENT not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Check discover agent cmd support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = BASE_DISCOVER_AGENT;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tBASE_DISCOVER_AGENT not supported ");
+ val_print(VAL_PRINT_ERR, "\n BASE_DISCOVER_AGENT not supported ");
return VAL_STATUS_SKIP;
}
/* Agent name for platform agent id should start with "platform" */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query with agent id %d", 0);
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query with platform agent id %d", 0);
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
agent_id = 0; /* agent id 0 is for platform */
param_count++;
- val_memset_zero(return_value, MAX_RETURN_VALUE_SIZE);
-
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_AGENT, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &agent_id, &rsp_msg_hdr, &status,
- &return_value_count, return_value);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -66,29 +66,28 @@ uint32_t base_discover_agent_v1(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- name = (uint8_t *) &return_value[0];
+ val_print_return_values(return_value_count, return_values);
+
+ name = (uint8_t *) &return_values[AGENT_NAME_v1_OFFSET];
if (val_strcmp((uint8_t *)"platform", name, 8) != VAL_STATUS_PASS) {
- val_print(VAL_PRINT_ERR, "\n\tCHECK AGENT NAME: FAILED");
- val_print(VAL_PRINT_ERR, "\n\tAgent name expected: %s", "platform*");
- val_print(VAL_PRINT_ERR, "\n\tAgent name received: %s", name);
+ val_print(VAL_PRINT_ERR, "\n CHECK NAME : FAILED");
+ val_print(VAL_PRINT_ERR, "\n EXPECTED : %s", "platform*");
+ val_print(VAL_PRINT_ERR, "\n RECEIVED : %s", name);
return VAL_STATUS_FAIL;
- } else {
- val_print(VAL_PRINT_DEBUG, "\n\tCHECK AGENT NAME: PASSED [%s]", name);
}
+ val_print(VAL_PRINT_TEST, "\n CHECK NAME : PASSED [%s]", name);
/* base discover agent cmd for invalid agent id should return NOT_FOUND status */
-
agent_id = 0;
num_agents = val_base_get_info(BASE_NUM_AGENTS);
while (++agent_id <= num_agents)
{
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Query with agent id %x", agent_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Query with agent id %x", agent_id);
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- val_memset_zero(return_value, MAX_RETURN_VALUE_SIZE);
param_count++;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_AGENT, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &agent_id, &rsp_msg_hdr, &status,
- &return_value_count, return_value);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -96,19 +95,24 @@ uint32_t base_discover_agent_v1(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_INFO, "\n\tAGENT_NAME: %s", (uint8_t *) &return_value[0]);
+ val_print_return_values(return_value_count, return_values);
+
+ name = (uint8_t *) &return_values[AGENT_NAME_v1_OFFSET];
+ val_print(VAL_PRINT_INFO, "\n AGENT_NAME : %s", name);
}
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 3] Query invalid agent id %d", agent_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 4] Query invalid agent id %d", agent_id);
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
param_count++;
- val_memset_zero(return_value, MAX_RETURN_VALUE_SIZE);
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_DISCOVER_AGENT, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &agent_id, &rsp_msg_hdr, &status,
- &return_value_count, return_value);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/base/test_b010.c b/test_pool/base/test_b010.c
index 20f2aacf280a487f38dd9821ca2f32490cdde7d7..24ef24e688097f585d5b5055736ac7cbcf9664fd 100644
--- a/test_pool/base/test_b010.c
+++ b/test_pool/base/test_b010.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,49 +15,57 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 10)
-#define TEST_DESC "Base invalid message id check "
+#define TEST_DESC "Notify error invalid notify_enable check "
-uint32_t base_invalid_messageid_call(void)
+uint32_t base_query_notify_error_support(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters, message_id;
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id, notify_enable;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Sending invalid base protocol cmd should fail */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Invalid command invocation");
+ /* If BASE NOTIFY ERRORS not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query notify error cmd support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters = NULL;
- attributes = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_INVALID_COMMAND, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
-
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ message_id = BASE_NOTIFY_ERRORS;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
- /* Query support for invalid base protocol command should return status NOT_FOUND */
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n BASE_NOTIFY_ERRORS not supported ");
+ return VAL_STATUS_SKIP;
+ }
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Query undefined command support");
+ /* BASE NOTIFY ERRORS with invalid notify_enable should return status INVALID PARAMETERS */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query notify error with invalid notify_enable");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- message_id = BASE_INVALID_COMMAND;
- attributes = 0;
- param_count = 1;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ notify_enable = INVALID_NOTIFY_ENABLE; /* Invalid notify enable value */
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_NOTIFY_ERRORS, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, ¬ify_enable, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/base/test_b011.c b/test_pool/base/test_b011.c
index db4080a189eb1e7503898c0abf9c286b984c127c..559060fe08f33e994939f937d2cf246026169c53 100644
--- a/test_pool/base/test_b011.c
+++ b/test_pool/base/test_b011.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,108 +16,104 @@
**/
#include"val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 11)
-#define TEST_DESC "Base set protocol permissions check "
-#define PARAMETER_SIZE 4
+#define TEST_DESC "Base set device permissions check "
+#define PARAMETER_SIZE 3
-uint32_t base_set_protocol_permissions_check(void)
+uint32_t base_set_device_permissions_check(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id, parameters[PARAMETER_SIZE];
- uint32_t return_value_count, return_value;
- uint32_t device_id, agent_id, protocol_id;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t message_id, device_id, agent_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* If SET PROTOCOL PERMISSIONS not supported, skip the test */
+ agent_id = val_base_get_info(BASE_TEST_AGENT_ID);
+
+ /* If agent is not trusted , skip the test */
+ if (val_check_trusted_agent(agent_id) == 0) {
+ val_print(VAL_PRINT_ERR, "\n Calling agent is untrusted agent ");
+ return VAL_STATUS_SKIP;
+ }
+ /* If SET DEVICE PERMISSIONS not supported, skip the test */
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- message_id = BASE_SET_PROTOCOL_PERMISSIONS;
- return_value = 0;
+ message_id = BASE_SET_DEVICE_PERMISSIONS;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
+ &return_value_count, return_values);
if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tSET_PROTOCOL_PERMISSIONS not supported ");
+ val_print(VAL_PRINT_ERR, "\n SET_DEVICE_PERMISSIONS not supported ");
return VAL_STATUS_SKIP;
}
- /* Setting protocol permissions for invalid agent should fail */
-
- agent_id = val_base_get_info(BASE_TEST_AGENT_ID);
+ /* Device permissions for invalid agent should fail */
device_id = val_agent_get_accessible_device(agent_id);
- protocol_id = val_device_get_accessible_protocol(device_id);
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Send invalid agent id");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Set permissions for invalid agent id");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters[param_count++] = val_base_get_info(BASE_NUM_AGENTS) + 1; /* invalid agent id */
parameters[param_count++] = device_id;
- parameters[param_count++] = protocol_id;
- parameters[param_count++] = 1; /* Allow access */
- return_value = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_PROTOCOL_PERMISSIONS, COMMAND_MSG);
+ parameters[param_count++] = FLAG_ACCESS_ALLOW; /* Allow access */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_DEVICE_PERMISSIONS, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Disabling access to BASE PROTOCOL should fail */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Try to remove access for base protocol id");
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters[param_count++] = agent_id;
- parameters[param_count++] = device_id;
- parameters[param_count++] = PROTOCOL_BASE;
- parameters[param_count++] = 0; /* Deny access */
- return_value = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_PROTOCOL_PERMISSIONS, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
-
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Calling PROTOCOL PERMISSIONS with invalid flag should fail */
+ val_print_return_values(return_value_count, return_values);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 3] Send invalid flags");
+ /* Device permissions setting with invalid flag should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Set permissions with invalid flag value");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters[param_count++] = agent_id;
parameters[param_count++] = device_id;
- parameters[param_count++] = protocol_id;
- parameters[param_count++] = 4; /* Invalid flag */
- return_value = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_PROTOCOL_PERMISSIONS, COMMAND_MSG);
+ parameters[param_count++] = INVALID_FLAG_VAL; /* Invalid flag */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_DEVICE_PERMISSIONS, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Setting protocol permissions fr device which agent don't have access should fail */
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+ /* Setting device permissions for device which agent don't have access should fail */
device_id = val_agent_get_inaccessible_device(agent_id);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 4] Try to remove access for invalid device id");
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Remove access for invalid device");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters[param_count++] = agent_id;
- parameters[param_count++] = device_id;
- parameters[param_count++] = protocol_id;
- parameters[param_count++] = 0; /* Deny access */
- return_value = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_PROTOCOL_PERMISSIONS, COMMAND_MSG);
+ parameters[param_count++] = device_id; /* Inaccessible device for agent */
+ parameters[param_count++] = FLAG_ACCESS_DENY; /* Deny access */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_DEVICE_PERMISSIONS, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/base/test_b012.c b/test_pool/base/test_b012.c
index 4b1014bcc2210630f9fe26ad1d6d096011a4345d..60cb2cb7230c2b9c5d4a714ceceda3049192076c 100644
--- a/test_pool/base/test_b012.c
+++ b/test_pool/base/test_b012.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,86 +16,114 @@
**/
#include"val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 12)
-#define TEST_DESC "Base set device permissions check "
+#define TEST_DESC "Base deny and restore device access "
#define PARAMETER_SIZE 3
-uint32_t base_set_device_permissions_check(void)
+uint32_t base_deny_restore_device_access(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id, parameters[PARAMETER_SIZE];
- uint32_t return_value_count, attributes;
- uint32_t agent_id, device_id;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameter[PARAMETER_SIZE];
+ uint32_t agent_id, device_id, message_id, protocol_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* If SET DEVICE PERMISSIONS not supported, skip the test */
+ agent_id = val_base_get_info(BASE_TEST_AGENT_ID);
+
+ /* If agent is not trusted , skip the test */
+ if (val_check_trusted_agent(agent_id) == 0) {
+ val_print(VAL_PRINT_ERR, "\n Calling agent is untrusted agent ");
+ return VAL_STATUS_SKIP;
+ }
+ /* If SET DEVICE PERMISSIONS not supported, skip the test */
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = BASE_SET_DEVICE_PERMISSIONS;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tSET_DEVICE_PERMISSIONS not supported ");
+ val_print(VAL_PRINT_ERR, "\n BASE_SET_DEVICE_PERMISSIONS not supported ");
return VAL_STATUS_SKIP;
}
- /* Device permissions for invalid agent should fail */
-
- agent_id = val_base_get_info(BASE_NUM_AGENTS);
+ /* Deny agent access for a device */
device_id = val_agent_get_accessible_device(agent_id);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Set permissions for invalid agent id");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Deny access to valid device %d", device_id);
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters[param_count++] = val_base_get_info(BASE_NUM_AGENTS) + 1; /* invalid agent id */
- parameters[param_count++] = device_id;
- parameters[param_count++] = 1; /* Allow access */
- attributes = 0;
+ parameter[param_count++] = agent_id;
+ parameter[param_count++] = device_id;
+ parameter[param_count++] = FLAG_ACCESS_DENY; /* Deny access */
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_DEVICE_PERMISSIONS, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Device permissions setting with invalid flag should fail */
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- agent_id = val_base_get_info(BASE_TEST_AGENT_ID);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Set permissions with invalid flag value");
+ /* Agent accessing denied device should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Access denied device");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters[param_count++] = agent_id;
- parameters[param_count++] = device_id;
- parameters[param_count++] = 4; /* Invalid flag */
- attributes = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_DEVICE_PERMISSIONS, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ protocol_id = val_device_get_accessible_protocol(device_id);
+ cmd_msg_hdr = val_msg_hdr_create(protocol_id, 0x0, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, NULL, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_SUCCESS) {
+ val_print(VAL_PRINT_ERR, "\n CHECK DENIED PROTOCOL ACCESS: FAILED");
+ val_print(VAL_PRINT_INFO, "\n Able to access denied device");
+ return VAL_STATUS_FAIL;
+ }
- if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ if (val_compare_status(status, SCMI_DENIED) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Setting device permissions for device which agent don't have access should fail */
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- device_id = val_agent_get_inaccessible_device(agent_id);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 3] Remove access for invalid device");
+ /* Restore agent access to device */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Restore denied device access");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters[param_count++] = agent_id;
- parameters[param_count++] = device_id; /* Inaccessible device for agent */
- parameters[param_count++] = 0; /* Deny access */
- attributes = 0;
+ parameter[param_count++] = agent_id;
+ parameter[param_count++] = device_id;
+ parameter[param_count++] = FLAG_ACCESS_ALLOW; /* Allow access */
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_DEVICE_PERMISSIONS, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Agent should be able to access device after device permission restored */
+ val_print(VAL_PRINT_TEST, "\n [Check 4] Access device after permissions restored");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ cmd_msg_hdr = val_msg_hdr_create(protocol_id, 0x0, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, NULL, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
return VAL_STATUS_PASS;
diff --git a/test_pool/base/test_b013.c b/test_pool/base/test_b013.c
index 78d11fd2756b720ea07535c2238766c1596d3d05..06f6ee9e1ad90439ebb8998a72959d01781d04d4 100644
--- a/test_pool/base/test_b013.c
+++ b/test_pool/base/test_b013.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,65 +15,127 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 13)
-#define TEST_DESC "Base reset agent configuration check "
-#define PARAMETER_SIZE 2
+#define TEST_DESC "Base set protocol permissions check "
+#define PARAMETER_SIZE 4
-uint32_t base_reset_agent_configuration_check(void)
+uint32_t base_set_protocol_permissions_check(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id, parameters[PARAMETER_SIZE];
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t protocol_id, agent_id, device_id, message_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* If BASE RESET AGENT CONFIGURATION not supported, skip the test */
+ agent_id = val_base_get_info(BASE_TEST_AGENT_ID);
+ /* If agent is not trusted , skip the test */
+ if (val_check_trusted_agent(agent_id) == 0) {
+ val_print(VAL_PRINT_ERR, "\n Calling agent is untrusted agent ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* If SET PROTOCOL PERMISSIONS not supported, skip the test */
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- message_id = BASE_RESET_AGENT_CONFIGURATION;
- attributes = 0;
+ message_id = BASE_SET_PROTOCOL_PERMISSIONS;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tBASE_RESET_AGENT_CONFIG not supported. ");
+ val_print(VAL_PRINT_ERR, "\n SET_PROTOCOL_PERMISSIONS not supported ");
return VAL_STATUS_SKIP;
}
- /* Setting permissions for invalid agent should fail */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Set permissions for invalid agent id");
+ /* Setting protocol permissions for invalid agent should fail */
+ device_id = val_agent_get_accessible_device(agent_id);
+ protocol_id = val_device_get_accessible_protocol(device_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Send invalid agent id");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters[param_count++] = val_base_get_info(BASE_NUM_AGENTS) + 1; /* invalid agent id */
- parameters[param_count++] = 1; /* Allow access */
- attributes = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_RESET_AGENT_CONFIGURATION, COMMAND_MSG);
+ parameters[param_count++] = device_id;
+ parameters[param_count++] = protocol_id;
+ parameters[param_count++] = FLAG_ACCESS_ALLOW; /* Allow access */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_PROTOCOL_PERMISSIONS, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ /* Disabling access to BASE PROTOCOL should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Try to remove access for base protocol id");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = agent_id;
+ parameters[param_count++] = device_id;
+ parameters[param_count++] = PROTOCOL_BASE;
+ parameters[param_count++] = FLAG_ACCESS_DENY; /* Deny access */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_PROTOCOL_PERMISSIONS, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Calling RESET AGENT CONFIGURATION cmd with invalid flag value should fail */
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Set permissions with invalid flag value");
+ /* Calling PROTOCOL PERMISSIONS with invalid flag should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Send invalid flags");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters[param_count++] = val_base_get_info(BASE_TEST_AGENT_ID);
- parameters[param_count++] = 4; /* Invalid flag */
- attributes = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_RESET_AGENT_CONFIGURATION, COMMAND_MSG);
+ parameters[param_count++] = agent_id;
+ parameters[param_count++] = device_id;
+ parameters[param_count++] = protocol_id;
+ parameters[param_count++] = INVALID_FLAG_VAL; /* Invalid flag */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_PROTOCOL_PERMISSIONS, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Setting protocol permissions for device which agent don't have access should fail */
+ device_id = val_agent_get_inaccessible_device(agent_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 4] Try to remove access for invalid device id");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = agent_id;
+ parameters[param_count++] = device_id;
+ parameters[param_count++] = protocol_id;
+ parameters[param_count++] = FLAG_ACCESS_DENY; /* Deny access */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_PROTOCOL_PERMISSIONS, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/base/test_b014.c b/test_pool/base/test_b014.c
index e62a5a5de52fe8532b5121ceb8a2df10f02cd1bf..e5ab48b6375fdfa8b0c1bfb8cf06084f4633ea6c 100644
--- a/test_pool/base/test_b014.c
+++ b/test_pool/base/test_b014.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,106 +16,121 @@
**/
#include"val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 14)
-#define TEST_DESC "Base deny and restore protocol access "
-#define MAX_RETURN_VALUE_SIZE 4
+#define TEST_DESC "Base deny and restore protocol access "
#define PARAMETER_SIZE 4
uint32_t base_deny_restore_protocol_access(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id, parameters[PARAMETER_SIZE], *parameter;
- uint32_t return_value_count, return_values[MAX_RETURN_VALUE_SIZE];
- uint32_t protocol_id, agent_id, device_id, protocol_version = 0x0;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t message_id, agent_id, device_id, protocol_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* If SET PROTOCOL PERMISSIONS not supported, skip the test */
+ agent_id = val_base_get_info(BASE_TEST_AGENT_ID);
+ /* If agent is not trusted , skip the test */
+ if (val_check_trusted_agent(agent_id) == 0) {
+ val_print(VAL_PRINT_ERR, "\n Calling agent is untrusted agent ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* If SET PROTOCOL PERMISSIONS not supported, skip the test */
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = BASE_SET_PROTOCOL_PERMISSIONS;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tBASE_SET_PROTOCOL_PERMISSION not supported ");
+ val_print(VAL_PRINT_ERR, "\n BASE_SET_PROTOCOL_PERMISSION not supported ");
return VAL_STATUS_SKIP;
}
- agent_id = val_base_get_info(BASE_TEST_AGENT_ID);
device_id = val_agent_get_accessible_device(agent_id);
protocol_id = val_device_get_accessible_protocol(device_id);
/* Deny agent access to a valid protocol */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Deny access to valid protocol %d", protocol_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Deny access to valid protocol %d", protocol_id);
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters[param_count++] = agent_id;
parameters[param_count++] = device_id;
parameters[param_count++] = protocol_id;
- parameters[param_count++] = 0; /* Deny access */
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
+ parameters[param_count++] = FLAG_ACCESS_DENY; /* Deny access */
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_PROTOCOL_PERMISSIONS, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
&return_value_count, return_values);
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Accessing command of denied protocol should fail */
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Access denied protocol commands");
+ /* Accessing command of denied protocol should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Access denied protocol commands");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameter = NULL;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(protocol_id, protocol_version, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
+ cmd_msg_hdr = val_msg_hdr_create(protocol_id, 0x0, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, NULL, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (status == SCMI_SUCCESS) {
- val_print(VAL_PRINT_ERR, "\n\tCHECK DENIED PROTOCOL ACCESS: FAILED");
- val_print(VAL_PRINT_ERR, "\n\tAble to access denied protocol");
+ val_print(VAL_PRINT_ERR, "\n CHECK DENIED PROTOCOL ACCESS: FAILED");
+ val_print(VAL_PRINT_ERR, "\n Able to access denied protocol");
return VAL_STATUS_FAIL;
- } else
- val_print(VAL_PRINT_DEBUG, "\n\tCHECK DENIED PROTOCOL ACCESS: PASSED");
+ }
- /* Restore the agent access to denied protocol */
+ if (val_compare_status(status, SCMI_DENIED) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 3] Restore denied protocol access");
+ /* Restore the agent access to denied protocol */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Restore denied protocol access");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters[param_count++] = agent_id;
parameters[param_count++] = device_id;
parameters[param_count++] = protocol_id;
- parameters[param_count++] = 1; /* Allow access */
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
+ parameters[param_count++] = FLAG_ACCESS_ALLOW; /* Allow access */
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_PROTOCOL_PERMISSIONS, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
&return_value_count, return_values);
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
/* Agent should be able to access the protocol commands */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Access protocol command after permissions restored");
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Access protocol after permissions restored");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameter = NULL;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(protocol_id, protocol_version, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
+ cmd_msg_hdr = val_msg_hdr_create(protocol_id, 0x0, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, NULL, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/base/test_b015.c b/test_pool/base/test_b015.c
index 9a6d0b621128f02a88941c2abc42ea1027838f8e..8c5b3860baa40b0055222d9471c68f00dda4f67a 100644
--- a/test_pool/base/test_b015.c
+++ b/test_pool/base/test_b015.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,117 +16,81 @@
**/
#include"val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 15)
-#define TEST_DESC "Restore protocol access with reset agent configuration "
-#define MAX_RETURN_VALUE_SIZE 4
-#define PARAMETER_SIZE 4
+#define TEST_DESC "Base reset agent configuration check "
+#define PARAMETER_SIZE 2
-uint32_t base_restore_protocol_access_with_reset_agent_configuration(void)
+uint32_t base_reset_agent_configuration_check(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id, parameters[PARAMETER_SIZE], *parameter;
- uint32_t return_value_count, return_values[MAX_RETURN_VALUE_SIZE];
- uint32_t protocol_id, agent_id, device_id, protocol_version = 0x0;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t message_id, agent_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* If SET PROTOCOL PERMISSIONS or RESET AGENT CONFIG cmds not supported, skip the test */
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- message_id = BASE_SET_PROTOCOL_PERMISSIONS;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, return_values);
+ agent_id = val_base_get_info(BASE_TEST_AGENT_ID);
- if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tBASE_SET_PROTOCOL_PERMISSION not supported. ");
+ /* If agent is not trusted , skip the test */
+ if (val_check_trusted_agent(agent_id) == 0) {
+ val_print(VAL_PRINT_ERR, "\n Calling agent is untrusted agent ");
return VAL_STATUS_SKIP;
}
+ /* If BASE RESET AGENT CONFIGURATION not supported, skip the test */
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = BASE_RESET_AGENT_CONFIGURATION;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tBASE_RESET AGENT CONFIG not supported. ");
+ val_print(VAL_PRINT_ERR, "\n BASE_RESET_AGENT_CONFIG not supported ");
return VAL_STATUS_SKIP;
}
- /* Remove agent access to valid protocol */
-
- agent_id = val_base_get_info(BASE_TEST_AGENT_ID);
- device_id = val_agent_get_accessible_device(agent_id);
- protocol_id = val_device_get_accessible_protocol(device_id);
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Deny access to valid protocol %d", protocol_id);
+ /* Setting permissions for invalid agent should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Set permissions for invalid agent id");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters[param_count++] = agent_id;
- parameters[param_count++] = device_id;
- parameters[param_count++] = protocol_id;
- parameters[param_count++] = 0; /* Deny access */
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_PROTOCOL_PERMISSIONS, COMMAND_MSG);
+ parameters[param_count++] = val_base_get_info(BASE_NUM_AGENTS) + 1; /* invalid agent id */
+ parameters[param_count++] = FLAG_ACCESS_ALLOW; /* Allow access */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_RESET_AGENT_CONFIGURATION, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
&return_value_count, return_values);
- if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
-
- /* Agent calling cmds of denied protocol should fail */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Access denied protocol commands");
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameter = NULL;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(protocol_id, protocol_version, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
- &return_value_count, return_values);
-
- if (status == SCMI_SUCCESS) {
- val_print(VAL_PRINT_ERR, "\n\tCHECK DENIED PROTOCOL ACCESS: FAILED");
- val_print(VAL_PRINT_INFO, "\n\tAble to access denied protocol");
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- } else
- val_print(VAL_PRINT_DEBUG, "\n\tCHECK DENIED PROTOCOL ACCESS: PASSED");
- /* Restore agent protocol permissions */
+ val_print_return_values(return_value_count, return_values);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 3] Restore denied protocol access");
+ /* Calling RESET AGENT CONFIGURATION cmd with invalid flag value should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Set permissions with invalid flag value");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters[param_count++] = agent_id;
- parameters[param_count++] = 1; /* reset all access permissions */
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
+ parameters[param_count++] = val_base_get_info(BASE_TEST_AGENT_ID);
+ parameters[param_count++] = INVALID_FLAG_VAL; /* Invalid flag */
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_RESET_AGENT_CONFIGURATION, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
&return_value_count, return_values);
- if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Agent should be able to access cmds after protocol permission restored */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 4] Access protocol commands after permissions restored");
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameter = NULL;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(protocol_id, protocol_version, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
- &return_value_count, return_values);
-
- if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ val_print_return_values(return_value_count, return_values);
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/base/test_b016.c b/test_pool/base/test_b016.c
index 0517fc62b754ce3f328efda8092bd28266571590..d9b78fe1763ae0871429ae53ae63c7c225b28eea 100644
--- a/test_pool/base/test_b016.c
+++ b/test_pool/base/test_b016.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,104 +16,122 @@
**/
#include"val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 16)
-#define TEST_DESC "Base deny and restore device access "
-#define MAX_RETURN_VALUE_SIZE 4
+#define TEST_DESC "Restore device access with reset agent "
#define PARAMETER_SIZE 3
-uint32_t base_deny_restore_device_access(void)
+uint32_t base_restore_device_access_with_reset_agent_configuration(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, device_id, message_id, parameter[PARAMETER_SIZE], *parameters;
- uint32_t return_value_count, return_values[MAX_RETURN_VALUE_SIZE];
- uint32_t protocol_id, agent_id, protocol_version = 0x0;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t message_id, device_id, protocol_id, agent_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* If SET DEVICE PERMISSIONS not supported, skip the test */
+ agent_id = val_base_get_info(BASE_TEST_AGENT_ID);
+
+ /* If agent is not trusted , skip the test */
+ if (val_check_trusted_agent(agent_id) == 0) {
+ val_print(VAL_PRINT_ERR, "\n Calling agent is untrusted agent ");
+ return VAL_STATUS_SKIP;
+ }
+ /* If SET DEVICE PERMISSIONS or BASE RESET AGENT CONFIGURATION not supported, skip the test*/
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = BASE_SET_DEVICE_PERMISSIONS;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tBASE_SET_DEVICE_PERMISSIONS not supported ");
+ val_print(VAL_PRINT_ERR, "\n BASE_SET_DEVICE_PERMISSIONS not supported ");
return VAL_STATUS_SKIP;
}
- /* Deny agent access for a device */
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = BASE_RESET_AGENT_CONFIGURATION;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
- agent_id = val_base_get_info(BASE_TEST_AGENT_ID);
- device_id = val_agent_get_accessible_device(agent_id);
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n RESET_AGENT_CONFIGURATION not supported ");
+ return VAL_STATUS_SKIP;
+ }
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Deny access to valid device %d", device_id);
+ /* Deny agent access to a device */
+ device_id = val_agent_get_accessible_device(agent_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Deny access to valid device %d", device_id);
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameter[param_count++] = agent_id;
- parameter[param_count++] = device_id;
- parameter[param_count++] = 0; /* Deny access */
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_PROTOCOL_PERMISSIONS, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
+ parameters[param_count++] = agent_id;
+ parameters[param_count++] = device_id;
+ parameters[param_count++] = FLAG_ACCESS_DENY; /* Deny access */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_DEVICE_PERMISSIONS, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Agent accessing denied device should fail */
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Access denied protocol commands");
+ /* Agent should not be able to access denied device */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Access denied protocol commands");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters = NULL;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
protocol_id = val_device_get_accessible_protocol(device_id);
- cmd_msg_hdr = val_msg_hdr_create(protocol_id, protocol_version, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ cmd_msg_hdr = val_msg_hdr_create(protocol_id, 0, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, NULL, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (status == SCMI_SUCCESS) {
- val_print(VAL_PRINT_ERR, "\n\tCHECK DENIED PROTOCOL ACCESS: FAILED");
- val_print(VAL_PRINT_INFO, "\n\tAble to access denied protocol");
+ val_print(VAL_PRINT_ERR, "\n CHECK DENIED PROTOCOL ACCESS: FAILED");
+ val_print(VAL_PRINT_INFO, "\n Able to access denied protocol");
return VAL_STATUS_FAIL;
- } else
- val_print(VAL_PRINT_DEBUG, "\n\tCHECK DENIED PROTOCOL ACCESS: PASSED");
+ }
- /* Restore agent access to device */
+ if (val_compare_status(status, SCMI_DENIED) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 3] Restore denied device access");
+ /* Restore device access to agent */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Restore denied protocol access");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameter[param_count++] = agent_id;
- parameter[param_count++] = device_id;
- parameter[param_count++] = 1; /* Allow access */
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_PROTOCOL_PERMISSIONS, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
+ parameters[param_count++] = agent_id;
+ parameters[param_count++] = FLAG_RESET_ACCESS; /* reset all access permissions */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_RESET_AGENT_CONFIGURATION, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Agent should be able to access device after device permission restored */
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 4] Access protocol command after permissions restored");
+ /* Agent should be able to access device after permissions restored */
+ val_print(VAL_PRINT_TEST, "\n [Check 4] Access protocol after permissions restored");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters = NULL;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(protocol_id, protocol_version, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ cmd_msg_hdr = val_msg_hdr_create(protocol_id, 0, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, NULL, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/base/test_b017.c b/test_pool/base/test_b017.c
index ed4de75c515dc8589f3fc6839cc58784660ae689..5bbff76087f3fc993493ce470c5c62c873acf9e9 100644
--- a/test_pool/base/test_b017.c
+++ b/test_pool/base/test_b017.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,61 +16,67 @@
**/
#include"val_interface.h"
+#include "val_base.h"
#define TEST_NUM (SCMI_BASE_TEST_NUM_BASE + 17)
-#define TEST_DESC "Restore device access with reset agent configuration "
-#define MAX_RETURN_VALUE_SIZE 4
-#define PARAMETER_SIZE 3
+#define TEST_DESC "Restore protocol access with reset agent "
+#define PARAMETER_SIZE 4
-uint32_t base_restore_device_access_with_reset_agent_configuration(void)
+uint32_t base_restore_protocol_access_with_reset_agent_configuration(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id, *parameter, parameters[PARAMETER_SIZE];
- uint32_t return_value_count, return_values[MAX_RETURN_VALUE_SIZE];
- uint32_t protocol_id, agent_id, device_id, protocol_version = 0x0;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t agent_id, message_id, device_id, protocol_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* If SET DEVICE PERMISSIONS or BASE RESET AGENT CONFIGURATION not supported, skip the test */
+ agent_id = val_base_get_info(BASE_TEST_AGENT_ID);
+
+ /* If agent is not trusted , skip the test */
+ if (val_check_trusted_agent(agent_id) == 0) {
+ val_print(VAL_PRINT_ERR, "\n Calling agent is untrusted agent ");
+ return VAL_STATUS_SKIP;
+ }
+ /* If SET PROTOCOL PERMISSIONS or RESET AGENT CONFIG cmds not supported, skip the test */
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- message_id = BASE_SET_DEVICE_PERMISSIONS;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
+ message_id = BASE_SET_PROTOCOL_PERMISSIONS;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\nBASE_SET_DEVICE_PERMISSIONS not supported. ");
+ val_print(VAL_PRINT_ERR, "\n BASE_SET_PROTOCOL_PERMISSION not supported ");
return VAL_STATUS_SKIP;
}
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = BASE_RESET_AGENT_CONFIGURATION;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tRESET_AGENT_CONFIGURATION not supported. ");
+ val_print(VAL_PRINT_ERR, "\n BASE_RESET AGENT CONFIG not supported ");
return VAL_STATUS_SKIP;
}
- agent_id = val_base_get_info(BASE_TEST_AGENT_ID);
+ /* Remove agent access to valid protocol */
device_id = val_agent_get_accessible_device(agent_id);
-
- /* Deny agent access to a device */
-
- val_print(VAL_PRINT_TEST, "\n\t[Check 1] Deny access to valid device %d", device_id);
+ protocol_id = val_device_get_accessible_protocol(device_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Deny access to valid protocol %d", protocol_id);
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters[param_count++] = agent_id;
parameters[param_count++] = device_id;
- parameters[param_count++] = 0; /* Deny access */
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
+ parameters[param_count++] = protocol_id;
+ parameters[param_count++] = FLAG_ACCESS_DENY; /* Deny access */
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_SET_PROTOCOL_PERMISSIONS, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
&return_value_count, return_values);
@@ -78,33 +84,39 @@ uint32_t base_restore_device_access_with_reset_agent_configuration(void)
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Agent should not be able to access denied device */
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_TEST, "\n\t[Check 2] Access denied protocol commands");
+ val_print_return_values(return_value_count, return_values);
+
+ /* Agent calling cmds of denied protocol should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Access denied protocol commands");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameter = NULL;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- protocol_id = val_device_get_accessible_protocol(device_id);
- cmd_msg_hdr = val_msg_hdr_create(protocol_id, protocol_version, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
+ cmd_msg_hdr = val_msg_hdr_create(protocol_id, 0, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, NULL, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (status == SCMI_SUCCESS) {
- val_print(VAL_PRINT_ERR, "\n\tCHECK DENIED PROTOCOL ACCESS: FAILED");
- val_print(VAL_PRINT_INFO, "\n\tAble to access denied protocol");
+ val_print(VAL_PRINT_ERR, "\n CHECK DENIED PROTOCOL ACCESS: FAILED");
+ val_print(VAL_PRINT_INFO, "\n Able to access denied protocol");
+ return VAL_STATUS_FAIL;
+ }
+
+ if (val_compare_status(status, SCMI_DENIED) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- } else
- val_print(VAL_PRINT_DEBUG, "\n\tCHECK DENIED PROTOCOL ACCESS: PASSED");
- /* Restore device access to agent */
+ val_print_return_values(return_value_count, return_values);
- val_print(VAL_PRINT_TEST, "\n\t[Check 3] Restore denied protocol access");
+ /* Restore agent protocol permissions */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Restore denied protocol access");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters[param_count++] = agent_id;
- parameters[param_count++] = 1; /* reset all access permissions */
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
+ parameters[param_count++] = FLAG_RESET_ACCESS; /* reset all access permissions */
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_RESET_AGENT_CONFIGURATION, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
&return_value_count, return_values);
@@ -112,19 +124,26 @@ uint32_t base_restore_device_access_with_reset_agent_configuration(void)
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Agent should be able to access device after permissions restored */
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
- val_print(VAL_PRINT_TEST, "\n\t[Check 4] Access protocol commands after permissions restored");
+ /* Agent should be able to access cmds after protocol permission restored */
+ val_print(VAL_PRINT_TEST, "\n [Check 4] Access protocol after permissions restored");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameter = NULL;
- cmd_msg_hdr = val_msg_hdr_create(protocol_id, protocol_version, COMMAND_MSG);
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
+ cmd_msg_hdr = val_msg_hdr_create(protocol_id, 0, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, NULL, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/clock/test_c001.c b/test_pool/clock/test_c001.c
index 2fd443a83f89cbff14b5c70102c85debd67935e3..0e863e1aa209cc01389734d2ac890adf62eaa90a 100644
--- a/test_pool/clock/test_c001.c
+++ b/test_pool/clock/test_c001.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,31 +15,34 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_clock.h"
#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 1)
-#define TEST_DESC "Clock Protocol Version check "
+#define TEST_DESC "Clock protocol version check "
-uint32_t clock_query_protocol_version(void)
+#define MIN_RET_VAL_EXPECTED 1
+
+uint32_t clock_query_protocol_version(uint32_t *version)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters;
- uint32_t return_value_count, version, expected_version;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Check protocol version is as expected value */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query protocol version");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query protocol version");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters = NULL; /* No parameters for this command */
- version = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_PROTOCOL_VERSION, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &version);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -47,10 +50,13 @@ uint32_t clock_query_protocol_version(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- expected_version = val_clock_get_expected_protocol_version();
- if (val_protocol_version_check(expected_version, version) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (return_value_count != MIN_RET_VAL_EXPECTED)
return VAL_STATUS_FAIL;
+ *version = return_values[VERSION_OFFSET];
+ val_print(VAL_PRINT_ERR, "\n VERSION : 0x%08x ", *version);
return VAL_STATUS_PASS;
}
diff --git a/test_pool/clock/test_c002.c b/test_pool/clock/test_c002.c
index 65a5ee4808b115aeb738325624c056d3e8242f58..a78f52f74cf746857018a3a6636bd5e23d389363 100644
--- a/test_pool/clock/test_c002.c
+++ b/test_pool/clock/test_c002.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,31 +15,34 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_clock.h"
#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 2)
-#define TEST_DESC "Clock Protocol Attributes check "
+#define TEST_DESC "Clock protocol attributes check "
uint32_t clock_query_protocol_attributes(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters;
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
+ uint32_t attributes, num_clocks, max_async;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Query clock protocol attributes and check number of clocks */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query protocol attributes");
+ /* Query clock protocol and check number of clocks */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query protocol attributes");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters = NULL; /* No parameters for this command */
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_PROTOCOL_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -47,17 +50,25 @@ uint32_t clock_query_protocol_attributes(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 24, 31) != VAL_STATUS_PASS))
return VAL_STATUS_FAIL;
+ num_clocks = VAL_EXTRACT_BITS(attributes, 0, 15);
+ if (val_compare("NUM CLOCKS", num_clocks, val_clock_get_expected_num_clocks()))
+ return VAL_STATUS_FAIL;
+
+ max_async = VAL_EXTRACT_BITS(attributes, 16, 23);
+ if (val_compare("MAX PENDING ASYNC CMD", max_async, val_clock_get_expected_max_async_cmd()))
+ return VAL_STATUS_FAIL;
+
/* Save the number of clocks */
- val_clock_save_info(NUM_CLOCKS, 0, VAL_EXTRACT_BITS(attributes, 0, 15));
- val_print(VAL_PRINT_INFO, "\n\tNUM CLOCKS: %d", VAL_EXTRACT_BITS(attributes, 0, 15));
+ val_clock_save_info(NUM_CLOCKS, 0, num_clocks);
/* Save the max number of pending async clock rate changes */
- val_clock_save_info(CLOCK_MAX_PENDING_ASYNC_CMD, 0, VAL_EXTRACT_BITS(attributes, 16, 23));
- val_print(VAL_PRINT_INFO, "\n\tMAX PENDING ASYNC CMD: %d ",
- VAL_EXTRACT_BITS(attributes, 16, 23));
+ val_clock_save_info(CLOCK_MAX_PENDING_ASYNC_CMD, 0, max_async);
return VAL_STATUS_PASS;
}
diff --git a/test_pool/clock/test_c003.c b/test_pool/clock/test_c003.c
index bf2be6da3803cfcf791a77ddbf0b160d9008fb7c..582d73cb105273dff9efb5c135d04da8f4a190a0 100644
--- a/test_pool/clock/test_c003.c
+++ b/test_pool/clock/test_c003.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,33 +15,35 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_clock.h"
#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 3)
-#define TEST_DESC "Clock Protocol mandatory command support check "
+#define TEST_DESC "Clock msg attributes mandatory cmd check "
uint32_t clock_query_mandatory_command_support(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id;
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
/* Mandatory cmd CLOCK ATTRIBUTES should be supported */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] CLOCK ATTRIBUTES support");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] CLOCK ATTRIBUTES support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = CLOCK_ATTRIBUTES;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_PROTOCOL_MESSAGE_ATTRIBUTES,
COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -49,21 +51,21 @@ uint32_t clock_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
/* Mandatory cmd CLOCK DESCRIBE RATES should be supported */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] CLOCK DESCRIBE RATES support");
+ val_print(VAL_PRINT_TEST, "\n [Check 2] CLOCK DESCRIBE RATES support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = CLOCK_DESCRIBE_RATES;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_PROTOCOL_MESSAGE_ATTRIBUTES,
COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -71,21 +73,21 @@ uint32_t clock_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
/* Mandatory cmd CLOCK RATE SET should be supported */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 3] CLOCK RATE SET support");
+ val_print(VAL_PRINT_TEST, "\n [Check 3] CLOCK RATE SET support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = CLOCK_RATE_SET;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_PROTOCOL_MESSAGE_ATTRIBUTES,
COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -93,21 +95,21 @@ uint32_t clock_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
/* Mandatory cmd CLOCK RATE GET should be supported */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 4] CLOCK RATE GET support");
+ val_print(VAL_PRINT_TEST, "\n [Check 4] CLOCK RATE GET support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = CLOCK_RATE_GET;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_PROTOCOL_MESSAGE_ATTRIBUTES,
COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -115,21 +117,21 @@ uint32_t clock_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
/* Mandatory cmd CLOCK CONFIG SET should be supported */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 5] CLOCK CONFIG SET support");
+ val_print(VAL_PRINT_TEST, "\n [Check 5] CLOCK CONFIG SET support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = CLOCK_CONFIG_SET;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_PROTOCOL_MESSAGE_ATTRIBUTES,
COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -137,7 +139,9 @@ uint32_t clock_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
return VAL_STATUS_PASS;
diff --git a/test_pool/clock/test_c004.c b/test_pool/clock/test_c004.c
index 57370cea30d20e132304f8d2de5c32d67e9a5b1b..1f036eac000e65665d94c841fe1404831bd416f1 100644
--- a/test_pool/clock/test_c004.c
+++ b/test_pool/clock/test_c004.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,32 +15,33 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_clock.h"
#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 4)
-#define TEST_DESC "Clock attributes check "
-#define MAX_RETURN_VALUE_SIZE 5
+#define TEST_DESC "Clock msg attributes invalid msg id check "
-uint32_t clock_attributes_check(void)
+uint32_t clock_invalid_messageid_call(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, clock_id, num_clocks, attributes;
- uint32_t return_value_count, return_values[MAX_RETURN_VALUE_SIZE];
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
+ uint32_t message_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* clock attributes cmd for invalid clock id should return NOT_FOUND status */
-
- clock_id = val_clock_get_info(NUM_CLOCKS, 0) + 1;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query with invalid clock_id %d", clock_id);
+ /* Sending invalid clock protocol cmd should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Invalid command invocation");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- param_count++;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_ATTRIBUTES, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &clock_id, &rsp_msg_hdr, &status,
+ parameters = NULL;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_INVALID_COMMAND, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
@@ -49,38 +50,26 @@ uint32_t clock_attributes_check(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Discover clock attributes for all clocks */
+ val_print_return_values(return_value_count, return_values);
- num_clocks = val_clock_get_info(NUM_CLOCKS, 0);
- for (clock_id = 0; clock_id < num_clocks; clock_id++)
- {
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Query with clock_id %d", clock_id);
+ /* Query support for invalid clock protocol command should return status NOT_FOUND */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query undefined command support");
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- param_count++;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_PROTOCOL_MESSAGE_ATTRIBUTES,
- COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &clock_id, &rsp_msg_hdr, &status,
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = CLOCK_INVALID_COMMAND;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
&return_value_count, return_values);
- if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- attributes = return_values[0];
- if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 2, 31) !=
- VAL_STATUS_PASS))
- return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- val_clock_save_info(CLOCK_ATTRIBUTE, clock_id, return_values[0]);
- val_clock_save_name(CLOCK_NAME, clock_id, (uint8_t *) &return_values[1]);
- val_print(VAL_PRINT_INFO, "\n\tCLOCK_ENABLED: %d", VAL_EXTRACT_BITS(attributes, 0, 0));
- val_print(VAL_PRINT_INFO, "\n\tCLOCK_NAME: %s ",
- (uint8_t *) &return_values[1]);
- }
+ val_print_return_values(return_value_count, return_values);
return VAL_STATUS_PASS;
}
diff --git a/test_pool/clock/test_c005.c b/test_pool/clock/test_c005.c
index d4fe1400ede59b2a36df9224a08cde7bef2d2dbd..7dbc353c2ab58ec3ce534c54659284d80cd7d127 100644
--- a/test_pool/clock/test_c005.c
+++ b/test_pool/clock/test_c005.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,53 +15,44 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_clock.h"
#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 5)
-#define TEST_DESC "Clock rate get check "
-#define MAX_RETURN_VALUE_SIZE 2
+#define TEST_DESC "Clock attributes check "
-uint32_t clock_rate_get_check(void)
+uint32_t clock_attributes_check(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, clock_id, num_clocks;
- uint32_t return_value_count, return_values[MAX_RETURN_VALUE_SIZE];
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t clock_id, num_clocks, attributes;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* clock rate get for invalid clock id should return NOT_FOUND status */
-
- clock_id = val_clock_get_info(NUM_CLOCKS, 0) + 1;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query with invalid clock_id %d", clock_id);
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- param_count++;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_RATE_GET, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &clock_id, &rsp_msg_hdr, &status,
- &return_value_count, return_values);
-
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- /* Discover clock rate for all clocks */
-
+ /* Discover clock attributes for all clocks */
num_clocks = val_clock_get_info(NUM_CLOCKS, 0);
+ if (num_clocks == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Clock found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM CLOCKS : %d", num_clocks);
+
for (clock_id = 0; clock_id < num_clocks; clock_id++)
{
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Query with clock_id %d", clock_id);
+ val_print(VAL_PRINT_TEST, "\n CLOCK ID: %d", clock_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query clock attribute");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
param_count++;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_RATE_GET, COMMAND_MSG);
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_ATTRIBUTES,
+ COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &clock_id, &rsp_msg_hdr, &status,
- &return_value_count, return_values);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -69,8 +60,17 @@ uint32_t clock_rate_get_check(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_INFO, "\n\tCLOCK RATE LOWER: %x", return_values[0]);
- val_print(VAL_PRINT_INFO, "\n\tCLOCK RATE UPPER: %x", return_values[1]);
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 1, 31) !=
+ VAL_STATUS_PASS))
+ return VAL_STATUS_FAIL;
+
+ val_clock_save_info(CLOCK_ATTRIBUTE, clock_id, attributes);
+ val_print(VAL_PRINT_INFO, "\n CLOCK_ENABLED: %d", VAL_EXTRACT_BITS(attributes, 0, 0));
+ val_print(VAL_PRINT_INFO, "\n CLOCK_NAME: %s ",
+ (uint8_t *) &return_values[NAME_OFFSET]);
}
return VAL_STATUS_PASS;
diff --git a/test_pool/clock/test_c006.c b/test_pool/clock/test_c006.c
index 57bf457f9bde48a5660396a0254587bc6c84ac12..1a2f0d26b42e50ae8cf04770d0ab170b7a81d4ab 100644
--- a/test_pool/clock/test_c006.c
+++ b/test_pool/clock/test_c006.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,34 +15,34 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_clock.h"
#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 6)
-#define TEST_DESC "Clock config set check "
-#define MAX_PARAMETER_SIZE 2
+#define TEST_DESC "Clock attributes invalid clock id check "
-uint32_t clock_config_set_check(void)
+uint32_t clock_attributes_check_invalid_clock_id(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, clock_id, parameters[MAX_PARAMETER_SIZE];
- uint32_t return_value_count, return_values;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t clock_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* clock config set for invalid clock id should return NOT_FOUND status */
-
+ /* clock attributes cmd for invalid clock id should return NOT_FOUND status */
clock_id = val_clock_get_info(NUM_CLOCKS, 0) + 1;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query with invalid clock_id %d", clock_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query with invalid clock_id %d", clock_id);
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters[param_count++] = clock_id;
- parameters[param_count++] = 0x01; /* Enable clock */
- return_values = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_CONFIG_SET, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &return_values);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_ATTRIBUTES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &clock_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -50,24 +50,5 @@ uint32_t clock_config_set_check(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Clock config set with invalid attributes */
-
- clock_id = 0;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Query with invalid attributes");
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters[param_count++] = clock_id;
- parameters[param_count++] = 0x04; /* Invalid attributes value */
- return_values = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_CONFIG_SET, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &return_values);
-
- if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
return VAL_STATUS_PASS;
}
diff --git a/test_pool/clock/test_c007.c b/test_pool/clock/test_c007.c
index 77e5f652dd8b66c0b57b9fa6a1292fc2213dbce8..35aa65914ff7865d668ea7036f1b2d06d48b150d 100644
--- a/test_pool/clock/test_c007.c
+++ b/test_pool/clock/test_c007.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,49 +15,167 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_clock.h"
#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 7)
-#define TEST_DESC "Clock invalid message id check "
+#define TEST_DESC "Clock describe rates check "
-uint32_t clock_invalid_messageid_call(void)
+#define PARAMETER_SIZE 2
+
+uint32_t clock_query_describe_rates(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters, message_id;
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t clock_id, num_clocks, num_remaining_rates;
+ uint32_t i, return_format, num_rates_retured, rate_index;
+ uint32_t parameters[PARAMETER_SIZE];
+ uint64_t clock_rate, clock_rate_higher, step_size;
+ uint32_t upper_word, lower_word, num_rate_flag;
+ uint32_t *rate_array;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Sending invalid clock protocol cmd should fail */
+ num_clocks = val_clock_get_info(NUM_CLOCKS, 0);
+ if (num_clocks == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Clock found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM CLOCKS : %d", num_clocks);
+
+ /* Check Clock describe rate for valid clocks */
+
+ for (clock_id = 0; clock_id < num_clocks; clock_id++)
+ {
+ rate_index = 0;
+ num_remaining_rates = 0;
+ num_rates_retured = 0;
+
+ val_print(VAL_PRINT_TEST, "\n CLOCK ID: %d", clock_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query describe rates", clock_id);
+ /* Get rate details by sending CLOCK_DESCRIBE_RATES repeatedly until,
+ all rates got received */
+ do
+ {
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = clock_id;
+ rate_index += num_rates_retured;
+ parameters[param_count++] = rate_index;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_DESCRIBE_RATES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ num_rate_flag = return_values[RATE_FLAG_OFFSET];
+
+ num_remaining_rates = VAL_EXTRACT_BITS(num_rate_flag, 16, 31);
+ val_print(VAL_PRINT_DEBUG, "\n NUM OF REMAINING RATES : %d", num_remaining_rates);
+
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(num_rate_flag, 13, 15)) !=
+ VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return_format = VAL_EXTRACT_BITS(num_rate_flag, 12, 12);
+ val_print(VAL_PRINT_DEBUG, "\n Return format : %d", return_format);
+
+ num_rates_retured = VAL_EXTRACT_BITS(num_rate_flag, 0, 11);
+ val_print(VAL_PRINT_DEBUG, "\n NUM OF RATES RETURNED : %d", num_rates_retured);
+
+ /* Rate array starts from return_values[1]*/
+ rate_array = &return_values[RATES_OFFSET];
+
+ for (i = 0; i < num_rates_retured; i++)
+ {
+ val_print(VAL_PRINT_DEBUG, "\n Rate Index : %d", rate_index + i);
+
+ if (return_format == CLOCK_RATE_FMT_ARRAY) {
+ lower_word = rate_array[i * 2];
+ upper_word = rate_array[1 + i * 2];
+
+ clock_rate = VAL_GET_64BIT_DATA(upper_word, lower_word);
+ val_print(VAL_PRINT_DEBUG, "\n CLOCK RATE : 0x%llX",
+ clock_rate);
+ /* Save first & last value*/
+ if (i == 0) {
+ val_clock_save_rate(CLOCK_LOWEST_RATE,
+ clock_id, clock_rate);
+ }
+
+ if (i == (num_rates_retured - 1)) {
+ val_clock_save_rate(CLOCK_HIGHEST_RATE,
+ clock_id, clock_rate);
+ }
+ } else {
+ /* Find lowest clock rate from rate array */
+ lower_word = rate_array[i * 6];
+ upper_word = rate_array[1 + i * 6];
+ clock_rate = VAL_GET_64BIT_DATA(upper_word, lower_word);
+
+ /* Find highest clock rate from rate array */
+ lower_word = rate_array[2 + i * 6];
+ upper_word = rate_array[3 + i * 6];
+ clock_rate_higher = VAL_GET_64BIT_DATA(upper_word, lower_word);
+
+ /* Find step size from rate array */
+ lower_word = rate_array[4 + i * 6];
+ upper_word = rate_array[5 + i * 6];
+ step_size = VAL_GET_64BIT_DATA(upper_word, lower_word);
+
+ val_print(VAL_PRINT_DEBUG, "\n LOWEST RATE : 0x%llX",
+ clock_rate);
+ val_print(VAL_PRINT_DEBUG, "\n HIGHEST RATE : 0x%llX",
+ clock_rate_higher);
+ val_print(VAL_PRINT_DEBUG, "\n STEP SIZE : 0x%llX",
+ step_size);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Invalid command invocation");
+ /* Store lowest & highest rates*/
+ val_clock_save_rate(CLOCK_LOWEST_RATE,
+ clock_id, clock_rate);
+ val_clock_save_rate(CLOCK_HIGHEST_RATE,
+ clock_id, clock_rate_higher);
+ }
+ }
+ } while (num_remaining_rates > 0);
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters = NULL;
- attributes = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_INVALID_COMMAND, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ if (val_compare("NUM OF RATES ", (rate_index + num_rates_retured),
+ val_clock_get_expected_number_of_rates(clock_id)))
+ return VAL_STATUS_FAIL;
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ /* For CLOCK_RATE_FMT_STEP_SIZE , rate index is ignored*/
+ if (return_format == CLOCK_RATE_FMT_STEP_SIZE) {
+ continue;
+ }
- /* Query support for invalid clock protocol command should return status NOT_FOUND */
+ /* Clock describe rate for invalid rate index */
+ rate_index += num_rates_retured;
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query with invalid index: %d", rate_index);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Query undefined command support");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = clock_id;
+ parameters[param_count++] = rate_index; /*Invalid rate index*/
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_DESCRIBE_RATES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- message_id = CLOCK_INVALID_COMMAND;
- attributes = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_PROTOCOL_MESSAGE_ATTRIBUTES,
- COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ if (val_compare_status(status, SCMI_OUT_OF_RANGE) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
return VAL_STATUS_PASS;
}
diff --git a/test_pool/clock/test_c008.c b/test_pool/clock/test_c008.c
new file mode 100644
index 0000000000000000000000000000000000000000..110242893e6d47532b78fe7f40af4d490dc0dfa8
--- /dev/null
+++ b/test_pool/clock/test_c008.c
@@ -0,0 +1,58 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_clock.h"
+
+#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 8)
+#define TEST_DESC "Clock describe rate invalid clock id check "
+
+#define PARAMETER_SIZE 2
+
+uint32_t clock_query_describe_rates_invalid_clock_id(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t clock_id;
+ uint32_t parameters[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Check Clock describe rate for invalid clocks */
+ clock_id = val_clock_get_info(NUM_CLOCKS, 0) + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query with invalid clock_id: %d", clock_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = clock_id;
+ parameters[param_count++] = 0;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_DESCRIBE_RATES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/clock/test_c009.c b/test_pool/clock/test_c009.c
new file mode 100644
index 0000000000000000000000000000000000000000..d341c90f9534f61584d0d71a4459cbcae6fcf108
--- /dev/null
+++ b/test_pool/clock/test_c009.c
@@ -0,0 +1,161 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_clock.h"
+
+#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 9)
+#define TEST_DESC "Clock rate set sync mode check "
+
+#define PARAMETER_SIZE 4
+
+/********* TEST ALGO ********************
+ * Get the current clock rate
+ * Find a new rate from previously saved rates
+ * Set new rate in sync mode
+ * Get the rate again and compare with newly set rates
+ * Restore the default rate
+*****************************************/
+
+uint32_t clock_rate_set_sync_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t clock_id, num_clocks;
+ uint32_t parameters[PARAMETER_SIZE], new_rate_low, new_rate_high;
+ uint64_t current_rate, new_rate;
+ uint32_t upper_word, lower_word;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ num_clocks = val_clock_get_info(NUM_CLOCKS, 0);
+ if (num_clocks == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Clock found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM CLOCKS : %d", num_clocks);
+
+ /* Set clock rate for all clocks in sync mode */
+ for (clock_id = 0; clock_id < num_clocks; clock_id++)
+ {
+ /* Get current rate */
+ val_print(VAL_PRINT_TEST, "\n CLOCK ID: %d", clock_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Get current rate");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_RATE_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &clock_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ lower_word = return_values[RATE_LOWER_WORD_OFFSET];
+ upper_word = return_values[RATE_UPPER_WORD_OFFSET];
+ current_rate = VAL_GET_64BIT_DATA(upper_word, lower_word);
+
+ /* Find a new valid rate from previously saved rates*/
+ if (val_clock_get_rate(CLOCK_LOWEST_RATE, clock_id) == current_rate)
+ new_rate = val_clock_get_rate(CLOCK_HIGHEST_RATE, clock_id);
+ else
+ new_rate = val_clock_get_rate(CLOCK_LOWEST_RATE, clock_id);
+
+ /* Set new rate in CLOCK_SET_SYNC_MODE*/
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Set new rate");
+ val_print(VAL_PRINT_TEST, "\n New clock rate :0x%llX",
+ new_rate);
+
+ new_rate_low = (uint32_t)(new_rate & MASK_FOR_LOWER_WORD);
+ new_rate_high = (uint32_t)((new_rate & MASK_FOR_UPPER_WORD) >> 32);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = CLOCK_SET_SYNC_MODE;
+ parameters[param_count++] = clock_id;
+ parameters[param_count++] = new_rate_low;
+ parameters[param_count++] = new_rate_high;;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_RATE_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ /* Get the rate for comparing with new rates*/
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Get the rates and compare");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_RATE_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &clock_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ /* Compare with newly set rate and received rate*/
+ if (val_compare("LOWER WORD OF RATE ",
+ new_rate_low, return_values[RATE_LOWER_WORD_OFFSET]))
+ return VAL_STATUS_FAIL;
+
+ if (val_compare("UPPER WORD OF RATE ",
+ new_rate_high, return_values[RATE_UPPER_WORD_OFFSET]))
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 4] Set default rate");
+
+ /* Restore the default rate */
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = CLOCK_SET_SYNC_MODE;
+ parameters[param_count++] = clock_id;
+ parameters[param_count++] = (uint32_t)(current_rate & MASK_FOR_LOWER_WORD);
+ parameters[param_count++] = (uint32_t)((current_rate & MASK_FOR_UPPER_WORD) >> 32);
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_RATE_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/clock/test_c010.c b/test_pool/clock/test_c010.c
new file mode 100644
index 0000000000000000000000000000000000000000..a9aa54574cccaf76dfa9c4cf65f404394a5adf5d
--- /dev/null
+++ b/test_pool/clock/test_c010.c
@@ -0,0 +1,176 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_clock.h"
+
+#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 10)
+#define TEST_DESC "Clock rate set async mode check "
+
+#define PARAMETER_SIZE 4
+
+/********* TEST ALGO ********************
+ * Get the current clock rate
+ * Find a new rate from previously saved rates
+ * Set new rate in async mode
+ * Wait for delayed response & compare with newly set rates
+ * Restore the default rate
+*****************************************/
+
+uint32_t clock_rate_set_async_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t clock_id, num_clocks, num_async;
+ uint32_t parameters[PARAMETER_SIZE];
+ uint64_t current_rate, new_rate;
+ uint32_t new_rate_low, new_rate_high;
+ uint32_t upper_word, lower_word;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Check whether platform support async mode */
+ num_async = val_clock_get_info(CLOCK_MAX_PENDING_ASYNC_CMD, 0);
+ if (num_async == 0) {
+ val_print(VAL_PRINT_ERR, "\n Async rate change is not supported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Set clock rate for all clocks in async mode */
+ num_clocks = val_clock_get_info(NUM_CLOCKS, 0);
+ if (num_clocks == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Clock found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM CLOCKS : %d", num_clocks);
+
+ for (clock_id = 0; clock_id < num_clocks; clock_id++)
+ {
+ /* Get current rate using CLOCK_RATE_GET*/
+ val_print(VAL_PRINT_TEST, "\n CLOCK ID: %d", clock_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Get current rate");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_RATE_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &clock_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ lower_word = return_values[RATE_LOWER_WORD_OFFSET];
+ upper_word = return_values[RATE_UPPER_WORD_OFFSET];
+ current_rate = VAL_GET_64BIT_DATA(upper_word, lower_word);
+
+ /* Find a new rate from previously stored rates*/
+ if (val_clock_get_rate(CLOCK_LOWEST_RATE, clock_id) == current_rate)
+ new_rate = val_clock_get_rate(CLOCK_HIGHEST_RATE, clock_id);
+ else
+ new_rate = val_clock_get_rate(CLOCK_LOWEST_RATE, clock_id);
+
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Set new rate");
+ val_print(VAL_PRINT_TEST, "\n New clock rate :0x%llX",
+ new_rate);
+
+ new_rate_low = (uint32_t)(new_rate & MASK_FOR_LOWER_WORD);
+ new_rate_high = (uint32_t)((new_rate & MASK_FOR_UPPER_WORD) >> 32);
+
+ /* Set rate with CLOCK_SET_ASYNC_MODE */
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = CLOCK_SET_ASYNC_MODE;
+ parameters[param_count++] = clock_id;
+ parameters[param_count++] = new_rate_low;
+ parameters[param_count++] = new_rate_high;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_RATE_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ /* Wait for delayed response */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Wait for delayed response");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ val_receive_delayed_response(&rsp_msg_hdr, &status, &return_value_count, return_values);
+
+ val_print(VAL_PRINT_TEST, "\n NOTIFY MSG HDR : 0x%08x", rsp_msg_hdr);
+ if (val_compare("PROTOCOL ID", VAL_EXTRACT_BITS(rsp_msg_hdr, 10, 17),
+ PROTOCOL_CLOCK))
+ return VAL_STATUS_FAIL;
+ if (val_compare("MSG TYPE ", VAL_EXTRACT_BITS(rsp_msg_hdr, 8, 9),
+ DELAYED_RESPONSE_MSG))
+ return VAL_STATUS_FAIL;
+ if (val_compare("MSG ID ", VAL_EXTRACT_BITS(rsp_msg_hdr, 0, 7),
+ CLOCK_RATE_SET_COMPLETE))
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ /* Compare send & received clock id*/
+ if (val_compare("CLOCK ID ",
+ clock_id, return_values[DELAYED_RESP_CLOCK_ID_OFFSET]))
+ return VAL_STATUS_FAIL;
+
+ /* Compare with new rate & received rate*/
+ if (val_compare("LOWER WORD OF RATE ",
+ new_rate_low, return_values[DELAYED_RESP_RATE_LOWER_OFFSET]))
+ return VAL_STATUS_FAIL;
+
+ if (val_compare("UPPER WORD OF RATE ",
+ new_rate_high, return_values[DELAYED_RESP_RATE_UPPER_OFFSET]))
+ return VAL_STATUS_FAIL;
+
+ /* Restore the default rate */
+ val_print(VAL_PRINT_TEST, "\n [Check 4] Set default rate");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = CLOCK_SET_SYNC_MODE;
+ parameters[param_count++] = clock_id;
+ parameters[param_count++] = (uint32_t)(current_rate & MASK_FOR_LOWER_WORD);
+ parameters[param_count++] = (uint32_t)((current_rate & MASK_FOR_UPPER_WORD) >> 32);
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_RATE_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/clock/test_c011.c b/test_pool/clock/test_c011.c
new file mode 100644
index 0000000000000000000000000000000000000000..91cfb11833c469da4775f83d3106c423402375df
--- /dev/null
+++ b/test_pool/clock/test_c011.c
@@ -0,0 +1,95 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_clock.h"
+
+#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 11)
+#define TEST_DESC "Clock rate set invalid param check "
+
+#define PARAMETER_SIZE 4
+
+uint32_t clock_rate_set_invalid_param_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t clock_id, num_clocks;
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t upper_word, lower_word;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ num_clocks = val_clock_get_info(NUM_CLOCKS, 0);
+ if (num_clocks == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Clock found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM CLOCKS : %d", num_clocks);
+
+ for (clock_id = 0; clock_id < num_clocks; clock_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n CLOCK ID: %d", clock_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query with invalid rate");
+
+ upper_word = (uint32_t)((val_clock_get_rate(CLOCK_HIGHEST_RATE, clock_id) &
+ MASK_FOR_UPPER_WORD) >> 32);
+ lower_word = (uint32_t)(val_clock_get_rate(CLOCK_LOWEST_RATE, clock_id) &
+ MASK_FOR_LOWER_WORD);
+
+ /* Query with invalid rate should fail with INVALID_PARAMETERS*/
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = CLOCK_SET_SYNC_MODE;
+ parameters[param_count++] = clock_id;
+ /* Invalid rates*/
+ parameters[param_count++] = lower_word + 1;
+ parameters[param_count++] = upper_word + 1;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_RATE_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query with invalid flag");
+
+ /* Query with invalid flag should fail with INVALID_PARAMETERS*/
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = CLOCK_SET_INVALID_FLAG;
+ parameters[param_count++] = clock_id;
+ parameters[param_count++] = lower_word;
+ parameters[param_count++] = upper_word;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_RATE_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/clock/test_c012.c b/test_pool/clock/test_c012.c
new file mode 100644
index 0000000000000000000000000000000000000000..43328b7b6a369d977092bcb2b3955adf087b9be6
--- /dev/null
+++ b/test_pool/clock/test_c012.c
@@ -0,0 +1,63 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_clock.h"
+
+#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 12)
+#define TEST_DESC "Clock rate set invalid clock id check "
+
+#define PARAMETER_SIZE 4
+
+uint32_t clock_rate_set_invalid_clock_id_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t clock_id;
+ uint32_t parameters[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Query with invalid id should fail with NOT_FOUND */
+ clock_id = val_clock_get_info(NUM_CLOCKS, 0) + 1; /* Invalid clock id*/
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query for invalid clock_id :%d", clock_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = CLOCK_SET_SYNC_MODE;
+ parameters[param_count++] = clock_id;
+ parameters[param_count++] =
+ (uint32_t)(val_clock_get_rate(CLOCK_LOWEST_RATE, clock_id) & MASK_FOR_LOWER_WORD);
+ parameters[param_count++] =
+ (uint32_t)((val_clock_get_rate(CLOCK_HIGHEST_RATE, clock_id) & MASK_FOR_UPPER_WORD) >> 32);
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_RATE_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/clock/test_c013.c b/test_pool/clock/test_c013.c
new file mode 100644
index 0000000000000000000000000000000000000000..a70c878aa0f785880b82a2d8d3aad2ca45901f46
--- /dev/null
+++ b/test_pool/clock/test_c013.c
@@ -0,0 +1,71 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_clock.h"
+
+#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 13)
+#define TEST_DESC "Clock rate get check "
+
+uint32_t clock_rate_get_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t clock_id, num_clocks;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ num_clocks = val_clock_get_info(NUM_CLOCKS, 0);
+ if (num_clocks == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Clock found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM CLOCKS : %d", num_clocks);
+
+ /* Discover clock rate for all clocks */
+ for (clock_id = 0; clock_id < num_clocks; clock_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n CLOCK ID: %d", clock_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Read clock rates");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_RATE_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &clock_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ val_print(VAL_PRINT_INFO, "\n CLOCK RATE LOWER: 0x%08x",
+ return_values[RATE_LOWER_WORD_OFFSET]);
+ val_print(VAL_PRINT_INFO, "\n CLOCK RATE UPPER: 0x%08x",
+ return_values[RATE_UPPER_WORD_OFFSET]);
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/clock/test_c014.c b/test_pool/clock/test_c014.c
new file mode 100644
index 0000000000000000000000000000000000000000..7af69fd3479d1d4b08e76ffc3dba011ee4c7c641
--- /dev/null
+++ b/test_pool/clock/test_c014.c
@@ -0,0 +1,54 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_clock.h"
+
+#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 14)
+#define TEST_DESC "Clock rate get invalid clock id check "
+
+uint32_t clock_rate_get_invalid_clock_id_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t clock_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* clock rate get for invalid clock id should return NOT_FOUND status */
+ clock_id = val_clock_get_info(NUM_CLOCKS, 0) + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query with invalid clock_id :%d", clock_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_RATE_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &clock_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/clock/test_c015.c b/test_pool/clock/test_c015.c
new file mode 100644
index 0000000000000000000000000000000000000000..affd155e4f1bdad3a842641b6674c499f3e107ce
--- /dev/null
+++ b/test_pool/clock/test_c015.c
@@ -0,0 +1,68 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_clock.h"
+
+#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 15)
+#define TEST_DESC "Clock config set invalid attribute check "
+
+#define MAX_PARAMETER_SIZE 2
+
+uint32_t clock_config_set_invalid_attr_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t clock_id, num_clocks, parameters[MAX_PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ num_clocks = val_clock_get_info(NUM_CLOCKS, 0);
+ if (num_clocks == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Clock found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM CLOCKS : %d", num_clocks);
+
+ for (clock_id = 0; clock_id < num_clocks; clock_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n CLOCK ID: %d", clock_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query with invalid attribute");
+
+ /* Clock config set with invalid attributes should fail with INVALID_PARAMETERS */
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = clock_id;
+ parameters[param_count++] = INVALID_ATTRIBUTE; /* Set invalid attribute */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_CONFIG_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/clock/test_c016.c b/test_pool/clock/test_c016.c
new file mode 100644
index 0000000000000000000000000000000000000000..7bd9751d253df92322ac047a683c2a105c46bd71
--- /dev/null
+++ b/test_pool/clock/test_c016.c
@@ -0,0 +1,57 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_clock.h"
+
+#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 16)
+#define TEST_DESC "Clock config set invalid clock id check "
+
+#define MAX_PARAMETER_SIZE 2
+
+uint32_t clock_config_set_invalid_clock_id_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t clock_id, parameters[MAX_PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* clock config set for invalid clock id should return NOT_FOUND status */
+ clock_id = val_clock_get_info(NUM_CLOCKS, 0) + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query with invalid clock_id :%d", clock_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = clock_id;
+ parameters[param_count++] = CONFIG_SET_ENABLE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_CONFIG_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/clock/test_c017.c b/test_pool/clock/test_c017.c
new file mode 100644
index 0000000000000000000000000000000000000000..85aba92adf037eba8091792099675b27c2135ed9
--- /dev/null
+++ b/test_pool/clock/test_c017.c
@@ -0,0 +1,137 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_clock.h"
+
+#define TEST_NUM (SCMI_CLOCK_TEST_NUM_BASE + 17)
+#define TEST_DESC "Clock config set check "
+
+#define MAX_PARAMETER_SIZE 2
+
+/********* TEST ALGO ********************
+ * Find a new attribute from previously saved value
+ * Set new attribute
+ * Get the attribute again and compare with newly set attribute
+ * Restore the default attribute
+*****************************************/
+
+uint32_t clock_config_set_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE], attributes;
+ uint32_t clock_id, num_clocks, parameters[MAX_PARAMETER_SIZE];
+ uint32_t run_flag = 0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ num_clocks = val_clock_get_info(NUM_CLOCKS, 0);
+ if (num_clocks == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Clock found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM CLOCKS : %d", num_clocks);
+
+ for (clock_id = 0; clock_id < num_clocks; clock_id++)
+ {
+
+ val_print(VAL_PRINT_TEST, "\n CLOCK ID: %d", clock_id);
+
+ /* Skip if always on clock*/
+ if (val_check_clock_config_change_support(clock_id) == 1)
+ continue;
+
+ run_flag = 1;
+ /* Find new attribute from previously stored value */
+ attributes = val_clock_get_info(CLOCK_ATTRIBUTE, clock_id);
+ if (attributes == CONFIG_SET_DISABLE)
+ attributes = CONFIG_SET_ENABLE;
+ else
+ attributes = CONFIG_SET_DISABLE;
+
+ /* CLOCK_CONFIG_SET with new attribute */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Set config with attributes :%d", attributes);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = clock_id;
+ parameters[param_count++] = attributes;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_CONFIG_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ /* Get attribute and compare with new value */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Verify the changed attribute");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_ATTRIBUTES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &clock_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_reserved_bits_check_is_zero(
+ VAL_EXTRACT_BITS(return_values[ATTRIBUTE_OFFSET], 1, 31) != VAL_STATUS_PASS))
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_compare("CLOCK STATUS ",
+ VAL_EXTRACT_BITS(return_values[ATTRIBUTE_OFFSET], 0, 0), attributes))
+ return VAL_STATUS_FAIL;
+
+ /* Restore the default attribute value*/
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Restore the original attributes :%d",
+ val_clock_get_info(CLOCK_ATTRIBUTE, clock_id));
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = clock_id;
+ parameters[param_count++] = val_clock_get_info(CLOCK_ATTRIBUTE, clock_id);
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_CLOCK, CLOCK_CONFIG_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+ }
+ if (run_flag == 0)
+ return VAL_STATUS_SKIP;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/common/protocol_testlist.c b/test_pool/common/protocol_testlist.c
deleted file mode 100644
index 9a9b5a5862d9e28827315d1d01be99248d302877..0000000000000000000000000000000000000000
--- a/test_pool/common/protocol_testlist.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
- * SPDX-License-Identifier : Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-**/
-
-#include "val_interface.h"
-#include "protocol_testlist.h"
-
-test_fn_ptr *val_get_testlist(uint32_t protocol_identifier, uint32_t *num_tests)
-{
- switch (protocol_identifier)
- {
- case PROTOCOL_BASE:
- return val_base_get_testlist(num_tests);
- break;
-#ifdef POWER_DOMAIN_PROTOCOL
- case PROTOCOL_POWER_DOMAIN:
- return val_power_domain_get_testlist(num_tests);
- break;
-#endif
-#ifdef SYSTEM_POWER_PROTOCOL
- case PROTOCOL_SYSTEM_POWER:
- return val_system_power_get_testlist(num_tests);
- break;
-#endif
-#ifdef CLOCK_PROTOCOL
- case PROTOCOL_CLOCK:
- return val_clock_get_testlist(num_tests);
- break;
-#endif
-#ifdef SENSOR_PROTOCOL
- case PROTOCOL_SENSOR:
- return val_sensor_get_testlist(num_tests);
- break;
-#endif
-#ifdef PERFORMANCE_PROTOCOL
- case PROTOCOL_PERFORMANCE:
- return val_performance_get_testlist(num_tests);
- break;
-#endif
- default:
- *num_tests = 0;
- return NULL;
- }
-}
-
-/**
- @brief This API is used to get protocol name
- 1. Caller - Test Suite.
- 2. Prerequisite - Base protocol info table.
- @param protocol_id protocol identifier
- @return string protocol name
-**/
-char *val_get_protocol_str(uint32_t protocol_id)
-{
- switch (protocol_id)
- {
- case PROTOCOL_BASE:
- return "BASE";
- break;
- case PROTOCOL_POWER_DOMAIN:
- return "POWER DOMAIN";
- break;
- case PROTOCOL_SYSTEM_POWER:
- return "SYSTEM POWER";
- break;
- case PROTOCOL_PERFORMANCE:
- return "PERFORMANCE";
- break;
- case PROTOCOL_SENSOR:
- return "SENSOR";
- break;
- case PROTOCOL_CLOCK:
- return "CLOCK";
- break;
- default:
- val_print(VAL_PRINT_WARN, "\n\tUnkown protocol id %d", protocol_id);
- return "UNKNOWN";
- }
-}
diff --git a/test_pool/performance/test_d001.c b/test_pool/performance/test_d001.c
index b2259c2e5fbdf698a9170c243f48fb69fbfef86c..5ce70e7b0b7c9cd807ca05bb2b24d03b2b326cf8 100644
--- a/test_pool/performance/test_d001.c
+++ b/test_pool/performance/test_d001.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,32 +15,36 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_performance.h"
#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 1)
-#define TEST_DESC "Performance Domain Protocol Version check "
+#define TEST_DESC "Performance protocol version check "
-uint32_t performance_query_protocol_version(void)
+#define MIN_RET_VAL_EXPECTED 1
+
+uint32_t performance_query_protocol_version(uint32_t *version)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters;
- uint32_t return_value_count, version, expected_version;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Check protocol version is as expected value */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query protocol version");
+ /* Check the implemented protocol version */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query protocol version");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters = NULL; /* No parameters for this command */
- version = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_VERSION,
COMMAND_MSG);
+ parameters = NULL; /* No parameters for this command */
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &version);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -48,9 +52,13 @@ uint32_t performance_query_protocol_version(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- expected_version = val_performance_get_expected_protocol_version();
- if (val_protocol_version_check(expected_version, version) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (return_value_count != MIN_RET_VAL_EXPECTED)
return VAL_STATUS_FAIL;
+ *version = return_values[VERSION_OFFSET];
+ val_print(VAL_PRINT_ERR, "\n VERSION : 0x%08x ", *version);
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/performance/test_d002.c b/test_pool/performance/test_d002.c
index 0e0069e6786ced1585a8f7c60cd537403d970531..9fd589043201eb3e9f523953ca115b1a62763d06 100644
--- a/test_pool/performance/test_d002.c
+++ b/test_pool/performance/test_d002.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,30 +15,32 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_performance.h"
#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 2)
-#define TEST_DESC "Performance Domain Protocol Attributes check "
-#define MAX_RETURN_VALUE_SIZE 4
+#define TEST_DESC "Performance protocol attributes check "
uint32_t performance_query_protocol_attributes(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters;
- uint32_t return_value_count, return_values[MAX_RETURN_VALUE_SIZE];
- uint32_t attributes, stats_addr_low, stats_addr_high, stats_len;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
+ uint32_t attributes, num_perf_domains, stats_addr_low, stats_addr_high, stats_len;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
/* Query performance protocol and check num of performance domains */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query protocol attributes");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query protocol attributes");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters = NULL; /* No parameters for this command */
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
+ /* No parameters for this command */
+ parameters = NULL;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_ATTRIBUTES,
COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
@@ -50,24 +52,40 @@ uint32_t performance_query_protocol_attributes(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- attributes = return_values[0];
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 17, 31) != VAL_STATUS_PASS))
return VAL_STATUS_FAIL;
- /* Save the number of performance domains */
- val_performance_save_info(NUM_PERF_DOMAINS, VAL_EXTRACT_BITS(attributes, 0, 15));
- val_print(VAL_PRINT_INFO, "\n\tNUM PERFORMANCE DOMAINS: %d ",
- VAL_EXTRACT_BITS(attributes, 0, 15));
-
- /* Save the performance statitcs memory lower address */
- stats_addr_low = return_values[1];
- val_performance_save_info(PERF_STATS_ADDR_LOW, stats_addr_low);
- /* Save the performance statitcs memory higher address */
- stats_addr_high = return_values[2];
- val_performance_save_info(PERF_STATS_ADDR_HIGH, stats_addr_high);
- /* Save the performance statitcs memory lower address */
- stats_len = return_values[3];
- val_performance_save_info(PERF_STATS_ADDR_LEN, stats_len);
+ val_print(VAL_PRINT_INFO, "\n PWR VAL in Mw : %d", VAL_EXTRACT_BITS(attributes, 16, 16));
+
+ /* Compare & save the number of performance domains */
+ num_perf_domains = VAL_EXTRACT_BITS(attributes, 0, 15);
+ if (val_compare("NUM PERF DOMAINS", num_perf_domains,
+ val_performance_get_expected_num_domains()))
+ return VAL_STATUS_FAIL;
+ val_performance_save_info(NUM_PERF_DOMAINS, 0x00, VAL_EXTRACT_BITS(attributes, 0, 15));
+
+ /* Compare & save the performance statistics memory lower address */
+ stats_addr_low = return_values[STATS_ADDR_LOW_OFFSET];
+ if (val_compare("STATS ADDR LOW ", stats_addr_low,
+ val_performance_get_expected_stats_addr_low()))
+ return VAL_STATUS_FAIL;
+ val_performance_save_info(PERF_STATS_ADDR_LOW, 0x00, stats_addr_low);
+
+ /* Compare & save the performance statistics memory higher address */
+ stats_addr_high = return_values[STATS_ADDR_HIGH_OFFSET];
+ if (val_compare("STATS ADDR HIGH ", stats_addr_high,
+ val_performance_get_expected_stats_addr_high()))
+ return VAL_STATUS_FAIL;
+ val_performance_save_info(PERF_STATS_ADDR_HIGH, 0x00, stats_addr_high);
+
+ /* Compare & save the performance statistics memory length */
+ stats_len = return_values[STATS_LENGTH_OFFSET];
+ if (val_compare("STATS ADDR LEN ", stats_len, val_performance_get_expected_stats_addr_len()))
+ return VAL_STATUS_FAIL;
+ val_performance_save_info(PERF_STATS_ADDR_LEN, 0x00, stats_len);
return VAL_STATUS_PASS;
}
diff --git a/test_pool/performance/test_d003.c b/test_pool/performance/test_d003.c
index 16b1be36e7241c53871fc9c2c5983442744ed913..0832adb71eaae922c39a8c7bbee9b8791a8d4b9b 100644
--- a/test_pool/performance/test_d003.c
+++ b/test_pool/performance/test_d003.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,31 +15,34 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_performance.h"
#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 3)
-#define TEST_DESC "Performance Protocol mandatory command support check "
+#define TEST_DESC "Perf msg attributes mandatory commands check "
uint32_t performance_query_mandatory_command_support(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id;
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id, attributes;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] PERFORMANCE DOMAIN ATTRIBUTES support");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] PERFORMANCE DOMAIN ATTRIBUTES support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = PERFORMANCE_DOMAIN_ATTRIBUTES;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
- COMMAND_MSG);
+ COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -47,19 +50,25 @@ uint32_t performance_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 1, 31)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Should be zero for PERFORMANCE DOMAIN ATTRIBUTES*/
+ if (val_compare("MSG FASTCH SUPPORT", VAL_EXTRACT_BITS(attributes, 0, 0), 0))
return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] PERFORMANCE DESCRIBE LEVELS support");
+ val_print(VAL_PRINT_TEST, "\n [Check 2] PERFORMANCE DESCRIBE LEVELS support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = PERFORMANCE_DESCRIBE_LEVELS;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
- COMMAND_MSG);
+ COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -67,19 +76,25 @@ uint32_t performance_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 1, 31)) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 3] PERFORMANCE LIMITS SET support");
+ /* Should be zero for PERFORMANCE DESCRIBE LEVELS*/
+ if (val_compare("MSG FASTCH SUPPORT", VAL_EXTRACT_BITS(attributes, 0, 0), 0))
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 3] PERFORMANCE LIMITS SET support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = PERFORMANCE_LIMITS_SET;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
- COMMAND_MSG);
+ COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -87,19 +102,26 @@ uint32_t performance_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 1, 31)) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 4] PERFORMANCE LIMITS GET support");
+ val_print(VAL_PRINT_DEBUG, "\n MESSAGE FASTCH SUPPORT : %d",
+ VAL_EXTRACT_BITS(attributes, 0, 0));
+ val_performance_save_info(PERF_MESSAGE_FAST_CH_SUPPORT, message_id,
+ VAL_EXTRACT_BITS(attributes, 0, 0));
+
+ val_print(VAL_PRINT_TEST, "\n [Check 4] PERFORMANCE LIMITS GET support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = PERFORMANCE_LIMITS_GET;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
- COMMAND_MSG);
+ COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -107,19 +129,26 @@ uint32_t performance_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 1, 31)) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 5] PERFORMANCE LEVEL SET support");
+ val_print(VAL_PRINT_DEBUG, "\n MESSAGE FASTCH SUPPORT : %d",
+ VAL_EXTRACT_BITS(attributes, 0, 0));
+ val_performance_save_info(PERF_MESSAGE_FAST_CH_SUPPORT, message_id,
+ VAL_EXTRACT_BITS(attributes, 0, 0));
+
+ val_print(VAL_PRINT_TEST, "\n [Check 5] PERFORMANCE LEVEL SET support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = PERFORMANCE_LEVEL_SET;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
- COMMAND_MSG);
+ COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -127,19 +156,26 @@ uint32_t performance_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 1, 31)) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 6] PERFORMANCE LEVEL GET support");
+ val_print(VAL_PRINT_DEBUG, "\n MESSAGE FASTCH SUPPORT : %d",
+ VAL_EXTRACT_BITS(attributes, 0, 0));
+ val_performance_save_info(PERF_MESSAGE_FAST_CH_SUPPORT, message_id,
+ VAL_EXTRACT_BITS(attributes, 0, 0));
+
+ val_print(VAL_PRINT_TEST, "\n [Check 6] PERFORMANCE LEVEL GET support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = PERFORMANCE_LEVEL_GET;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
- COMMAND_MSG);
+ COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -147,8 +183,16 @@ uint32_t performance_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 1, 31)) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ val_print(VAL_PRINT_DEBUG, "\n MESSAGE FASTCH SUPPORT : %d ",
+ VAL_EXTRACT_BITS(attributes, 0, 0));
+ val_performance_save_info(PERF_MESSAGE_FAST_CH_SUPPORT, message_id,
+ VAL_EXTRACT_BITS(attributes, 0, 0));
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/performance/test_d003_v1.c b/test_pool/performance/test_d003_v1.c
new file mode 100644
index 0000000000000000000000000000000000000000..7efc9f74dc4b09ea4b9818fdc6fe20f6d4452055
--- /dev/null
+++ b/test_pool/performance/test_d003_v1.c
@@ -0,0 +1,164 @@
+/** @file
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 3)
+#define TEST_DESC "Perf msg attributes mandatory commands check "
+
+uint32_t performance_query_mandatory_command_support_v1(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 1] PERFORMANCE DOMAIN ATTRIBUTES support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_DOMAIN_ATTRIBUTES;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 2] PERFORMANCE DESCRIBE LEVELS support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_DESCRIBE_LEVELS;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 3] PERFORMANCE LIMITS SET support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_LIMITS_SET;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 4] PERFORMANCE LIMITS GET support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_LIMITS_GET;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 5] PERFORMANCE LEVEL SET support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_LEVEL_SET;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 6] PERFORMANCE LEVEL GET support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_LEVEL_GET;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d004.c b/test_pool/performance/test_d004.c
new file mode 100644
index 0000000000000000000000000000000000000000..5ee6eb38e6acaeded2950c5a8ec24977a74390fd
--- /dev/null
+++ b/test_pool/performance/test_d004.c
@@ -0,0 +1,72 @@
+/** @file
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include"val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 4)
+#define TEST_DESC "Perf msg attributes invalid message id check "
+
+uint32_t performance_invalid_messageid_call(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
+ uint32_t message_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Sending invalid performance protocol cmd should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Invalid command invocation");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters = NULL;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_INVALID_COMMAND,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Query support for invalid performance protocol command should return status NOT_FOUND */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query undefined command support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_INVALID_COMMAND;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d005.c b/test_pool/performance/test_d005.c
new file mode 100644
index 0000000000000000000000000000000000000000..ddc25b89387c98381fc1ac0592c369c9546dea69
--- /dev/null
+++ b/test_pool/performance/test_d005.c
@@ -0,0 +1,111 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 5)
+#define TEST_DESC "Performance domain attributes check "
+
+uint32_t performance_query_domain_attributes(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, attribute;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Check performance domain attributes for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query attributes");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DOMAIN_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ attribute = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attribute, 0, 26)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_INFO, "\n SET LIMIT SUPPORT : %d",
+ VAL_EXTRACT_BITS(attribute, 31, 31));
+ val_performance_save_info(PERF_DOMAIN_SET_PERFORMANCE_LIMIT_SUPPORT, domain_id,
+ VAL_EXTRACT_BITS(attribute, 31, 31));
+
+ val_print(VAL_PRINT_INFO, "\n SET LEVEL SUPPORT : %d",
+ VAL_EXTRACT_BITS(attribute, 30, 30));
+ val_performance_save_info(PERF_DOMAIN_SET_PERFORMANCE_LEVEL_SUPPORT, domain_id,
+ VAL_EXTRACT_BITS(attribute, 30, 30));
+
+ val_print(VAL_PRINT_INFO, "\n LIMIT CHANGE NOTIFY SUPPORT: %d",
+ VAL_EXTRACT_BITS(attribute, 29, 29));
+ val_performance_save_info(PERF_DOMAIN_LIMIT_CHANGE_NTFY_SUPPORT, domain_id,
+ VAL_EXTRACT_BITS(attribute, 29, 29));
+
+ val_print(VAL_PRINT_INFO, "\n LEVEL CHANGE NOTIFY SUPPORT: %d",
+ VAL_EXTRACT_BITS(attribute, 28, 28));
+ val_performance_save_info(PERF_DOMAIN_LVL_CHANGE_NTFY_SUPPORT, domain_id,
+ VAL_EXTRACT_BITS(attribute, 28, 28));
+
+ val_print(VAL_PRINT_INFO, "\n FAST CHANNEL SUPPORT : %d",
+ VAL_EXTRACT_BITS(attribute, 27, 27));
+ val_performance_save_info(PERF_DOMAIN_FAST_CH_SUPPORT, domain_id,
+ VAL_EXTRACT_BITS(attribute, 27, 27));
+
+ if (val_reserved_bits_check_is_zero(
+ VAL_EXTRACT_BITS(return_values[RATE_LIMIT_OFFSET], 20, 31)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_INFO, "\n RATE LIMIT : %d",
+ VAL_EXTRACT_BITS(return_values[RATE_LIMIT_OFFSET], 0, 19));
+ val_print(VAL_PRINT_INFO, "\n SUSTAINED FREQENCY : %d",
+ return_values[FREQUENCY_OFFSET]);
+ val_print(VAL_PRINT_INFO, "\n SUSTAINED LEVEL : %d",
+ return_values[SUSTAINED_LEVEL_OFFSET]);
+
+ if (val_compare_str("DOMAIN NAME", (char *)&return_values[NAME_OFFSET],
+ (char *)val_performance_get_expected_name(domain_id), SCMI_NAME_STR_SIZE))
+ return VAL_STATUS_FAIL;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d005_v1.c b/test_pool/performance/test_d005_v1.c
new file mode 100644
index 0000000000000000000000000000000000000000..cddd1614e0b42caef4b316dc0536b72457e1cd32
--- /dev/null
+++ b/test_pool/performance/test_d005_v1.c
@@ -0,0 +1,106 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 5)
+#define TEST_DESC "Performance domain attributes check "
+
+uint32_t performance_query_domain_attributes_v1(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, attribute;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Check performance domain attributes for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query attributes");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DOMAIN_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ attribute = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attribute, 0, 27)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_INFO, "\n SET LIMIT SUPPORT : %d",
+ VAL_EXTRACT_BITS(attribute, 31, 31));
+ val_performance_save_info(PERF_DOMAIN_SET_PERFORMANCE_LIMIT_SUPPORT, domain_id,
+ VAL_EXTRACT_BITS(attribute, 31, 31));
+
+ val_print(VAL_PRINT_INFO, "\n SET LEVEL SUPPORT : %d",
+ VAL_EXTRACT_BITS(attribute, 30, 30));
+ val_performance_save_info(PERF_DOMAIN_SET_PERFORMANCE_LEVEL_SUPPORT, domain_id,
+ VAL_EXTRACT_BITS(attribute, 30, 30));
+
+ val_print(VAL_PRINT_INFO, "\n LIMIT CHANGE NOTIFY SUPPORT: %d",
+ VAL_EXTRACT_BITS(attribute, 29, 29));
+ val_performance_save_info(PERF_DOMAIN_LIMIT_CHANGE_NTFY_SUPPORT, domain_id,
+ VAL_EXTRACT_BITS(attribute, 29, 29));
+
+ val_print(VAL_PRINT_INFO, "\n LEVEL CHANGE NOTIFY SUPPORT: %d",
+ VAL_EXTRACT_BITS(attribute, 28, 28));
+ val_performance_save_info(PERF_DOMAIN_LVL_CHANGE_NTFY_SUPPORT, domain_id,
+ VAL_EXTRACT_BITS(attribute, 28, 28));
+
+ if (val_reserved_bits_check_is_zero(
+ VAL_EXTRACT_BITS(return_values[RATE_LIMIT_OFFSET], 20, 31)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_INFO, "\n RATE LIMIT : %d",
+ VAL_EXTRACT_BITS(return_values[RATE_LIMIT_OFFSET], 0, 19));
+ val_print(VAL_PRINT_INFO, "\n SUSTAINED FREQENCY : %d",
+ return_values[FREQUENCY_OFFSET]);
+ val_print(VAL_PRINT_INFO, "\n SUSTAINED LEVEL : %d",
+ return_values[SUSTAINED_LEVEL_OFFSET]);
+
+ if (val_compare_str("DOMAIN NAME", (char *)&return_values[NAME_OFFSET],
+ (char *)val_performance_get_expected_name(domain_id), SCMI_NAME_STR_SIZE))
+ return VAL_STATUS_FAIL;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d006.c b/test_pool/performance/test_d006.c
new file mode 100644
index 0000000000000000000000000000000000000000..ad1eaf4dd8cfdf4cb3bb294ba97baddf6770375e
--- /dev/null
+++ b/test_pool/performance/test_d006.c
@@ -0,0 +1,55 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 6)
+#define TEST_DESC "Perf domain attributes invalid domain check "
+
+uint32_t performance_query_domain_attributes_invalid_domain(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Check performance domain attributes for invalid domain */
+ domain_id = val_performance_get_info(NUM_PERF_DOMAINS, 0x00) + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query with invalid domain_id: %d", domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DOMAIN_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d007.c b/test_pool/performance/test_d007.c
new file mode 100644
index 0000000000000000000000000000000000000000..b99f7a740ed81427de100c5be899c10addd9a001
--- /dev/null
+++ b/test_pool/performance/test_d007.c
@@ -0,0 +1,153 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 7)
+#define TEST_DESC "Performance describe levels check "
+
+#define PARAMETER_SIZE 2
+#define PERF_LEVEL_ARRAY_COUNT 3
+
+uint32_t performance_query_describe_levels(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, num_remaining_levels, num_levels_retured;
+ uint32_t i, perf_level, power_cost, latency, level_index;
+ uint32_t min_perf_level, max_perf_level;
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t *perf_level_array;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Check performance describe levels for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ level_index = 0;
+ num_remaining_levels = 0;
+ num_levels_retured = 0;
+ min_perf_level = 0xFFFFFFFF;
+ max_perf_level = 0;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query describe levels");
+
+ do
+ {
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ level_index += num_levels_retured;
+ parameters[param_count++] = level_index;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DESCRIBE_LEVELS,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ num_remaining_levels = VAL_EXTRACT_BITS(return_values[NUM_LEVEL_OFFSET], 16, 31);
+ val_print(VAL_PRINT_DEBUG, "\n NUM OF REMAINING LEVELS: %d",
+ num_remaining_levels);
+
+ if (val_reserved_bits_check_is_zero(
+ VAL_EXTRACT_BITS(return_values[NUM_LEVEL_OFFSET], 12, 15)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ num_levels_retured = VAL_EXTRACT_BITS(return_values[NUM_LEVEL_OFFSET], 0, 11);
+ val_print(VAL_PRINT_DEBUG, "\n NUM OF LEVELS RETURNED : %d", num_levels_retured);
+
+ perf_level_array = &return_values[PERF_LEVEL_ARRAY_OFFSET];
+ for (i = 0; i < num_levels_retured; i++)
+ {
+ perf_level = perf_level_array[i*PERF_LEVEL_ARRAY_COUNT];
+ val_print(VAL_PRINT_DEBUG, "\n PERFORMANCE LEVEL[%d] : %08x",
+ level_index + i, perf_level);
+
+ if (min_perf_level > perf_level)
+ min_perf_level = perf_level;
+
+ if (max_perf_level < perf_level)
+ max_perf_level = perf_level;
+
+ /* Store a intermediate value*/
+ if (i == 1)
+ val_performance_save_info(PERF_DOMAIN_INTERMEDIATE_LEVEL, domain_id,
+ perf_level);
+
+ power_cost = perf_level_array[1 + (i * PERF_LEVEL_ARRAY_COUNT)];
+ val_print(VAL_PRINT_DEBUG, "\n PERFORMANCE POWER COST[%d] : %08x",
+ level_index + i, power_cost);
+
+ latency = VAL_EXTRACT_BITS(perf_level_array[2 + (i * PERF_LEVEL_ARRAY_COUNT)],
+ 0, 15);
+ val_print(VAL_PRINT_DEBUG, "\n PERFORMANCE LATENCY[%d] : %08x",
+ level_index + i, latency);
+
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(
+ perf_level_array[2 + (i * PERF_LEVEL_ARRAY_COUNT)], 16, 31)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+ } while (num_remaining_levels > 0);
+
+ if (val_compare("NUM OF LEVELS ", (level_index + num_levels_retured),
+ val_performance_get_expected_number_of_level(domain_id)))
+ return VAL_STATUS_FAIL;
+
+ val_performance_save_info(PERF_DOMAIN_MAX_LEVEL, domain_id, max_perf_level);
+ val_performance_save_info(PERF_DOMAIN_MIN_LEVEL, domain_id, min_perf_level);
+
+ /* Performance domain attributes for invalid level index */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query with invalid level_index ");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = (level_index + num_levels_retured) + 1; /*Invalid level index*/
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DESCRIBE_LEVELS,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d008.c b/test_pool/performance/test_d008.c
new file mode 100644
index 0000000000000000000000000000000000000000..5e69b4f9390bd7900b662d94884a92419286f908
--- /dev/null
+++ b/test_pool/performance/test_d008.c
@@ -0,0 +1,60 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 8)
+#define TEST_DESC "Perf describe levels invalid domain check "
+
+#define PARAMETER_SIZE 2
+
+uint32_t performance_query_describe_levels_invalid_domain(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id;
+ uint32_t parameters[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Performance domain attributes for invalid performance domain should fail */
+ domain_id = val_performance_get_info(NUM_PERF_DOMAINS, 0x00) + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query desc levels with invalid domain_id: %d",
+ domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = 0;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DESCRIBE_LEVELS,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d009.c b/test_pool/performance/test_d009.c
new file mode 100644
index 0000000000000000000000000000000000000000..5de23f0af2ae4652e8cccb4e42c2f12140d5d711
--- /dev/null
+++ b/test_pool/performance/test_d009.c
@@ -0,0 +1,149 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 9)
+#define TEST_DESC "Performance limits set change limit check "
+#define PARAMETER_SIZE 3
+
+/********* TEST ALGO ********************
+ * Get the default level
+ * Set a new level
+ * Get level & compare whether set level is success
+*****************************************/
+
+uint32_t performance_query_set_limit(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains;
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t range_max, range_min, temp_max;
+ uint32_t run_flag = 0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Check performance set levels for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ if (val_performance_get_info(PERF_DOMAIN_SET_PERFORMANCE_LIMIT_SUPPORT, domain_id) == 0)
+ continue;
+ run_flag = 1;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Get performance limits ");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LIMITS_GET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ range_max = return_values[RANGE_MAX_OFFSET];
+ range_min = return_values[RANGE_MIN_OFFSET];
+ if (range_max != val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id))
+ temp_max = val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id);
+ else
+ temp_max = val_performance_get_info(PERF_DOMAIN_INTERMEDIATE_LEVEL, domain_id);
+
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Change performance limits ");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = temp_max;
+ parameters[param_count++] = range_min;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LIMITS_SET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Verify the changed perf limit");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LIMITS_GET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_compare("RANGE_MAX", return_values[RANGE_MAX_OFFSET], temp_max))
+ return VAL_STATUS_FAIL;
+
+ if (val_compare("RANGE_MIN", return_values[RANGE_MIN_OFFSET], range_min))
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 4] Restore original performance limits");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = range_max;
+ parameters[param_count++] = range_min;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LIMITS_SET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ }
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain support PERF SET LIMIT ");
+ return VAL_STATUS_SKIP;
+ }
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d010.c b/test_pool/performance/test_d010.c
new file mode 100644
index 0000000000000000000000000000000000000000..f8a0a14bc540110209ad4598707eb03097615973
--- /dev/null
+++ b/test_pool/performance/test_d010.c
@@ -0,0 +1,116 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 10)
+#define TEST_DESC "Performance limits set invalid limits check "
+
+#define PARAMETER_SIZE 3
+
+uint32_t performance_query_set_limit_invalid_range(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains;
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t run_flag = 0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Check performance set limit for invalid ranges.*/
+
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ if (val_performance_get_info(PERF_DOMAIN_SET_PERFORMANCE_LIMIT_SUPPORT, domain_id) == 0)
+ continue;
+ run_flag = 1;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Set invalid max limit");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id) + 1;
+ parameters[param_count++] = val_performance_get_info(PERF_DOMAIN_MIN_LEVEL, domain_id);
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LIMITS_SET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_OUT_OF_RANGE) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Set invalid min limit");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id);
+ parameters[param_count++] = val_performance_get_info(PERF_DOMAIN_MIN_LEVEL, domain_id) - 1;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LIMITS_SET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_OUT_OF_RANGE) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Set limit with max_limit < min_limit");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = val_performance_get_info(PERF_DOMAIN_MIN_LEVEL, domain_id);
+ parameters[param_count++] = val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id);
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LIMITS_SET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain support PERF SET LIMIT ");
+ return VAL_STATUS_SKIP;
+ }
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d011.c b/test_pool/performance/test_d011.c
new file mode 100644
index 0000000000000000000000000000000000000000..fe1a9461ea15a429a329891b1806f21ab007a1ba
--- /dev/null
+++ b/test_pool/performance/test_d011.c
@@ -0,0 +1,93 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 11)
+#define TEST_DESC "Performance limits set invalid domain check "
+
+#define PARAMETER_SIZE 3
+
+uint32_t performance_query_set_limit_invalid_domain(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains;
+ uint32_t parameters[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Check performance set limit for unsupported domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ if (val_performance_get_info(PERF_DOMAIN_SET_PERFORMANCE_LIMIT_SUPPORT, domain_id) == 1)
+ continue;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Set perf limits for unsupported domain_id");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id);
+ parameters[param_count++] = val_performance_get_info(PERF_DOMAIN_MIN_LEVEL, domain_id);
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LIMITS_SET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_DENIED) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ /* Performance Set Limit for invalid performance domain should fail */
+ domain_id = num_domains + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Set perf limits for invalid domain_id: %d",
+ domain_id);
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id);
+ parameters[param_count++] = val_performance_get_info(PERF_DOMAIN_MIN_LEVEL, domain_id);
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LIMITS_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d012.c b/test_pool/performance/test_d012.c
new file mode 100644
index 0000000000000000000000000000000000000000..735b05bc8ee8f710ffd71c07603c8ee05faa3201
--- /dev/null
+++ b/test_pool/performance/test_d012.c
@@ -0,0 +1,55 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 12)
+#define TEST_DESC "Performance limits get invalid domain check "
+
+uint32_t performance_query_get_limit_invalid_domain(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Performance get limit for invalid performance domain should fail */
+ domain_id = val_performance_get_info(NUM_PERF_DOMAINS, 0x00) + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Perf limits get for invalid domain_id: %d",
+ domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LIMITS_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d013.c b/test_pool/performance/test_d013.c
new file mode 100644
index 0000000000000000000000000000000000000000..beb737f4d3ec036a037c452907335cc8eb8e4cf8
--- /dev/null
+++ b/test_pool/performance/test_d013.c
@@ -0,0 +1,148 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 13)
+#define TEST_DESC "Performance level set change level check "
+#define PARAMETER_SIZE 2
+
+/********* TEST ALGO ********************
+ * Get the default level
+ * Set a new level
+ * Get level & compare whether set level is success
+*****************************************/
+
+uint32_t performance_query_set_level(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains;
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t default_level, new_level;
+ uint32_t run_flag = 0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Check performance set levels for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ if (val_performance_get_info(PERF_DOMAIN_SET_PERFORMANCE_LEVEL_SUPPORT, domain_id) == 0)
+ continue;
+ run_flag = 1;
+
+ /* Get the current performance level for the domain */
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query performance level");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LEVEL_GET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ default_level = return_values[PERFORMANCE_LEVEL_OFFSET];
+
+ /* Find the new performance level */
+ if (default_level != val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id))
+ new_level = val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id);
+ else
+ new_level = val_performance_get_info(PERF_DOMAIN_MIN_LEVEL, domain_id);
+
+ /* Set new performance level for the domain */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Set changed performance level ");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = new_level;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LEVEL_SET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Get and and compare with level set */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Check changed perf level");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LEVEL_GET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_compare("LEVEL ", return_values[PERFORMANCE_LEVEL_OFFSET], new_level))
+ return VAL_STATUS_FAIL;
+
+ /* Restore performance level for the domain */
+ val_print(VAL_PRINT_TEST, "\n [Check 4] Restore performance level");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = default_level;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LEVEL_SET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain support PERF SET LEVEL ");
+ return VAL_STATUS_SKIP;
+ }
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d014.c b/test_pool/performance/test_d014.c
new file mode 100644
index 0000000000000000000000000000000000000000..dce5f76a2e736b573be5d5d6be413aacb9ba9267
--- /dev/null
+++ b/test_pool/performance/test_d014.c
@@ -0,0 +1,94 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 14)
+#define TEST_DESC "Performance level set invalid level check "
+#define PARAMETER_SIZE 2
+
+uint32_t performance_query_set_level_invalid_range(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains;
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t run_flag = 0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Check performance set levels for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ if (val_performance_get_info(PERF_DOMAIN_SET_PERFORMANCE_LEVEL_SUPPORT, domain_id) == 0)
+ continue;
+ run_flag = 1;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Set perf level > max level ");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id) + 1;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LEVEL_SET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_OUT_OF_RANGE) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Set perf level < min level");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = val_performance_get_info(PERF_DOMAIN_MIN_LEVEL, domain_id) - 1;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LEVEL_SET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_OUT_OF_RANGE) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain support PERF SET LEVEL ");
+ return VAL_STATUS_SKIP;
+ }
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d015.c b/test_pool/performance/test_d015.c
new file mode 100644
index 0000000000000000000000000000000000000000..0feb2244fe45e7fa2305c51ed9e7e8112ba6266b
--- /dev/null
+++ b/test_pool/performance/test_d015.c
@@ -0,0 +1,90 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 15)
+#define TEST_DESC "Performance level set invalid domain check "
+
+#define PARAMETER_SIZE 2
+
+uint32_t performance_query_set_level_invalid_domain(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains;
+ uint32_t parameters[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Check performance set levels for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ if (val_performance_get_info(PERF_DOMAIN_SET_PERFORMANCE_LEVEL_SUPPORT, domain_id) == 1)
+ continue;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Set perf level for unsupported domain_id");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id);
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LEVEL_SET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_DENIED) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ /* Performance Set Limit for invalid performance domain should fail */
+ domain_id = num_domains + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Set perf level for invalid domain_id: %d",
+ domain_id);
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id);
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LEVEL_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d016.c b/test_pool/performance/test_d016.c
new file mode 100644
index 0000000000000000000000000000000000000000..8db2dd17cefca4c67fedcf8fff38e763ce8f650c
--- /dev/null
+++ b/test_pool/performance/test_d016.c
@@ -0,0 +1,55 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 16)
+#define TEST_DESC "Performance level get invalid domain check "
+
+uint32_t performance_query_get_level_invalid_domain(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Performance get levels for invalid performance domain should fail */
+ domain_id = val_performance_get_info(NUM_PERF_DOMAINS, 0x00) + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Get perf level for invalid domain_id: %d",
+ domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LEVEL_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d017.c b/test_pool/performance/test_d017.c
new file mode 100644
index 0000000000000000000000000000000000000000..1dd598251b1d3a6051fef7e4e85c1bf5cf28c4fe
--- /dev/null
+++ b/test_pool/performance/test_d017.c
@@ -0,0 +1,93 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 17)
+#define TEST_DESC "Perf notify limit invalid notify_enable check"
+
+#define PARAMETER_SIZE 2
+
+uint32_t performance_query_notify_limit_invalid_parameters(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, message_id;
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t run_flag = 0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Skip if performance limit notify is not supported*/
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query performance limit notify support");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_NOTIFY_LIMITS;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n PERFORMANCE_NOTIFY_LIMITS unsupported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Check performance set limit for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ if (val_performance_get_info(PERF_DOMAIN_LIMIT_CHANGE_NTFY_SUPPORT, domain_id) == 0)
+ continue;
+ run_flag = 1;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Notify_limits with invalid notify_enable");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = INVALID_NOTIFY_EN_VAL;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_NOTIFY_LIMITS,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain support PERF NOTIFY LIMITS ");
+ return VAL_STATUS_SKIP;
+ }
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d018.c b/test_pool/performance/test_d018.c
new file mode 100644
index 0000000000000000000000000000000000000000..7de69eb11d19ff1235402bc7ba7976a81c34aa6a
--- /dev/null
+++ b/test_pool/performance/test_d018.c
@@ -0,0 +1,105 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 18)
+#define TEST_DESC "Performance notify limit invalid domain check"
+
+#define PARAMETER_SIZE 2
+
+uint32_t performance_query_notify_limit_invalid_domain(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, message_id;
+ uint32_t parameters[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Skip if performance limit notify is not supported*/
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query performance limit notify support");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_NOTIFY_LIMITS;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n PERFORMANCE_NOTIFY_LIMITS unsupported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Check performance set limit for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ if (val_performance_get_info(PERF_DOMAIN_LIMIT_CHANGE_NTFY_SUPPORT, domain_id) == 1)
+ continue;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Enable notify_limit for unsupported domain");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = NOTIFY_ENABLE;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_NOTIFY_LIMITS,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_SUPPORTED) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ /* Performance Set Limit for invalid performance domain should fail */
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Enable notify_limit for invalid domain_id: %d",
+ domain_id);
+
+ parameters[param_count++] = num_domains + 1;
+ parameters[param_count++] = NOTIFY_ENABLE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_NOTIFY_LIMITS, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d019.c b/test_pool/performance/test_d019.c
new file mode 100644
index 0000000000000000000000000000000000000000..28b639efa4825706d86116264509ecbe9146664b
--- /dev/null
+++ b/test_pool/performance/test_d019.c
@@ -0,0 +1,93 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 19)
+#define TEST_DESC "Perf notify level invalid notify_enable check"
+
+#define PARAMETER_SIZE 2
+
+uint32_t performance_query_notify_level_invalid_parameters(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, message_id;
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t run_flag = 0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Skip if performance notify level is not supported*/
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query performance level notify support");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_NOTIFY_LEVEL;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n PERFORMANCE_NOTIFY_LEVEL unsupported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Check performance set level for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ if (val_performance_get_info(PERF_DOMAIN_LVL_CHANGE_NTFY_SUPPORT, domain_id) == 0)
+ continue;
+ run_flag = 1;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Notify_levels with invalid notify_enable");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = INVALID_NOTIFY_EN_VAL;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_NOTIFY_LEVEL,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain support PERF NOTIFY LEVELS ");
+ return VAL_STATUS_SKIP;
+ }
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d020.c b/test_pool/performance/test_d020.c
new file mode 100644
index 0000000000000000000000000000000000000000..d933dc5bd51490c1b5fb6d04eae85e6b21856d56
--- /dev/null
+++ b/test_pool/performance/test_d020.c
@@ -0,0 +1,105 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 20)
+#define TEST_DESC "Performance notify level invalid domain check"
+
+#define PARAMETER_SIZE 2
+
+uint32_t performance_query_notify_level_invalid_domain(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, message_id;
+ uint32_t parameters[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Skip if performance notify level is not supported*/
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query performance level notify support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_NOTIFY_LEVEL;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n PERFORMANCE_NOTIFY_LEVEL unsupported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Check performance set level for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ if (val_performance_get_info(PERF_DOMAIN_LVL_CHANGE_NTFY_SUPPORT, domain_id) == 1)
+ continue;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Enable notify_level for unsupported domain");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = NOTIFY_ENABLE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_NOTIFY_LEVEL,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_SUPPORTED) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ /* Performance Set level for invalid performance domain should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Enable notify_level for invalid domain_id: %d",
+ domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = num_domains + 1;
+ parameters[param_count++] = 1;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_NOTIFY_LEVEL, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d021.c b/test_pool/performance/test_d021.c
new file mode 100644
index 0000000000000000000000000000000000000000..ec735de4070af489360773551e06f6ddc7ae113f
--- /dev/null
+++ b/test_pool/performance/test_d021.c
@@ -0,0 +1,134 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 21)
+#define TEST_DESC "Performance describe fast channel check "
+
+#define PARAMETER_SIZE 2
+
+uint32_t performance_query_describe_fast_channel(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, message_id, attributes;
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t run_flag = 0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Skip if describe fast channel is not supported*/
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query performance describe fast channel support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_DESCRIBE_FASTCHANNEL;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n PERF_DESCRIBE_FASTCHANNEL not supported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Check performance describe fast channel for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ if (val_performance_get_info(PERF_DOMAIN_FAST_CH_SUPPORT, domain_id) == 0)
+ continue;
+
+ for (message_id = PERFORMANCE_LIMITS_SET; message_id <= PERFORMANCE_LEVEL_GET; message_id++)
+ {
+ if (val_performance_get_info(PERF_MESSAGE_FAST_CH_SUPPORT, message_id) == 0)
+ continue;
+ run_flag = 1;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID:%d and msg_id: %d",
+ domain_id, message_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query describe fast channel");
+
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = message_id;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DESCRIBE_FASTCHANNEL,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 3, 31)) !=
+ VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n DOORBELL SUPPORT :%d",
+ VAL_EXTRACT_BITS(attributes, 0, 0));
+ val_print(VAL_PRINT_TEST, "\n DOORBELL DATA WIDTH :%d",
+ VAL_EXTRACT_BITS(attributes, 1, 2));
+ val_print(VAL_PRINT_TEST, "\n FAST CH RATE LIMIT :%d",
+ return_values[FAST_CH_RATE_LIMIT_OFFSET]);
+ val_print(VAL_PRINT_TEST, "\n FAST CH ADDR LOW :%d",
+ return_values[CHAN_ADDR_LOW_OFFSET]);
+ val_print(VAL_PRINT_TEST, "\n FAST CH ADDR HIGH :%d",
+ return_values[CHAN_ADDR_HIGH_OFFSET]);
+ val_print(VAL_PRINT_TEST, "\n FAST CH SIZE :%d",
+ return_values[CHAN_SIZE_OFFSET]);
+ val_print(VAL_PRINT_TEST, "\n DOORBELL ADDR LOW :%d",
+ return_values[DOORBELL_ADDR_LOW_OFFSET]);
+ val_print(VAL_PRINT_TEST, "\n DOORBELL ADDR HIGH :%d",
+ return_values[DOORBELL_ADDR_HIGH_OFFSET]);
+ val_print(VAL_PRINT_TEST, "\n DOORBELL MASK LOW :%d",
+ return_values[DOORBELL_MASK_LOW_OFFSET]);
+ val_print(VAL_PRINT_TEST, "\n DOORBELL MASK HIGH :%d",
+ return_values[DOORBELL_MASK_HIGH_OFFSET]);
+ val_print(VAL_PRINT_TEST, "\n DOORBELL PRESERVE LOW :%d",
+ return_values[DOORBELL_PRESERVE_LOW_OFFSET]);
+ val_print(VAL_PRINT_TEST, "\n DOORBELL PRESERVE HIGH :%d",
+ return_values[DOORBELL_PRESERVE_HIGH_OFFSET]);
+ }
+ }
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain support FAST CHANNEL ");
+ return VAL_STATUS_SKIP;
+ }
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d022.c b/test_pool/performance/test_d022.c
new file mode 100644
index 0000000000000000000000000000000000000000..e399d92d7d84205a26b20e36d3821761e8b294be
--- /dev/null
+++ b/test_pool/performance/test_d022.c
@@ -0,0 +1,75 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 22)
+#define TEST_DESC "Perf describe fast chl invalid domain check "
+
+#define PARAMETER_SIZE 2
+
+uint32_t performance_query_describe_fast_channel_invalid_domain(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, message_id;
+ uint32_t parameters[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Skip if describe fast channel is not supported*/
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query performance describe fast channel support");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_DESCRIBE_FASTCHANNEL;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n PERF_DESCRIBE_FASTCHANNEL not supported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Check performance describe fast channel for invalid domain */
+ domain_id = val_performance_get_info(NUM_PERF_DOMAINS, 0x00) + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query desc fastchannel for invalid domain id: %d",
+ domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = PERFORMANCE_LEVEL_SET;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DESCRIBE_FASTCHANNEL,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d023.c b/test_pool/performance/test_d023.c
new file mode 100644
index 0000000000000000000000000000000000000000..b4380cce4ef09e467a5c1d5f45339bfad01cc543
--- /dev/null
+++ b/test_pool/performance/test_d023.c
@@ -0,0 +1,94 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 23)
+#define TEST_DESC "Perf describe fast chl invalid message check "
+
+#define PARAMETER_SIZE 2
+
+uint32_t performance_query_describe_fast_channel_invalid_message(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, message_id;
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t run_flag = 0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Skip if describe fast channel is not supported*/
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query performance describe fast channel support");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_DESCRIBE_FASTCHANNEL;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n PERF_DESCRIBE_FASTCHANNEL not supported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Check performance describe fast channel for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ if (val_performance_get_info(PERF_DOMAIN_FAST_CH_SUPPORT, domain_id) == 0)
+ continue;
+ run_flag = 1;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query fastchannel support for invalid msg id");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = PERFORMANCE_INVALID_COMMAND;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DESCRIBE_FASTCHANNEL,
+ COMMAND_MSG);
+
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain support FAST CHANNEL ");
+ return VAL_STATUS_SKIP;
+ }
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d024.c b/test_pool/performance/test_d024.c
new file mode 100644
index 0000000000000000000000000000000000000000..5e8d4e74ae1408a4421166f1b855a35a06431391
--- /dev/null
+++ b/test_pool/performance/test_d024.c
@@ -0,0 +1,102 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 24)
+#define TEST_DESC "Perf desc fast chl unsupported domain check "
+
+#define PARAMETER_SIZE 2
+
+uint32_t performance_query_describe_fast_channel_unsupported_domain(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, message_id;
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t run_flag = 0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Skip if describe fast channel is not supported*/
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query performance describe fast channel support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_DESCRIBE_FASTCHANNEL;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n PERF_DESCRIBE_FASTCHANNEL not supported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Check performance describe fast channel for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ if (val_performance_get_info(PERF_DOMAIN_FAST_CH_SUPPORT, domain_id) == 1)
+ continue;
+
+ for (message_id = PERFORMANCE_LIMITS_SET; message_id <= PERFORMANCE_LEVEL_GET; message_id++)
+ {
+ if (val_performance_get_info(PERF_MESSAGE_FAST_CH_SUPPORT, message_id) == 0)
+ continue;
+ run_flag = 1;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID:%d and msg_id: %d",
+ domain_id, message_id);
+ val_print(VAL_PRINT_TEST,
+ "\n [Check 2] Invoke describe fast chn for unsupported domain");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = message_id;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DESCRIBE_FASTCHANNEL,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_SUPPORTED) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+ }
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n All domain support FAST CHANNEL ");
+ return VAL_STATUS_SKIP;
+ }
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d025.c b/test_pool/performance/test_d025.c
new file mode 100644
index 0000000000000000000000000000000000000000..8b98c245fb89db0516d33ada9126603a6c184706
--- /dev/null
+++ b/test_pool/performance/test_d025.c
@@ -0,0 +1,102 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 25)
+#define TEST_DESC "Perf desc fast chl unsupported message check "
+
+#define PARAMETER_SIZE 2
+
+uint32_t performance_query_describe_fast_channel_unsupported_message(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, message_id;
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t run_flag = 0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Skip if describe fast channel is not supported*/
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query performance describe fast channel support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_DESCRIBE_FASTCHANNEL;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n PERF_DESCRIBE_FASTCHANNEL not supported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Check performance describe fast channel for valid domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ if (val_performance_get_info(PERF_DOMAIN_FAST_CH_SUPPORT, domain_id) == 0)
+ continue;
+
+ for (message_id = PERFORMANCE_PROTOCOL_VERSION; message_id < PERFORMANCE_LIMITS_SET;
+ message_id++)
+ {
+ run_flag = 1;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID:%d and msg_id: %d",
+ domain_id, message_id);
+ val_print(VAL_PRINT_TEST,
+ "\n [Check 2] Invoke describe fastchannel for unsupported msg_id");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = message_id;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DESCRIBE_FASTCHANNEL,
+ COMMAND_MSG);
+
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_SUPPORTED) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+ }
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain support FAST CHANNEL ");
+ return VAL_STATUS_SKIP;
+ }
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d026.c b/test_pool/performance/test_d026.c
new file mode 100644
index 0000000000000000000000000000000000000000..b1ab7fe94af578892b09adaecc3ead213ec71152
--- /dev/null
+++ b/test_pool/performance/test_d026.c
@@ -0,0 +1,213 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 26)
+#define TEST_DESC "Perf limits changed notification check "
+
+/********* TEST ALGO ********************
+ * Get the domain which has limit change noti and set limit support
+ * Enable limit notification
+ * Get allowed performance levels for the domain
+ * Set new performance limit
+ * Check if notification of new limit is received
+ * Disable notification
+ * Restore the default limits
+*****************************************/
+
+uint32_t performance_limit_set_async(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, attribute;
+ uint32_t range_max, range_min, tmp_max;
+ uint32_t parameters[3], set_limit_support = 0, limit_notify_support = 0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Check for set limit and notify limit change support for each domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ set_limit_support = 0;
+ limit_notify_support = 0;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST,
+ "\n [Check 1] Find set limit & limit notify supported domain");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DOMAIN_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ attribute = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attribute, 0, 26)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ set_limit_support = VAL_EXTRACT_BITS(attribute, 31, 31);
+ val_print(VAL_PRINT_TEST, "\n SET LIMIT SUPPORT: %d", set_limit_support);
+ limit_notify_support = VAL_EXTRACT_BITS(attribute, 29, 29);
+ val_print(VAL_PRINT_TEST, "\n LIMIT CHG NOTIFY SUPPORT: %d", limit_notify_support);
+ if (set_limit_support && limit_notify_support)
+ break;
+ }
+
+ if ((set_limit_support && limit_notify_support) == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain has both set/notify limit support ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Enable limit change notification for the domain */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Enable limit change notify for domain_id: %d",
+ domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = NOTIFY_ENABLE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_NOTIFY_LIMITS, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Get the allowed performance limits for the domain */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Get current limits of domain_id: %d", domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LIMITS_GET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ range_max = return_values[RANGE_MAX_OFFSET];
+ range_min = return_values[RANGE_MIN_OFFSET];
+ if (range_max != val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id))
+ tmp_max = val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id);
+ else
+ tmp_max = val_performance_get_info(PERF_DOMAIN_INTERMEDIATE_LEVEL, domain_id);
+
+ /* Change the performance limit */
+ val_print(VAL_PRINT_TEST, "\n [Check 4] Change the range_max limit from: " \
+ "%08x => %08x", range_max, tmp_max);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = tmp_max;
+ parameters[param_count++] = range_min;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LIMITS_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Wait for notification */
+ val_print(VAL_PRINT_TEST, "\n [Check 5] Wait for limit change notify");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ val_receive_notification(&rsp_msg_hdr, &return_value_count, return_values);
+
+ val_print(VAL_PRINT_TEST, "\n NOTIFY MSG HDR : %08x", rsp_msg_hdr);
+ if (val_compare("PROTOCOL ID", VAL_EXTRACT_BITS(rsp_msg_hdr, 10, 17), PROTOCOL_PERFORMANCE))
+ return VAL_STATUS_FAIL;
+ if (val_compare("MSG TYPE ", VAL_EXTRACT_BITS(rsp_msg_hdr, 8, 9), NOTIFICATION_MSG))
+ return VAL_STATUS_FAIL;
+ if (val_compare("MSG ID ", VAL_EXTRACT_BITS(rsp_msg_hdr, 0, 7), PERFORMANCE_LIMITS_CHANGED))
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+ if (val_compare("DOMAIN ID ", return_values[NOTIFICATION_DOMAIN_ID_OFFSET], domain_id))
+ return VAL_STATUS_FAIL;
+ if (val_compare("RANGE MAX ", return_values[NOTIFICATION_RANGE_MAX_OFFSET], tmp_max))
+ return VAL_STATUS_FAIL;
+ if (val_compare("RANGE MIN ", return_values[NOTIFICATION_RANGE_MIN_OFFSET], range_min))
+ return VAL_STATUS_FAIL;
+
+ /* Disable limit change notification for the domain */
+ val_print(VAL_PRINT_TEST, "\n [Check 6] Disable limit change notify for domain_id: %d",
+ domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = NOTIFY_DISABLE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_NOTIFY_LIMITS, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 7] Restore perf limits for domain_id: %d",
+ domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = range_max;
+ parameters[param_count++] = range_min;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LIMITS_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
+
diff --git a/test_pool/performance/test_d027.c b/test_pool/performance/test_d027.c
new file mode 100644
index 0000000000000000000000000000000000000000..bdbbfd63483a14d4f9dbc7993a098cdf1eef65af
--- /dev/null
+++ b/test_pool/performance/test_d027.c
@@ -0,0 +1,212 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 27)
+#define TEST_DESC "Performance level changed notification check "
+
+/********* TEST ALGO ********************
+ * Get the domain which has level change noti and set level support
+ * Enable level notification
+ * Get allowed performance levels for the domain
+ * Set new performance level
+ * Check if notification of new level is received
+ * Disable notification
+ * Restore the default level
+*****************************************/
+
+uint32_t performance_level_set_async(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, attribute, cur_level, default_level;
+ uint32_t parameters[2], set_level_support = 0, level_notify_support = 0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Check for set level and notify level change support for each domain */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ set_level_support = 0;
+ level_notify_support = 0;
+
+ val_print(VAL_PRINT_TEST, "\n PERFORMANCE DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST,
+ "\n [Check 1] Find set level & level notify supported domain");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DOMAIN_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ attribute = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attribute, 0, 26)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ set_level_support = VAL_EXTRACT_BITS(attribute, 30, 30);
+ val_print(VAL_PRINT_DEBUG, "\n SET LEVEL SUPPORT: %d", set_level_support);
+ level_notify_support = VAL_EXTRACT_BITS(attribute, 28, 28);
+ val_print(VAL_PRINT_DEBUG, "\n LEVEL CHG NOTIFY SUPPORT: %d", level_notify_support);
+ if (set_level_support && level_notify_support)
+ break;
+ }
+
+ if ((set_level_support && level_notify_support) == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain has both set/notify level support ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Enable level change notification for the domain */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Enable level change notify for domain_id: %d",
+ domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = NOTIFY_ENABLE; /* Enable notification */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_NOTIFY_LEVEL, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Get the allowed performance levels for the domain */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Get current level of domain_id: %d",
+ domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LEVEL_GET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ default_level = return_values[PERFORMANCE_LEVEL_OFFSET];
+
+ /* Find the new performance level */
+ if (default_level != val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id))
+ cur_level = val_performance_get_info(PERF_DOMAIN_MAX_LEVEL, domain_id);
+ else
+ cur_level = val_performance_get_info(PERF_DOMAIN_MIN_LEVEL, domain_id);
+
+ /* Change the performance level */
+ val_print(VAL_PRINT_TEST, "\n [Check 4] Change the performance level to: %08x", cur_level);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = cur_level;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LEVEL_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Wait for notification */
+ val_print(VAL_PRINT_TEST, "\n [Check 5] Wait for level change notify");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ val_receive_notification(&rsp_msg_hdr, &return_value_count, return_values);
+
+ val_print(VAL_PRINT_TEST, "\n NOTIFY MSG HDR : %08x", rsp_msg_hdr);
+ if (val_compare("PROTOCOL ID", VAL_EXTRACT_BITS(rsp_msg_hdr, 10, 17), PROTOCOL_PERFORMANCE))
+ return VAL_STATUS_FAIL;
+ if (val_compare("MSG TYPE ", VAL_EXTRACT_BITS(rsp_msg_hdr, 8, 9), NOTIFICATION_MSG))
+ return VAL_STATUS_FAIL;
+ if (val_compare("MSG ID ", VAL_EXTRACT_BITS(rsp_msg_hdr, 0, 7), PERFORMANCE_LEVEL_CHANGED))
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+ if (val_compare("DOMAIN ID ", return_values[NOTIFICATION_DOMAIN_ID_OFFSET], domain_id))
+ return VAL_STATUS_FAIL;
+ if (val_compare("PERF LEVEL ", return_values[NOTIFICATION_LEVEL_OFFSET], cur_level))
+ return VAL_STATUS_FAIL;
+
+ /* Disable level change notification for the domain */
+
+ val_print(VAL_PRINT_TEST, "\n [Check 6] Disable level change notify for domain_id: %d",
+ domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = NOTIFY_DISABLE; /* Disable notification */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_NOTIFY_LEVEL, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Restore performance level for the domain */
+ val_print(VAL_PRINT_TEST, "\n [Check 7] Restore perf level for domain_id: %d",
+ domain_id);
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = default_level;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LEVEL_SET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
+
diff --git a/test_pool/performance/test_d028.c b/test_pool/performance/test_d028.c
new file mode 100644
index 0000000000000000000000000000000000000000..111b2702b29ba4b88c6206dfa62ce08e3dc73a79
--- /dev/null
+++ b/test_pool/performance/test_d028.c
@@ -0,0 +1,145 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 28)
+#define TEST_DESC "Performance level get via fast channel "
+
+#define PARAMETER_SIZE 2
+
+uint32_t performance_level_get_fast_channel(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, message_id, attributes;
+ uint32_t parameters[PARAMETER_SIZE], perf_level;
+ uint32_t chl_addr_low, chl_addr_high ;
+ uint32_t run_flag = 0;
+ uint64_t chl_addr = 0x0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Skip if describe fast channel is not supported*/
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query performance describe fast channel support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_DESCRIBE_FASTCHANNEL;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n PERF_DESCRIBE_FASTCHANNEL not supported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Skip if no performance domains found */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ /* Continue till we find domain which supports fastchannel */
+ if (val_performance_get_info(PERF_DOMAIN_FAST_CH_SUPPORT, domain_id) == 0)
+ continue;
+
+ val_print(VAL_PRINT_TEST, "\n FAST CHANNEL supported for DOMAIN: %d",domain_id);
+
+ message_id = PERFORMANCE_LEVEL_GET;
+ /* if perf level get doesn't support fastchannel, skip */
+ if (val_performance_get_info(PERF_MESSAGE_FAST_CH_SUPPORT, message_id))
+ {
+ run_flag = 1;
+ val_print(VAL_PRINT_TEST, "\n FAST CHANNEL supported for perf level get");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Get fast chl details for perf level get");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = message_id;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DESCRIBE_FASTCHANNEL,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 3, 31)) !=
+ VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Doorbell should not be supported for perf level get 4.5.2 */
+ if (val_compare("DOORBELL SUPPORT", VAL_EXTRACT_BITS(attributes, 0, 0), NOT_SUPPORTED))
+ return VAL_STATUS_FAIL;
+
+ chl_addr_low = return_values[CHAN_ADDR_LOW_OFFSET];
+ chl_addr_high = return_values[CHAN_ADDR_HIGH_OFFSET];
+ chl_addr = (uint64_t) chl_addr_high << 32 | chl_addr_low;
+
+ if (chl_addr_high)
+ perf_level = *(volatile uint64_t *)chl_addr;
+ else
+ perf_level = *(volatile uint32_t*)chl_addr;
+
+ /* Get perf level from normal channel and and compare */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Get perf level via normal channel");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LEVEL_GET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_compare("LEVEL ", return_values[PERFORMANCE_LEVEL_OFFSET], perf_level))
+ return VAL_STATUS_FAIL;
+
+ }
+ }
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain/msg support FAST CHANNEL ");
+ return VAL_STATUS_SKIP;
+ }
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/performance/test_d029.c b/test_pool/performance/test_d029.c
new file mode 100644
index 0000000000000000000000000000000000000000..7633e2064751aac81a6f1773536d734cebfd0114
--- /dev/null
+++ b/test_pool/performance/test_d029.c
@@ -0,0 +1,147 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_performance.h"
+
+#define TEST_NUM (SCMI_PERFORMANCE_TEST_NUM_BASE + 29)
+#define TEST_DESC "Performance limits get via fast channel "
+
+#define PARAMETER_SIZE 2
+
+uint32_t performance_limits_get_fast_channel(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, message_id, attributes;
+ uint32_t parameters[PARAMETER_SIZE], perf_limit_max, perf_limit_min;
+ uint64_t chl_addr_low, chl_addr_high;
+ uint32_t run_flag = 0;
+ uint64_t chl_addr = 0x0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Skip if describe fast channel is not supported*/
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query performance describe fast channel support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = PERFORMANCE_DESCRIBE_FASTCHANNEL;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n PERF_DESCRIBE_FASTCHANNEL not supported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Skip if no performance domains found */
+ num_domains = val_performance_get_info(NUM_PERF_DOMAINS, 0x00);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No performance domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ /* Continue till we find domain which supports fastchannel */
+ if (val_performance_get_info(PERF_DOMAIN_FAST_CH_SUPPORT, domain_id) == 0)
+ continue;
+
+ message_id = PERFORMANCE_LIMITS_GET;
+ /* if perf limits get doesn't support fastchannel, skip */
+ if (val_performance_get_info(PERF_MESSAGE_FAST_CH_SUPPORT, message_id))
+ {
+ run_flag = 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Get fast chl details for perf limits get");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = message_id;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_DESCRIBE_FASTCHANNEL,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 3, 31)) !=
+ VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Doorbell should not be supported for perf limits get 4.5.2 */
+ if (val_compare("DOORBELL SUPPORT", VAL_EXTRACT_BITS(attributes, 0, 0), NOT_SUPPORTED))
+ return VAL_STATUS_FAIL;
+
+ chl_addr_low = return_values[CHAN_ADDR_LOW_OFFSET];
+ chl_addr_high = return_values[CHAN_ADDR_HIGH_OFFSET];
+ chl_addr = chl_addr_high << 32 | chl_addr_low;
+
+ if (chl_addr_high) {
+ perf_limit_max = *(volatile uint64_t *)chl_addr;
+ perf_limit_min = *((volatile uint64_t *)chl_addr + 1);
+ }
+ else {
+ perf_limit_max = *(volatile uint32_t*)chl_addr_low;
+ perf_limit_min = *((volatile uint32_t*)chl_addr_low + 1);
+ }
+
+ /* Get perf limits from normal channel and and compare */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Get perf limits via normal channel");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_PERFORMANCE, PERFORMANCE_LIMITS_GET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_compare("LIMIT_MAX ", return_values[RANGE_MAX_OFFSET], perf_limit_max))
+ return VAL_STATUS_FAIL;
+ if (val_compare("LIMIT_MIN ", return_values[RANGE_MIN_OFFSET], perf_limit_min))
+ return VAL_STATUS_FAIL;
+ }
+ }
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain/msg support FAST CHANNEL ");
+ return VAL_STATUS_SKIP;
+ }
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/power_domain/power_domain_testlist.c b/test_pool/power_domain/power_domain_testlist.c
deleted file mode 100644
index 0ac4bff3731e8da1ec207e544a4c263cca72c212..0000000000000000000000000000000000000000
--- a/test_pool/power_domain/power_domain_testlist.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
- * SPDX-License-Identifier : Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-**/
-#include "val_interface.h"
-#include "power_domain_testlist.h"
-
-test_fn_ptr power_domain_test[] = {
- power_domain_query_protocol_version,
- power_domain_query_protocol_attributes,
- power_domain_query_mandatory_command_support,
- power_domain_query_domain_attributes,
- power_domain_set_power_state_check,
- power_domain_get_power_state_check,
- power_domain_power_state_notify_check,
- power_domain_invalid_messageid_call,
-#ifndef SCMI_VERSION_1
- power_domain_power_state_change_requested_notify_check,
-#endif
-};
-
-test_fn_ptr *val_power_domain_get_testlist(uint32_t *num_tests)
-{
- *num_tests = NUM_ELEMS(power_domain_test);
- return power_domain_test;
-}
diff --git a/test_pool/power_domain/power_domain_testlist.h b/test_pool/power_domain/power_domain_testlist.h
deleted file mode 100644
index 7b72e4419603062f03ffec515ba9a9a3aa404d65..0000000000000000000000000000000000000000
--- a/test_pool/power_domain/power_domain_testlist.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
- * SPDX-License-Identifier : Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-**/
-
-#ifndef __POWER_DOMAIN_TESTLIST_H__
-#define __POWER_DOMAIN_TESTLIST_H__
-
-uint32_t power_domain_query_protocol_version(void);
-uint32_t power_domain_query_protocol_attributes(void);
-uint32_t power_domain_query_mandatory_command_support(void);
-uint32_t power_domain_query_domain_attributes(void);
-uint32_t power_domain_set_power_state_check(void);
-uint32_t power_domain_get_power_state_check(void);
-uint32_t power_domain_power_state_notify_check(void);
-uint32_t power_domain_invalid_messageid_call(void);
-#ifndef SCMI_VERSION_1
-uint32_t power_domain_power_state_change_requested_notify_check(void);
-#endif
-
-#endif
diff --git a/test_pool/power_domain/test_p001.c b/test_pool/power_domain/test_p001.c
index bf6d9a901ccebb50865b6dcc2deae182b2b3fe05..e634459b4ac6cbd122cbc383bae3b4aa9314b0ef 100644
--- a/test_pool/power_domain/test_p001.c
+++ b/test_pool/power_domain/test_p001.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,41 +15,47 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_power_domain.h"
#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 1)
-#define TEST_DESC "Power domain protocol version check "
+#define TEST_DESC "Power domain protocol version check "
+#define RETURN_VALUE_COUNT 1
-uint32_t power_domain_query_protocol_version(void)
+uint32_t power_domain_query_protocol_version(uint32_t *version)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters;
- uint32_t return_value_count, version, expected_version;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Check power domain protocol version */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query protocol version");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query protocol version");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters = NULL;
- version = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, PD_PROTOCOL_VERSION, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &version);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_compare_msg_hdr(rsp_msg_hdr, cmd_msg_hdr) != VAL_STATUS_PASS)
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- expected_version = val_power_domain_get_expected_protocol_version();
- if (val_protocol_version_check(expected_version, version) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (return_value_count != RETURN_VALUE_COUNT)
return VAL_STATUS_FAIL;
+ *version = return_values[VERSION_OFFSET];
+ val_print(VAL_PRINT_ERR, "\n VERSION : 0x%08x ", *version);
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/power_domain/test_p002.c b/test_pool/power_domain/test_p002.c
index 2d8103bf9bc333aa7852d653c4a23d6e38638acc..6fb05b9b489c12413136372fbe686f7bf9cae7ab 100644
--- a/test_pool/power_domain/test_p002.c
+++ b/test_pool/power_domain/test_p002.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,30 +15,32 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_power_domain.h"
#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 2)
-#define TEST_DESC "Power domain protocol attributes check "
-#define MAX_RETURN_VALUE_SIZE 4
+#define TEST_DESC "Power domain protocol attributes check "
uint32_t power_domain_query_protocol_attributes(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters;
- uint32_t return_value_count, return_values[MAX_RETURN_VALUE_SIZE];
- uint32_t attributes, stats_addr_low, stats_addr_high, stats_len;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
+ uint32_t attributes, num_domains, stats_addr_low, stats_addr_high, stats_len;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
/* Query protocol attributes for number of power domains */
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query protocol attributes");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query protocol attributes");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters = NULL; /* No parameters for this command */
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, PD_PROTOCOL_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
&return_value_count, return_values);
@@ -49,26 +51,35 @@ uint32_t power_domain_query_protocol_attributes(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- attributes = return_values[0];
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 16, 31)) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
/* Save number of power domains */
- val_power_domain_save_info(NUM_POWER_DOMAIN, 0x00, VAL_EXTRACT_BITS(attributes, 0, 15));
- val_print(VAL_PRINT_INFO, "\n\tNUM POWER DOMAINS: %d", VAL_EXTRACT_BITS(attributes, 0, 15));
+ num_domains = VAL_EXTRACT_BITS(attributes, 0, 15);
+ if (val_compare("NUM POWER DOMAINS", num_domains, val_power_get_expected_num_domains()))
+ return VAL_STATUS_FAIL;
+ val_power_domain_save_info(NUM_POWER_DOMAIN, 0x00, num_domains);
+
/* Save the power domain shared memory low address */
- stats_addr_low = return_values[1];
+ stats_addr_low = return_values[STATS_ADDR_LOW_OFFSET];
+ if (val_compare("STATS ADDR LOW ", stats_addr_low, val_power_get_expected_stats_addr_low()))
+ return VAL_STATUS_FAIL;
val_power_domain_save_info(PD_STATS_ADDR_LOW, 0x00, stats_addr_low);
- val_print(VAL_PRINT_INFO, "\n\tSTATISTICS ADDR LOW: %x", VAL_EXTRACT_BITS(attributes, 0, 15));
+
/* Save the power domain shared memory high address */
- stats_addr_high = return_values[2];
+ stats_addr_high = return_values[STATS_ADDR_HIGH_OFFSET];
+ if (val_compare("STATS ADDR HIGH ", stats_addr_high, val_power_get_expected_stats_addr_high()))
+ return VAL_STATUS_FAIL;
val_power_domain_save_info(PD_STATS_ADDR_HIGH, 0x00, stats_addr_high);
- val_print(VAL_PRINT_INFO, "\n\tSTATISTICS ADDR HIGH: %x", VAL_EXTRACT_BITS(attributes, 0, 15));
+
/* Save the power domain shared memory length */
- stats_len = return_values[3];
+ stats_len = return_values[STATS_LENGTH_OFFSET];
+ if (val_compare("STATS ADDR LEN", stats_len, val_power_get_expected_stats_addr_len()))
+ return VAL_STATUS_FAIL;
val_power_domain_save_info(PD_STATS_ADDR_LEN, 0x00, stats_len);
- val_print(VAL_PRINT_INFO, "\n\tSTATISTICS ADDR LEN: %d ",
- VAL_EXTRACT_BITS(attributes, 0, 15));
return VAL_STATUS_PASS;
}
diff --git a/test_pool/power_domain/test_p003.c b/test_pool/power_domain/test_p003.c
index e7defa9b59204479e5866c2c19f368ff5b67ca00..e66323a1a42d2f497599b8bd64ade17fc5f843e5 100644
--- a/test_pool/power_domain/test_p003.c
+++ b/test_pool/power_domain/test_p003.c
@@ -15,32 +15,35 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_power_domain.h"
#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 3)
-#define TEST_DESC "Power domain mandatory command support check "
+#define TEST_DESC "Power msg attributes mandatory cmd check "
uint32_t power_domain_query_mandatory_command_support(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id;
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
/* Mandatory cmd POWER STATE SET should be supported */
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] POWER_STATE_SET support");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] POWER_STATE_SET support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = POWER_STATE_SET;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, PD_PROTOCOL_MESSAGE_ATTRIBUTES,
- COMMAND_MSG);
+ COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -48,21 +51,21 @@ uint32_t power_domain_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
/* Mandatory cmd POWER STATE GET should be supported */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] POWER_STATE_GET support");
+ val_print(VAL_PRINT_TEST, "\n [Check 2] POWER_STATE_GET support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = POWER_STATE_GET;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, PD_PROTOCOL_MESSAGE_ATTRIBUTES,
- COMMAND_MSG);
+ COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -70,21 +73,21 @@ uint32_t power_domain_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
/* Mandatory cmd POWER DOMAIN MESSAGE ATTRIBUTES should be supported */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 3] POWER_DOMAIN_MESSAGE_ATTRIBUTES support");
+ val_print(VAL_PRINT_TEST, "\n [Check 3] POWER_DOMAIN_MESSAGE_ATTRIBUTES support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = POWER_DOMAIN_ATTRIBUTES;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, PD_PROTOCOL_MESSAGE_ATTRIBUTES,
- COMMAND_MSG);
+ COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -92,7 +95,9 @@ uint32_t power_domain_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
return VAL_STATUS_PASS;
diff --git a/test_pool/power_domain/test_p004.c b/test_pool/power_domain/test_p004.c
index 80494a14fc53418c8a230da9b5b9f982da56298e..fd336895a9634cc95faef243b563315817f1284c 100644
--- a/test_pool/power_domain/test_p004.c
+++ b/test_pool/power_domain/test_p004.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, 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,65 +18,49 @@
#include"val_interface.h"
#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 4)
-#define TEST_DESC "Power domain attributes check "
-#define MAX_RETURN_VALUE_SIZE 5
+#define TEST_DESC "Power msg attributes invalid msg id check "
-uint32_t power_domain_query_domain_attributes(void)
+uint32_t power_domain_invalid_messageid_call(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, domain_id, num_domains;
- uint32_t return_value_count, return_values[MAX_RETURN_VALUE_SIZE], attribute;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
+ uint32_t message_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Check power domain attributes for valid domain */
+ /* Sending invalid power domain protocol cmd should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Invalid command invocation");
- num_domains = val_power_domain_get_info(0, NUM_POWER_DOMAIN);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query with valid power domains");
-
- for (domain_id = 0; domain_id < num_domains; domain_id++)
- {
- val_print(VAL_PRINT_DEBUG, "\n\tPOWER_DOMAIN ID %d", domain_id);
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- param_count++;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_DOMAIN_ATTRIBUTES,
- COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters = NULL;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_PROTOCOL_INVALID_COMMAND,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
&return_value_count, return_values);
- if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- attribute = return_values[0];
- if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attribute, 0, 28)) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_DEBUG, "\n\tPOWER STATE CHANGE NOTIFICATIONS SUPPORT: %d",
- VAL_EXTRACT_BITS(attribute, 31, 31));
- val_print(VAL_PRINT_DEBUG, "\n\tPOWER ASYNCHRONOUS SUPPORT: %d",
- VAL_EXTRACT_BITS(attribute, 30, 30));
- val_print(VAL_PRINT_DEBUG, "\n\tPOWER SYNCHRONOUS SUPPORT: %d",
- VAL_EXTRACT_BITS(attribute, 29, 29));
- val_print(VAL_PRINT_DEBUG, "\n\tDOMAIN NAME: %s", (uint8_t *)&return_values[1]);
- }
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- /* Power domain attributes for invalid power domain should fail */
+ val_print_return_values(return_value_count, return_values);
- domain_id = val_power_domain_get_info(0, NUM_POWER_DOMAIN) + 1;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Query with invalid domain id %d", domain_id);
+ /* Query support for invalid power domain protocol command should return status NOT_FOUND */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query undefined command support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = POWER_PROTOCOL_INVALID_COMMAND;
param_count++;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_DOMAIN_ATTRIBUTES, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, PD_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
&return_value_count, return_values);
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
@@ -85,5 +69,7 @@ uint32_t power_domain_query_domain_attributes(void)
if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ val_print_return_values(return_value_count, return_values);
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/power_domain/test_p005.c b/test_pool/power_domain/test_p005.c
index d35bbaa5bf6f9c9c51355d9bffbf060b9731173c..0a26fd1870574e28cca133502891ae1b754011fe 100644
--- a/test_pool/power_domain/test_p005.c
+++ b/test_pool/power_domain/test_p005.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,78 +15,67 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_power_domain.h"
#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 5)
-#define TEST_DESC "Power state set check "
-#define PARAMETER_SIZE 3
+#define TEST_DESC "Power domain attributes check "
-uint32_t power_domain_set_power_state_check(void)
+uint32_t power_domain_query_domain_attributes(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, parameters[PARAMETER_SIZE];
- uint32_t return_value_count, return_value;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, attribute;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Power state set cmd with invalid flags value should return status INVALID PARAMETERS */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Set power set with invalid flag value");
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters[param_count++] = 0xF;
- parameters[param_count++] = val_power_domain_get_info(0, NUM_POWER_DOMAIN) - 1;
- parameters[param_count++] = 0; /* ON state */
- return_value = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_SET, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
-
- if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- /* Setting invalid power state should fail */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Set invalid power state");
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters[param_count++] = 0;
- parameters[param_count++] = val_power_domain_get_info(0, NUM_POWER_DOMAIN);
- parameters[param_count++] = 1 < 31; /* Invalid state */
- return_value = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_SET, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
-
- if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- /* Setting power state for invalid power domain should return status INVALID PARAMETERS */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 3] Set power state for invalid domain");
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters[param_count++] = 0;
- parameters[param_count++] = val_power_domain_get_info(0, NUM_POWER_DOMAIN) + 1; /* invalid pd */
- parameters[param_count++] = 0; /* ON state */
- return_value = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_SET, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
-
- if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ num_domains = val_power_domain_get_info(0, NUM_POWER_DOMAIN);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No power domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ /* Check power domain attributes for valid domain */
+ val_print(VAL_PRINT_TEST, "\n POWER DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query power domain attribute");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_DOMAIN_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ attribute = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attribute, 0, 28)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_DEBUG, "\n POWER STATE CHANGE NOTIFICATIONS SUPPORT: %d",
+ VAL_EXTRACT_BITS(attribute, 31, 31));
+ val_print(VAL_PRINT_DEBUG, "\n POWER ASYNCHRONOUS SUPPORT: %d",
+ VAL_EXTRACT_BITS(attribute, 30, 30));
+ val_print(VAL_PRINT_DEBUG, "\n POWER SYNCHRONOUS SUPPORT: %d",
+ VAL_EXTRACT_BITS(attribute, 29, 29));
+ val_print(VAL_PRINT_DEBUG, "\n DOMAIN NAME: %s",
+ (uint8_t *)&return_values[DOMAIN_NAME_OFFSET]);
+ }
return VAL_STATUS_PASS;
+
}
diff --git a/test_pool/power_domain/test_p006.c b/test_pool/power_domain/test_p006.c
index 44e1145d6ebba9aab7938e0aa62648900687f728..5c939d21b38a8e4b337f76da24113a77aefb1bcf 100644
--- a/test_pool/power_domain/test_p006.c
+++ b/test_pool/power_domain/test_p006.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,59 +15,36 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_power_domain.h"
#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 6)
-#define TEST_DESC "Power state get check "
+#define TEST_DESC "Power domain attributes invalid domain check "
-uint32_t power_domain_get_power_state_check(void)
+uint32_t power_domain_query_domain_attributes_invalid_doamin(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, domain_id, num_domains;
- uint32_t return_value_count, return_value;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Get power state for valid power domain */
-
- num_domains = val_power_domain_get_info(0, NUM_POWER_DOMAIN);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Get power state for valid domain");
-
- for (domain_id = 0; domain_id < num_domains; domain_id++)
- {
- val_print(VAL_PRINT_DEBUG, "\n\tPOWER_DOMAIN ID %d", domain_id);
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- param_count++;
- return_value = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_GET, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
-
- if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- if (val_compare_msg_hdr(rsp_msg_hdr, cmd_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- val_print(VAL_PRINT_DEBUG, "\n\tPOWER STATE [%x]", return_value);
- }
-
- /* Get power state for invalid power domain should fail */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Get power state for invalid domain");
+ /* Power domain attributes for invalid power domain should fail */
+ domain_id = val_power_domain_get_info(0, NUM_POWER_DOMAIN) + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query with invalid domain id %d", domain_id);
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- domain_id = val_power_domain_get_info(0, NUM_POWER_DOMAIN) + 1;
param_count++;
- return_value = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_GET, COMMAND_MSG);
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_DOMAIN_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
+ &return_value_count, return_values);
- if (val_compare_msg_hdr(rsp_msg_hdr, cmd_msg_hdr) != VAL_STATUS_PASS)
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
diff --git a/test_pool/power_domain/test_p007.c b/test_pool/power_domain/test_p007.c
index 086602ec9d4752058e383b926764cd818b0db8a4..0349c12ec21de88b9d1a8cab43f17b0d8c38c8a5 100644
--- a/test_pool/power_domain/test_p007.c
+++ b/test_pool/power_domain/test_p007.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,69 +16,108 @@
**/
#include"val_interface.h"
+#include"val_power_domain.h"
#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 7)
-#define TEST_DESC "Power state notify check "
-#define PARAMETER_SIZE 2
+#define TEST_DESC "Power state set invalid param check "
-uint32_t power_domain_power_state_notify_check(void)
+#define PARAMETER_SIZE 3
+
+uint32_t power_domain_set_power_state_check(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id, parameter[PARAMETER_SIZE];
- uint32_t return_value_count, return_value;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t attribute, num_domains, domain_id, run_flag = 0;
+ uint32_t set_state_async, set_state_sync;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* If POWER STATE NOTIFY not supported, skip the test */
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- param_count++;
- message_id = POWER_STATE_NOTIFY;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, PD_PROTOCOL_MESSAGE_ATTRIBUTES,
- COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
-
- if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tPOWER_STATE_NOTIFY not supported ");
+ num_domains = val_power_domain_get_info(0, NUM_POWER_DOMAIN);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No power domains found ");
return VAL_STATUS_SKIP;
}
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n POWER DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query power domain attribute");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_DOMAIN_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ attribute = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attribute, 0, 28)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ set_state_async = VAL_EXTRACT_BITS(attribute, 30, 30);
+ set_state_sync = VAL_EXTRACT_BITS(attribute, 29, 29);
+ if (set_state_async == 0 && set_state_sync == 0)
+ continue;
+
+ run_flag = 1;
+
+ /* Power state set cmd with invalid flags value should return status INVALID PARAMETERS */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Set power set with invalid flag value");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ if (set_state_async)
+ parameters[param_count++] = INVALID_SYNC_FLAG;
+ else
+ parameters[param_count++] = INVALID_ASYNC_FLAG;
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = POWER_STATE_ON;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Setting invalid power state should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Set invalid power state");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = SYNC_POWER_STATE_CHANGE;
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = INVALID_POWER_STATE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
- /* Enabling power state notify for invalid power domain should fail */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Enable power state notify for invalid domain");
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameter[param_count++] = val_power_domain_get_info(0, NUM_POWER_DOMAIN) + 1;
- parameter[param_count++] = 1; /* Enable notification */
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_NOTIFY, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
-
- if (val_compare_msg_hdr(rsp_msg_hdr, cmd_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- /* Power state notify for invalid flag value should fail */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Enable notification with invalid flag value");
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameter[param_count++] = val_power_domain_get_info(0, NUM_POWER_DOMAIN);
- parameter[param_count++] = 0xF; /* Invalid flag */
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_NOTIFY, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
-
- if (val_compare_msg_hdr(rsp_msg_hdr, cmd_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
-
- if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain support POWER STATE SET ");
+ return VAL_STATUS_SKIP;
+ }
return VAL_STATUS_PASS;
}
diff --git a/test_pool/power_domain/test_p008.c b/test_pool/power_domain/test_p008.c
index 4f9fc3467c61a45962737fd48e01131395ac8e8e..4385b4f33a792c569c5e8567ac23354a31aa03f7 100644
--- a/test_pool/power_domain/test_p008.c
+++ b/test_pool/power_domain/test_p008.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,56 +16,89 @@
**/
#include"val_interface.h"
+#include"val_power_domain.h"
#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 8)
-#define TEST_DESC "Power protocol invalid message id check "
+#define TEST_DESC "Power state set unsupported domain check "
-uint32_t power_domain_invalid_messageid_call(void)
+#define PARAMETER_SIZE 3
+
+uint32_t power_domain_set_power_state_unsupported_domain_check(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters, message_id;
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t attribute, num_domains, domain_id, run_flag = 0;
+ uint32_t set_state_async, set_state_sync;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Sending invalid power domain protocol cmd should fail */
+ num_domains = val_power_domain_get_info(0, NUM_POWER_DOMAIN);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No power domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n POWER DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query power domain attribute");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_DOMAIN_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Invalid command invocation");
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters = NULL;
- attributes = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_PROTOCOL_INVALID_COMMAND,
- COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- if (val_compare_msg_hdr(rsp_msg_hdr, cmd_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ val_print_return_values(return_value_count, return_values);
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ attribute = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attribute, 0, 28)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- /* Query support for invalid power domain protocol command should return status NOT_FOUND */
+ set_state_async = VAL_EXTRACT_BITS(attribute, 30, 30);
+ set_state_sync = VAL_EXTRACT_BITS(attribute, 29, 29);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Query undefined command support");
+ if (set_state_async == 1 || set_state_sync == 1)
+ continue;
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- message_id = POWER_PROTOCOL_INVALID_COMMAND;
- param_count++;
- attributes = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, PD_PROTOCOL_MESSAGE_ATTRIBUTES,
- COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ run_flag = 1;
- if (val_compare_msg_hdr(rsp_msg_hdr, cmd_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ /* Power state set cmd with invalid flags value should return status NOT_SUPPORTED */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Set power set with unsupported");
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = SYNC_POWER_STATE_CHANGE;
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = POWER_STATE_ON;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_NOT_SUPPORTED) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n All domain support POWER STATE SET ");
+ return VAL_STATUS_SKIP;
+ }
return VAL_STATUS_PASS;
}
diff --git a/test_pool/power_domain/test_p009.c b/test_pool/power_domain/test_p009.c
index 16f331225ea143699edb03588698adad3636b819..04019645e24f7cba1d870d3e62e4fcd5aba36ed1 100644
--- a/test_pool/power_domain/test_p009.c
+++ b/test_pool/power_domain/test_p009.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,67 +16,41 @@
**/
#include"val_interface.h"
+#include"val_power_domain.h"
#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 9)
-#define TEST_DESC "Power state change requested notify check "
-#define PARAMETER_SIZE 2
+#define TEST_DESC "Power state set invalid domain check "
-uint32_t power_domain_power_state_change_requested_notify_check(void)
+#define PARAMETER_SIZE 3
+
+uint32_t power_domain_set_power_state_check_invalid_domain(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id, parameter[PARAMETER_SIZE];
- uint32_t return_value_count, return_value;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[PARAMETER_SIZE];
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* If POWER STATE CHANGE REQUESTED NOTIFY not supported, skip the test */
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- message_id = POWER_STATE_CHANGE_REQUESTED_NOTIFY;
- param_count++;
- return_value = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, PD_PROTOCOL_MESSAGE_ATTRIBUTES,
- COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
-
- if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tPOWER_STATE_CHANGE_REQUESTED_NOTIFY not supported ");
- return VAL_STATUS_SKIP;
- }
-
- /* Enabling power state change notify for invalid power domain should fail */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Enable notification for invalid power domain");
+ /* Setting power state for invalid power domain should return status NOT FOUNT */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Set power state for invalid domain");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameter[param_count++] = val_power_domain_get_info(0, NUM_POWER_DOMAIN) + 1;
- parameter[param_count++] = 1; /* Enable notification */
- return_value = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_CHANGE_REQUESTED_NOTIFY,
- COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
-
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ parameters[param_count++] = SYNC_POWER_STATE_CHANGE;
+ parameters[param_count++] = val_power_domain_get_info(0, NUM_POWER_DOMAIN) + 1;
+ parameters[param_count++] = POWER_STATE_ON;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Power state change notify for invalid flag value should fail */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Enable notification with invalid flag value");
-
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameter[param_count++] = val_power_domain_get_info(0, NUM_POWER_DOMAIN);
- parameter[param_count++] = 0xF; /* Invalid flag */
- return_value = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_CHANGE_REQUESTED_NOTIFY,
- COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
- &return_value_count, &return_value);
-
- if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
return VAL_STATUS_PASS;
diff --git a/test_pool/power_domain/test_p010.c b/test_pool/power_domain/test_p010.c
new file mode 100644
index 0000000000000000000000000000000000000000..2e3a023c5b8bce1fc1ca12dba678f4959da8a63b
--- /dev/null
+++ b/test_pool/power_domain/test_p010.c
@@ -0,0 +1,68 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include"val_interface.h"
+#include"val_power_domain.h"
+
+#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 10)
+#define TEST_DESC "Power state get check "
+
+uint32_t power_domain_get_power_state_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, power_state;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ num_domains = val_power_domain_get_info(0, NUM_POWER_DOMAIN);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No power domains found ");
+ return VAL_STATUS_SKIP;
+ }
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ /* Get power state for valid power domain */
+ val_print(VAL_PRINT_TEST, "\n POWER DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Get power state");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ power_state = return_values[POWER_STATE_OFFSET];
+ val_print(VAL_PRINT_DEBUG, "\n POWER STATE [0x%08X]", power_state);
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/power_domain/test_p011.c b/test_pool/power_domain/test_p011.c
new file mode 100644
index 0000000000000000000000000000000000000000..98b4c5a5c2bc722df5275318c49f0e58a464ad92
--- /dev/null
+++ b/test_pool/power_domain/test_p011.c
@@ -0,0 +1,54 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include"val_interface.h"
+#include"val_power_domain.h"
+
+#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 11)
+#define TEST_DESC "Power state get invalid domain check "
+
+uint32_t power_domain_get_power_state_check_invalid_domain(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Get power state for invalid power domain should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Get power state for invalid domain");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ domain_id = val_power_domain_get_info(0, NUM_POWER_DOMAIN) + 1;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/power_domain/test_p012.c b/test_pool/power_domain/test_p012.c
new file mode 100644
index 0000000000000000000000000000000000000000..a767ea6429ff58a3304bbe0990c73462972072f6
--- /dev/null
+++ b/test_pool/power_domain/test_p012.c
@@ -0,0 +1,115 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include"val_interface.h"
+#include"val_power_domain.h"
+
+#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 12)
+#define TEST_DESC "Power state ntfy invalid notify_enable check "
+
+#define PARAMETER_SIZE 2
+
+uint32_t power_domain_power_state_notify_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id, parameter[PARAMETER_SIZE];
+ uint32_t num_domains, domain_id, attribute, run_flag = 0;
+ uint32_t state_change_notify;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* If POWER STATE NOTIFY not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query power state notify cmd support");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ message_id = POWER_STATE_NOTIFY;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, PD_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n POWER_STATE_NOTIFY unsupported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ num_domains = val_power_domain_get_info(0, NUM_POWER_DOMAIN);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No power domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n POWER DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query power domain attribute");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_DOMAIN_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ attribute = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attribute, 0, 28)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ state_change_notify = VAL_EXTRACT_BITS(attribute, 31, 31);
+ if (state_change_notify == 0)
+ continue;
+
+ run_flag = 1;
+
+ /* Power state notify for invalid notify_enable value should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Set notification with invalid notify_enable");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameter[param_count++] = domain_id;
+ parameter[param_count++] = INVALID_NOTIFY_ENABLE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_NOTIFY, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No domain support POWER STATE NOTIFICATION ");
+ return VAL_STATUS_SKIP;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/power_domain/test_p013.c b/test_pool/power_domain/test_p013.c
new file mode 100644
index 0000000000000000000000000000000000000000..54a6281d9f61e9c64cdc9e3f95de2ac377ef7548
--- /dev/null
+++ b/test_pool/power_domain/test_p013.c
@@ -0,0 +1,115 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include"val_interface.h"
+#include"val_power_domain.h"
+
+#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 13)
+#define TEST_DESC "Power state notify unsupported domain check "
+
+#define PARAMETER_SIZE 2
+
+uint32_t power_domain_power_state_notify_unspported_domain_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id, parameter[PARAMETER_SIZE];
+ uint32_t num_domains, domain_id, attribute, run_flag = 0;
+ uint32_t state_change_notify;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* If POWER STATE NOTIFY not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query power state notify cmd support");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ message_id = POWER_STATE_NOTIFY;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, PD_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n POWER_STATE_NOTIFY unsupported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ num_domains = val_power_domain_get_info(0, NUM_POWER_DOMAIN);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No power domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n POWER DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query power domain attribute");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_DOMAIN_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ attribute = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attribute, 0, 28)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ state_change_notify = VAL_EXTRACT_BITS(attribute, 31, 31);
+ if (state_change_notify == 1)
+ continue;
+
+ run_flag = 1;
+
+ /* Power state notify for unsupported domain should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Enable notification ");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameter[param_count++] = domain_id;
+ parameter[param_count++] = NOTIFY_ENABLE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_NOTIFY, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_NOT_SUPPORTED) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n All domain support POWER STATE NOTIFICATION ");
+ return VAL_STATUS_SKIP;
+ }
+
+ return VAL_STATUS_PASS;
+
+}
diff --git a/test_pool/power_domain/test_p014.c b/test_pool/power_domain/test_p014.c
new file mode 100644
index 0000000000000000000000000000000000000000..ac2def43cafc5376cf3999ebe9c2e18aad3fc508
--- /dev/null
+++ b/test_pool/power_domain/test_p014.c
@@ -0,0 +1,72 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include"val_interface.h"
+#include"val_power_domain.h"
+
+#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 14)
+#define TEST_DESC "Power state notify invalid domain check "
+
+#define PARAMETER_SIZE 2
+
+uint32_t power_domain_power_state_notify_invalid_domain_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id, parameter[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* If POWER STATE NOTIFY not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query power state notify cmd support");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ message_id = POWER_STATE_NOTIFY;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, PD_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n POWER_STATE_NOTIFY unsupported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Enabling power state notify for invalid power domain should fail */
+
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Enable power state notify for invalid domain");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameter[param_count++] = val_power_domain_get_info(0, NUM_POWER_DOMAIN) + 1;
+ parameter[param_count++] = NOTIFY_ENABLE; /* Enable notification */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_NOTIFY, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/power_domain/test_p015.c b/test_pool/power_domain/test_p015.c
new file mode 100644
index 0000000000000000000000000000000000000000..c6fd8033424c408a0e6c918d0ccd04127e933aac
--- /dev/null
+++ b/test_pool/power_domain/test_p015.c
@@ -0,0 +1,84 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include"val_interface.h"
+#include"val_power_domain.h"
+
+#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 15)
+#define TEST_DESC "State chg rqst invalid notify_enable check "
+
+#define PARAMETER_SIZE 2
+
+uint32_t power_domain_power_state_change_requested_notify_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id, parameter[PARAMETER_SIZE];
+ uint32_t domain_id, num_domains;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* If POWER STATE CHANGE REQUESTED NOTIFY not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query power state change requested nfy support");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = POWER_STATE_CHANGE_REQUESTED_NOTIFY;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, PD_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n POWER_STATE_CHANGE_REQUESTED_NOTIFY unsupported");
+ return VAL_STATUS_SKIP;
+ }
+
+ num_domains = val_power_domain_get_info(0, NUM_POWER_DOMAIN);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No power domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ /* Power state change notify for invalid notify_enable value should fail */
+ val_print(VAL_PRINT_TEST, "\n POWER DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Enable with invalid notify_enable");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameter[param_count++] = domain_id;
+ parameter[param_count++] = INVALID_NOTIFY_ENABLE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_CHANGE_REQUESTED_NOTIFY,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/power_domain/test_p016.c b/test_pool/power_domain/test_p016.c
new file mode 100644
index 0000000000000000000000000000000000000000..258c4f2138755bda41aef3f7b194c2a8a44df919
--- /dev/null
+++ b/test_pool/power_domain/test_p016.c
@@ -0,0 +1,72 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include"val_interface.h"
+#include"val_power_domain.h"
+
+#define TEST_NUM (SCMI_POWER_DOMAIN_TEST_NUM_BASE + 16)
+#define TEST_DESC "State chg rqst notify invalid domain check "
+
+#define PARAMETER_SIZE 2
+
+uint32_t power_domain_power_state_change_requested_notify_invalid_domain_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id, parameter[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* If POWER STATE CHANGE REQUESTED NOTIFY not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query power state change requested nfy support");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = POWER_STATE_CHANGE_REQUESTED_NOTIFY;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, PD_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n POWER_STATE_CHANGE_REQUESTED_NOTIFY unsupported");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Enabling power state change notify for invalid power domain should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Enable notification for invalid power domain");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameter[param_count++] = val_power_domain_get_info(0, NUM_POWER_DOMAIN) + 1;
+ parameter[param_count++] = NOTIFY_ENABLE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_POWER_DOMAIN, POWER_STATE_CHANGE_REQUESTED_NOTIFY,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameter, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/reset/Makefile b/test_pool/reset/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..2fc3e96ad6496c66393a8b60e6a4757e1cda6e4e
--- /dev/null
+++ b/test_pool/reset/Makefile
@@ -0,0 +1,18 @@
+#/** @file
+# * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+# * SPDX-License-Identifier : Apache-2.0
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# * http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+#**/
+
+include ${TOP}/test_pool/build_protocol.mk
diff --git a/test_pool/reset/test_r001.c b/test_pool/reset/test_r001.c
new file mode 100644
index 0000000000000000000000000000000000000000..d8a62302e4bb10430bda3385862431a4addcc0b7
--- /dev/null
+++ b/test_pool/reset/test_r001.c
@@ -0,0 +1,62 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_reset.h"
+
+#define TEST_NUM (SCMI_RESET_TEST_NUM_BASE + 1)
+#define TEST_DESC "Reset protocol version check "
+
+#define RETURN_VALUE_COUNT 1
+
+uint32_t reset_query_protocol_version(uint32_t *version)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query protocol version");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters = NULL; /* No parameters for this command */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_PROTOCOL_VERSION, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_compare_return_count(return_value_count, RETURN_VALUE_COUNT))
+ return VAL_STATUS_FAIL;
+
+ *version = return_values[VERSION_OFFSET];
+ val_print(VAL_PRINT_ERR, "\n VERSION : 0x%08x ", *version);
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/reset/test_r002.c b/test_pool/reset/test_r002.c
new file mode 100644
index 0000000000000000000000000000000000000000..7a1546dc2aaf29f275463a467a598ee33b755783
--- /dev/null
+++ b/test_pool/reset/test_r002.c
@@ -0,0 +1,72 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_reset.h"
+
+#define TEST_NUM (SCMI_RESET_TEST_NUM_BASE + 2)
+#define TEST_DESC "Reset protocol attributes check "
+
+#define RETURN_VALUE_COUNT 1
+
+uint32_t reset_query_protocol_attributes(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
+ uint32_t attributes, num_domains;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Query reset protocol and check num of domains */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query protocol attributes");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters = NULL; /* No parameters for this command */
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_PROTOCOL_ATTRIBUTES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 16, 31) != VAL_STATUS_PASS))
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_return_count(return_value_count, RETURN_VALUE_COUNT))
+ return VAL_STATUS_FAIL;
+
+ /* Save the number of domains */
+ num_domains = VAL_EXTRACT_BITS(attributes, 0, 15);
+ if (val_compare("NUM DOMAINS", num_domains, val_reset_get_expected_num_domains()))
+ return VAL_STATUS_FAIL;
+
+ val_reset_save_info(NUM_RESET_DOMAINS, 0x0, num_domains);
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/reset/test_r003.c b/test_pool/reset/test_r003.c
new file mode 100644
index 0000000000000000000000000000000000000000..bd385c1a0335ce8e7fc36578f0344019dcbda18a
--- /dev/null
+++ b/test_pool/reset/test_r003.c
@@ -0,0 +1,82 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_reset.h"
+
+#define TEST_NUM (SCMI_RESET_TEST_NUM_BASE + 3)
+#define TEST_DESC "Reset msg attributes mandatory cmd check "
+
+uint32_t reset_query_mandatory_command_support(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Mandatory cmd RESET_DOMAIN_ATTRIBUTES should be supported */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] RESET DOMAIN ATTRIBUTES support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = RESET_DOMAIN_ATTRIBUTES;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Mandatory cmd RESET should be supported */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] RESET support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = RESET_PROTOCOL_RESET;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/reset/test_r004.c b/test_pool/reset/test_r004.c
new file mode 100644
index 0000000000000000000000000000000000000000..03fc5f8c6333503aedb3c62b44f0f66e42ef0be4
--- /dev/null
+++ b/test_pool/reset/test_r004.c
@@ -0,0 +1,75 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_reset.h"
+
+#define TEST_NUM (SCMI_RESET_TEST_NUM_BASE + 4)
+#define TEST_DESC "Reset msg attributes invalid msg id check "
+
+uint32_t reset_invalid_messageid_call(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
+ uint32_t message_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Sending invalid reset protocol cmd should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Invalid command invocation");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters = NULL;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_INVALID_COMMAND, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ /* Query support for invalid reset protocol command should return status NOT_FOUND */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query undefined command support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = RESET_INVALID_COMMAND;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/reset/test_r005.c b/test_pool/reset/test_r005.c
new file mode 100644
index 0000000000000000000000000000000000000000..02ecca225c6cadc305728405e698c14edd12d967
--- /dev/null
+++ b/test_pool/reset/test_r005.c
@@ -0,0 +1,91 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_reset.h"
+
+#define TEST_NUM (SCMI_RESET_TEST_NUM_BASE + 5)
+#define TEST_DESC "Reset domain attributes check "
+
+uint32_t reset_query_domain_attributes(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains, attribute;
+ uint32_t latency, async_support, notification_support;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Skip if no domains found*/
+ num_domains = val_reset_get_info(NUM_RESET_DOMAINS, 0x0);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No reset domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ /* Check reset domain attributes for valid domain */
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n RESET DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query attributes");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_DOMAIN_ATTRIBUTES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ attribute = return_values[ATTRIBUTE_OFFSET];
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attribute, 0, 29)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ async_support = VAL_EXTRACT_BITS(attribute, 31, 31);
+ notification_support = VAL_EXTRACT_BITS(attribute, 30, 30);
+ latency = return_values[LATANCY_OFFSET];
+
+ val_print(VAL_PRINT_DEBUG, "\n Async reset support : %d",
+ async_support);
+ val_print(VAL_PRINT_DEBUG, "\n Reset notifications support : %d",
+ notification_support);
+ val_print(VAL_PRINT_DEBUG, "\n Latency : %d",
+ latency);
+
+ /* Save info for further tests*/
+ val_reset_save_info(RESET_ASYNC_SUPPORT, domain_id, async_support);
+ val_reset_save_info(RESET_NOTIFY_SUPPORT, domain_id, notification_support);
+
+ if (val_compare_str("DOMAIN NAME", (char *)&return_values[NAME_OFFSET],
+ (char *)val_reset_get_expected_name(domain_id), SCMI_NAME_STR_SIZE))
+ return VAL_STATUS_FAIL;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/reset/test_r006.c b/test_pool/reset/test_r006.c
new file mode 100644
index 0000000000000000000000000000000000000000..f6edf565907f2b17864f29aa8e5044ddcd24c050
--- /dev/null
+++ b/test_pool/reset/test_r006.c
@@ -0,0 +1,56 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_reset.h"
+
+#define TEST_NUM (SCMI_RESET_TEST_NUM_BASE + 6)
+#define TEST_DESC "Domain attributes invalid domain id check "
+
+uint32_t reset_query_domain_attributes_invalid_id(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ domain_id = val_reset_get_info(NUM_RESET_DOMAINS, 0x0) + 1;
+
+ /* Check reset domain attributes for invalid domain */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query attributes for invalid domain_id: %d",
+ domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_DOMAIN_ATTRIBUTES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &domain_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/reset/test_r007.c b/test_pool/reset/test_r007.c
new file mode 100644
index 0000000000000000000000000000000000000000..5bab3573a4341c7a9d37f72cf2830298c9f48807
--- /dev/null
+++ b/test_pool/reset/test_r007.c
@@ -0,0 +1,62 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_reset.h"
+
+#define TEST_NUM (SCMI_RESET_TEST_NUM_BASE + 7)
+#define TEST_DESC "Reset command invalid domain id check "
+
+#define PARAMETER_SIZE 3
+
+uint32_t reset_query_reset_command_invalid_id(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id;
+ uint32_t parameters[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ domain_id = val_reset_get_info(NUM_RESET_DOMAINS, 0x0) + 1;
+
+ /* Check reset for invalid domain */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query reset for invalid domain_id: %d",
+ domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id; /* Invalid domain id*/
+ parameters[param_count++] = EXPLICIT_SYNC_DEASSERT_RESET;
+ parameters[param_count++] = ARCH_COLD_RESET;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_PROTOCOL_RESET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/reset/test_r008.c b/test_pool/reset/test_r008.c
new file mode 100644
index 0000000000000000000000000000000000000000..333296a13b67ba90cb1ea8ca7e268efc86e75d7b
--- /dev/null
+++ b/test_pool/reset/test_r008.c
@@ -0,0 +1,96 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_reset.h"
+
+#define TEST_NUM (SCMI_RESET_TEST_NUM_BASE + 8)
+#define TEST_DESC "Reset command invalid flag check "
+
+#define PARAMETER_SIZE 3
+
+uint32_t reset_query_reset_command_invalid_flag(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains;
+ uint32_t parameters[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Skip if no domains found*/
+ num_domains = val_reset_get_info(NUM_RESET_DOMAINS, 0x0);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No reset domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ /* Check reset for valid domain with invalid flag*/
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ /* Query with invalid reserve bits */
+ val_print(VAL_PRINT_TEST, "\n RESET DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query reset with invalid reserve bit");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = INVALID_FLAG_VAL;
+ parameters[param_count++] = ARCH_COLD_RESET;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_PROTOCOL_RESET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Continue if domain is supported async mode */
+ if (val_reset_get_info(RESET_ASYNC_SUPPORT, domain_id) == 1)
+ continue;
+
+ /* Query with invalid aync reset flag */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query reset with invalid async flag");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = (1 << RESET_FLAG_ASYNC_RESET_BIT) |
+ (1 << RESET_FLAG_AUTONOMOUS_RESET_BIT);
+ parameters[param_count++] = ARCH_COLD_RESET;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_PROTOCOL_RESET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_SUPPORTED) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/reset/test_r009.c b/test_pool/reset/test_r009.c
new file mode 100644
index 0000000000000000000000000000000000000000..a7b44e35173dfb893f589016fbbfafc6aa99b18c
--- /dev/null
+++ b/test_pool/reset/test_r009.c
@@ -0,0 +1,73 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_reset.h"
+
+#define TEST_NUM (SCMI_RESET_TEST_NUM_BASE + 9)
+#define TEST_DESC "Reset command invalid reset_state check "
+
+#define PARAMETER_SIZE 3
+
+uint32_t reset_query_reset_command_invalid_reset_state(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, num_domains;
+ uint32_t parameters[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Skip if no domains found*/
+ num_domains = val_reset_get_info(NUM_RESET_DOMAINS, 0x0);
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No reset domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ /* Query with invalid reset_state */
+ val_print(VAL_PRINT_TEST, "\n RESET DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query reset with invalid reset_state");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = EXPLICIT_SYNC_DEASSERT_RESET;
+ /* invalid reset state */
+ parameters[param_count++] = (RESET_TYPE_ARCHITECTURAL << RESET_TYPE_BIT) |
+ RESET_ARCHITECTURAL_INVALID_ID;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_PROTOCOL_RESET,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/reset/test_r010.c b/test_pool/reset/test_r010.c
new file mode 100644
index 0000000000000000000000000000000000000000..8710ff295a552bc160af5f4a592c4ec8c64990e3
--- /dev/null
+++ b/test_pool/reset/test_r010.c
@@ -0,0 +1,77 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_reset.h"
+
+#define TEST_NUM (SCMI_RESET_TEST_NUM_BASE + 10)
+#define TEST_DESC "Reset notify invalid domain id "
+
+#define PARAMETER_SIZE 2
+
+uint32_t reset_query_notify_invalid_id(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, message_id;
+ uint32_t parameters[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* If RESET_PROTOCOL_NOTIFY not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query reset notify cmd support");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ message_id = RESET_PROTOCOL_NOTIFY;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n RESET_PROTOCOL_NOTIFY not supported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ domain_id = val_reset_get_info(NUM_RESET_DOMAINS, 0x0) + 1;
+
+ /* Check notify for invalid domain */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query reset for invalid domain_id: %d",
+ domain_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id; /* Invalid domain id*/
+ parameters[param_count++] = RESET_NOTIFY_DISABLE;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_PROTOCOL_NOTIFY,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/reset/test_r011.c b/test_pool/reset/test_r011.c
new file mode 100644
index 0000000000000000000000000000000000000000..a40d4c13222d9d7b5385a0597772c217df89c9f8
--- /dev/null
+++ b/test_pool/reset/test_r011.c
@@ -0,0 +1,87 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_reset.h"
+
+#define TEST_NUM (SCMI_RESET_TEST_NUM_BASE + 11)
+#define TEST_DESC "Reset notify invalid notify_enable "
+
+#define PARAMETER_SIZE 2
+
+uint32_t reset_query_invalid_notify_enable(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t domain_id, message_id, num_domains;
+ uint32_t parameters[PARAMETER_SIZE];
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* If RESET_PROTOCOL_NOTIFY not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query reset notify cmd support");
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ param_count++;
+ message_id = RESET_PROTOCOL_NOTIFY;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n RESET_PROTOCOL_NOTIFY not supported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ num_domains = val_reset_get_info(NUM_RESET_DOMAINS, 0x0);
+
+ /* Skip if no domains found*/
+ if (num_domains == 0) {
+ val_print(VAL_PRINT_ERR, "\n No reset domains found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM DOMAINS : %d", num_domains);
+
+ for (domain_id = 0; domain_id < num_domains; domain_id++)
+ {
+ /* Check notify for invalid notify_enable */
+ val_print(VAL_PRINT_TEST, "\n RESET DOMAIN ID: %d", domain_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query reset for invalid notify_enable");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = domain_id;
+ parameters[param_count++] = RESET_INVALID_NOTIFY_ENABLE;
+
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_RESET, RESET_PROTOCOL_NOTIFY,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/sensor/test_m001.c b/test_pool/sensor/test_m001.c
index f9038bbc7e18dea9bca1ca66c263af0a4207f073..9205882b23ea9f9d127452bac1800276d2ad1856 100644
--- a/test_pool/sensor/test_m001.c
+++ b/test_pool/sensor/test_m001.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,31 +15,34 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_sensor.h"
#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 1)
-#define TEST_DESC "Sensor Protocol Version check "
+#define TEST_DESC "Sensor protocol version check "
-uint32_t sensor_query_protocol_version(void)
+#define MIN_RET_VAL_EXPECTED 1
+
+uint32_t sensor_query_protocol_version(uint32_t *version)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters;
- uint32_t return_value_count, version, expected_version;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Check protocol version is as expected value */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query protocol version");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query protocol version");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters = NULL; /* No parameters for this command */
- version = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_PROTOCOL_VERSION, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &version);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -47,9 +50,13 @@ uint32_t sensor_query_protocol_version(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- expected_version = val_sensor_get_expected_protocol_version();
- if (val_protocol_version_check(expected_version, version) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (return_value_count != MIN_RET_VAL_EXPECTED)
return VAL_STATUS_FAIL;
+ *version = return_values[VERSION_OFFSET];
+ val_print(VAL_PRINT_ERR, "\n VERSION : 0x%08x ", *version);
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/sensor/test_m002.c b/test_pool/sensor/test_m002.c
index 7d54a8a4be82e788460a7d8ddaac868ecbf3c664..785818670db7ca711a118bd014a07c82846438bb 100644
--- a/test_pool/sensor/test_m002.c
+++ b/test_pool/sensor/test_m002.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,30 +15,32 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_sensor.h"
#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 2)
-#define TEST_DESC "Sensor Protocol Attributes check "
-#define MAX_RETURN_VALUE_SIZE 4
+#define TEST_DESC "Sensor protocol attributes check "
uint32_t sensor_query_protocol_attributes(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters;
- uint32_t return_value_count, return_values[MAX_RETURN_VALUE_SIZE];
- uint32_t attributes, stats_addr_low, stats_addr_high, stats_len;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
+ uint32_t attributes, num_sensors;
+ uint32_t reg_addr_low, reg_addr_high, reg_len;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
/* Query sensor protocol and check num of sensors */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query protocol attributes");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query protocol attributes");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters = NULL; /* No parameters for this command */
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_PROTOCOL_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
&return_value_count, return_values);
@@ -49,24 +51,35 @@ uint32_t sensor_query_protocol_attributes(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- attributes = return_values[0];
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 24, 31) != VAL_STATUS_PASS))
return VAL_STATUS_FAIL;
/* Save the number of sensors */
- val_sensor_save_info(NUM_SENSORS, VAL_EXTRACT_BITS(attributes, 0, 15));
- val_print(VAL_PRINT_INFO, "\n\tNUM SENSORS: %d ",
- VAL_EXTRACT_BITS(attributes, 0, 15));
+ num_sensors = VAL_EXTRACT_BITS(attributes, 0, 15);
+ if (val_compare("NUM SENSORS", num_sensors, val_sensor_get_expected_num_sensors()))
+ return VAL_STATUS_FAIL;
+ val_sensor_save_info(NUM_SENSORS, num_sensors);
/* Save the sensor shared memory low address */
- stats_addr_low = return_values[1];
- val_sensor_save_info(SENSOR_STATS_ADDR_LOW, stats_addr_low);
+ reg_addr_low = return_values[REG_ADDR_LOW_OFFSET];
+ if (val_compare("REG ADDR LOW ", reg_addr_low, val_sensor_get_expected_stats_addr_low()))
+ return VAL_STATUS_FAIL;
+ val_sensor_save_info(SENSOR_STATS_ADDR_LOW, reg_addr_low);
+
/* Save the sensor shared memory high address */
- stats_addr_high = return_values[2];
- val_sensor_save_info(SENSOR_STATS_ADDR_HIGH, stats_addr_high);
+ reg_addr_high = return_values[REG_ADDR_HIGH_OFFSET];
+ if (val_compare("REG ADDR HIGH", reg_addr_high, val_sensor_get_expected_stats_addr_high()))
+ return VAL_STATUS_FAIL;
+ val_sensor_save_info(SENSOR_STATS_ADDR_HIGH, reg_addr_high);
+
/* Save the sensor shared memory length */
- stats_len = return_values[3];
- val_sensor_save_info(SENSOR_STATS_ADDR_LEN, stats_len);
+ reg_len = return_values[REG_LENGTH_OFFSET];
+ if (val_compare("REG LEN ", reg_len, val_sensor_get_expected_stats_addr_len()))
+ return VAL_STATUS_FAIL;
+ val_sensor_save_info(SENSOR_STATS_ADDR_LEN, reg_len);
return VAL_STATUS_PASS;
}
diff --git a/test_pool/sensor/test_m003.c b/test_pool/sensor/test_m003.c
index c6485914be10f05cdf2bfe3f23a983af855bbe02..a552ffd7ed9c27074c3cbedc7cbd6f5b54e5dc1c 100644
--- a/test_pool/sensor/test_m003.c
+++ b/test_pool/sensor/test_m003.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,33 +15,35 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_sensor.h"
#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 3)
-#define TEST_DESC "Sensor Protocol mandatory command support check "
+#define TEST_DESC "Sensor msg attributes mandatory cmd check "
uint32_t sensor_query_mandatory_command_support(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id;
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
/* Mandatory cmd SENSOR DESCRIPTION GET should be supported */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] SENSOR DESCRIPTION GET support");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] SENSOR DESCRIPTION GET support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = SENSOR_DESCRIPTION_GET;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_PROTOCOL_MESSAGE_ATTRIBUTES,
COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -49,21 +51,21 @@ uint32_t sensor_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
/* Mandatory cmd SENSOR READING GET should be supported */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] SENSOR READING GET support");
+ val_print(VAL_PRINT_TEST, "\n [Check 2] SENSOR READING GET support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = SENSOR_READING_GET;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_PROTOCOL_MESSAGE_ATTRIBUTES,
COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -71,7 +73,9 @@ uint32_t sensor_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
return VAL_STATUS_PASS;
diff --git a/test_pool/sensor/test_m004.c b/test_pool/sensor/test_m004.c
index 04ee407d221bf11a0f6c18526f080a8372936891..e4ea00c39a87b2ec64f26d2ebde3a5ff7cce23dc 100644
--- a/test_pool/sensor/test_m004.c
+++ b/test_pool/sensor/test_m004.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,49 +15,61 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_sensor.h"
#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 4)
-#define TEST_DESC "Sensor invalid message id check "
+#define TEST_DESC "Sensor msg attributes invalid msg id check "
uint32_t sensor_invalid_messageid_call(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters, message_id;
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
+ uint32_t message_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
/* Sending invalid sensor protocol cmd should fail */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Invalid command invocation");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Invalid command invocation");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters = NULL;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_INVALID_COMMAND, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- /* Query support for invalid sensor protocol command should return status NOT_FOUND */
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Query undefined command support");
+ /* Query support for invalid sensor protocol command should return status NOT_FOUND */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query undefined command support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = SENSOR_INVALID_COMMAND;
- attributes = 0;
+ param_count++;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_PROTOCOL_MESSAGE_ATTRIBUTES,
COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/sensor/test_m005.c b/test_pool/sensor/test_m005.c
index 4716a0b0cbd5f8dfbd2420a10d6f02b6dc0c190e..9715c8d5362f0c664ed3966eafbe3a17817dd142 100644
--- a/test_pool/sensor/test_m005.c
+++ b/test_pool/sensor/test_m005.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,57 +15,112 @@
* limitations under the License.
**/
-#include"val_interface.h"
+#include "val_interface.h"
+#include "val_sensor.h"
#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 5)
-#define TEST_DESC "Sensor reading get check "
-#define MAX_RETURN_VALUE_SIZE 2
-#define MAX_PARAMETER_SIZE 2
+#define TEST_DESC "Sensor description get check "
-uint32_t sensor_reading_get_check(void)
+#define SENSOR_DESC_LEN 7
+
+uint32_t sensor_query_description_get(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, parameters[MAX_PARAMETER_SIZE], sensor_id;
- uint32_t return_value_count, return_values[MAX_RETURN_VALUE_SIZE];
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t num_remaining_desc, num_desc_retured = 0;
+ uint32_t i, desc_index = 0, sensor_id;
+ uint32_t async_support, num_trip_points;
+ uint32_t *sensor_desc, num_sensor_flag;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Reading sensor value for invalid sensor should fail */
- sensor_id = val_sensor_get_info(NUM_SENSORS) + 1;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Send invalid sensor id %d", sensor_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query sensor description ");
- VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters[param_count++] = sensor_id;
- parameters[param_count++] = 0x1;
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_READING_GET, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, return_values);
+ /* Reading sensor description repeatedly until all sensor details received*/
+ do
+ {
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ desc_index += num_desc_retured;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_DESCRIPTION_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &desc_index, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
- if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ num_sensor_flag = return_values[NUM_SENSOR_FLAG_OFFSET];
+ num_remaining_desc = VAL_EXTRACT_BITS(num_sensor_flag, 16, 31);
+ val_print(VAL_PRINT_DEBUG, "\n NUM OF REMAINING DESC : %d", num_remaining_desc);
- /* Reading sensor value with incorrect flags */
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(num_sensor_flag, 12, 15)) !=
+ VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Send incorrect flag value");
+ num_desc_retured = VAL_EXTRACT_BITS(num_sensor_flag, 0, 11);
+ val_print(VAL_PRINT_DEBUG, "\n NUM OF DESC RETURNED : %d", num_desc_retured);
+
+ /* Sensor desc start from return_values[1] */
+ sensor_desc = &return_values[DESC_OFFSET];
+ for (i = 0; i < num_desc_retured; i++)
+ {
+ sensor_id = sensor_desc[i * SENSOR_DESC_LEN];
+ async_support = VAL_EXTRACT_BITS(sensor_desc[1 + (i * SENSOR_DESC_LEN)], 31, 31);
+ num_trip_points = VAL_EXTRACT_BITS(sensor_desc[1 + (i * SENSOR_DESC_LEN)], 0, 7);
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(
+ sensor_desc[1 + (i * SENSOR_DESC_LEN)], 8, 30)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(
+ sensor_desc[2 + (i * SENSOR_DESC_LEN)], 16, 21)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(
+ sensor_desc[2 + (i * SENSOR_DESC_LEN)], 8, 10)) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print(VAL_PRINT_DEBUG, "\n Sensor id : %d", sensor_id);
+ val_print(VAL_PRINT_DEBUG, "\n Async read support : %d", async_support);
+ val_print(VAL_PRINT_DEBUG, "\n Number of trip points : %d", num_trip_points);
+ val_print(VAL_PRINT_DEBUG, "\n Sensor update interval : %dx10^%d",
+ VAL_EXTRACT_BITS(sensor_desc[2 + (i * SENSOR_DESC_LEN)], 27, 31),
+ VAL_EXTRACT_BITS(sensor_desc[2 + (i * SENSOR_DESC_LEN)], 22, 26));
+ val_print(VAL_PRINT_DEBUG, "\n Unit multiplier : %d",
+ VAL_EXTRACT_BITS(sensor_desc[2 + (i * SENSOR_DESC_LEN)], 11, 15));
+ val_print(VAL_PRINT_DEBUG, "\n Sensor name : %s",
+ &sensor_desc[3 + (i * SENSOR_DESC_LEN)]);
+
+ /* Save sensor information */
+ val_sensor_save_desc_info(SENSOR_NUM_OF_TRIP_POINTS, sensor_id, num_trip_points);
+ val_sensor_save_desc_info(SENSOR_ASYNC_READ_SUPPORT, sensor_id, async_support);
+ }
+ } while (num_remaining_desc > 0);
+
+ desc_index += num_desc_retured;
+ if (val_compare("NUM OF DESC ", desc_index, val_sensor_get_expected_num_sensors()))
+ return VAL_STATUS_FAIL;
+
+ /* Sensor get desc for invalid descriptor index */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query with invalid desc_index : %d", desc_index);
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters[param_count++] = 0;
- parameters[param_count++] = 0x4; /* invalid flag value */
- val_memset_zero(return_values, MAX_RETURN_VALUE_SIZE);
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_READING_GET, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_DESCRIPTION_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &desc_index, &rsp_msg_hdr, &status,
&return_value_count, return_values);
- if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
return VAL_STATUS_PASS;
diff --git a/test_pool/sensor/test_m006.c b/test_pool/sensor/test_m006.c
new file mode 100644
index 0000000000000000000000000000000000000000..0271dc0d7f75ce0c524420a1a6a1261ac3f288d2
--- /dev/null
+++ b/test_pool/sensor/test_m006.c
@@ -0,0 +1,85 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_sensor.h"
+
+#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 6)
+#define TEST_DESC "Sensor trip pnt notify invalid event_ctrl chk"
+
+#define MAX_PARAMETER_SIZE 2
+
+uint32_t sensor_trip_point_nfy_event_ctrl_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[MAX_PARAMETER_SIZE];
+ uint32_t sensor_id, num_sensors;
+ uint32_t message_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* if TRIP POINT NOTIFY not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query trip point notify cmd support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = SENSOR_TRIP_POINT_NOTIFY;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n SENSOR_TRIP_POINT_NOTIFY unsupported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ num_sensors = val_sensor_get_info(NUM_SENSORS);
+ if (num_sensors == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Sensor found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM SENSORS : %d", num_sensors);
+
+ /* Set trip point notify with incorrect event control */
+ for (sensor_id = 0; sensor_id < num_sensors; sensor_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n SENSOR ID: %d", sensor_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Send invalid event control");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = sensor_id;
+ parameters[param_count++] = EVENT_CTRL_INVALID_VAL;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_TRIP_POINT_NOTIFY, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/sensor/test_m007.c b/test_pool/sensor/test_m007.c
new file mode 100644
index 0000000000000000000000000000000000000000..dab90d2e11e04a00d74d06d24e29d9eda9964e7e
--- /dev/null
+++ b/test_pool/sensor/test_m007.c
@@ -0,0 +1,74 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_sensor.h"
+
+#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 7)
+#define TEST_DESC "Sensor trip pnt notify invalid sensor id chk "
+
+#define MAX_PARAMETER_SIZE 2
+
+uint32_t sensor_trip_point_nfy_invalid_id_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[MAX_PARAMETER_SIZE];
+ uint32_t sensor_id, message_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* if TRIP POINT NOTIFY not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query trip point notify cmd support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = SENSOR_TRIP_POINT_NOTIFY;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n SENSOR_TRIP_POINT_NOTIFY unsupported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Query with invalid sensor id */
+ sensor_id = val_sensor_get_info(NUM_SENSORS) + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Send invalid sensor_id :%d", sensor_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = sensor_id;
+ parameters[param_count++] = TRIP_POINT_NFY_DISABLE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_TRIP_POINT_NOTIFY, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/sensor/test_m008.c b/test_pool/sensor/test_m008.c
new file mode 100644
index 0000000000000000000000000000000000000000..357b9bd7ed53f015ecbef56685cdf92884d28b16
--- /dev/null
+++ b/test_pool/sensor/test_m008.c
@@ -0,0 +1,107 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_sensor.h"
+
+#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 8)
+#define TEST_DESC "Sensor trip point config invalid param check "
+
+#define MAX_PARAMETER_SIZE 3
+
+uint32_t sensor_trip_point_config_invalid_param_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[MAX_PARAMETER_SIZE];
+ uint32_t sensor_id, num_sensors, message_id;
+ uint32_t trip_point_evt_ctl, trip_point_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* if TRIP POINT CONFIG not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query trip point config cmd support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = SENSOR_TRIP_POINT_CONFIG;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n SENSOR_TRIP_POINT_CONFIG unsupported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ num_sensors = val_sensor_get_info(NUM_SENSORS);
+ if (num_sensors == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Sensor found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM SENSORS : %d", num_sensors);
+
+ /* Set trip point config with incorrect parameters */
+ for (sensor_id = 0; sensor_id < num_sensors; sensor_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n SENSOR ID: %d", sensor_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Send incorrect reserve_bit");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = sensor_id;
+ parameters[param_count++] = EVENT_CTRL_INVALID_VAL;
+ parameters[param_count++] = TRIP_POINT_DEFAULT_LOW_VAL;
+ parameters[param_count++] = TRIP_POINT_DEFAULT_HIGH_VAL;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_TRIP_POINT_CONFIG, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Invalid trip point id */
+ trip_point_id = val_sensor_get_desc_info(SENSOR_NUM_OF_TRIP_POINTS, sensor_id) + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 3] Send invalid trip_pnt_id: %d", trip_point_id);
+
+ trip_point_evt_ctl = ((trip_point_id << TRIP_POINT_ID_LOW) | TRIP_POINT_DISABLE);
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = sensor_id;
+ parameters[param_count++] = trip_point_evt_ctl;
+ parameters[param_count++] = TRIP_POINT_DEFAULT_LOW_VAL;
+ parameters[param_count++] = TRIP_POINT_DEFAULT_HIGH_VAL;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_TRIP_POINT_CONFIG, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/sensor/test_m009.c b/test_pool/sensor/test_m009.c
new file mode 100644
index 0000000000000000000000000000000000000000..e7befe72e58c4427f36cc0c4224de34667dc8c25
--- /dev/null
+++ b/test_pool/sensor/test_m009.c
@@ -0,0 +1,76 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_sensor.h"
+
+#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 9)
+#define TEST_DESC "Sensor trip pnt config invalid sensor id chk "
+
+#define MAX_PARAMETER_SIZE 3
+
+uint32_t sensor_trip_point_config_invalid_id_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[MAX_PARAMETER_SIZE];
+ uint32_t sensor_id, message_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* if TRIP POINT CONFIG not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query trip point config cmd support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = SENSOR_TRIP_POINT_CONFIG;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n SENSOR_TRIP_POINT_CONFIG unsupported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* Query with invalid sensor id , should fail with SCMI_NOT_FOUND*/
+ sensor_id = val_sensor_get_info(NUM_SENSORS) + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Send invalid sensor_id: %d", sensor_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = sensor_id;
+ parameters[param_count++] = TRIP_POINT_DISABLE;
+ parameters[param_count++] = TRIP_POINT_DEFAULT_LOW_VAL;
+ parameters[param_count++] = TRIP_POINT_DEFAULT_HIGH_VAL;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_TRIP_POINT_CONFIG, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/sensor/test_m010.c b/test_pool/sensor/test_m010.c
new file mode 100644
index 0000000000000000000000000000000000000000..c0f01f63eb01d0616295695c997eb46cafae849d
--- /dev/null
+++ b/test_pool/sensor/test_m010.c
@@ -0,0 +1,108 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_sensor.h"
+
+#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 10)
+#define TEST_DESC "Sensor trip point config set check "
+
+#define MAX_PARAMETER_SIZE 3
+
+uint32_t sensor_trip_point_config_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[MAX_PARAMETER_SIZE];
+ uint32_t sensor_id, num_sensors, message_id;
+ uint32_t trip_point_evt_ctl, trip_point_id;
+ uint32_t run_flag = 0, num_trip_point;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* if TRIP POINT CONFIG not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query trip point config cmd support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = SENSOR_TRIP_POINT_CONFIG;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_PROTOCOL_MESSAGE_ATTRIBUTES,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n SENSOR_TRIP_POINT_CONFIG unsupported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ num_sensors = val_sensor_get_info(NUM_SENSORS);
+ if (num_sensors == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Sensor found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM SENSORS : %d", num_sensors);
+
+ /* Set trip point config with valid parameters */
+ for (sensor_id = 0; sensor_id < num_sensors; sensor_id++)
+ {
+ num_trip_point = val_sensor_get_desc_info(SENSOR_NUM_OF_TRIP_POINTS, sensor_id);
+
+ /* Continue if trip point is not supported */
+ if (num_trip_point == 0) {
+ val_print(VAL_PRINT_TEST, "\n No trip point found for sensor_id :%d", sensor_id);
+ continue;
+ }
+
+ /* Query with valid trip point id and sensor id*/
+ val_print(VAL_PRINT_TEST, "\n SENSOR ID: %d", sensor_id);
+ run_flag = 1;
+ for (trip_point_id = 0; trip_point_id < num_trip_point; trip_point_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query with valid trip_point_id :%d",
+ trip_point_id);
+
+ trip_point_evt_ctl = ((trip_point_id << TRIP_POINT_ID_LOW) | TRIP_POINT_DISABLE);
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = sensor_id;
+ parameters[param_count++] = trip_point_evt_ctl;
+ parameters[param_count++] = TRIP_POINT_DEFAULT_LOW_VAL;
+ parameters[param_count++] = TRIP_POINT_DEFAULT_HIGH_VAL;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_TRIP_POINT_CONFIG,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+ }
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No trip point set for any sensor ");
+ return VAL_STATUS_SKIP;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/sensor/test_m011.c b/test_pool/sensor/test_m011.c
new file mode 100644
index 0000000000000000000000000000000000000000..1f5a12f1ba83a78bd049adbb0d04beea2adb3952
--- /dev/null
+++ b/test_pool/sensor/test_m011.c
@@ -0,0 +1,68 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_sensor.h"
+
+#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 11)
+#define TEST_DESC "Sensor reading get invalid flag check "
+
+#define MAX_PARAMETER_SIZE 2
+
+uint32_t sensor_reading_get_invalid_flag_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[MAX_PARAMETER_SIZE];
+ uint32_t sensor_id, num_sensors;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ num_sensors = val_sensor_get_info(NUM_SENSORS);
+ if (num_sensors == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Sensor found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM SENSORS : %d", num_sensors);
+
+ /* Reading sensor value with incorrect flags */
+ for (sensor_id = 0; sensor_id < num_sensors; sensor_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n SENSOR ID: %d", sensor_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Send incorrect flag value");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = sensor_id;
+ parameters[param_count++] = INVALID_FLAG_VAL;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_READING_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/sensor/test_m012.c b/test_pool/sensor/test_m012.c
new file mode 100644
index 0000000000000000000000000000000000000000..6ce387d22209c69a9f05cca63e90afb715dd652a
--- /dev/null
+++ b/test_pool/sensor/test_m012.c
@@ -0,0 +1,57 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_sensor.h"
+
+#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 12)
+#define TEST_DESC "Sensor reading get invalid sensor id check "
+
+#define MAX_PARAMETER_SIZE 2
+
+uint32_t sensor_reading_get_invalid_id_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[MAX_PARAMETER_SIZE], sensor_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* Reading sensor value for invalid sensor should fail */
+ sensor_id = val_sensor_get_info(NUM_SENSORS) + 1;
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Send invalid sensor id : %d", sensor_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = sensor_id;
+ parameters[param_count++] = SENSOR_READ_SYNC_MODE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_READING_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/sensor/test_m013.c b/test_pool/sensor/test_m013.c
new file mode 100644
index 0000000000000000000000000000000000000000..17780090e194668996deba784c60620ea83eed21
--- /dev/null
+++ b/test_pool/sensor/test_m013.c
@@ -0,0 +1,77 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_sensor.h"
+
+#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 13)
+#define TEST_DESC "Sensor reading get - sync mode access check "
+
+#define MAX_PARAMETER_SIZE 2
+
+uint32_t sensor_reading_get_sync_mode(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[MAX_PARAMETER_SIZE];
+ uint32_t sensor_id, num_sensors;
+ uint32_t sensor_val_low, sensor_val_high;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ num_sensors = val_sensor_get_info(NUM_SENSORS);
+ if (num_sensors == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Sensor found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM SENSORS : %d", num_sensors);
+
+ /* Reading sensor value in sync mode */
+ for (sensor_id = 0; sensor_id < num_sensors; sensor_id++)
+ {
+ val_print(VAL_PRINT_TEST, "\n SENSOR ID: %d", sensor_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Get sensor reading synchronously");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = sensor_id;
+ parameters[param_count++] = SENSOR_READ_SYNC_MODE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_READING_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ sensor_val_low = return_values[SENSOR_VAL_LOW_OFFSET];
+ sensor_val_high = return_values[SENSOR_VAL_HIGH_OFFSET];
+
+ val_print(VAL_PRINT_DEBUG, "\n Sensor value low : 0x%08X", sensor_val_low);
+ val_print(VAL_PRINT_DEBUG, "\n Sensor value high : 0x%08X", sensor_val_high);
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/sensor/test_m014.c b/test_pool/sensor/test_m014.c
new file mode 100644
index 0000000000000000000000000000000000000000..83931845f6d8af2f8c4b5099bc76c2259ebe8cf7
--- /dev/null
+++ b/test_pool/sensor/test_m014.c
@@ -0,0 +1,110 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_sensor.h"
+
+#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 14)
+#define TEST_DESC "Sensor reading get - async mode access check "
+
+#define MAX_PARAMETER_SIZE 2
+
+uint32_t sensor_reading_get_async_mode(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[MAX_PARAMETER_SIZE];
+ uint32_t sensor_id, num_sensors, run_flag = 0;
+ uint32_t sensor_id_rcvd, sensor_val_low, sensor_val_high;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ num_sensors = val_sensor_get_info(NUM_SENSORS);
+ if (num_sensors == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Sensor found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM SENSORS : %d", num_sensors);
+
+ /* Reading sensor value in async mode */
+ for (sensor_id = 0; sensor_id < num_sensors; sensor_id++)
+ {
+ /* Skip if sensor not supported async mode access */
+ if (val_sensor_get_desc_info(SENSOR_ASYNC_READ_SUPPORT, sensor_id) == 0)
+ continue;
+
+ run_flag = 1;
+
+ /* Query with async mode settings */
+ val_print(VAL_PRINT_TEST, "\n SENSOR ID: %d", sensor_id);
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Get sensor reading asynchronously");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = sensor_id;
+ parameters[param_count++] = SENSOR_READ_ASYNC_MODE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_READING_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ /* Wait for delayed response */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Wait for delayed response");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ val_receive_notification(&rsp_msg_hdr, &return_value_count, return_values);
+
+ val_print(VAL_PRINT_TEST, "\n NOTIFY MSG HDR : 0x%08x", rsp_msg_hdr);
+ if (val_compare("PROTOCOL ID", VAL_EXTRACT_BITS(rsp_msg_hdr, 10, 17), PROTOCOL_SENSOR))
+ return VAL_STATUS_FAIL;
+ if (val_compare("MSG TYPE ", VAL_EXTRACT_BITS(rsp_msg_hdr, 8, 9), DELAYED_RESPONSE_MSG))
+ return VAL_STATUS_FAIL;
+ if (val_compare("MSG ID ", VAL_EXTRACT_BITS(rsp_msg_hdr, 0, 7),
+ SENSOR_READING_COMPLETE))
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ sensor_id_rcvd = return_values[DELAYED_RESP_SENSOR_ID_OFFSET];
+ if (val_compare("SENSOR ID ", sensor_id_rcvd, sensor_id))
+ return VAL_STATUS_FAIL;
+
+ sensor_val_low = return_values[DELAYED_RESP_SENSOR_VAL_LOW_OFFSET];
+ sensor_val_high = return_values[DELAYED_RESP_SENSOR_VAL_HIGH_OFFSET];
+
+ val_print(VAL_PRINT_DEBUG, "\n Sensor value low : 0x%08X", sensor_val_low);
+ val_print(VAL_PRINT_DEBUG, "\n Sensor value high : 0x%08X", sensor_val_high);
+ }
+
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n No sensor support async mode ");
+ return VAL_STATUS_SKIP;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/sensor/test_m015.c b/test_pool/sensor/test_m015.c
new file mode 100644
index 0000000000000000000000000000000000000000..7ab5eca178e4f383522b8244619e334478b93913
--- /dev/null
+++ b/test_pool/sensor/test_m015.c
@@ -0,0 +1,79 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include "val_interface.h"
+#include "val_sensor.h"
+
+#define TEST_NUM (SCMI_SENSOR_TEST_NUM_BASE + 15)
+#define TEST_DESC "Sensor reading get async mode unsupported chk"
+
+#define MAX_PARAMETER_SIZE 2
+
+uint32_t sensor_reading_get_async_mode_not_supported(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[MAX_PARAMETER_SIZE];
+ uint32_t sensor_id, num_sensors, run_flag = 0;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ num_sensors = val_sensor_get_info(NUM_SENSORS);
+ if (num_sensors == 0) {
+ val_print(VAL_PRINT_ERR, "\n No Sensor found ");
+ return VAL_STATUS_SKIP;
+ }
+ val_print(VAL_PRINT_DEBUG, "\n NUM SENSORS : %d", num_sensors);
+
+ /* Reading sensor value in async mode for unsupported sensor */
+ for (sensor_id = 0; sensor_id < num_sensors; sensor_id++)
+ {
+ /* Skip if sensor supported async mode */
+ if (val_sensor_get_desc_info(SENSOR_ASYNC_READ_SUPPORT, sensor_id) == 1)
+ continue;
+
+ run_flag = 1;
+
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Async mode read for unsupported sensor: %d",
+ sensor_id);
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters[param_count++] = sensor_id;
+ parameters[param_count++] = SENSOR_READ_ASYNC_MODE;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SENSOR, SENSOR_READING_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_status(status, SCMI_NOT_SUPPORTED) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+ }
+
+ if (run_flag == 0) {
+ val_print(VAL_PRINT_ERR, "\n All sensor support async mode access ");
+ return VAL_STATUS_SKIP;
+ }
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/system_power/system_power_testlist.c b/test_pool/system_power/system_power_testlist.c
deleted file mode 100644
index 41813a558169771ad8bb6b849eaa7ceaa2a9b71a..0000000000000000000000000000000000000000
--- a/test_pool/system_power/system_power_testlist.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
- * SPDX-License-Identifier : Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-**/
-#include "val_interface.h"
-#include "system_power_testlist.h"
-
-test_fn_ptr system_power_test[] = {
- system_power_query_protocol_version,
- system_power_query_protocol_attributes,
- system_power_query_mandatory_command_support,
- system_power_state_get_check,
- system_power_invalid_messageid_call
-};
-
-test_fn_ptr *val_system_power_get_testlist(uint32_t *num_tests)
-{
- *num_tests = NUM_ELEMS(system_power_test);
- return system_power_test;
-}
diff --git a/test_pool/system_power/test_s001.c b/test_pool/system_power/test_s001.c
index 482e719b303890e915f2ce0234c851e2964cd7f8..eb185db442c8a3d8d2fc977ebcff13d0f3d83d04 100644
--- a/test_pool/system_power/test_s001.c
+++ b/test_pool/system_power/test_s001.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,31 +16,34 @@
**/
#include"val_interface.h"
+#include"val_system_power.h"
#define TEST_NUM (SCMI_SYSTEM_POWER_TEST_NUM_BASE + 1)
-#define TEST_DESC "System Power Protocol Version check "
+#define TEST_DESC "System power protocol version check "
-uint32_t system_power_query_protocol_version(void)
+#define MIN_RET_VAL_EXPECTED 1
+
+uint32_t system_power_query_protocol_version(uint32_t *version)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters;
- uint32_t return_value_count, version, expected_version;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Check protocol version is as expected value */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query protocol version");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query protocol version");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters = NULL; /* No parameters for this command */
- version = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER,
SYSTEM_POWER_PROTOCOL_VERSION, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &version);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -48,9 +51,13 @@ uint32_t system_power_query_protocol_version(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- expected_version = val_system_power_get_expected_protocol_version();
- if (val_protocol_version_check(expected_version, version) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (return_value_count != MIN_RET_VAL_EXPECTED)
return VAL_STATUS_FAIL;
+ *version = return_values[VERSION_OFFSET];
+ val_print(VAL_PRINT_ERR, "\n VERSION : 0x%08x ", *version);
+
return VAL_STATUS_PASS;
}
diff --git a/test_pool/system_power/test_s002.c b/test_pool/system_power/test_s002.c
index 69c80dcf5149b1248d199ca9f07f385cd714ec79..123b16f5c91efd76af3b02890f258c235573bdf2 100644
--- a/test_pool/system_power/test_s002.c
+++ b/test_pool/system_power/test_s002.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,31 +16,33 @@
**/
#include"val_interface.h"
+#include"val_system_power.h"
#define TEST_NUM (SCMI_SYSTEM_POWER_TEST_NUM_BASE + 2)
-#define TEST_DESC "System Power Protocol Attributes check "
+#define TEST_DESC "System power protocol attributes check "
uint32_t system_power_query_protocol_attributes(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters;
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Query system power protocol attributes */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query protocol attributes");
+ /* Query system power protocol return_values */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query protocol return_values");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
parameters = NULL; /* No parameters for this command */
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER,
SYSTEM_POWER_PROTOCOL_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -48,7 +50,9 @@ uint32_t system_power_query_protocol_attributes(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(attributes) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
return VAL_STATUS_PASS;
diff --git a/test_pool/system_power/test_s003.c b/test_pool/system_power/test_s003.c
index 6f77e096b121d47fc873478648374c1a3f202b0b..c1c386ba8c59600261c30fc38481dc2187a8f524 100644
--- a/test_pool/system_power/test_s003.c
+++ b/test_pool/system_power/test_s003.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,32 +16,34 @@
**/
#include"val_interface.h"
+#include"val_system_power.h"
#define TEST_NUM (SCMI_SYSTEM_POWER_TEST_NUM_BASE + 3)
-#define TEST_DESC "System Power mandatory command support check "
+#define TEST_DESC "Sys pwr msg attributes mandatory cmd check "
uint32_t system_power_query_mandatory_command_support(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id;
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t message_id, attributes;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
/* Mandatory cmd SYSTEM POWER STATE SET should be supported */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] SYSTEM POWER STATE SET support");
+ val_print(VAL_PRINT_TEST, "\n [Check 1] SYSTEM POWER STATE SET support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = SYSTEM_POWER_STATE_SET;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER,
SYSTEM_POWER_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -49,24 +51,30 @@ uint32_t system_power_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ val_print_return_values(return_value_count, return_values);
+
+ attributes = return_values[ATTRIBUTE_OFFSET];
if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 0, 29)) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
+ val_print(VAL_PRINT_DEBUG, "\n RESET SUPPORT : %d",
+ VAL_EXTRACT_BITS(attributes, 31, 31));
+ val_print(VAL_PRINT_DEBUG, "\n SUSPEND SUPPORT: %d",
+ VAL_EXTRACT_BITS(attributes, 30, 30));
+
val_system_power_save_info(SYSTEM_RESET_SUPPORT, VAL_EXTRACT_BITS(attributes, 31, 31));
val_system_power_save_info(SYSTEM_SUSPEND_SUPPORT, VAL_EXTRACT_BITS(attributes, 30, 30));
/* Mandatory cmd SYSTEM POWER STATE GET should be supported */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] SYSTEM POWER STATE GET support");
+ val_print(VAL_PRINT_TEST, "\n [Check 2] SYSTEM POWER STATE GET support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
message_id = SYSTEM_POWER_STATE_GET;
param_count++;
- attributes = 0;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER,
SYSTEM_POWER_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ &return_value_count, return_values);
if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
@@ -74,7 +82,31 @@ uint32_t system_power_query_mandatory_command_support(void)
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
- if (val_reserved_bits_check_is_zero(VAL_EXTRACT_BITS(attributes, 0, 29)) != VAL_STATUS_PASS)
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ /* Mandatory cmd SYSTEM POWER STATE NOTIFY should be supported */
+ val_print(VAL_PRINT_TEST, "\n [Check 3] SYSTEM POWER STATE NOTIFY support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = SYSTEM_POWER_STATE_NOTIFY;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER,
+ SYSTEM_POWER_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_SUCCESS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ val_print_return_values(return_value_count, return_values);
+
+ if (val_reserved_bits_check_is_zero(return_values[ATTRIBUTE_OFFSET]) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
return VAL_STATUS_PASS;
diff --git a/test_pool/system_power/test_s004.c b/test_pool/system_power/test_s004.c
index 70eed7c165fd58bb9bf6722bd83690eb31f78f2c..664cd2b9b3646861adffed4c3c0d7b30beb82415 100644
--- a/test_pool/system_power/test_s004.c
+++ b/test_pool/system_power/test_s004.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,52 +16,56 @@
**/
#include"val_interface.h"
+#include"val_system_power.h"
#define TEST_NUM (SCMI_SYSTEM_POWER_TEST_NUM_BASE + 4)
-#define TEST_DESC "System Power state get check "
+#define TEST_DESC "Sys pwr msg attibutes invalid msg id check "
-uint32_t system_power_state_get_check(void)
+uint32_t system_power_invalid_messageid_call(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, message_id, *parameters;
- uint32_t return_value_count, system_state, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters, message_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* If SYSTEM POWER STATE GET not supported, skip the test */
+ /* Sending invalid system power protocol cmd should fail */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Invalid command invocation");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- message_id = SYSTEM_POWER_STATE_GET;
- param_count++;
- attributes = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_BASE, BASE_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ parameters = NULL;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER, SYSTEM_POWER_INVALID_COMMAND,
+ COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
- if (status == SCMI_NOT_FOUND) {
- val_print(VAL_PRINT_TEST, "\n\tSYSTEM POWER STATE GET not supported ");
- return VAL_STATUS_SKIP;
- }
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- /* SYSTEM power state should be not be available to non PSCI agent */
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Query system power state");
+ /* Query support for invalid system power protocol command should return status NOT_FOUND */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query undefined command support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters = NULL;
- system_state = 0;
+ message_id = SYSTEM_POWER_INVALID_COMMAND;
+ param_count++;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER,
- SYSTEM_POWER_STATE_GET, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &system_state);
+ SYSTEM_POWER_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
- if (val_compare_status(status, SCMI_NOT_SUPPORTED) != VAL_STATUS_PASS)
+ if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ return VAL_STATUS_FAIL;;
return VAL_STATUS_PASS;
}
diff --git a/test_pool/system_power/test_s005.c b/test_pool/system_power/test_s005.c
index d23900b4c7206eaa56c4d852f42f4d6419b440cb..c1b5abb5df93cb27777d6e1ccf540d02f6986515 100644
--- a/test_pool/system_power/test_s005.c
+++ b/test_pool/system_power/test_s005.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,48 +16,58 @@
**/
#include"val_interface.h"
+#include"val_system_power.h"
#define TEST_NUM (SCMI_SYSTEM_POWER_TEST_NUM_BASE + 5)
-#define TEST_DESC "System Power invalid message id check "
+#define TEST_DESC "System Power state set invalid flag check "
-uint32_t system_power_invalid_messageid_call(void)
+#define PARAMETER_SIZE 2
+
+uint32_t system_power_state_set_invalid_parameters(void)
{
- int32_t status;
- uint32_t rsp_msg_hdr, cmd_msg_hdr;
- uint32_t param_count, *parameters, message_id;
- uint32_t return_value_count, attributes;
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters[PARAMETER_SIZE];
+ uint32_t message_id;
if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
return VAL_STATUS_SKIP;
- /* Sending invalid system power protocol cmd should fail */
-
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 1] Invalid command invocation");
+ /* If SYSTEM POWER STATE SET not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query system power state set cmd support");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- parameters = NULL;
- attributes = 0;
- cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER, SYSTEM_POWER_INVALID_COMMAND,
- COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
-
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
- return VAL_STATUS_FAIL;
+ message_id = SYSTEM_POWER_STATE_SET;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER,
+ SYSTEM_POWER_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
- /* Query support for invalid system power protocol command should return status NOT_FOUND */
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n SYSTEM POWER STATE SET not supported ");
+ return VAL_STATUS_SKIP;
+ }
- val_print(VAL_PRINT_DEBUG, "\n\t[Check 2] Query undefined command support");
+ /* SYSTEM power state should be not be available to non PSCI agent */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Set power state with invalid flag");
VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
- message_id = SYSTEM_POWER_INVALID_COMMAND;
- attributes = 0;
+ parameters[param_count++] = INVALID_FLAG_VAL;
+ parameters[param_count++] = SYSTEM_POWER_COLD_RESET;
cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER,
- SYSTEM_POWER_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
- val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
- &return_value_count, &attributes);
+ SYSTEM_POWER_STATE_SET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
- if (val_compare_status(status, SCMI_NOT_FOUND) != VAL_STATUS_PASS)
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
return VAL_STATUS_FAIL;
return VAL_STATUS_PASS;
diff --git a/test_pool/system_power/test_s006.c b/test_pool/system_power/test_s006.c
new file mode 100644
index 0000000000000000000000000000000000000000..4a1875a8f0b18e8b3d6f6df6f8c32fd52b16a000
--- /dev/null
+++ b/test_pool/system_power/test_s006.c
@@ -0,0 +1,71 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include"val_interface.h"
+#include"val_system_power.h"
+
+#define TEST_NUM (SCMI_SYSTEM_POWER_TEST_NUM_BASE + 6)
+#define TEST_DESC "System Power state get check "
+
+uint32_t system_power_state_get_check(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t *parameters;
+ uint32_t message_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* If SYSTEM POWER STATE GET not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query system power state get cmd support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = SYSTEM_POWER_STATE_GET;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER,
+ SYSTEM_POWER_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n SYSTEM POWER STATE GET not supported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ /* SYSTEM power state should be not be available to non PSCI agent */
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Query system power state");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters = NULL;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER,
+ SYSTEM_POWER_STATE_GET, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, parameters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_NOT_SUPPORTED) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+}
diff --git a/test_pool/system_power/test_s007.c b/test_pool/system_power/test_s007.c
new file mode 100644
index 0000000000000000000000000000000000000000..f845a749b8b2095c0b339e98b28c1530737f6572
--- /dev/null
+++ b/test_pool/system_power/test_s007.c
@@ -0,0 +1,72 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#include"val_interface.h"
+#include"val_system_power.h"
+
+#define TEST_NUM (SCMI_SYSTEM_POWER_TEST_NUM_BASE + 7)
+#define TEST_DESC "Sys pwr state nfy invalid notify_enable check"
+
+uint32_t system_power_state_notify_invalid_parameters(void)
+{
+ int32_t status;
+ uint32_t rsp_msg_hdr;
+ uint32_t cmd_msg_hdr;
+ size_t param_count;
+ size_t return_value_count;
+ uint32_t return_values[MAX_RETURNS_SIZE];
+ uint32_t parameters;
+ uint32_t message_id;
+
+ if (val_test_initialize(TEST_NUM, TEST_DESC) != VAL_STATUS_PASS)
+ return VAL_STATUS_SKIP;
+
+ /* If SYSTEM POWER STATE NOTIFY not supported, skip the test */
+ val_print(VAL_PRINT_TEST, "\n [Check 1] Query system power state notify cmd support");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ message_id = SYSTEM_POWER_STATE_NOTIFY;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER,
+ SYSTEM_POWER_PROTOCOL_MESSAGE_ATTRIBUTES, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, &message_id, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (status == SCMI_NOT_FOUND) {
+ val_print(VAL_PRINT_ERR, "\n SYSTEM POWER STATE NOTIFY not supported ");
+ return VAL_STATUS_SKIP;
+ }
+
+ val_print(VAL_PRINT_TEST, "\n [Check 2] Set power state notify invalid notify_enable");
+
+ VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, return_value_count, status);
+ parameters = INVALID_NOTIFY_EN_VAL;
+ param_count++;
+ cmd_msg_hdr = val_msg_hdr_create(PROTOCOL_SYSTEM_POWER,
+ SYSTEM_POWER_STATE_NOTIFY, COMMAND_MSG);
+ val_send_message(cmd_msg_hdr, param_count, ¶meters, &rsp_msg_hdr, &status,
+ &return_value_count, return_values);
+
+ if (val_compare_status(status, SCMI_INVALID_PARAMETERS) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ if (val_compare_msg_hdr(cmd_msg_hdr, rsp_msg_hdr) != VAL_STATUS_PASS)
+ return VAL_STATUS_FAIL;
+
+ return VAL_STATUS_PASS;
+
+}
diff --git a/val/include/pal_interface.h b/val/include/pal_interface.h
index 19668d1876e3fff64386677e3219e11c2c3958d8..be7ef2e621c9f583379385bec5114f9371524ba9 100644
--- a/val/include/pal_interface.h
+++ b/val/include/pal_interface.h
@@ -42,27 +42,71 @@
#define SCMI_NAME_STR_SIZE 16
#define NUM_ELEMS(x) (sizeof(x) / sizeof((x)[0]))
+#define MAX_RETURNS_SIZE 32
-void pal_send_message(uint32_t message_header_send, uint32_t parameter_count,
+/************ PAL API'S ****************/
+
+uint32_t pal_initialize_system(void *info);
+void pal_send_message(uint32_t message_header_send, size_t parameter_count,
const uint32_t *parameters, uint32_t *message_header_rcv, int32_t *status,
- uint32_t *return_values_count, uint32_t *return_values);
-void pal_fill_protocols_database(void);
-uint32_t pal_strcpy(uint8_t *dst_ptr, uint8_t *src_ptr);
-uint32_t pal_strcmp(uint8_t *dst_ptr, uint8_t *src_ptr, uint32_t len);
+ size_t *return_values_count, uint32_t *return_values);
void pal_print(uint32_t level, const char *string, va_list args);
-void pal_memset_zero(uint32_t length, uint32_t *buffer);
-void pal_initialize_system(void);
+void *pal_memcpy(void *dest, const void *src, size_t size);
+
+void pal_receive_delayed_response(uint32_t *message_header_rcv, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values);
+void pal_receive_notification(uint32_t *message_header_rcv, size_t *return_values_count,
+ uint32_t *return_values);
uint32_t pal_agent_get_accessible_device(uint32_t agent_id);
uint32_t pal_device_get_accessible_protocol(uint32_t device_id);
uint32_t pal_agent_get_inaccessible_device(uint32_t agent_id);
-uint32_t pal_base_get_expected_protocol_version(void);
+uint32_t pal_check_trusted_agent(uint32_t agent_id);
+
+/* BASE protocol specific API's */
char *pal_base_get_expected_vendor_name(void);
char *pal_base_get_expected_subvendor_name(void);
uint32_t pal_base_get_expected_implementation_version(void);
uint32_t pal_base_get_expected_num_agents(void);
-uint32_t pal_pwr_domain_get_expected_protocol_version(void);
-uint32_t pal_pwr_domain_get_expected_num_domains(void);
-uint32_t pal_get_expected_num_supported_protocols(void);
+uint32_t pal_base_get_expected_num_protocols(void);
+
+/* CLOCK protocol specific APS's */
+#ifdef CLOCK_PROTOCOL
uint32_t pal_clock_get_expected_num_clocks(void);
+uint32_t pal_clock_get_expected_max_async_cmd(void);
+uint32_t pal_clock_get_expected_number_of_rates(uint32_t clock_id);
+uint32_t pal_check_clock_config_change_support(uint32_t clock_id);
+#endif
+
+/* SENSOR protocol specific API's */
+#ifdef SENSOR_PROTOCOL
+uint32_t pal_sensor_get_expected_num_sensors(void);
+uint32_t pal_sensor_get_expected_stats_addr_low(void);
+uint32_t pal_sensor_get_expected_stats_addr_high(void);
+uint32_t pal_sensor_get_expected_stats_addr_len(void);
+#endif
+
+/* PERFORMANCE protocol specific API's */
+#ifdef PERFORMANCE_PROTOCOL
+uint32_t pal_performance_get_expected_num_domains(void);
+uint32_t pal_performance_get_expected_stats_addr_low(void);
+uint32_t pal_performance_get_expected_stats_addr_high(void);
+uint32_t pal_performance_get_expected_stats_addr_len(void);
+uint8_t *pal_performance_get_expected_name(uint32_t domain_id);
+uint32_t pal_performance_get_expected_number_of_level(uint32_t domain_id);
+#endif
+
+/* POWER DOMAIN protocol specific API's */
+#ifdef POWER_DOMAIN_PROTOCOL
+uint32_t pal_power_get_expected_num_domains(void);
+uint32_t pal_power_get_expected_stats_addr_low(void);
+uint32_t pal_power_get_expected_stats_addr_high(void);
+uint32_t pal_power_get_expected_stats_addr_len(void);
+#endif
+
+/* RESET protocol specific API's */
+#ifdef RESET_PROTOCOL
+uint32_t pal_reset_get_expected_num_domains(void);
+uint8_t *pal_reset_get_expected_name(uint32_t domain_id);
+#endif
#endif
diff --git a/val/include/val_base.h b/val/include/val_base.h
index d418ad9f1e24d01ec699f9eba4400e9d2a6da090..13e271a6b83b3b012be93167d06db7e231d19819 100644
--- a/val/include/val_base.h
+++ b/val/include/val_base.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, 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,11 +18,22 @@
#ifndef __VAL_BASE_H__
#define __VAL_BASE_H__
-#ifdef SCMI_VERSION_1
-#define BASE_VERSION 0x00010000
-#else
-#define BASE_VERSION 0x00020000
-#endif
+#define VERSION_OFFSET 0
+#define ATTRIBUTE_OFFSET 0
+#define VENDOR_ID_OFFSET 0
+#define IMPLEMENTATION_VERSION_OFFSET 0
+#define NUM_OF_PROTOCOLS_OFFSET 0
+#define PROTOCOL_LIST_OFFSET 1
+#define AGENT_ID_OFFSET 0
+#define AGENT_NAME_OFFSET 1
+
+#define AGENT_NAME_v1_OFFSET 0
+
+#define INVALID_NOTIFY_ENABLE 0xF
+#define INVALID_FLAG_VAL 0xF
+#define FLAG_ACCESS_ALLOW 1
+#define FLAG_ACCESS_DENY 0
+#define FLAG_RESET_ACCESS 1
typedef struct {
uint32_t num_agents;
@@ -34,4 +45,35 @@ typedef struct {
uint8_t test_agent_name[SCMI_NAME_STR_SIZE];
} BASE_INFO_s;
+/* Common Tests */
+uint32_t base_query_protocol_version(uint32_t *version);
+uint32_t base_query_protocol_attributes(void);
+uint32_t base_query_mandatory_command_support(void);
+uint32_t base_query_vendor_name(void);
+uint32_t base_query_implementation_version(void);
+uint32_t base_query_subvendor_info(void);
+uint32_t base_query_notify_error_support(void);
+uint32_t base_query_protocol_list(void);
+uint32_t base_invalid_messageid_call(void);
+
+/* v1 specific tests */
+uint32_t base_discover_agent_v1(void);
+
+/* v2 specific tests */
+uint32_t base_discover_agent(void);
+uint32_t base_set_device_permissions_check(void);
+uint32_t base_set_protocol_permissions_check(void);
+uint32_t base_reset_agent_configuration_check(void);
+uint32_t base_deny_restore_protocol_access(void);
+uint32_t base_restore_protocol_access_with_reset_agent_configuration(void);
+uint32_t base_deny_restore_device_access(void);
+uint32_t base_restore_device_access_with_reset_agent_configuration(void);
+
+/* Expected Values */
+char *val_base_get_expected_vendor_name(void);
+char *val_base_get_expected_subvendor_name(void);
+uint32_t val_base_get_expected_implementation_version(void);
+uint32_t val_base_get_expected_num_agents(void);
+uint32_t val_base_get_expected_num_protocols(void);
+
#endif
diff --git a/val/include/val_clock.h b/val/include/val_clock.h
index 5eef81ae6ab5353530504b16b1b834abb7e7d22f..b2efacaa81c9d5b9b4aee19c8f4500d3928cc8d6 100644
--- a/val/include/val_clock.h
+++ b/val/include/val_clock.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, 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,13 +18,69 @@
#ifndef __VAL_CLOCK_H__
#define __VAL_CLOCK_H__
-#define CLOCK_VERSION 0x00010000
+#define VERSION_OFFSET 0
+#define ATTRIBUTE_OFFSET 0
+#define NAME_OFFSET 1
+#define RATE_FLAG_OFFSET 0
+#define RATES_OFFSET 1
+#define RATE_LOWER_WORD_OFFSET 0
+#define RATE_UPPER_WORD_OFFSET 1
+
+#define DELAYED_RESP_CLOCK_ID_OFFSET 0
+#define DELAYED_RESP_RATE_LOWER_OFFSET 1
+#define DELAYED_RESP_RATE_UPPER_OFFSET 2
+
+
+#define INVALID_ATTRIBUTE 0xF
+#define CONFIG_SET_ENABLE 0x1
+#define CONFIG_SET_DISABLE 0x0
+#define CLOCK_SET_ASYNC_MODE 0x1
+#define CLOCK_SET_SYNC_MODE 0x0
+#define CLOCK_SET_INVALID_FLAG 0xFF
+#define MASK_FOR_LOWER_WORD 0xFFFFFFFFLL
+#define MASK_FOR_UPPER_WORD 0xFFFFFFFF00000000LL
+#define CLOCK_RATE_FMT_ARRAY 0x0
+#define CLOCK_RATE_FMT_STEP_SIZE 0x1
+
+
+#define MAX_NUM_OF_CLOCKS 10
+
+typedef struct {
+ uint64_t lowest_rate;
+ uint64_t highest_rate;
+} CLOCK_RATE_INFO_s;
typedef struct {
uint32_t num_clocks;
uint32_t max_async_cmd;
- uint32_t clock_attribute[16];
- uint8_t clock_name[16][16];
+ uint32_t clock_attribute[MAX_NUM_OF_CLOCKS];
+ uint8_t clock_name[MAX_NUM_OF_CLOCKS][SCMI_NAME_STR_SIZE];
+ CLOCK_RATE_INFO_s clock_rate[MAX_NUM_OF_CLOCKS];
} CLOCK_INFO_s;
+/* Common Tests */
+uint32_t clock_query_protocol_version(uint32_t *version);
+uint32_t clock_query_protocol_attributes(void);
+uint32_t clock_query_mandatory_command_support(void);
+uint32_t clock_invalid_messageid_call(void);
+uint32_t clock_attributes_check(void);
+uint32_t clock_attributes_check_invalid_clock_id(void);
+uint32_t clock_query_describe_rates(void);
+uint32_t clock_query_describe_rates_invalid_clock_id(void);
+uint32_t clock_rate_set_sync_check(void);
+uint32_t clock_rate_set_async_check(void);
+uint32_t clock_rate_set_invalid_param_check(void);
+uint32_t clock_rate_set_invalid_clock_id_check(void);
+uint32_t clock_rate_get_check(void);
+uint32_t clock_rate_get_invalid_clock_id_check(void);
+uint32_t clock_config_set_invalid_attr_check(void);
+uint32_t clock_config_set_invalid_clock_id_check(void);
+uint32_t clock_config_set_check(void);
+
+/* expected values */
+uint32_t val_clock_get_expected_num_clocks(void);
+uint32_t val_clock_get_expected_max_async_cmd(void);
+uint32_t val_clock_get_expected_number_of_rates(uint32_t clock_id);
+uint32_t val_check_clock_config_change_support(uint32_t clock_id);
+
#endif
diff --git a/val/include/val_interface.h b/val/include/val_interface.h
index a660072a6cef15b535c718273e59a77a2e857760..c6bf9e2853a0da01c55fa57148cfc6aecf11f4b2 100644
--- a/val/include/val_interface.h
+++ b/val/include/val_interface.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,12 +20,18 @@
#include "pal_interface.h"
+#define RUN_TEST(x) val_report_status(x)
+
+#define PROTOCOL_VERSION_1 0x00010000
+#define PROTOCOL_VERSION_2 0x00020000
+
#define SCMI_BASE_TEST_NUM_BASE 100
#define SCMI_POWER_DOMAIN_TEST_NUM_BASE 200
#define SCMI_SYSTEM_POWER_TEST_NUM_BASE 300
#define SCMI_PERFORMANCE_TEST_NUM_BASE 400
#define SCMI_CLOCK_TEST_NUM_BASE 500
#define SCMI_SENSOR_TEST_NUM_BASE 600
+#define SCMI_RESET_TEST_NUM_BASE 700
/* set PRINT_LEVEL to one of the below values in your application entry
to control the verbosity of the prints */
@@ -41,11 +47,13 @@
#define VAL_STATUS_NO_TESTS PAL_STATUS_NO_TESTS
#define VAL_RESERVED_BYTE_ZERO 0x00
-#define VAL_EXTRACT_BITS(data, start, end) ((data >> start) & ((1ul << (end-start+1))-1))
+#define VAL_EXTRACT_BITS(data, start, end) ((data >> start) & ((1ul << (end - start + 1)) - 1))
+#define VAL_GET_64BIT_DATA(upper, lower) ((((uint64_t)upper) << 32) | lower)
#define VAL_INIT_TEST_PARAM(param_count, rsp_msg_hdr, ret_value_count, status) \
{param_count = 0; rsp_msg_hdr = 0; ret_value_count = 0; status = SCMI_GENERIC_ERROR; }
-typedef uint32_t (*test_fn_ptr)(void);
+#define VAL_ERR_PRINT_ID_ENABLED 1
+#define VAL_ERR_PRINT_ID_DISABLED 0
/* GENERIC VAL APIs */
@@ -78,31 +86,44 @@ typedef enum {
PROTOCOL_PERFORMANCE,
PROTOCOL_CLOCK,
PROTOCOL_SENSOR,
+ PROTOCOL_RESET,
PROTOCOL_MAX
} PROTOCOL_IDENTIFIER;
-test_fn_ptr *val_get_testlist(uint32_t protocol_identifier, uint32_t *num_tests);
uint32_t val_strcpy(uint8_t *dst_ptr, uint8_t *src_ptr);
uint32_t val_strcmp(uint8_t *dst_ptr, uint8_t *src_ptr, uint32_t len);
-uint32_t val_compare_msg_hdr(uint32_t sent_msg_hdr, uint32_t rcvd_msg_hdr);
+uint32_t val_compare_msg_hdr(uint32_t sent_msg_hdr, uint32_t rsp_msg_hdr);
uint32_t val_protocol_version_check(uint32_t exp_version, uint32_t version);
uint32_t val_reserved_bits_check_is_zero(uint32_t reserved_bits);
void val_print(uint32_t level, const char *string, ...);
-void val_memset_zero(uint32_t *buffer, uint32_t length);
+void val_memset(void *ptr, int value, size_t length);
uint32_t val_msg_hdr_create(uint32_t protoco_id, uint32_t msg_id, uint32_t msg_type);
char *val_get_result_string(uint32_t test_status);
char *val_get_protocol_str(uint32_t protocol_id);
char *val_get_status_string(int32_t status);
-void val_send_message(uint32_t msg_hdr, uint32_t num_parameter, uint32_t *parameter_buffer,
- uint32_t *rcvd_msg_hdr, int32_t *status, uint32_t *rcvd_buffer_size,
- uint32_t *rcvd_buffer);
-void val_initialize_system(void);
+uint32_t val_compare_return_count(uint32_t received, uint32_t expected);
+void val_send_message(uint32_t msg_hdr, size_t num_parameter, uint32_t *parameter_buffer,
+ uint32_t *rcvd_msg_hdr, int32_t *status, size_t *rcvd_buffer_size, uint32_t *rcvd_buffer);
+void val_receive_delayed_response(uint32_t *message_header_rcv, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values);
+void val_receive_notification(uint32_t *message_header_rcv, size_t *return_values_count,
+ uint32_t *return_values);
+uint32_t val_initialize_system(void *info);
uint32_t val_test_initialize(uint32_t test_num, char *test_desc);
-uint32_t val_execute_tests(uint32_t protocol_identifier);
+void val_print_return_values(uint32_t count, uint32_t *values);
uint32_t val_compare_status(int32_t status, int32_t expected_status);
uint32_t val_agent_get_accessible_device(uint32_t agent_id);
uint32_t val_device_get_accessible_protocol(uint32_t device_id);
uint32_t val_agent_get_inaccessible_device(uint32_t agent_id);
+void val_agent_set_supported_protocol_list(uint32_t protocol_list);
+uint32_t val_agent_check_protocol_support(uint32_t protocol);
+uint32_t val_check_trusted_agent(uint32_t agent_id);
+uint32_t val_report_status(uint32_t status);
+uint32_t val_get_test_passed(void);
+uint32_t val_get_test_failed(void);
+uint32_t val_get_test_skipped(void);
+uint32_t val_compare(char *parameter, uint32_t rcvd_val, uint32_t exp_val);
+uint32_t val_compare_str(char *parameter, char *rcvd_val, char *exp_val, uint32_t len);
/* BASE VAL APIs */
@@ -139,7 +160,7 @@ typedef enum {
void val_base_save_info(uint32_t param_identifier, uint32_t param_value);
void val_base_save_name(uint32_t param_identifier, uint8_t *vendor_name);
uint32_t val_base_get_info(uint32_t param_identifier);
-uint32_t val_base_get_expected_protocol_version(void);
+uint32_t val_base_execute_tests(void);
/* POWER DOMAIN VAL APIs */
@@ -174,7 +195,7 @@ typedef enum {
uint32_t val_power_domain_get_info(uint32_t pd_id, uint32_t param_identifier);
void val_power_domain_save_info(uint32_t param_identifier, uint32_t domain_id,
uint32_t param_value);
-uint32_t val_power_domain_get_expected_protocol_version(void);
+uint32_t val_power_domain_execute_tests(void);
/* SYSTEM POWER VAL APIs */
@@ -197,8 +218,17 @@ typedef enum {
SYSTEM_SUSPEND_SUPPORT
} SYSTEM_POWER_INFO;
+typedef enum {
+ SYSTEM_POWER_SHUTDOWN,
+ SYSTEM_POWER_COLD_RESET,
+ SYSTEM_POWER_WARM_RESET,
+ SYSTEM_POWER_POWER_UP,
+ SYSTEM_POWER_SUSPEND,
+ SYSTEM_POWER_RESERVED,
+} SYSTEM_POWER_STATES;
+
void val_system_power_save_info(uint32_t param_identifier, uint32_t param_value);
-uint32_t val_system_power_get_expected_protocol_version(void);
+uint32_t val_system_power_execute_tests(void);
/* PERFORMANCE VAL APIs */
@@ -214,7 +244,8 @@ typedef enum {
PERFORMANCE_LEVEL_GET,
PERFORMANCE_NOTIFY_LIMITS,
PERFORMANCE_NOTIFY_LEVEL,
- PERFORMANCE_DESCRIBE_FASTCHANNEL
+ PERFORMANCE_DESCRIBE_FASTCHANNEL,
+ PERFORMANCE_INVALID_COMMAND
} PERFORMANCE_COMMANDS;
typedef enum {
@@ -226,11 +257,22 @@ typedef enum {
NUM_PERF_DOMAINS,
PERF_STATS_ADDR_LOW,
PERF_STATS_ADDR_HIGH,
- PERF_STATS_ADDR_LEN
+ PERF_STATS_ADDR_LEN,
+ PERF_DOMAIN_NAME,
+ PERF_MESSAGE_FAST_CH_SUPPORT,
+ PERF_DOMAIN_FAST_CH_SUPPORT,
+ PERF_DOMAIN_LVL_CHANGE_NTFY_SUPPORT,
+ PERF_DOMAIN_LIMIT_CHANGE_NTFY_SUPPORT,
+ PERF_DOMAIN_SET_PERFORMANCE_LEVEL_SUPPORT,
+ PERF_DOMAIN_SET_PERFORMANCE_LIMIT_SUPPORT,
+ PERF_DOMAIN_MAX_LEVEL,
+ PERF_DOMAIN_MIN_LEVEL,
+ PERF_DOMAIN_INTERMEDIATE_LEVEL,
} PERFORMANCE_DOMAIN_INFO;
-void val_performance_save_info(uint32_t param_identifier, uint32_t param_value);
-uint32_t val_performance_get_expected_protocol_version(void);
+void val_performance_save_info(uint32_t param_identifier, uint32_t perf_id, uint32_t param_value);
+uint32_t val_performance_get_info(uint32_t param_identifier, uint32_t perf_id);
+uint32_t val_performance_execute_tests(void);
/* CLOCK VAL APIs */
@@ -254,13 +296,17 @@ typedef enum {
NUM_CLOCKS,
CLOCK_MAX_PENDING_ASYNC_CMD,
CLOCK_ATTRIBUTE,
- CLOCK_NAME
+ CLOCK_NAME,
+ CLOCK_LOWEST_RATE,
+ CLOCK_HIGHEST_RATE
} CLOCK_INFO;
void val_clock_save_info(uint32_t param_identifier, uint32_t clock_id, uint32_t param_value);
+void val_clock_save_rate(uint32_t param_identifier, uint32_t clock_id, uint64_t param_value);
void val_clock_save_name(uint32_t param_identifier, uint32_t clock_id, uint8_t *param_value);
uint32_t val_clock_get_info(uint32_t param_identifier, uint32_t clock_id);
-uint32_t val_clock_get_expected_protocol_version(void);
+uint64_t val_clock_get_rate(uint32_t param_identifier, uint32_t clock_id);
+uint32_t val_clock_execute_tests(void);
/* SENSOR VAL APIs */
@@ -287,11 +333,46 @@ typedef enum {
NUM_SENSORS,
SENSOR_STATS_ADDR_LOW,
SENSOR_STATS_ADDR_HIGH,
- SENSOR_STATS_ADDR_LEN
+ SENSOR_STATS_ADDR_LEN,
+ SENSOR_NUM_OF_TRIP_POINTS,
+ SENSOR_ASYNC_READ_SUPPORT
} SENSOR_INFO;
void val_sensor_save_info(uint32_t param_identifier, uint32_t param_value);
-uint32_t val_sensor_get_expected_protocol_version(void);
uint32_t val_sensor_get_info(uint32_t param_identifier);
+void val_sensor_save_desc_info(uint32_t param_identifier, uint32_t sensor_id,
+ uint32_t param_value);
+uint32_t val_sensor_get_desc_info(uint32_t param_identifier, uint32_t sensor_id);
+uint32_t val_sensor_execute_tests(void);
+
+/* Reset protocol defines & APIs*/
+
+typedef enum {
+ RESET_PROTOCOL_VERSION = 0x0,
+ RESET_PROTOCOL_ATTRIBUTES,
+ RESET_PROTOCOL_MESSAGE_ATTRIBUTES,
+ RESET_DOMAIN_ATTRIBUTES,
+ RESET_PROTOCOL_RESET,
+ RESET_PROTOCOL_NOTIFY,
+ RESET_INVALID_COMMAND
+} RESET_COMMANDS;
+
+typedef enum {
+ RESET_COMPLETE = 0x04
+} RESET_DELAYED_RESPONSE;
+
+typedef enum {
+ RESET_ISSUED = 0x0
+} RESET_NOTIFICATIONS;
+
+typedef enum {
+ NUM_RESET_DOMAINS,
+ RESET_ASYNC_SUPPORT,
+ RESET_NOTIFY_SUPPORT
+} RESET_INFO;
+
+void val_reset_save_info(uint32_t param_identifier, uint32_t domain_id, uint32_t param_value);
+uint32_t val_reset_get_info(uint32_t param_identifier, uint32_t domain_id);
+uint32_t val_reset_execute_tests(void);
#endif
diff --git a/val/include/val_performance.h b/val/include/val_performance.h
index 9984ccff599792b80966592977d19183e1a6f49d..2b4b43232193f9606d62f5e8e0ef5fca1f35bd58 100644
--- a/val/include/val_performance.h
+++ b/val/include/val_performance.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, 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,17 +18,115 @@
#ifndef __VAL_PERFORMANCE_H__
#define __VAL_PERFORMANCE_H__
-#ifdef SCMI_VERSION_1
-#define PERFORMANCE_VERSION 0x00010000
-#else
-#define PERFORMANCE_VERSION 0x00020000
-#endif
+#define MAX_PERFORMANCE_DOMAINS 16
+#define MAX_PERFORMANCE_LEVELS 16
+
+#define NOT_SUPPORTED 0
+#define VERSION_OFFSET 0
+#define ATTRIBUTE_OFFSET 0
+#define STATS_ADDR_LOW_OFFSET 1
+#define STATS_ADDR_HIGH_OFFSET 2
+#define STATS_LENGTH_OFFSET 3
+#define RATE_LIMIT_OFFSET 1
+#define FREQUENCY_OFFSET 2
+#define SUSTAINED_LEVEL_OFFSET 3
+#define NAME_OFFSET 4
+#define NUM_LEVEL_OFFSET 0
+#define PERF_LEVEL_ARRAY_OFFSET 1
+#define RANGE_MAX_OFFSET 0
+#define RANGE_MIN_OFFSET 1
+#define PERFORMANCE_LEVEL_OFFSET 0
+#define FAST_CH_RATE_LIMIT_OFFSET 1
+#define CHAN_ADDR_LOW_OFFSET 2
+#define CHAN_ADDR_HIGH_OFFSET 3
+#define CHAN_SIZE_OFFSET 4
+#define DOORBELL_ADDR_LOW_OFFSET 5
+#define DOORBELL_ADDR_HIGH_OFFSET 6
+#define DOORBELL_MASK_LOW_OFFSET 7
+#define DOORBELL_MASK_HIGH_OFFSET 8
+#define DOORBELL_PRESERVE_LOW_OFFSET 9
+#define DOORBELL_PRESERVE_HIGH_OFFSET 10
+
+#define NOTIFICATION_DOMAIN_ID_OFFSET 1
+#define NOTIFICATION_RANGE_MAX_OFFSET 2
+#define NOTIFICATION_RANGE_MIN_OFFSET 3
+#define NOTIFICATION_LEVEL_OFFSET 2
+
+#define INVALID_NOTIFY_EN_VAL 0xFF
+#define NOTIFY_ENABLE 1
+#define NOTIFY_DISABLE 0
+
+typedef struct {
+ uint8_t performance_limits_set;
+ uint8_t performance_limits_get;
+ uint8_t performance_level_set;
+ uint8_t performance_level_get;
+} PERFORMANCE_CMD_FAST_CH_SUPPORT_s;
+
+typedef struct {
+ uint8_t name[SCMI_NAME_STR_SIZE];
+ uint8_t fast_ch_support;
+ uint8_t Perf_lvl_change_ntfy_support;
+ uint8_t Perf_limit_change_ntfy_support;
+ uint8_t set_performance_level_support;
+ uint8_t set_performance_limit_support;
+ uint32_t maximum_level;
+ uint32_t minimum_level;
+ uint32_t intermediate_level;
+} PERFORMANCE_DOMAIN_INFO_s;
typedef struct {
uint32_t num_perf_domains;
uint32_t perf_stats_addr_low;
uint8_t perf_stats_addr_high;
uint8_t perf_stats_addr_len;
+ PERFORMANCE_CMD_FAST_CH_SUPPORT_s perf_fast_cmd_ch_support;
+ PERFORMANCE_DOMAIN_INFO_s perf_domain_info[MAX_PERFORMANCE_DOMAINS];
} PERFORMANCE_INFO_s;
+/* Common Tests */
+uint32_t performance_query_protocol_version(uint32_t *version);
+uint32_t performance_query_protocol_attributes(void);
+uint32_t performance_query_describe_levels(void);
+uint32_t performance_query_set_limit(void);
+uint32_t performance_query_set_level(void);
+uint32_t performance_invalid_messageid_call(void);
+uint32_t performance_query_domain_attributes_invalid_domain(void);
+uint32_t performance_query_describe_levels_invalid_domain(void);
+uint32_t performance_query_set_limit_invalid_range(void);
+uint32_t performance_query_set_limit_invalid_domain(void);
+uint32_t performance_query_get_limit_invalid_domain(void);
+uint32_t performance_query_set_level_invalid_domain(void);
+uint32_t performance_query_set_level_invalid_range(void);
+uint32_t performance_query_get_level_invalid_domain(void);
+uint32_t performance_query_notify_level_invalid_domain(void);
+uint32_t performance_query_notify_level_invalid_parameters(void);
+uint32_t performance_query_notify_limit_invalid_domain(void);
+uint32_t performance_query_notify_limit_invalid_parameters(void);
+uint32_t performance_limit_set_async(void);
+uint32_t performance_level_set_async(void);
+
+/* V1 Tests */
+uint32_t performance_query_mandatory_command_support_v1(void);
+uint32_t performance_query_domain_attributes_v1(void);
+
+/* V2 Tests */
+uint32_t performance_query_mandatory_command_support(void);
+uint32_t performance_query_domain_attributes(void);
+uint32_t performance_query_describe_fast_channel(void);
+uint32_t performance_query_describe_fast_channel_invalid_domain(void);
+uint32_t performance_query_describe_fast_channel_invalid_message(void);
+uint32_t performance_query_describe_fast_channel_unsupported_domain(void);
+uint32_t performance_query_describe_fast_channel_unsupported_message(void);
+uint32_t performance_level_get_fast_channel(void);
+uint32_t performance_limits_get_fast_channel(void);
+
+/* Get expected*/
+uint32_t val_performance_get_expected_num_domains(void);
+uint32_t val_performance_get_expected_stats_addr_low(void);
+uint32_t val_performance_get_expected_stats_addr_high(void);
+uint32_t val_performance_get_expected_stats_addr_len(void);
+uint8_t *val_performance_get_expected_name(uint32_t domain_id);
+uint32_t val_performance_get_expected_number_of_level(uint32_t domain_id);
+
#endif
diff --git a/val/include/val_power_domain.h b/val/include/val_power_domain.h
index b417aa4d6ad67892f2dc6b656d34c5fea7b51f38..33d788d1466fd4a7b60ed1dd2839fa8e9d47dabe 100644
--- a/val/include/val_power_domain.h
+++ b/val/include/val_power_domain.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,11 +20,21 @@
#define MAX_POWER_DOMAINS 10
-#ifdef SCMI_VERSION_1
-#define POWER_DOMAIN_VERSION 0x00010000
-#else
-#define POWER_DOMAIN_VERSION 0x00020000
-#endif
+#define VERSION_OFFSET 0
+#define ATTRIBUTE_OFFSET 0
+#define STATS_ADDR_LOW_OFFSET 1
+#define STATS_ADDR_HIGH_OFFSET 2
+#define STATS_LENGTH_OFFSET 3
+#define DOMAIN_NAME_OFFSET 1
+#define POWER_STATE_OFFSET 0
+
+#define INVALID_SYNC_FLAG 0xF
+#define INVALID_ASYNC_FLAG 0xE
+#define POWER_STATE_ON 0
+#define INVALID_POWER_STATE 0xFF000000
+#define SYNC_POWER_STATE_CHANGE 0
+#define NOTIFY_ENABLE 1
+#define INVALID_NOTIFY_ENABLE 0xF
typedef struct {
uint32_t num_power_domain;
@@ -37,4 +47,29 @@ typedef struct {
uint8_t pd_name[MAX_POWER_DOMAINS][SCMI_NAME_STR_SIZE];
} POWER_DOMAIN_INFO_s;
+/* Common Tests */
+uint32_t power_domain_query_protocol_version(uint32_t *version);
+uint32_t power_domain_query_protocol_attributes(void);
+uint32_t power_domain_query_mandatory_command_support(void);
+uint32_t power_domain_invalid_messageid_call(void);
+uint32_t power_domain_query_domain_attributes(void);
+uint32_t power_domain_query_domain_attributes_invalid_doamin(void);
+uint32_t power_domain_set_power_state_check(void);
+uint32_t power_domain_set_power_state_unsupported_domain_check(void);
+uint32_t power_domain_set_power_state_check_invalid_domain(void);
+uint32_t power_domain_get_power_state_check(void);
+uint32_t power_domain_get_power_state_check_invalid_domain(void);
+uint32_t power_domain_power_state_notify_check(void);
+uint32_t power_domain_power_state_notify_unspported_domain_check(void);
+uint32_t power_domain_power_state_notify_invalid_domain_check(void);
+
+/* v2 Tests */
+uint32_t power_domain_power_state_change_requested_notify_check(void);
+uint32_t power_domain_power_state_change_requested_notify_invalid_domain_check(void);
+
+uint32_t val_power_get_expected_num_domains(void);
+uint32_t val_power_get_expected_stats_addr_low(void);
+uint32_t val_power_get_expected_stats_addr_high(void);
+uint32_t val_power_get_expected_stats_addr_len(void);
+
#endif
diff --git a/val/include/val_reset.h b/val/include/val_reset.h
new file mode 100644
index 0000000000000000000000000000000000000000..39c5accce223d64c82d28ce9269feba0172691cf
--- /dev/null
+++ b/val/include/val_reset.h
@@ -0,0 +1,66 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+
+#ifndef __VAL_RESET_H__
+#define __VAL_RESET_H__
+
+#define MAX_NUM_OF_DOMAINS 5
+
+#define VERSION_OFFSET 0
+#define ATTRIBUTE_OFFSET 0
+#define LATANCY_OFFSET 1
+#define NAME_OFFSET 2
+
+#define ARCH_COLD_RESET 0
+#define EXPLICIT_SYNC_DEASSERT_RESET 0
+#define INVALID_FLAG_VAL 0xF8
+#define RESET_FLAG_ASYNC_RESET_BIT 0x2
+#define RESET_FLAG_AUTONOMOUS_RESET_BIT 0x0
+#define RESET_TYPE_BIT 31
+#define RESET_TYPE_ARCHITECTURAL 0x0
+#define RESET_ARCHITECTURAL_INVALID_ID 0xFF
+#define RESET_NOTIFY_DISABLE 0x0
+#define RESET_INVALID_NOTIFY_ENABLE 0xF
+
+
+typedef struct {
+ uint32_t async_support;
+ uint32_t notify_support;
+} RESET_DOMAIN_INFO_s;
+
+typedef struct {
+ uint32_t num_domains;
+ RESET_DOMAIN_INFO_s domain_info[MAX_NUM_OF_DOMAINS];
+} RESET_INFO_s;
+
+/* Common Tests */
+uint32_t reset_query_protocol_version(uint32_t *version);
+uint32_t reset_query_protocol_attributes(void);
+uint32_t reset_query_mandatory_command_support(void);
+uint32_t reset_invalid_messageid_call(void);
+uint32_t reset_query_domain_attributes(void);
+uint32_t reset_query_domain_attributes_invalid_id(void);
+uint32_t reset_query_reset_command_invalid_id(void);
+uint32_t reset_query_reset_command_invalid_flag(void);
+uint32_t reset_query_reset_command_invalid_reset_state(void);
+uint32_t reset_query_notify_invalid_id(void);
+uint32_t reset_query_invalid_notify_enable(void);
+
+uint32_t val_reset_get_expected_num_domains(void);
+uint8_t *val_reset_get_expected_name(uint32_t domain_id);
+
+#endif /*__VAL_RESET_H__*/
diff --git a/val/include/val_sensor.h b/val/include/val_sensor.h
index 28c06a7245dd1fc5e94a823f9a8b087827f3d473..586c84e6b469d7caf42cb99a7c147d78b02577b9 100644
--- a/val/include/val_sensor.h
+++ b/val/include/val_sensor.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, 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,13 +18,69 @@
#ifndef __VAL_SENSOR_H__
#define __VAL_SENSOR_H__
-#define SENSOR_VERSION 0x00010000
+#define MAX_NUM_OF_SENSORS 32
+
+#define VERSION_OFFSET 0
+#define ATTRIBUTE_OFFSET 0
+#define REG_ADDR_LOW_OFFSET 1
+#define REG_ADDR_HIGH_OFFSET 2
+#define REG_LENGTH_OFFSET 3
+#define NUM_SENSOR_FLAG_OFFSET 0
+#define DESC_OFFSET 1
+#define SENSOR_VAL_LOW_OFFSET 0
+#define SENSOR_VAL_HIGH_OFFSET 1
+
+#define DELAYED_RESP_SENSOR_ID_OFFSET 0
+#define DELAYED_RESP_SENSOR_VAL_LOW_OFFSET 1
+#define DELAYED_RESP_SENSOR_VAL_HIGH_OFFSET 2
+
+#define INVALID_FLAG_VAL 0xF
+#define SENSOR_READ_ASYNC_MODE 0x1
+#define SENSOR_READ_SYNC_MODE 0x0
+#define TRIP_POINT_NFY_ENABLE 0x1
+#define TRIP_POINT_NFY_DISABLE 0x0
+#define EVENT_CTRL_INVALID_VAL 0xF
+#define TRIP_POINT_DISABLE 0x0
+#define TRIP_POINT_DEFAULT_LOW_VAL 0x0
+#define TRIP_POINT_DEFAULT_HIGH_VAL 0x0
+#define TRIP_POINT_CROSSED_POISTIVE_DIR 0x1
+#define TRIP_POINT_CROSSED_NEGETIVE_DIR 0x2
+#define TRIP_POINT_CROSSED_EITHER_DIR 0x3
+#define TRIP_POINT_ID_LOW 0x4
+
+typedef struct {
+ uint32_t num_trip_points;
+ uint32_t async_read_support;
+} SENSOR_DESC_INFO_s;
typedef struct {
uint32_t num_sensors;
uint32_t sensor_stats_addr_low;
uint8_t sensor_stats_addr_high;
uint8_t sensor_stats_addr_len;
+ SENSOR_DESC_INFO_s desc_info[MAX_NUM_OF_SENSORS];
} SENSOR_INFO_s;
+/* Common Tests */
+uint32_t sensor_query_protocol_version(uint32_t *version);
+uint32_t sensor_query_protocol_attributes(void);
+uint32_t sensor_query_mandatory_command_support(void);
+uint32_t sensor_invalid_messageid_call(void);
+uint32_t sensor_query_description_get(void);
+uint32_t sensor_trip_point_nfy_event_ctrl_check(void);
+uint32_t sensor_trip_point_nfy_invalid_id_check(void);
+uint32_t sensor_trip_point_config_invalid_param_check(void);
+uint32_t sensor_trip_point_config_invalid_id_check(void);
+uint32_t sensor_trip_point_config_check(void);
+uint32_t sensor_reading_get_invalid_flag_check(void);
+uint32_t sensor_reading_get_invalid_id_check(void);
+uint32_t sensor_reading_get_sync_mode(void);
+uint32_t sensor_reading_get_async_mode(void);
+uint32_t sensor_reading_get_async_mode_not_supported(void);
+
+uint32_t val_sensor_get_expected_num_sensors(void);
+uint32_t val_sensor_get_expected_stats_addr_low(void);
+uint32_t val_sensor_get_expected_stats_addr_high(void);
+uint32_t val_sensor_get_expected_stats_addr_len(void);
+
#endif
diff --git a/val/include/val_system_power.h b/val/include/val_system_power.h
index 20d0e33a4165b93c0e06b45395437b0642546749..9cf6658dc578dcc8d9f270d072620b0f373d2d11 100644
--- a/val/include/val_system_power.h
+++ b/val/include/val_system_power.h
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, 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,11 +18,24 @@
#ifndef __VAL_SYSTEM_POWER_H__
#define __VAL_SYSTEM_POWER_H__
-#define SYSTEM_POWER_VERSION 0x00010000
+#define VERSION_OFFSET 0
+#define ATTRIBUTE_OFFSET 0
+
+#define INVALID_FLAG_VAL 0xF
+#define INVALID_NOTIFY_EN_VAL 0xF
typedef struct {
uint32_t system_power_reset_support;
uint32_t system_power_suspend_support;
} SYSTEM_POWER_INFO_s;
+/* Common Tests */
+uint32_t system_power_query_protocol_version(uint32_t *version);
+uint32_t system_power_query_protocol_attributes(void);
+uint32_t system_power_query_mandatory_command_support(void);
+uint32_t system_power_invalid_messageid_call(void);
+uint32_t system_power_state_get_check(void);
+uint32_t system_power_state_set_invalid_parameters(void);
+uint32_t system_power_state_notify_invalid_parameters(void);
+
#endif
diff --git a/val/val_base.c b/val/val_base.c
index cfa33bdf4967a9c80d93a3849e75d8e83066f71b..9e618f360cb767a16bcb25d6c44671849069ff80 100644
--- a/val/val_base.c
+++ b/val/val_base.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,6 +20,48 @@
BASE_INFO_s g_base_info_table;
+/**
+ @brief This API is called from app layer to execute base tests
+ @param none
+ @return test execution result
+**/
+uint32_t val_base_execute_tests(void)
+{
+ uint32_t version = 0;
+
+ val_memset((void *)&g_base_info_table, 0, sizeof(g_base_info_table));
+
+ if (RUN_TEST(base_query_protocol_version(&version)))
+ return VAL_STATUS_FAIL;
+
+ RUN_TEST(base_query_protocol_attributes());
+ RUN_TEST(base_query_mandatory_command_support());
+ RUN_TEST(base_invalid_messageid_call());
+ RUN_TEST(base_query_vendor_name());
+ RUN_TEST(base_query_subvendor_info());
+ RUN_TEST(base_query_implementation_version());
+ RUN_TEST(base_query_protocol_list());
+ if (version == PROTOCOL_VERSION_1) {
+ RUN_TEST(base_discover_agent_v1());
+ }
+ if (version == PROTOCOL_VERSION_2) {
+ RUN_TEST(base_discover_agent());
+ }
+ RUN_TEST(base_query_notify_error_support());
+
+ if (version == PROTOCOL_VERSION_2) {
+ RUN_TEST(base_set_device_permissions_check());
+ RUN_TEST(base_deny_restore_device_access());
+ RUN_TEST(base_set_protocol_permissions_check());
+ RUN_TEST(base_deny_restore_protocol_access());
+ RUN_TEST(base_reset_agent_configuration_check());
+ RUN_TEST(base_restore_device_access_with_reset_agent_configuration());
+ RUN_TEST(base_restore_protocol_access_with_reset_agent_configuration());
+ }
+
+ return VAL_STATUS_PASS;
+}
+
/**
@brief This API is used to set base protocol info
1. Caller - Test Suite.
@@ -42,7 +84,7 @@ void val_base_save_info(uint32_t param_identifier, uint32_t param_value)
g_base_info_table.test_agent_id = param_value;
break;
default:
- val_print(VAL_PRINT_WARN, "\nUnidentified base parameter %d", param_identifier);
+ val_print(VAL_PRINT_ERR, "\nUnidentified base parameter %d", param_identifier);
}
}
@@ -72,7 +114,7 @@ uint32_t val_base_get_info(uint32_t param_identifier)
param_value = g_base_info_table.implementation_version;
break;
default:
- val_print(VAL_PRINT_WARN, "\nUnidentified parameter %d", param_identifier);
+ val_print(VAL_PRINT_ERR, "\nUnidentified parameter %d", param_identifier);
}
return param_value;
@@ -100,20 +142,56 @@ void val_base_save_name(uint32_t param_identifier, uint8_t *param_value)
val_strcpy(&(g_base_info_table.test_agent_name[0]), param_value);
break;
default:
- val_print(VAL_PRINT_WARN, "\nUnidentified parameter %d", param_identifier);
+ val_print(VAL_PRINT_ERR, "\nUnidentified parameter %d", param_identifier);
}
}
/**
- @brief This API is used to get base protocol implemented version
- 1. Caller - Test Suite.
- 2. Prerequisite - Base protocol info table.
+ @brief This API is used for checking vendor name
+ @param none
+ @return vendor name
+**/
+char *val_base_get_expected_vendor_name(void)
+{
+ return pal_base_get_expected_vendor_name();
+}
+
+/**
+ @brief This API is used for checking subvendor name
@param none
- @return base protocol version
+ @return subvendor name
**/
-uint32_t val_base_get_expected_protocol_version(void)
+char *val_base_get_expected_subvendor_name(void)
{
- return BASE_VERSION;
+ return pal_base_get_expected_subvendor_name();
}
+/**
+ @brief This API is used for checking implementation version
+ @param none
+ @return implementation version
+**/
+uint32_t val_base_get_expected_implementation_version(void)
+{
+ return pal_base_get_expected_implementation_version();
+}
+/**
+ @brief This API is used for checking num of agents
+ @param none
+ @return num of agents
+**/
+uint32_t val_base_get_expected_num_agents(void)
+{
+ return pal_base_get_expected_num_agents();
+}
+
+/**
+ @brief This API is used for checking num of protocols
+ @param none
+ @return num of protocols agent have access
+**/
+uint32_t val_base_get_expected_num_protocols(void)
+{
+ return pal_base_get_expected_num_protocols();
+}
diff --git a/val/val_clock.c b/val/val_clock.c
index 1f26436532b0e92838bdacd82f5c448b50c85e47..06741d0b1162fa9141e2a98268c572936e3a2964 100644
--- a/val/val_clock.c
+++ b/val/val_clock.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,11 +14,50 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
+#ifdef CLOCK_PROTOCOL
#include "val_interface.h"
#include "val_clock.h"
-CLOCK_INFO_s g_clock_info_table;
+static CLOCK_INFO_s g_clock_info_table;
+
+/**
+ @brief This API is called from app layer to execute clock tests
+ @param none
+ @return test execution result
+**/
+uint32_t val_clock_execute_tests(void)
+{
+ uint32_t version = 0;
+
+ val_memset((void *)&g_clock_info_table, 0, sizeof(g_clock_info_table));
+
+ if (val_agent_check_protocol_support(PROTOCOL_CLOCK)) {
+ if (RUN_TEST(clock_query_protocol_version(&version)))
+ return VAL_STATUS_FAIL;
+
+ RUN_TEST(clock_query_protocol_attributes());
+ RUN_TEST(clock_query_mandatory_command_support());
+ RUN_TEST(clock_invalid_messageid_call());
+ RUN_TEST(clock_attributes_check());
+ RUN_TEST(clock_attributes_check_invalid_clock_id());
+ RUN_TEST(clock_query_describe_rates());
+ RUN_TEST(clock_query_describe_rates_invalid_clock_id());
+ RUN_TEST(clock_rate_set_sync_check());
+ RUN_TEST(clock_rate_set_async_check());
+ RUN_TEST(clock_rate_set_invalid_param_check());
+ RUN_TEST(clock_rate_set_invalid_clock_id_check());
+ RUN_TEST(clock_rate_get_check());
+ RUN_TEST(clock_rate_get_invalid_clock_id_check());
+ RUN_TEST(clock_config_set_invalid_attr_check());
+ RUN_TEST(clock_config_set_invalid_clock_id_check());
+ RUN_TEST(clock_config_set_check());
+ }
+ else
+ val_print(VAL_PRINT_ERR, "\n Calling agent have no access to CLOCK protocol");
+
+ return VAL_STATUS_PASS;
+}
/**
@brief This API is used to save clock protocol info
@@ -47,6 +86,32 @@ void val_clock_save_info(uint32_t param_identifier, uint32_t clock_id, uint32_t
}
}
+/**
+ @brief This API is used to save clock rate info
+ 1. Caller - Test Suite.
+ 2. Prerequisite - Base protocol info table.
+ @param param_identifier id of parameter which will be set
+ @param clock_id clock id
+ @param param_value value of parameter
+ @return none
+**/
+void val_clock_save_rate(uint32_t param_identifier, uint32_t clock_id, uint64_t param_value)
+{
+ switch (param_identifier)
+ {
+ case CLOCK_LOWEST_RATE:
+ g_clock_info_table.clock_rate[clock_id].lowest_rate =
+ param_value;
+ break;
+ case CLOCK_HIGHEST_RATE:
+ g_clock_info_table.clock_rate[clock_id].highest_rate =
+ param_value;
+ break;
+ default:
+ val_print(VAL_PRINT_ERR, "\nUnidentified parameter %d", param_identifier);
+ }
+}
+
/**
@brief This API is used to get clock protocol info
1. Caller - Test Suite.
@@ -67,6 +132,38 @@ uint32_t val_clock_get_info(uint32_t param_identifier, uint32_t clock_id)
case CLOCK_MAX_PENDING_ASYNC_CMD:
param_value = g_clock_info_table.max_async_cmd;
break;
+ case CLOCK_ATTRIBUTE:
+ param_value = g_clock_info_table.clock_attribute[clock_id];
+ break;
+ default:
+ val_print(VAL_PRINT_ERR, "\nUnidentified parameter %d", param_identifier);
+ }
+
+ return param_value;
+}
+
+/**
+ @brief This API is used to get clock protocol info
+ 1. Caller - Test Suite.
+ 2. Prerequisite - Base protocol info table.
+ @param param_identifier id of parameter which will be set
+ @param clock_id clock id
+ @return param_value value of the parameter
+**/
+uint64_t val_clock_get_rate(uint32_t param_identifier, uint32_t clock_id)
+{
+ uint64_t param_value = 0;
+
+ switch (param_identifier)
+ {
+ case CLOCK_LOWEST_RATE:
+ param_value =
+ g_clock_info_table.clock_rate[clock_id].lowest_rate;
+ break;
+ case CLOCK_HIGHEST_RATE:
+ param_value =
+ g_clock_info_table.clock_rate[clock_id].highest_rate;
+ break;
default:
val_print(VAL_PRINT_ERR, "\nUnidentified parameter %d", param_identifier);
}
@@ -95,13 +192,43 @@ void val_clock_save_name(uint32_t param_identifier, uint32_t clock_id, uint8_t *
}
/**
- @brief This API is used to get clock protocol implemented version
- 1. Caller - Test Suite.
- 2. Prerequisite - clock protocol info table.
+ @brief This API is used for checking num of clocks
@param none
- @return clock protocol version
+ @return num of clocks
**/
-uint32_t val_clock_get_expected_protocol_version(void)
+uint32_t val_clock_get_expected_num_clocks(void)
{
- return CLOCK_VERSION;
+ return pal_clock_get_expected_num_clocks();
}
+
+/**
+ @brief This API is used for checking max num of async cmds supported
+ @param none
+ @return max num of async cmds supported
+**/
+uint32_t val_clock_get_expected_max_async_cmd(void)
+{
+ return pal_clock_get_expected_max_async_cmd();
+}
+
+/**
+ @brief This API is used for checking num of rates for each clock
+ @param clock id
+ @return num of rates
+**/
+uint32_t val_clock_get_expected_number_of_rates(uint32_t clock_id)
+{
+ return pal_clock_get_expected_number_of_rates(clock_id);
+}
+
+/**
+ @brief This API is used for checking if clock supports config change
+ @param clock id
+ @return true/false
+**/
+uint32_t val_check_clock_config_change_support(uint32_t clock_id)
+{
+ return pal_check_clock_config_change_support(clock_id);
+}
+
+#endif
diff --git a/val/val_interface.c b/val/val_interface.c
index 045aa04924476f3cb14f9f996e5f73349b04bb32..e3cc6f0b080990ff0159d1f973fd49b63d46555e 100644
--- a/val/val_interface.c
+++ b/val/val_interface.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,6 +19,12 @@
#define MAX_STRCPY_SIZE 100
+static uint64_t g_test_pass;
+static uint64_t g_test_fail;
+static uint64_t g_test_skip;
+
+static uint32_t g_protocol_list;
+
/**
@brief This function forms the command message header
1. Caller - ACK.
@@ -44,9 +50,12 @@ uint32_t val_msg_hdr_create(uint32_t protocol_id, uint32_t msg_id, uint32_t msg_
@param none
@return none
**/
-void val_initialize_system(void)
+uint32_t val_initialize_system(void *info)
{
- pal_initialize_system();
+ g_test_pass = 0;
+ g_test_fail = 0;
+ g_test_skip = 0;
+ return pal_initialize_system(info);
}
/**
@@ -58,8 +67,7 @@ void val_initialize_system(void)
**/
uint32_t val_test_initialize(uint32_t test_num, char *test_desc)
{
- val_print(VAL_PRINT_ERR, "\n%4d : %s ", test_num, test_desc);
-
+ val_print(VAL_PRINT_ERR, "\n%3d: %s ", test_num, test_desc);
return VAL_STATUS_PASS;
}
@@ -84,18 +92,19 @@ void val_print(uint32_t print_level, const char *format, ...)
/**
@brief This is val memset function
1. Caller - ACK.
- @param length length of buffer
- @param buffer buffer pointer
+ @param ptr address
+ @param value value to be filled in address
+ @param length length of buffer in bytes
@return none
**/
-void val_memset_zero(uint32_t *buffer, uint32_t length)
+void val_memset(void *ptr, int value, size_t length)
{
- if (buffer == NULL)
- return;
+ uint8_t *dest = (uint8_t *)ptr;
+ int32_t i;
- for (int i = 0; i < length; i++)
- {
- buffer[i] = 0;
+ if (dest != NULL) {
+ for (i = 0; i < length; i++)
+ dest[i] = value;
}
}
@@ -138,6 +147,8 @@ uint32_t val_strcmp(uint8_t *dst_ptr, uint8_t *src_ptr, uint32_t len)
return PAL_STATUS_FAIL;
while (index < len) {
+ if ((dst_ptr[index] == '\0') || (src_ptr[index] == '\0'))
+ break;
if (dst_ptr[index] != src_ptr[index])
return PAL_STATUS_FAIL;
++index;
@@ -155,41 +166,78 @@ uint32_t val_strcmp(uint8_t *dst_ptr, uint8_t *src_ptr, uint32_t len)
uint32_t val_compare_msg_hdr(uint32_t sent_msg_hdr, uint32_t rcvd_msg_hdr)
{
if (rcvd_msg_hdr != sent_msg_hdr) {
- val_print(VAL_PRINT_ERR, "\n\tMSG HEADER CHECK: FAILED");
- val_print(VAL_PRINT_ERR, "\n\tMessage header sent %x%08x", sent_msg_hdr);
- val_print(VAL_PRINT_ERR, "\n\tMessage header received %x", rcvd_msg_hdr);
-
+ val_print(VAL_PRINT_ERR, "\n CHECK HEADER : FAILED");
+ val_print(VAL_PRINT_ERR, "\n SENT : 0x%08x ", sent_msg_hdr);
+ val_print(VAL_PRINT_ERR, "\n RECEIVED : 0x%08x ", rcvd_msg_hdr);
return VAL_STATUS_FAIL;
} else
- val_print(VAL_PRINT_DEBUG, "\n\tCHECK HEADER: PASSED [0x%08x] ",
- rcvd_msg_hdr);
+ val_print(VAL_PRINT_TEST, "\n CHECK HEADER : PASSED [0x%08x] ",
+ rcvd_msg_hdr);
return VAL_STATUS_PASS;
}
/**
- @brief This function checks if correct protocol version is implemented
+ @brief This function compares int value recieve by SCMI protocol with expected value
1. Caller - Test Suite.
- @param protocol_identifier protocol identifier
- @param version scmi implemented version received from platform
+ @param parameter name
+ @param rcvd_val value recievd using SCMI protocol
+ @param exp_val expected value using pal expected file
@return status
**/
-uint32_t val_protocol_version_check(uint32_t expected_version, uint32_t version)
+uint32_t val_compare(char *parameter, uint32_t rcvd_val, uint32_t exp_val)
{
+ if (rcvd_val != exp_val) {
+ val_print(VAL_PRINT_ERR, "\n CHECK %s: FAILED", parameter);
+ val_print(VAL_PRINT_ERR, "\n EXPECTED : 0x%08x ", exp_val);
+ val_print(VAL_PRINT_ERR, "\n RECEIVED : 0x%08x ", rcvd_val);
+ return VAL_STATUS_FAIL;
+ } else
+ val_print(VAL_PRINT_TEST, "\n CHECK %s: PASSED [0x%08x] ", parameter, rcvd_val);
- if (expected_version != version) {
- val_print(VAL_PRINT_ERR, "\n\tPROTOCOL VERSION CHECK: FAILED");
- val_print(VAL_PRINT_ERR, "\n\tProtocol version expected %x", expected_version);
- val_print(VAL_PRINT_ERR, "\n\tProtocol version received %x ",
- version);
+ return VAL_STATUS_PASS;
+}
+
+/**
+ @brief This function compares string value recieve by SCMI protocol with expected value
+ 1. Caller - Test Suite.
+ @param parameter name
+ @param rcvd_val value recievd using SCMI protocol
+ @param exp_val expected value using pal expected file
+ @param len length of string
+ @return status
+**/
+uint32_t val_compare_str(char *parameter, char *rcvd_val, char *exp_val, uint32_t len)
+{
+ if (val_strcmp((uint8_t *)rcvd_val, (uint8_t *)exp_val, len)) {
+ val_print(VAL_PRINT_ERR, "\n CHECK %s: FAILED", parameter);
+ val_print(VAL_PRINT_ERR, "\n EXPECTED : %s ", exp_val);
+ val_print(VAL_PRINT_ERR, "\n RECEIVED : %s ", rcvd_val);
return VAL_STATUS_FAIL;
- } else {
- val_print(VAL_PRINT_DEBUG, "\n\tPROTOCOL VERSION CHECK: PASSED [%x] ",
- version);
- }
+ } else
+ val_print(VAL_PRINT_TEST, "\n CHECK %s: PASSED [%s] ", parameter, rcvd_val);
+
return VAL_STATUS_PASS;
}
+/**
+ @brief This function is used to print ret values for debugging
+ 1. Caller - Test Suite.
+ @param count number of ret values
+ @param values return values
+ @return none
+**/
+void val_print_return_values(uint32_t count, uint32_t *values)
+{
+ uint32_t i;
+
+ val_print(VAL_PRINT_DEBUG, "\n RETURN COUNT : %d ", count);
+ for (i = 0; i < count; i++) {
+ val_print(VAL_PRINT_DEBUG, "\n RETURN[%02d] : 0x%08x", i, values[i]);
+ }
+
+}
+
/**
@brief This function checks if reserved_bits received are zero
1. Caller - Test Suite.
@@ -199,15 +247,39 @@ uint32_t val_protocol_version_check(uint32_t expected_version, uint32_t version)
uint32_t val_reserved_bits_check_is_zero(uint32_t reserved_bits)
{
if (reserved_bits != VAL_RESERVED_BYTE_ZERO) {
- val_print(VAL_PRINT_ERR, "\n\tRESERVED BITS CHECK: FAILED");
- val_print(VAL_PRINT_ERR, "\n\tReserved bits value received %x", reserved_bits);
+ val_print(VAL_PRINT_ERR, "\n CHECK RSVD BITS: FAILED [0x%08x]", reserved_bits);
return VAL_STATUS_FAIL;
} else
- val_print(VAL_PRINT_DEBUG, "\n\tRESERVED BITS CHECK: PASSED ");
+ val_print(VAL_PRINT_TEST, "\n CHECK RSVD BITS: PASSED ");
return VAL_STATUS_PASS;
}
+/**
+ @brief This API is used to convert test result to string
+ @param test_status test status value
+ @return string test status string
+**/
+uint32_t val_report_status(uint32_t status)
+{
+ switch (status)
+ {
+ case VAL_STATUS_PASS:
+ g_test_pass++;
+ val_print(VAL_PRINT_ERR, " : CONFORMANT");
+ break;
+ case VAL_STATUS_FAIL:
+ g_test_fail++;
+ val_print(VAL_PRINT_ERR, " : NON CONFORMANT");
+ break;
+ case VAL_STATUS_SKIP:
+ g_test_skip++;
+ val_print(VAL_PRINT_ERR, " : SKIPPED");
+ break;
+ }
+ return status;
+}
+
/**
@brief This API is used to get test status string
1. Caller - Test Suite.
@@ -226,7 +298,7 @@ char *val_get_result_string(uint32_t test_status)
case VAL_STATUS_SKIP:
return "SKIPPED";
default:
- val_print(VAL_PRINT_WARN, "\n\tInvalid test status %d", test_status);
+ val_print(VAL_PRINT_ERR, "\nInvalid test status %d", test_status);
return "UNKNOWN";
}
}
@@ -243,31 +315,31 @@ char *val_get_status_string(int32_t status)
switch (status)
{
case SCMI_SUCCESS:
- return "SCMI_SUCCESS ";
+ return "SCMI_STATUS_SUCCES";
case SCMI_NOT_SUPPORTED:
- return "SCMI_NOT_SUPPORTED ";
+ return "SCMI_NOT_SUPPORTED";
case SCMI_INVALID_PARAMETERS:
- return "SCMI_INVALID_PARAMETERS";
+ return "SCMI_INVALID_PARAM";
case SCMI_DENIED:
- return "SCMI_DENIED ";
+ return "SCMI_DENIED_ERROR";
case SCMI_NOT_FOUND:
- return "SCMI_NOT_FOUND ";
+ return "SCMI_NOT_FOUND_ERR";
case SCMI_OUT_OF_RANGE:
- return "SCMI_OUT_OF_RANGE ";
+ return "SCMI_OUT_OF_RANGE";
case SCMI_BUSY:
- return "SCMI_BUSY ";
+ return "SCMI_BUSY_ERROR";
case SCMI_COMMS_ERROR:
- return "SCMI_COMMS_ERROR ";
+ return "SCMI_COMMS_ERROR";
case SCMI_GENERIC_ERROR:
- return "SCMI_GENERIC_ERROR ";
+ return "SCMI_GENERIC_ERROR";
case SCMI_HARDWARE_ERROR:
- return "SCMI_HARDWARE_ERROR ";
+ return "SCMI_HARDWARE_ERR";
case SCMI_PROTOCOL_ERROR:
- return "SCMI_PROTOCOL_ERROR ";
+ return "SCMI_PROTOCOL_ERR";
case SCMI_RESERVED:
- return "SCMI_RESERVED ";
+ return "SCMI_RESERVED_ERR";
default:
- val_print(VAL_PRINT_WARN, "\n\tInvalid status %d", status);
+ val_print(VAL_PRINT_ERR, "\nInvalid status %d", status);
return "SCMI_NOT_SPECIFIED";
}
}
@@ -284,19 +356,39 @@ char *val_get_status_string(int32_t status)
uint32_t val_compare_status(int32_t status, int32_t expected_status)
{
if (status != expected_status) {
- val_print(VAL_PRINT_ERR, "\n\tCHECK STATUS: FAILED");
- val_print(VAL_PRINT_ERR, "\n\tStatus expected %s",
- val_get_status_string(expected_status));
- val_print(VAL_PRINT_ERR, "\n\tStatus received %s\t ",
- val_get_status_string(status));
+ val_print(VAL_PRINT_ERR, "\n CHECK STATUS : FAILED");
+ val_print(VAL_PRINT_ERR, "\n EXPECTED : %s ",
+ val_get_status_string(expected_status));
+ val_print(VAL_PRINT_ERR, "\n RECEIVED : %s ",
+ val_get_status_string(status));
return VAL_STATUS_FAIL;
} else {
- val_print(VAL_PRINT_DEBUG, "\n\tCHECK STATUS: PASSED %s\t ",
+ val_print(VAL_PRINT_TEST, "\n CHECK STATUS : PASSED [%s] ",
val_get_status_string(status));
return VAL_STATUS_PASS;
}
}
+/**
+ @brief This function checks if expected & received return values counts matches
+ 1. Caller - Test Suite.
+ @param received received return values count
+ @param expected expected return values count
+ @return status
+**/
+uint32_t val_compare_return_count(uint32_t received, uint32_t expected)
+{
+ if (received != expected) {
+ val_print(VAL_PRINT_ERR, "\n CHECK COUNT : FAILED");
+ val_print(VAL_PRINT_ERR, "\n EXPECTED : %d ", expected);
+ val_print(VAL_PRINT_ERR, "\n RECEIVED : %d ", received);
+ return VAL_STATUS_FAIL;
+ } else
+ val_print(VAL_PRINT_TEST, "\n CHECK COUNT : PASSED [%d] ", received);
+
+ return VAL_STATUS_PASS;
+}
+
/**
@brief This function is used to send command data to platform and receive response
1. Caller - Test Suite.
@@ -309,23 +401,51 @@ uint32_t val_compare_status(int32_t status, int32_t expected_status)
@param rcvd_buffer return values buffer
@return none
**/
-void val_send_message(uint32_t msg_hdr, uint32_t num_parameter, uint32_t *parameter_buffer,
- uint32_t *rcvd_msg_hdr, int32_t *status, uint32_t *rcvd_buffer_size,
+void val_send_message(uint32_t msg_hdr, size_t num_parameter, uint32_t *parameter_buffer,
+ uint32_t *rcvd_msg_hdr, int32_t *status, size_t *rcvd_buffer_size,
uint32_t *rcvd_buffer)
{
uint32_t i;
- val_print(VAL_PRINT_INFO, "\n\t MSG HDR: %x", msg_hdr);
- val_print(VAL_PRINT_INFO, "\n\t NUM PARAM: %d", num_parameter);
+ val_print(VAL_PRINT_DEBUG, "\n MSG HDR : 0x%08x", msg_hdr);
+ val_print(VAL_PRINT_DEBUG, "\n NUM PARAM : %d", num_parameter);
+
for (i = 0; i < num_parameter; i++)
{
- val_print(VAL_PRINT_DEBUG, "\n\t PARAMETER_%d = %x", i, parameter_buffer[i]);
+ val_print(VAL_PRINT_DEBUG, "\n PARAMETER[%02d] : 0x%08x", i, parameter_buffer[i]);
}
- pal_send_message(msg_hdr, (size_t) num_parameter, parameter_buffer, rcvd_msg_hdr, status,
+ pal_send_message(msg_hdr, num_parameter, parameter_buffer, rcvd_msg_hdr, status,
rcvd_buffer_size, rcvd_buffer);
}
+/**
+ @brief This API is used to receive notifications from platform
+ 1. Caller - Test Suite.
+ @param message header received
+ @param return values count
+ @param return values list
+**/
+void val_receive_notification(uint32_t *message_header_rcv, size_t *return_values_count,
+ uint32_t *return_values)
+{
+ pal_receive_notification(message_header_rcv, return_values_count, return_values);
+}
+
+/**
+ @brief This API is used to receive delayed response
+ 1. Caller - Test Suite.
+ @param message header received
+ @param status of command processed
+ @param return values count
+ @param return values list
+**/
+void val_receive_delayed_response(uint32_t *message_header_rcv, int32_t *status,
+ size_t *return_values_count, uint32_t *return_values)
+{
+ pal_receive_delayed_response(message_header_rcv, status, return_values_count, return_values);
+}
+
/**
@brief This API is used return accesible device for given agent id
1. Caller - Test Suite.
@@ -358,3 +478,62 @@ uint32_t val_device_get_accessible_protocol(uint32_t device_id)
{
return pal_device_get_accessible_protocol(device_id);
}
+
+/**
+ @brief This API is used to set supported protocols
+ 1. Caller - Test Suite.
+ @param protocol_list
+**/
+void val_agent_set_supported_protocol_list(uint32_t protocol_list)
+{
+ g_protocol_list = protocol_list;
+}
+
+/**
+ @brief This API is used to get protocols
+ 1. Caller - Test Suite.
+ @param protocol
+ @return protocol id is supported or not
+**/
+uint32_t val_agent_check_protocol_support(uint32_t protocol)
+{
+ return ((g_protocol_list >> protocol) & 1);
+}
+
+/**
+ @brief This API is used to get whether an agent is supported or not
+ 1. Caller - Test Suite.
+ @param agent_id
+ @return agent is trusted or not
+**/
+uint32_t val_check_trusted_agent(uint32_t agent_id)
+{
+ return pal_check_trusted_agent(agent_id);
+}
+
+/**
+ @brief This API returns num of test passed
+ @return num of test passed
+**/
+uint32_t val_get_test_passed(void)
+{
+ return g_test_pass;
+}
+
+/**
+ @brief This API returns num of test failed
+ @return num of test failed
+**/
+uint32_t val_get_test_failed(void)
+{
+ return g_test_fail;
+}
+
+/**
+ @brief This API returns num of test skipped
+ @return num of test skipped
+**/
+uint32_t val_get_test_skipped(void)
+{
+ return g_test_skip;
+}
diff --git a/val/val_performance.c b/val/val_performance.c
index 34edc37a51b0a4a9c3e86a4c815cd4e798e57d00..a1a2154bd4f5e13980dbe274ddb3430b305999e7 100644
--- a/val/val_performance.c
+++ b/val/val_performance.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,21 +14,89 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
+#ifdef PERFORMANCE_PROTOCOL
#include "val_interface.h"
#include "val_performance.h"
-PERFORMANCE_INFO_s g_performance_info_table;
+static PERFORMANCE_INFO_s g_performance_info_table;
+
+/**
+ @brief This API is called from app layer to execute performance tests
+ @param none
+ @return test execution result
+**/
+uint32_t val_performance_execute_tests(void)
+{
+ uint32_t version = 0;
+
+ val_memset((void *)&g_performance_info_table, 0, sizeof(g_performance_info_table));
+
+ if (val_agent_check_protocol_support(PROTOCOL_PERFORMANCE)) {
+ if (RUN_TEST(performance_query_protocol_version(&version)))
+ return VAL_STATUS_FAIL;
+
+ RUN_TEST(performance_query_protocol_attributes());
+
+ if (version == PROTOCOL_VERSION_1) {
+ RUN_TEST(performance_query_mandatory_command_support_v1());
+ RUN_TEST(performance_invalid_messageid_call());
+ RUN_TEST(performance_query_domain_attributes_v1());
+ }
+
+ if (version == PROTOCOL_VERSION_2) {
+ RUN_TEST(performance_query_mandatory_command_support());
+ RUN_TEST(performance_invalid_messageid_call());
+ RUN_TEST(performance_query_domain_attributes());
+ }
+ RUN_TEST(performance_query_domain_attributes_invalid_domain());
+ RUN_TEST(performance_query_describe_levels());
+ RUN_TEST(performance_query_describe_levels_invalid_domain());
+ RUN_TEST(performance_query_set_limit());
+ RUN_TEST(performance_query_set_limit_invalid_range());
+ RUN_TEST(performance_query_set_limit_invalid_domain());
+ RUN_TEST(performance_query_get_limit_invalid_domain());
+ RUN_TEST(performance_query_set_level());
+ RUN_TEST(performance_query_set_level_invalid_range());
+ RUN_TEST(performance_query_set_level_invalid_domain());
+ RUN_TEST(performance_query_get_level_invalid_domain());
+ RUN_TEST(performance_query_notify_limit_invalid_parameters());
+ RUN_TEST(performance_query_notify_limit_invalid_domain());
+ RUN_TEST(performance_query_notify_level_invalid_parameters());
+ RUN_TEST(performance_query_notify_level_invalid_domain());
+
+ if (version == PROTOCOL_VERSION_2) {
+ RUN_TEST(performance_query_describe_fast_channel());
+ RUN_TEST(performance_query_describe_fast_channel_invalid_domain());
+ RUN_TEST(performance_query_describe_fast_channel_invalid_message());
+ RUN_TEST(performance_query_describe_fast_channel_unsupported_domain());
+ RUN_TEST(performance_query_describe_fast_channel_unsupported_message());
+ }
+ RUN_TEST(performance_limit_set_async());
+ RUN_TEST(performance_level_set_async());
+
+ if (version == PROTOCOL_VERSION_2) {
+ RUN_TEST(performance_level_get_fast_channel());
+ RUN_TEST(performance_limits_get_fast_channel());
+ }
+ }
+ else
+ val_print(VAL_PRINT_ERR, "\n Calling agent have no access to PERFORMANCE protocol");
+
+ return VAL_STATUS_PASS;
+}
/**
@brief This API is used to set performance protocol info
1. Caller - Test Suite.
2. Prerequisite - Performance protocol info table.
@param param_identifier id of parameter which will be set
+ @param perf_id Performance domain identifier,
+ (used as Message id for PERF_MESSAGE_FAST_CH_SUPPORT)
@param param_value value of parameter
@return none
**/
-void val_performance_save_info(uint32_t param_identifier, uint32_t param_value)
+void val_performance_save_info(uint32_t param_identifier, uint32_t perf_id, uint32_t param_value)
{
switch (param_identifier)
{
@@ -44,6 +112,56 @@ void val_performance_save_info(uint32_t param_identifier, uint32_t param_value)
case PERF_STATS_ADDR_LEN:
g_performance_info_table.perf_stats_addr_len = param_value;
break;
+ case PERF_DOMAIN_FAST_CH_SUPPORT:
+ g_performance_info_table.perf_domain_info[perf_id].fast_ch_support = param_value;
+ break;
+ case PERF_DOMAIN_LVL_CHANGE_NTFY_SUPPORT:
+ g_performance_info_table.perf_domain_info[perf_id].Perf_lvl_change_ntfy_support =
+ param_value;
+ break;
+ case PERF_DOMAIN_LIMIT_CHANGE_NTFY_SUPPORT:
+ g_performance_info_table.perf_domain_info[perf_id].Perf_limit_change_ntfy_support =
+ param_value;
+ break;
+ case PERF_DOMAIN_SET_PERFORMANCE_LEVEL_SUPPORT:
+ g_performance_info_table.perf_domain_info[perf_id].set_performance_level_support =
+ param_value;
+ break;
+ case PERF_DOMAIN_SET_PERFORMANCE_LIMIT_SUPPORT:
+ g_performance_info_table.perf_domain_info[perf_id].set_performance_limit_support =
+ param_value;
+ break;
+ case PERF_DOMAIN_MAX_LEVEL:
+ g_performance_info_table.perf_domain_info[perf_id].maximum_level = param_value;
+ break;
+ case PERF_DOMAIN_MIN_LEVEL:
+ g_performance_info_table.perf_domain_info[perf_id].minimum_level = param_value;
+ break;
+ case PERF_DOMAIN_INTERMEDIATE_LEVEL:
+ g_performance_info_table.perf_domain_info[perf_id].intermediate_level = param_value;
+ break;
+ case PERF_MESSAGE_FAST_CH_SUPPORT:
+ switch (perf_id)
+ {
+ case PERFORMANCE_LIMITS_SET:
+ g_performance_info_table.perf_fast_cmd_ch_support.performance_level_set =
+ param_value;
+ break;
+ case PERFORMANCE_LIMITS_GET:
+ g_performance_info_table.perf_fast_cmd_ch_support.performance_level_get =
+ param_value;
+ break;
+ case PERFORMANCE_LEVEL_SET:
+ g_performance_info_table.perf_fast_cmd_ch_support.performance_level_set = param_value;
+ break;
+ case PERFORMANCE_LEVEL_GET:
+ g_performance_info_table.perf_fast_cmd_ch_support.performance_level_get = param_value;
+ break;
+ default:
+ val_print(VAL_PRINT_ERR, "\nUnidentified Command %d,parameter identifier = %d",
+ perf_id, param_identifier);
+ }
+ break;
default:
val_print(VAL_PRINT_ERR, "\nUnidentified parameter %d", param_identifier);
}
@@ -54,9 +172,11 @@ void val_performance_save_info(uint32_t param_identifier, uint32_t param_value)
1. Caller - Test Suite.
2. Prerequisite - Performance protocol info table.
@param param_identifier id of parameter which will be set
+ @param perf_id Performance domain identifier,
+ (used as Message id for PERF_MESSAGE_FAST_CH_SUPPORT)
@return param_value value of the parameter
**/
-uint32_t val_performance_get_info(uint32_t param_identifier)
+uint32_t val_performance_get_info(uint32_t param_identifier, uint32_t perf_id)
{
uint32_t param_value = 0;
@@ -72,8 +192,56 @@ uint32_t val_performance_get_info(uint32_t param_identifier)
param_value = g_performance_info_table.perf_stats_addr_high;
break;
case PERF_STATS_ADDR_LEN:
- param_value = g_performance_info_table.perf_stats_addr_len;
+ param_value = g_performance_info_table.perf_stats_addr_len;
+ break;
+ case PERF_DOMAIN_FAST_CH_SUPPORT:
+ param_value = g_performance_info_table.perf_domain_info[perf_id].fast_ch_support;
break;
+ case PERF_DOMAIN_LVL_CHANGE_NTFY_SUPPORT:
+ param_value =
+ g_performance_info_table.perf_domain_info[perf_id].Perf_lvl_change_ntfy_support;
+ break;
+ case PERF_DOMAIN_LIMIT_CHANGE_NTFY_SUPPORT:
+ param_value =
+ g_performance_info_table.perf_domain_info[perf_id].Perf_limit_change_ntfy_support;
+ break;
+ case PERF_DOMAIN_SET_PERFORMANCE_LEVEL_SUPPORT:
+ param_value =
+ g_performance_info_table.perf_domain_info[perf_id].set_performance_level_support;
+ break;
+ case PERF_DOMAIN_SET_PERFORMANCE_LIMIT_SUPPORT:
+ param_value =
+ g_performance_info_table.perf_domain_info[perf_id].set_performance_limit_support;
+ break;
+ case PERF_DOMAIN_MAX_LEVEL:
+ param_value = g_performance_info_table.perf_domain_info[perf_id].maximum_level;
+ break;
+ case PERF_DOMAIN_MIN_LEVEL:
+ param_value = g_performance_info_table.perf_domain_info[perf_id].minimum_level;
+ break;
+ case PERF_DOMAIN_INTERMEDIATE_LEVEL:
+ param_value = g_performance_info_table.perf_domain_info[perf_id].intermediate_level;
+ break;
+ case PERF_MESSAGE_FAST_CH_SUPPORT:
+ switch (perf_id)
+ {
+ case PERFORMANCE_LIMITS_SET:
+ param_value = g_performance_info_table.perf_fast_cmd_ch_support.performance_level_set;
+ break;
+ case PERFORMANCE_LIMITS_GET:
+ param_value = g_performance_info_table.perf_fast_cmd_ch_support.performance_level_get;
+ break;
+ case PERFORMANCE_LEVEL_SET:
+ param_value = g_performance_info_table.perf_fast_cmd_ch_support.performance_level_set;
+ break;
+ case PERFORMANCE_LEVEL_GET:
+ param_value = g_performance_info_table.perf_fast_cmd_ch_support.performance_level_get;
+ break;
+ default:
+ val_print(VAL_PRINT_ERR, "\nUnidentified Command %d,parameter identifier = %d",
+ perf_id, param_identifier);
+ }
+ break;
default:
val_print(VAL_PRINT_ERR, "\nUnidentified parameter %d", param_identifier);
}
@@ -82,13 +250,63 @@ uint32_t val_performance_get_info(uint32_t param_identifier)
}
/**
- @brief This API is used to get performance protocol implemented version
- 1. Caller - Test Suite.
- 2. Prerequisite - Performance protocol info table.
+ @brief This API is used for checking number of perf domains
+ @param none
+ @return num of perf domains
+**/
+uint32_t val_performance_get_expected_num_domains(void)
+{
+ return pal_performance_get_expected_num_domains();
+}
+
+/**
+ @brief This API is used for checking perf statistics addr low
+ @param none
+ @return statistics addr low
+**/
+uint32_t val_performance_get_expected_stats_addr_low(void)
+{
+ return pal_performance_get_expected_stats_addr_low();
+}
+
+/**
+ @brief This API is used for checking perf statistics addr high
+ @param none
+ @return statistics addr high
+**/
+uint32_t val_performance_get_expected_stats_addr_high(void)
+{
+ return pal_performance_get_expected_stats_addr_high();
+}
+
+/**
+ @brief This API is used for checking statistics addr len
@param none
- @return performance protocol version
+ @return statistics addr len
+**/
+uint32_t val_performance_get_expected_stats_addr_len(void)
+{
+ return pal_performance_get_expected_stats_addr_len();
+}
+
+/**
+ @brief This API is used for checking domain name
+ @param perf domain id
+ @return perf domain name
**/
-uint32_t val_performance_get_expected_protocol_version(void)
+uint8_t *val_performance_get_expected_name(uint32_t domain_id)
{
- return PERFORMANCE_VERSION;
+ return pal_performance_get_expected_name(domain_id);
}
+
+/**
+ @brief This API is used for checking num of level for perf domain
+ @param perf domain id
+ @return num of level for perf domain
+**/
+uint32_t val_performance_get_expected_number_of_level(uint32_t domain_id)
+{
+ return pal_performance_get_expected_number_of_level(domain_id);
+}
+
+#endif
diff --git a/val/val_power_domain.c b/val/val_power_domain.c
index 3eaffe856954295bbbc80c8c44b4561b71bb3387..c503f009aeb58f6edabf9631d451281c2831ff7c 100644
--- a/val/val_power_domain.c
+++ b/val/val_power_domain.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,11 +14,52 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
+#ifdef POWER_DOMAIN_PROTOCOL
#include "val_interface.h"
#include "val_power_domain.h"
-POWER_DOMAIN_INFO_s g_power_domain_info_table;
+static POWER_DOMAIN_INFO_s g_power_domain_info_table;
+
+/**
+ @brief This API is called from app layer to execute power domain tests
+ @param none
+ @return test execution result
+**/
+uint32_t val_power_domain_execute_tests(void)
+{
+ uint32_t version = 0;
+
+ val_memset((void *)&g_power_domain_info_table, 0, sizeof(g_power_domain_info_table));
+
+ if (val_agent_check_protocol_support(PROTOCOL_POWER_DOMAIN)) {
+ if (RUN_TEST(power_domain_query_protocol_version(&version)))
+ return VAL_STATUS_FAIL;
+
+ RUN_TEST(power_domain_query_protocol_attributes());
+ RUN_TEST(power_domain_query_mandatory_command_support());
+ RUN_TEST(power_domain_invalid_messageid_call());
+ RUN_TEST(power_domain_query_domain_attributes());
+ RUN_TEST(power_domain_query_domain_attributes_invalid_doamin());
+ RUN_TEST(power_domain_set_power_state_check());
+ RUN_TEST(power_domain_set_power_state_unsupported_domain_check());
+ RUN_TEST(power_domain_set_power_state_check_invalid_domain());
+ RUN_TEST(power_domain_get_power_state_check());
+ RUN_TEST(power_domain_get_power_state_check_invalid_domain());
+ RUN_TEST(power_domain_power_state_notify_check());
+ RUN_TEST(power_domain_power_state_notify_unspported_domain_check());
+ RUN_TEST(power_domain_power_state_notify_invalid_domain_check());
+
+ if (version == PROTOCOL_VERSION_2) {
+ RUN_TEST(power_domain_power_state_change_requested_notify_check());
+ RUN_TEST(power_domain_power_state_change_requested_notify_invalid_domain_check());
+ }
+ }
+ else
+ val_print(VAL_PRINT_ERR, "\n Calling agent have no access to POWER DOMAIN protocol");
+
+ return VAL_STATUS_PASS;
+}
/**
@brief This API is used to set power_domain protocol info
@@ -55,7 +96,7 @@ void val_power_domain_save_info(uint32_t param_identifier, uint32_t pd_id, uint3
g_power_domain_info_table.pd_sync_support[pd_id] = param_value;
break;
default:
- val_print(VAL_PRINT_WARN, "\n\tUnidentified parameter %d", param_identifier);
+ val_print(VAL_PRINT_WARN, "\nUnidentified parameter %d", param_identifier);
}
}
@@ -95,7 +136,7 @@ uint32_t val_power_domain_get_info(uint32_t pd_id, uint32_t param_identifier)
param_value = g_power_domain_info_table.pd_sync_support[pd_id];
break;
default:
- val_print(VAL_PRINT_WARN, "\n\tUnidentified parameter %d", param_identifier);
+ val_print(VAL_PRINT_WARN, "\nUnidentified parameter %d", param_identifier);
}
return param_value;
@@ -118,18 +159,48 @@ void val_power_domain_save_name(uint32_t param_identifier, uint32_t pd_id, uint8
val_strcpy(&g_power_domain_info_table.pd_name[pd_id][0], param_value);
break;
default:
- val_print(VAL_PRINT_WARN, "\n\tUnidentified parameter %d", param_identifier);
+ val_print(VAL_PRINT_WARN, "\nUnidentified parameter %d", param_identifier);
}
}
/**
- @brief This API is used to get power domain protocol implemented version
- 1. Caller - Test Suite.
- 2. Prerequisite - Power domain protocol info table.
+ @brief This API is used for checking num of power domain
@param none
- @return none
+ @return num of power domain
**/
-uint32_t val_power_domain_get_expected_protocol_version(void)
+uint32_t val_power_get_expected_num_domains(void)
{
- return POWER_DOMAIN_VERSION;
+ return pal_power_get_expected_num_domains();
}
+
+/**
+ @brief This API is used for checking power domain statistics addr low
+ @param none
+ @return statistics addr low
+**/
+uint32_t val_power_get_expected_stats_addr_low(void)
+{
+ return pal_power_get_expected_stats_addr_low();
+}
+
+/**
+ @brief This API is used for checking power domain statistics addr high
+ @param none
+ @return statistics addr high
+**/
+uint32_t val_power_get_expected_stats_addr_high(void)
+{
+ return pal_power_get_expected_stats_addr_high();
+}
+
+/**
+ @brief This API is used for checking power domain statistics addr len
+ @param none
+ @return statistics addr len
+**/
+uint32_t val_power_get_expected_stats_addr_len(void)
+{
+ return pal_power_get_expected_stats_addr_len();
+}
+
+#endif
diff --git a/val/val_reset.c b/val/val_reset.c
new file mode 100644
index 0000000000000000000000000000000000000000..2a418fda7233562f4ec8c818cabb4ea65968bcc0
--- /dev/null
+++ b/val/val_reset.c
@@ -0,0 +1,133 @@
+/** @file
+ * Copyright (c) 2020, Arm Limited or its affiliates. All rights reserved.
+ * SPDX-License-Identifier : Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+**/
+#ifdef RESET_PROTOCOL
+
+#include "val_interface.h"
+#include "val_reset.h"
+
+static RESET_INFO_s g_reset_info_table;
+
+/**
+ @brief This API is called from app layer to execute reset domain tests
+ @param none
+ @return test execution result
+**/
+uint32_t val_reset_execute_tests(void)
+{
+ uint32_t version = 0;
+
+ val_memset((void *)&g_reset_info_table, 0, sizeof(g_reset_info_table));
+
+ if (val_agent_check_protocol_support(PROTOCOL_RESET)) {
+ if (RUN_TEST(reset_query_protocol_version(&version)))
+ return VAL_STATUS_FAIL;
+
+ RUN_TEST(reset_query_protocol_attributes());
+ RUN_TEST(reset_query_mandatory_command_support());
+ RUN_TEST(reset_invalid_messageid_call());
+ RUN_TEST(reset_query_domain_attributes());
+ RUN_TEST(reset_query_domain_attributes_invalid_id());
+ RUN_TEST(reset_query_reset_command_invalid_id());
+ RUN_TEST(reset_query_reset_command_invalid_flag());
+ RUN_TEST(reset_query_reset_command_invalid_reset_state());
+ RUN_TEST(reset_query_notify_invalid_id());
+ RUN_TEST(reset_query_invalid_notify_enable());
+ }
+ else
+ val_print(VAL_PRINT_ERR, "\n Calling agent have no access to RESET protocol");
+
+ return VAL_STATUS_PASS;
+}
+
+/**
+ @brief This API is used to set reset protocol info
+ 1. Caller - Test Suite.
+ 2. Prerequisite - Reset protocol info table.
+ @param param_identifier id of parameter which will be set
+ @param param_value value of parameter
+ @return none
+**/
+void val_reset_save_info(uint32_t param_identifier, uint32_t domain_id, uint32_t param_value)
+{
+ switch (param_identifier)
+ {
+ case NUM_RESET_DOMAINS:
+ g_reset_info_table.num_domains = param_value;
+ break;
+ case RESET_ASYNC_SUPPORT:
+ g_reset_info_table.domain_info[domain_id].async_support =
+ param_value;
+ break;
+ case RESET_NOTIFY_SUPPORT:
+ g_reset_info_table.domain_info[domain_id].notify_support =
+ param_value;
+ break;
+ default:
+ val_print(VAL_PRINT_ERR, "\nUnidentified parameter %d", param_identifier);
+ }
+}
+
+/**
+ @brief This API is used to get reset protocol info
+ 1. Caller - Test Suite.
+ 2. Prerequisite - Reset protocol info table.
+ @param param_identifier id of parameter which will be set
+ @return param_value value of the parameter
+**/
+uint32_t val_reset_get_info(uint32_t param_identifier, uint32_t domain_id)
+{
+ uint32_t param_value = 0;
+
+ switch (param_identifier)
+ {
+ case NUM_RESET_DOMAINS:
+ param_value = g_reset_info_table.num_domains;
+ break;
+ case RESET_ASYNC_SUPPORT:
+ param_value = g_reset_info_table.domain_info[domain_id].async_support;
+ break;
+ case RESET_NOTIFY_SUPPORT:
+ param_value = g_reset_info_table.domain_info[domain_id].notify_support;
+ break;
+ default:
+ val_print(VAL_PRINT_ERR, "\nUnidentified parameter %d", param_identifier);
+ }
+
+ return param_value;
+}
+
+/**
+ @brief This API is used for checking num of reset domain
+ @param none
+ @return num of reset domain
+**/
+uint32_t val_reset_get_expected_num_domains(void)
+{
+ return pal_reset_get_expected_num_domains();
+}
+
+/**
+ @brief This API is used for checking reset domain name
+ @param domain id
+ @return reset domain name
+**/
+uint8_t *val_reset_get_expected_name(uint32_t domain_id)
+{
+ return pal_reset_get_expected_name(domain_id);
+}
+
+#endif
diff --git a/val/val_sensor.c b/val/val_sensor.c
index 9e9b2100d1be318b9481db9e29ad162dcb6f6489..8e5ce188a92b25732fd5acb1b0222a2cfcd675bc 100644
--- a/val/val_sensor.c
+++ b/val/val_sensor.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,11 +14,49 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
+#ifdef SENSOR_PROTOCOL
#include "val_interface.h"
#include "val_sensor.h"
-SENSOR_INFO_s g_sensor_info_table;
+static SENSOR_INFO_s g_sensor_info_table;
+
+/**
+ @brief This API is called from app layer to execute sensor domain tests
+ @param none
+ @return test execution result
+**/
+uint32_t val_sensor_execute_tests(void)
+{
+ uint32_t version = 0;
+
+ val_memset((void *)&g_sensor_info_table, 0, sizeof(g_sensor_info_table));
+
+ if (val_agent_check_protocol_support(PROTOCOL_SENSOR)) {
+ if (RUN_TEST(sensor_query_protocol_version(&version)))
+ return VAL_STATUS_FAIL;
+
+ RUN_TEST(sensor_query_protocol_attributes());
+ RUN_TEST(sensor_query_mandatory_command_support());
+ RUN_TEST(sensor_invalid_messageid_call());
+ RUN_TEST(sensor_query_description_get());
+ RUN_TEST(sensor_trip_point_nfy_event_ctrl_check());
+ RUN_TEST(sensor_trip_point_nfy_invalid_id_check());
+ RUN_TEST(sensor_trip_point_config_invalid_param_check());
+ RUN_TEST(sensor_trip_point_config_invalid_id_check());
+ RUN_TEST(sensor_trip_point_config_check());
+ RUN_TEST(sensor_reading_get_invalid_flag_check());
+ RUN_TEST(sensor_reading_get_invalid_id_check());
+ RUN_TEST(sensor_reading_get_sync_mode());
+ RUN_TEST(sensor_reading_get_async_mode());
+ RUN_TEST(sensor_reading_get_async_mode_not_supported());
+ }
+ else
+ val_print(VAL_PRINT_ERR, "\n Calling agent have no access to SENSOR protocol");
+
+
+ return VAL_STATUS_PASS;
+}
/**
@brief This API is used to set sensor protocol info
@@ -81,14 +119,95 @@ uint32_t val_sensor_get_info(uint32_t param_identifier)
return param_value;
}
+
+/**
+ @brief This API is used to set sensor protocol info
+ 1. Caller - Test Suite.
+ 2. Prerequisite - Sensor protocol info table.
+ @param param_identifier id of parameter which will be set
+ @param sensor_id Sensor id
+ @param param_value value of parameter
+ @return none
+**/
+void val_sensor_save_desc_info(uint32_t param_identifier, uint32_t sensor_id, uint32_t param_value)
+{
+ switch (param_identifier)
+ {
+ case SENSOR_NUM_OF_TRIP_POINTS:
+ g_sensor_info_table.desc_info[sensor_id].num_trip_points = param_value;
+ break;
+ case SENSOR_ASYNC_READ_SUPPORT:
+ g_sensor_info_table.desc_info[sensor_id].async_read_support = param_value;
+ break;
+ default:
+ val_print(VAL_PRINT_ERR, "\nUnidentified parameter %d", param_identifier);
+ }
+}
+
/**
- @brief This API is used to get sensor protocol implemented version
+ @brief This API is used to get sensor protocol info
1. Caller - Test Suite.
2. Prerequisite - Sensor protocol info table.
+ @param param_identifier id of parameter which will be set
+ @param sensor_id Sensor id
+ @return param_value value of the parameter
+**/
+uint32_t val_sensor_get_desc_info(uint32_t param_identifier, uint32_t sensor_id)
+{
+ uint32_t param_value = 0;
+ switch (param_identifier)
+ {
+ case SENSOR_NUM_OF_TRIP_POINTS:
+ param_value = g_sensor_info_table.desc_info[sensor_id].num_trip_points;
+ break;
+ case SENSOR_ASYNC_READ_SUPPORT:
+ param_value = g_sensor_info_table.desc_info[sensor_id].async_read_support;
+ break;
+ default:
+ val_print(VAL_PRINT_ERR, "\nUnidentified parameter %d", param_identifier);
+ }
+
+ return param_value;
+}
+
+/**
+ @brief This API is used for checking num of sensors
+ @param none
+ @return num of sensors
+**/
+uint32_t val_sensor_get_expected_num_sensors(void)
+{
+ return pal_sensor_get_expected_num_sensors();
+}
+
+/**
+ @brief This API is used for checking sensor statistics addr low
@param none
- @return sensor protocol version
+ @return statistics addr low
**/
-uint32_t val_sensor_get_expected_protocol_version(void)
+uint32_t val_sensor_get_expected_stats_addr_low(void)
{
- return SENSOR_VERSION;
+ return pal_sensor_get_expected_stats_addr_low();
}
+
+/**
+ @brief This API is used for checking sensor statistics addr high
+ @param none
+ @return statistics addr high
+**/
+uint32_t val_sensor_get_expected_stats_addr_high(void)
+{
+ return pal_sensor_get_expected_stats_addr_high();
+}
+
+/**
+ @brief This API is used for checking sensor statistics addr len
+ @param none
+ @return statistics addr len
+**/
+uint32_t val_sensor_get_expected_stats_addr_len(void)
+{
+ return pal_sensor_get_expected_stats_addr_len();
+}
+
+#endif
diff --git a/val/val_system_power.c b/val/val_system_power.c
index 974cbbfd31d35973c740c9e314cbf2e7672f318a..96355b0f0363ac2cc4be80e5f410f88fa606d94e 100644
--- a/val/val_system_power.c
+++ b/val/val_system_power.c
@@ -1,5 +1,5 @@
/** @file
- * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited or its affiliates. All rights reserved.
* SPDX-License-Identifier : Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,11 +14,40 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
+#ifdef SYSTEM_POWER_PROTOCOL
#include "val_interface.h"
#include "val_system_power.h"
-SYSTEM_POWER_INFO_s g_system_power_info_table;
+static SYSTEM_POWER_INFO_s g_system_power_info_table;
+
+/**
+ @brief This API is called from app layer to execute system power tests
+ @param none
+ @return test execution result
+**/
+uint32_t val_system_power_execute_tests(void)
+{
+ uint32_t version = 0;
+
+ val_memset((void *)&g_system_power_info_table, 0, sizeof(g_system_power_info_table));
+
+ if (val_agent_check_protocol_support(PROTOCOL_SYSTEM_POWER)) {
+ if (RUN_TEST(system_power_query_protocol_version(&version)))
+ return VAL_STATUS_FAIL;
+
+ RUN_TEST(system_power_query_protocol_attributes());
+ RUN_TEST(system_power_query_mandatory_command_support());
+ RUN_TEST(system_power_invalid_messageid_call());
+ RUN_TEST(system_power_state_set_invalid_parameters());
+ RUN_TEST(system_power_state_get_check());
+ RUN_TEST(system_power_state_notify_invalid_parameters());
+ }
+ else
+ val_print(VAL_PRINT_ERR, "\n Calling agent have no access to SYSTEM POWER protocol");
+
+ return VAL_STATUS_PASS;
+}
/**
@brief This API is used to set system_power protocol info
@@ -69,14 +98,4 @@ uint32_t val_system_power_get_info(uint32_t param_identifier)
return param_value;
}
-/**
- @brief This API is used to get system power protocol implemented version
- 1. Caller - Test Suite.
- 2. Prerequisite - System power protocol info table.
- @param none
- @return system power protocol version
-**/
-uint32_t val_system_power_get_expected_protocol_version(void)
-{
- return SYSTEM_POWER_VERSION;
-}
+#endif