Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 81113c6

Browse files
Merge pull request #19 from chetan-rathore/master
SCMI 2.0 EAC release
2 parents 1eb2bd6 + 7a12559 commit 81113c6

223 files changed

Lines changed: 16085 additions & 3396 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,50 @@ export TOP=$(shell pwd)
2121
# Library and executable names
2222
LIB=scmi_test
2323
PROGRAM=scmi_test_agent
24+
BAREMETAL=baremetal
25+
MOCKER=mocker
26+
LINUX=linux
2427

25-
# Default version and verbose setting
26-
VERBOSE := 3
27-
VERSION := 1
28-
29-
# Obtain PLAT command line argument and set platform directory
30-
# However PLAT is an optional variable hence conditionally set these
28+
#Set PLATFORM
3129
ifneq ($(PLAT),)
32-
PLAT_DIR=platform/$(PLAT)
33-
EXE=$(PROGRAM)
30+
PLAT_DIR=platform/$(PLAT)
31+
APP_DIR=$(PLAT)_app
32+
EXE=$(PROGRAM)
3433
endif
3534

36-
APP_DIR=linux_app
35+
ifeq ($(PLAT),$(BAREMETAL))
36+
LIB_BM=$(LIB)
37+
undefine EXE
38+
else
39+
LIB_ALL=$(LIB)
40+
endif
41+
42+
ifeq ($(PLAT),$(LINUX))
43+
PLAT_DIR=platform/sgm776
44+
endif
45+
46+
# Set VERBOSE to default(TEST) if not set
47+
ifndef VERBOSE
48+
VERBOSE=3
49+
endif
3750

3851
# Obtain PROTOCOLS command line argument
3952
comma := ,
40-
ALL_PROTOCOLS=base common $(subst $(comma), ,$(PROTOCOLS))
53+
ALL_PROTOCOLS=base $(subst $(comma), ,$(PROTOCOLS))
4154
ALL_PROTOCOLS_UPPER=$(shell echo $(ALL_PROTOCOLS) | tr a-z A-Z)
4255

4356
# List of subdirs to be built
4457
DIRS=val $(PLAT_DIR) $(ALL_PROTOCOLS:%=test_pool/%) $(APP_DIR)
58+
ifeq ($(PLAT),$(MOCKER))
59+
DIRS+=$(PLAT_DIR)/$(PLAT)
60+
endif
4561
BUILD_ALL=$(DIRS)
4662

4763
# Name for directory within each subdir that contains its header files
4864
export HEADER_DIR=include
4965

5066
# List of directories to be searched for header files
51-
export I_DIRS=$(DIRS:%=-I$(TOP)/%/${HEADER_DIR}) -I$(TOP)/test_pool/${HEADER_DIR} -I$(TOP)/platform/${HEADER_DIR}
67+
export I_DIRS=$(DIRS:%=-I$(TOP)/%/${HEADER_DIR}) -I$(TOP)/val/${HEADER_DIR} -I$(TOP)/platform/$(PLAT)/${HEADER_DIR}
5268

5369
# Output objects directory
5470
export APP_OBJ_DIR=$(TOP)/app_output
@@ -64,15 +80,14 @@ export VAL_OBJ_DIR=$(TOP)/val_output
6480

6581
# list of names to be converted as macros
6682
export D_NAMES=$(ALL_PROTOCOLS_UPPER:%=-D%_PROTOCOL)
67-
export CFLAGS=-DVERBOSE_LEVEL=$(VERBOSE) -Wall -Werror
68-
export CFLAGS+=-DSCMI_VERSION_$(VERSION)
83+
export CFLAGS+=-DVERBOSE_LEVEL=$(VERBOSE) -Wall -Werror
6984

7085
# Location of external library directories
7186
LIB_DIR=$(TOP)
7287

7388
all: all_makefiles # to avoid overriding all target
7489

75-
all_makefiles: check_requirements $(BUILD_ALL) $(LIB) $(EXE)
90+
all_makefiles: check_requirements $(BUILD_ALL) $(LIB_ALL) $(LIB_BM) $(EXE)
7691
@echo "### Built project successfully!!!###"
7792

7893
check_requirements:
@@ -88,15 +103,18 @@ $(BUILD_ALL):
88103
$(PROGRAM):
89104
echo "Building executable '$@' at `pwd`"
90105
echo "$(CC) $(D_NAMES) $(CFLAGS) $(PLATFORM_OBJ_DIR)/*.o $(LDFLAGS) -L$(LIB_DIR) -l$(LIB) -o $@"
91-
$(CC) $(D_NAMES) $(CFLAGS) $(PLATFORM_OBJ_DIR)/*.o $(LDFLAGS) -L$(LIB_DIR) -l$(LIB) -o $@
106+
$(CC) $(D_NAMES) $(CFLAGS) $(APP_OBJ_DIR)/*.o $(PLATFORM_OBJ_DIR)/*.o $(LDFLAGS) -L$(LIB_DIR) -l$(LIB) -o $@
107+
108+
$(LIB_BM):
109+
echo "Building library at `pwd`"
110+
$(AR) -cvq lib$@.a $(VAL_OBJ_DIR)/*.o $(TEST_OBJ_DIR)/*.o $(APP_OBJ_DIR)/*.o $(PLATFORM_OBJ_DIR)/*.o
92111

93-
$(LIB):
112+
$(LIB_ALL):
94113
echo "Building library at `pwd`"
95-
$(AR) -cvq lib$@.a $(VAL_OBJ_DIR)/*.o $(TEST_OBJ_DIR)/*.o $(APP_OBJ_DIR)/*.o
114+
$(AR) -cvq lib$@.a $(VAL_OBJ_DIR)/*.o $(TEST_OBJ_DIR)/*.o
96115

97116
help:
98-
@echo "### SUPPORTED PROTOCOLS : base power_domain system_domain performance clock sensor ###"
99-
@echo "### SUPPORTED VERSION : 1 (SCMI v1.0 test) , 2 (SCMI v2.0 test) ###"
117+
@echo "### SUPPORTED PROTOCOLS : base power_domain system_domain performance clock sensor reset ###"
100118
@echo "### SUPPORTED VERBOSE : 1 (ERR) 2 (WARN) 3 (TEST) 4 (DEBUG) 5 (INFO) ###"
101119

102120
clean: clean_all # to avoid overriding clean target

README.md

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,37 @@
1-
# System Control and Management Interface Compliance Suite
1+
2+
# System Control and Management Interface - Compliance Suite
23

34
## Introduction
4-
**System Control and Management Interface** (SCMI) is a set of operating system-independent software interfaces that are used in system management.
5+
**System Control and Management Interface** (SCMI) is a set of Operating System-independent software interfaces that are used in system management.
56

6-
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).
7+
For more information, download the [SCMI Platform Design Document](https://developer.arm.com/documentation/den0056/b/?lang=en).
78

8-
## SCMI compliance suite
9-
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.
9+
## SCMI Compliance suite
10+
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.
1011

1112
## Release details
12-
- Code quality: REL v2.0 Alpha.
13+
- Code quality: REL v2.0.
1314
- The tests are written for version 2.0 of the SCMI PDD.
1415
- The compliance suite maintains backward compatibility with version 1.0 of the SCMI PDD.
1516
- The compliance suite is not a substitute for design verification.
16-
- Refer to the [Test checklist] for the scenarios covered by the tests.
17+
- The compliance suite is verified against [SCP-firmware](https://github.com/ARM-software/SCP-firmware).
18+
- To know about the gaps in the test coverage, see the [Test checklist].
1719

1820
## GitHub branch
19-
20-
To get the latest version of the code with bug fixes and new features, use the master branch.
21+
Use the master branch to get the latest version of the code with bug fixes and new features.
2122

2223
## Test scenarios
2324

24-
The mapping of the SCMI commands to the test cases are mentioned in the [Test checklist].
25-
26-
## Future enhancements
27-
28-
The following features or capability additions are planned as part of future releases:
29-
- Testing notifications and delayed responses for relevant commands.
30-
- Test library extension with new test cases for additional protocols as defined in the newer version of the PDD.
25+
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].
3126

3227
## Getting started
33-
See the [User Guide] for instructions to adapt, build, and run the test suite.
28+
See the [User Guide] for instructions to adapt, build and run the test suite.
3429

3530
### Additional reading
36-
For details on the design of the SCMI test suite, see the [Validation Methodology Document].
31+
For details on the design of the SCMI test suite, see [Validation Methodology Document].
3732

3833
## License
39-
The software is provided under Apache 2.0 [License]. Contributions to this project are accepted under the same license.
34+
The software is provided under Apache 2.0 license. Contributions to this project are accepted under the same license.
4035

4136
## Feedback and support
4237
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.
4944

5045
- - - - - - - - - - - - - - - - - - - -
5146

52-
_Copyright (c) 2019, Arm Limited and Contributors. All rights reserved._
47+
_Copyright (c) 2019-2020, Arm Limited and Contributors. All rights reserved._
5348

54-
[User Guide]: ./docs/user_guide.md "SCMI Test Suite User Guide"
55-
[Validation Methodology Document]: ./docs/Arm_SCMI_Validation_Methodology.pdf "SCMI Test Suite Design"
56-
[Test checklist]: ./docs/scmi_testlist.md "SCMI Test Specification"
57-
[License]: ./LICENSE.md "License"
49+
[User Guide]: ./docs/user_guide.md "SCMI Test Suite User Guide"
50+
[Validation Methodology Document]: ./docs/Arm_SCMI_Validation_Methodology.pdf "SCMI Test Suite Design"
51+
[Test checklist]: ./docs/scmi_testlist.md "SCMI Test Specification"

baremetal_app/Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#/** @file
2+
# * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
3+
# * SPDX-License-Identifier : Apache-2.0
4+
# *
5+
# * Licensed under the Apache License, Version 2.0 (the "License");
6+
# * you may not use this file except in compliance with the License.
7+
# * You may obtain a copy of the License at
8+
# *
9+
# * http://www.apache.org/licenses/LICENSE-2.0
10+
# *
11+
# * Unless required by applicable law or agreed to in writing, software
12+
# * distributed under the License is distributed on an "AS IS" BASIS,
13+
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# * See the License for the specific language governing permissions and
15+
# * limitations under the License.
16+
#**/
17+
18+
C_FILES := $(wildcard *.c)
19+
H_FILES := $(wildcard $(HEADER_DIR)/*.h)
20+
OBJS := $(patsubst %.c,$(APP_OBJ_DIR)/%.o,$(C_FILES))
21+
22+
all: all_baremetal_app
23+
24+
all_baremetal_app: $(OBJS)
25+
@echo "### Finished building with makefile at `pwd` ###"
26+
27+
$(APP_OBJ_DIR)/%.o: %.c $(H_FILES)
28+
echo "$(CC) $(D_NAMES) $(CFLAGS) $(I_DIRS) -c $< -o $@"
29+
$(CC) $(D_NAMES) $(CFLAGS) $(I_DIRS) -g -c $< -o $@
30+
31+
clean: clean_baremetal_app
32+
33+
clean_baremetal_app:
34+
35+
.PHONY: clean

baremetal_app/app.c

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/** @file
2+
* Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
3+
* SPDX-License-Identifier : Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
**/
17+
18+
#include "val_interface.h"
19+
20+
/**
21+
@brief Entry point to SCMI suite
22+
1. Caller - Platform layer.
23+
2. Prerequisite - Power domain protocol info table.
24+
@param none
25+
@return none
26+
**/
27+
28+
void arm_scmi_agent_execute(void *agent_info)
29+
{
30+
uint32_t num_pass;
31+
uint32_t num_fail;
32+
uint32_t num_skip;
33+
34+
val_print(VAL_PRINT_ERR, "\n\n **** SCMI Compliance Suite **** ");
35+
36+
if (val_initialize_system(agent_info)) {
37+
val_print(VAL_PRINT_ERR, "\n **** INIT FAILED ***");
38+
return;
39+
}
40+
41+
val_print(VAL_PRINT_ERR, "\n\n *** Starting BASE tests ***");
42+
val_base_execute_tests();
43+
44+
#ifdef POWER_DOMAIN_PROTOCOL
45+
val_print(VAL_PRINT_ERR, "\n\n *** Starting POWER tests *** ");
46+
val_power_domain_execute_tests();
47+
#endif
48+
49+
#ifdef SYSTEM_POWER_PROTOCOL
50+
val_print(VAL_PRINT_ERR, "\n\n *** Starting SYSTEM POWER tests *** ");
51+
val_system_power_execute_tests();
52+
#endif
53+
54+
#ifdef PERFORMANCE_PROTOCOL
55+
val_print(VAL_PRINT_ERR, "\n\n *** Starting PERFORMANCE tests *** ");
56+
val_performance_execute_tests();
57+
#endif
58+
59+
#ifdef CLOCK_PROTOCOL
60+
val_print(VAL_PRINT_ERR, "\n\n *** Starting CLOCK tests ***");
61+
val_clock_execute_tests();
62+
#endif
63+
64+
#ifdef SENSOR_PROTOCOL
65+
val_print(VAL_PRINT_ERR, "\n\n *** Starting SENSOR tests *** ");
66+
val_sensor_execute_tests();
67+
#endif
68+
69+
#ifdef RESET_PROTOCOL
70+
val_print(VAL_PRINT_ERR, "\n\n *** Starting RESET tests *** ");
71+
val_reset_execute_tests();
72+
#endif
73+
74+
num_pass = val_get_test_passed();
75+
num_fail = val_get_test_failed();
76+
num_skip = val_get_test_skipped();
77+
78+
val_print(VAL_PRINT_ERR, "\n****************************************************", 0);
79+
val_print(VAL_PRINT_ERR, "\n TOTAL TESTS: %d", num_pass + num_fail + num_skip);
80+
val_print(VAL_PRINT_ERR, " PASSED: %d", num_pass);
81+
val_print(VAL_PRINT_ERR, " FAILED: %d", num_fail);
82+
val_print(VAL_PRINT_ERR, " SKIPPED: %d", num_skip);
83+
val_print(VAL_PRINT_ERR, "\n****************************************************", 0);
84+
85+
val_print(VAL_PRINT_ERR, "\n\n **** SCMI tests complete **** \n ");
86+
}
394 KB
Binary file not shown.
-384 KB
Binary file not shown.

docs/guide_sgm_testing.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
**Guide for testing on SGM platforms**
23
=================================
34

@@ -17,43 +18,43 @@ For an introduction to the System Guidance for Mobile (SGM) platforms, please re
1718

1819
Software Stack
1920
-------
20-
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.
21+
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.
2122

2223
Linux kernel
2324
-------
24-
The following changes must be made in the Linux kernel source code after downloading software stack for SGM.
25+
The following changes must be made in the Linux kernel source code after downloading the software stack for SGM.
2526

2627
### Mailbox test driver
27-
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.
28+
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.
2829

2930
### Doorbell support patches for mailbox
30-
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.
31+
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.
3132

3233
### Additional changes to enable mailbox test driver
3334
In addition to applying the patches, follow these steps before starting the kernel build.
3435

3536
`Enable mailbox test driver`: Set CONFIG_MAILBOX_TEST=y in kernel config to include mailbox test driver in the kernel.
3637

37-
`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.
38+
`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.
3839
<br> The driver support to add this as a configurable option is planned for the future.
3940
<br> 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:
4041

4142
```
42-
}
43-
*(touser + l) = '\0';
43+
}
44+
*(touser + l) = '\0';
4445
45-
+ ret = simple_read_from_buffer(userbuf, count, ppos, tdev->rx_buffer,
46-
+ MBOX_HEXDUMP_MAX_LEN);
46+
+ ret = simple_read_from_buffer(userbuf, count, ppos, tdev->rx_buffer,
47+
+ MBOX_HEXDUMP_MAX_LEN);
4748
+
48-
memset(tdev->rx_buffer, 0, MBOX_MAX_MSG_LEN);
49-
mbox_data_ready = false;
49+
memset(tdev->rx_buffer, 0, MBOX_MAX_MSG_LEN);
50+
mbox_data_ready = false;
5051
51-
spin_unlock_irqrestore(&tdev->lock, flags);
52+
spin_unlock_irqrestore(&tdev->lock, flags);
5253
53-
- ret = simple_read_from_buffer(userbuf, count, ppos, touser, MBOX_HEXDUMP_MAX_LEN);
54+
- ret = simple_read_from_buffer(userbuf, count, ppos, touser, MBOX_HEXDUMP_MAX_LEN);
5455
waitq_err:
55-
__set_current_state(TASK_RUNNING);
56-
remove_wait_queue(&tdev->waitq, &wait);
56+
__set_current_state(TASK_RUNNING);
57+
remove_wait_queue(&tdev->waitq, &wait);
5758
```
5859
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.
5960

@@ -64,10 +65,9 @@ For instructions to build the test suite for sgm platform and running it, see re
6465

6566
- - - - - - - - - - - - - - - -
6667

67-
_Copyright (c) 2019, Arm Limited and Contributors. All rights reserved._
68+
_Copyright (c) 2019-2020, Arm Limited and Contributors. All rights reserved._
6869

69-
[ARM Developer documentation]: https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms
70-
[Mailbox doorbell support patches]: https://lkml.org/lkml/2017/5/24/339
71-
[Mailbox doorbell support repo]: https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/log/?h=scmi_mhu_dt_changes
72-
[User Guide]: ./user_guide.md
70+
[ARM Developer documentation]: https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms
71+
[Mailbox doorbell support patches]: https://lkml.org/lkml/2017/5/24/339
72+
[User Guide]: ./user_guide.md
7373
[super-project]: https://git.linaro.org/landing-teams/working/arm/arm-reference-platforms.git/about/docs/user-guide.rst

0 commit comments

Comments
 (0)