Merge "Support for extended register usage in SMCCC v1.2 spec"
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..a7083fb
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,25 @@
+#
+# Copyright (c) 2019, ARM Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+# Minimal makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+SPHINXPROJ = TrustedFirmware-A Tests
+SOURCEDIR = .
+BUILDDIR = build
+
+# Put it first so that "make" without argument is like "make help".
+help:
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+.PHONY: help Makefile
+
+# Catch-all target: route all unknown targets to Sphinx using the new
+# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
+%: Makefile
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
diff --git a/docs/change-log.rst b/docs/change-log.rst
index 29de0ed..da967e4 100644
--- a/docs/change-log.rst
+++ b/docs/change-log.rst
@@ -1,8 +1,5 @@
-
-.. section-numbering::
- :suffix: .
-
-.. contents::
+Change Log & Release Notes
+==========================
Please note that the Trusted Firmware-A Tests version follows the Trusted
Firmware-A version for simplicity. At any point in time, TF-A Tests version
@@ -10,11 +7,11 @@
Tests are not guaranteed to be compatible. This also means that a version
upgrade on the TF-A-Tests side might not necessarily introduce any new feature.
-Trusted Firmware-A Tests - version 2.2
-======================================
+Version 2.2
+-----------
New features
-------------
+^^^^^^^^^^^^
- A wide range of tests are made available in this release to help validate
the functionality of TF-A.
@@ -22,7 +19,7 @@
- Various improvements to test framework and test suite.
TFTF
-````
+~~~~
- Enhancement to xlat table library synchronous to TF-A code base.
@@ -74,18 +71,18 @@
and fix the conditional check of AMU Group0 counter value.
Secure partitions
-`````````````````
+~~~~~~~~~~~~~~~~~
A new Secure Partition Quark is introduced in this release.
Quark
-'''''''''
+~~~~~
The Quark test secure partition provided is a simple service which returns a
magic number. Further, a simple test is added to test if Quark is functional.
Issues resolved since last release
-----------------------------------
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Bug fix in libc memchr implementation.
@@ -97,18 +94,14 @@
corresponding tests are stable in this release.
Known issues and limitations
-----------------------------
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The sections below list the known issues and limitations of each test image
provided in this repository. Unless and otherwise stated, issues and limitations
stated in previous release continue to exist in this release.
TFTF
-````
-
-Tests
-'''''
-
+~~~~
- Multicore spurious interrupt test is observed to have unstable behavior. As a
temporary solution, this test is skipped for AArch64 Juno configurations.
@@ -119,11 +112,11 @@
-Trusted Firmware-A Tests - version 2.1
-======================================
+Version 2.1
+-----------
New features
-------------
+^^^^^^^^^^^^
- Add initial support for testing Secure Partition Client Interface (SPCI)
and Secure Partition Run-Time (SPRT) standards.
@@ -139,7 +132,7 @@
- Various stability improvements, code refactoring and clean ups.
TFTF
-````
+~~~~
- Reorganize tests build infrastructure to allow the selection of a subset of
tests.
@@ -173,7 +166,7 @@
- `Arm Neoverse Reference Design N1 Edge (RD-N1-Edge)`_ FVP (experimental).
Secure partitions
-`````````````````
+~~~~~~~~~~~~~~~~~
We now have 3 Secure Partitions to test the SPM implementation in TF-A.
@@ -211,7 +204,7 @@
provides the same services but with different identifiers at the moment.
EL3 payload
-```````````
+~~~~~~~~~~~
- New platform ports:
@@ -220,7 +213,7 @@
- `Arm Neoverse Reference Design N1 Edge (RD-N1-Edge)`_ FVP (experimental).
Issues resolved since last release
-----------------------------------
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- The GICv2 spurious IRQ test is no longer Juno-specific. It is now only
GICv2-specific.
@@ -233,19 +226,19 @@
- Cactus-MM now successfully links with GNU toolchain 7.3.1.
Known issues and limitations
-----------------------------
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The sections below lists the known issues and limitations of each test image
provided in this repository.
TFTF
-````
+~~~~
The TFTF test image might be conceptually sub-divided further in 2 parts: the
tests themselves, and the test framework they are based upon.
Test framework
-''''''''''''''
+~~~~~~~~~~~~~~
- Some stability issues.
@@ -285,7 +278,7 @@
It is only enabled on the primary CPU on the cold boot.
Tests
-'''''
+~~~~~
- Some tests are implemented for AArch64 only and are skipped on AArch32.
@@ -324,7 +317,7 @@
The root cause is unknown.
FWU images
-``````````
+~~~~~~~~~~
- The FWU tests do not work on the revC of the Base AEM FVP. They only work on
the revB.
@@ -333,7 +326,7 @@
is not a clean design and may cause confusion.
Test secure partitions (Cactus, Cactus-MM, Ivy)
-```````````````````````````````````````````````
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- This is experimental code. It's likely to change a lot as the secure
partition software architecture evolves.
@@ -341,7 +334,7 @@
- Supported on AArch64 FVP platform only.
All test images
-```````````````
+~~~~~~~~~~~~~~~
- TF-A Tests are derived from a fork of TF-A so:
@@ -376,16 +369,16 @@
all such direct reads of the ``CNTPCT_EL0`` register and replace them with a
call to ``syscounter_read()`` where appropriate.
-Trusted Firmware-A Tests - version 2.0
-======================================
+Version 2.0
+-----------
New features
-------------
+^^^^^^^^^^^^
This is the first public release of the Trusted Firmware-A Tests source code.
TFTF
-````
+~~~~
- Provides a baremetal test framework to exercise TF-A features through its
``SMC`` interface.
@@ -433,7 +426,7 @@
test results in non-volatile memory (e.g. flash).
FWU images
-``````````
+~~~~~~~~~~
- Provides example code to exercise the Firmware Update feature of TF-A.
@@ -442,12 +435,12 @@
to the TF-A BL1 image.
EL3 test payload
-````````````````
+~~~~~~~~~~~~~~~~
- Tests the ability of TF-A to load an EL3 payload.
Cactus test secure partition
-````````````````````````````
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Tests that TF-A has correctly setup the secure partition environment: it
should be allowed to perform cache maintenance operations, access floating
@@ -459,19 +452,19 @@
- Tests the ability of a secure partition to handle StandaloneMM requests.
Known issues and limitations
-----------------------------
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The sections below lists the known issues and limitations of each test image
provided in this repository.
TFTF
-````
+~~~~
The TFTF test image might be conceptually sub-divided further in 2 parts: the
tests themselves, and the test framework they are based upon.
Test framework
-''''''''''''''
+~~~~~~~~~~~~~~
- Some stability issues.
@@ -507,7 +500,7 @@
not complete. As a result, there are still some TFTF files scattered around.
Tests
-'''''
+~~~~~
- Some tests are implemented for AArch64 only and are skipped on AArch32.
@@ -555,7 +548,7 @@
The root cause is unknown.
FWU images
-``````````
+~~~~~~~~~~
- The FWU tests do not work on the revC of the Base AEM FVP. They only work on
the revB.
@@ -564,7 +557,7 @@
is not a clean design and may cause confusion.
Cactus test secure partition
-````````````````````````````
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Cactus is experimental code. It's likely to change a lot as the secure
partition software architecture evolves.
@@ -574,7 +567,7 @@
- Cactus is supported on AArch64 FVP platform only.
All test images
-```````````````
+~~~~~~~~~~~~~~~
- TF-A Tests are derived from a fork of TF-A so:
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..58f5e72
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,81 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2019, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#
+# Configuration file for the Sphinx documentation builder.
+#
+# See the options documentation at http://www.sphinx-doc.org/en/master/config
+
+import os
+
+# -- Project information -----------------------------------------------------
+
+project = 'Trusted Firmware-A Tests'
+
+# -- General configuration ---------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = ['sphinx.ext.autosectionlabel', 'sphinxcontrib.plantuml']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'index'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This pattern also affects html_static_path and html_extra_path .
+exclude_patterns = []
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# Minimum version of sphinx required
+needs_sphinx = '2.0'
+
+# -- Options for HTML output -------------------------------------------------
+
+# Don't show the "Built with Sphinx" footer
+html_show_sphinx = False
+
+# Don't show copyright info in the footer (we have this content in the page)
+html_show_copyright = False
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = "sphinx_rtd_theme"
+
+# The logo to display in the sidebar
+html_logo = 'resources/TrustedFirmware-Logo_standard-white.png'
+
+# Options for the "sphinx-rtd-theme" theme
+html_theme_options = {
+ 'collapse_navigation': False, # Can expand and collapse sidebar entries
+ 'prev_next_buttons_location': 'both', # Top and bottom of the page
+ 'style_external_links': True # Display an icon next to external links
+}
+
+# -- Options for autosectionlabel --------------------------------------------
+
+# Only generate automatic section labels for document titles
+autosectionlabel_maxdepth = 1
+
+# -- Options for plantuml ----------------------------------------------------
+
+plantuml_output_format = 'svg_img'
diff --git a/docs/design.rst b/docs/design.rst
index 91815d0..4df620c 100644
--- a/docs/design.rst
+++ b/docs/design.rst
@@ -1,10 +1,5 @@
-Trusted Firmware-A Tests - Design
-=================================
-
-.. section-numbering::
- :suffix: .
-
-.. contents::
+Design
+======
This document provides some details about the internals of the TF-A Tests
design. It is incomplete at the moment.
diff --git a/docs/implementing-tests.rst b/docs/implementing-tests.rst
index f7be284..3810c14 100644
--- a/docs/implementing-tests.rst
+++ b/docs/implementing-tests.rst
@@ -1,10 +1,5 @@
-How to implement tests
-======================
-
-.. section-numbering::
- :suffix: .
-
-.. contents::
+Implementing Tests
+==================
This document aims at providing some pointers to help implementing new tests in
the TFTF image.
@@ -114,7 +109,7 @@
--------------
-*Copyright (c) 2018, Arm Limited. All rights reserved.*
+*Copyright (c) 2018-2019, Arm Limited. All rights reserved.*
.. _SMC Calling Convention: SMCCC_
.. _SMCCC: http://infocenter.arm.com/help/topic/com.arm.doc.den0028b/ARM_DEN0028B_SMC_Calling_Convention.pdf
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000..29b25d5
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,18 @@
+Trusted Firmware-A Tests Documentation
+======================================
+
+.. toctree::
+ :maxdepth: 1
+ :hidden:
+
+ Home<self>
+ user-guide
+ porting-guide
+ implementing-tests
+ design
+ change-log
+ license
+
+--------------
+
+*Copyright (c)2019, Arm Limited. All rights reserved.*
diff --git a/docs/license.rst b/docs/license.rst
new file mode 100644
index 0000000..46124fc
--- /dev/null
+++ b/docs/license.rst
@@ -0,0 +1,68 @@
+License
+=======
+
+The software is provided under a BSD-3-Clause `license`_. Contributions to this
+project are accepted under the same license with developer sign-off as
+described in the `Contributing Guidelines`_.
+
+::
+
+ Copyright (c) <year> <owner>. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ - Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ - Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+SPDX Identifiers
+----------------
+
+Individual files contain the following tag instead of the full license text.
+
+::
+
+ SPDX-License-Identifier: BSD-3-Clause
+
+This enables machine processing of license information based on the SPDX
+License Identifiers that are here available: http://spdx.org/licenses/
+
+Other Projects
+--------------
+
+This project contains code from other projects as listed below. The original
+license text is included in those source files.
+
+- The libc source code is derived from `FreeBSD`_ and `SCC`_. FreeBSD uses
+ various BSD licenses, including BSD-3-Clause and BSD-2-Clause. The SCC code
+ is used under the BSD-3-Clause license with the author's permission.
+
+- The `LLVM compiler-rt`_ source code is disjunctively dual licensed
+ (NCSA OR MIT). It is used by this project under the terms of the NCSA
+ license (also known as the University of Illinois/NCSA Open Source License),
+ which is a permissive license compatible with BSD-3-Clause. Any
+ contributions to this code must be made under the terms of both licenses.
+
+.. _FreeBSD: http://www.freebsd.org
+.. _SCC: http://www.simple-cc.org/
+.. _LLVM compiler-rt: https://compiler-rt.llvm.org/
diff --git a/docs/porting-guide.rst b/docs/porting-guide.rst
index 9759c98..ba9b9aa 100644
--- a/docs/porting-guide.rst
+++ b/docs/porting-guide.rst
@@ -1,12 +1,5 @@
-Trusted Firmware-A Tests - Porting Guide
-========================================
-
-.. section-numbering::
- :suffix: .
-
-.. contents::
-
---------------
+Porting Guide
+=============
Introduction
------------
diff --git a/docs/requirements.txt b/docs/requirements.txt
new file mode 100644
index 0000000..358ed0e
--- /dev/null
+++ b/docs/requirements.txt
@@ -0,0 +1,3 @@
+sphinx>=2.0.0
+sphinx-rtd-theme>=0.4.3
+sphinxcontrib-plantuml>=0.15
diff --git a/docs/resources/TrustedFirmware-Logo_standard-white.png b/docs/resources/TrustedFirmware-Logo_standard-white.png
new file mode 100644
index 0000000..e7bff71
--- /dev/null
+++ b/docs/resources/TrustedFirmware-Logo_standard-white.png
Binary files differ
diff --git a/docs/user-guide.rst b/docs/user-guide.rst
index 2e6f7ba..5dc7074 100644
--- a/docs/user-guide.rst
+++ b/docs/user-guide.rst
@@ -1,10 +1,5 @@
-Trusted Firmware-A Tests - User Guide
-=====================================
-
-.. section-numbering::
- :suffix: .
-
-.. contents::
+User Guide
+==========
This document describes how to build the Trusted Firmware-A Tests (TF-A Tests)
and run them on a set of platforms. It assumes that the reader has previous
@@ -430,6 +425,12 @@
platform makefile is free to override this value if Firmware Update is
supported on this platform.
+Arm FVP platform specific build options
+'''''''''''''''''''''''''''''''''''''''
+
+- ``FVP_MAX_PE_PER_CPU``: Sets the maximum number of PEs implemented on any CPU
+ in the system. It can take either 1 or 2 values. This option defaults to 1.
+
Checking source code style
--------------------------
diff --git a/el3_payload/Makefile b/el3_payload/Makefile
index 984f60d..188731c 100644
--- a/el3_payload/Makefile
+++ b/el3_payload/Makefile
@@ -1,9 +1,25 @@
#
-# Copyright (c) 2018, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
+# Default number of threads per CPU on FVP
+FVP_MAX_PE_PER_CPU := 1
+
+# Check the PE per core count
+ifneq ($(FVP_MAX_PE_PER_CPU),$(filter $(FVP_MAX_PE_PER_CPU),1 2))
+$(error "Incorrect FVP_MAX_PE_PER_CPU specified for FVP port")
+endif
+
+# Convenience function for adding build definitions
+# $(eval $(call add_define,BAR_DEFINES,FOO)) will have:
+# -DFOO if $(FOO) is empty; -DFOO=$(FOO) otherwise
+# inside the BAR_DEFINES variable.
+define add_define
+$(1) += -D$(2)$(if $(value $(2)),=$(value $(2)),)
+endef
+
CC := ${CROSS_COMPILE}gcc
AS := ${CROSS_COMPILE}as
LD := ${CROSS_COMPILE}ld
@@ -27,6 +43,9 @@
include plat/${PLAT}/platform.mk
+# Pass FVP_MAX_PE_PER_CPU to the build system
+$(eval $(call add_define,ASFLAGS,FVP_MAX_PE_PER_CPU))
+
all: ${BIN}
${PLAT_BUILD_DIR}:
diff --git a/el3_payload/plat/fvp/platform.h b/el3_payload/plat/fvp/platform.h
index 809ae7e..657b9db 100644
--- a/el3_payload/plat/fvp/platform.h
+++ b/el3_payload/plat/fvp/platform.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -15,7 +15,5 @@
#define UART_BASE 0x1c090000
#define FVP_MAX_CPUS_PER_CLUSTER 4
-/* Currently multi-threaded CPUs only have a single thread */
-#define FVP_MAX_PE_PER_CPU 1
#endif /* __PLATFORM_H__ */
diff --git a/include/lib/tftf_lib.h b/include/lib/tftf_lib.h
index 9812252..7f6786a 100644
--- a/include/lib/tftf_lib.h
+++ b/include/lib/tftf_lib.h
@@ -199,7 +199,12 @@
unsigned int tftf_is_rebooted(void);
static inline unsigned int make_mpid(unsigned int clusterid,
+#if FVP_MAX_PE_PER_CPU > 1
+ unsigned int coreid,
+ unsigned int threadid)
+#else
unsigned int coreid)
+#endif
{
/*
* If MT bit is set then need to shift the affinities and also set the
@@ -207,11 +212,14 @@
*/
if ((read_mpidr_el1() & MPIDR_MT_MASK) != 0)
return MPIDR_MT_MASK |
- ((clusterid & MPIDR_AFFLVL_MASK) << MPIDR_AFF2_SHIFT) |
- ((coreid & MPIDR_AFFLVL_MASK) << MPIDR_AFF1_SHIFT);
+#if FVP_MAX_PE_PER_CPU > 1
+ ((threadid & MPIDR_AFFLVL_MASK) << MPIDR_AFF0_SHIFT) |
+#endif
+ ((coreid & MPIDR_AFFLVL_MASK) << MPIDR_AFF1_SHIFT) |
+ ((clusterid & MPIDR_AFFLVL_MASK) << MPIDR_AFF2_SHIFT);
else
- return ((clusterid & MPIDR_AFFLVL_MASK) << MPIDR_AFF1_SHIFT) |
- ((coreid & MPIDR_AFFLVL_MASK) << MPIDR_AFF0_SHIFT);
+ return ((coreid & MPIDR_AFFLVL_MASK) << MPIDR_AFF0_SHIFT) |
+ ((clusterid & MPIDR_AFFLVL_MASK) << MPIDR_AFF1_SHIFT);
}
diff --git a/license.rst b/license.rst
index 3c87311..3ec3b74 100644
--- a/license.rst
+++ b/license.rst
@@ -1,38 +1 @@
-Copyright (c) <year> <owner>. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-- Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-- Redistributions in binary form must reproduce the above copyright notice, this
- list of conditions and the following disclaimer in the documentation and/or
- other materials provided with the distribution.
-
-- Neither the name of the copyright holder nor the names of its contributors
- may be used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
---------------
-
-Note:
-Individual files contain the following tag instead of the full license text.
-
-::
-
- SPDX-License-Identifier: BSD-3-Clause
-
-This enables machine processing of license information based on the SPDX
-License Identifiers that are here available: http://spdx.org/licenses/
+See docs/license.rst
diff --git a/plat/arm/fvp/fvp_def.h b/plat/arm/fvp/fvp_def.h
index abaa387..3f01678 100644
--- a/plat/arm/fvp/fvp_def.h
+++ b/plat/arm/fvp/fvp_def.h
@@ -19,8 +19,6 @@
#define FVP_MAX_CPUS_PER_CLUSTER 8
/* Currently the highest cluster count on the FVP is 4 (Quad cluster) */
#define FVP_CLUSTER_COUNT 4
-/* Currently multi-threaded CPUs only have a single thread */
-#define FVP_MAX_PE_PER_CPU 1
/*******************************************************************************
* FVP memory map related constants
diff --git a/plat/arm/fvp/fvp_topology.c b/plat/arm/fvp/fvp_topology.c
index 751a1b8..dddd25b 100644
--- a/plat/arm/fvp/fvp_topology.c
+++ b/plat/arm/fvp/fvp_topology.c
@@ -17,46 +17,40 @@
#define PSYSR_OFF 0x10
#define PSYSR_INVALID 0xffffffff
+#if FVP_MAX_PE_PER_CPU == 2
+/* SMT: 2 threads per CPU */
+#define CPU_DEF(cluster, cpu) \
+ { cluster, cpu, 0 }, \
+ { cluster, cpu, 1 }
+
+#else
+#define CPU_DEF(cluster, cpu) \
+ { cluster, cpu }
+#endif
+
+/* 8 CPUs per cluster */
+#define CLUSTER_DEF(cluster) \
+ CPU_DEF(cluster, 0), \
+ CPU_DEF(cluster, 1), \
+ CPU_DEF(cluster, 2), \
+ CPU_DEF(cluster, 3), \
+ CPU_DEF(cluster, 4), \
+ CPU_DEF(cluster, 5), \
+ CPU_DEF(cluster, 6), \
+ CPU_DEF(cluster, 7)
+
static const struct {
unsigned int cluster_id;
unsigned int cpu_id;
+#if FVP_MAX_PE_PER_CPU > 1
+ unsigned int thread_id;
+#endif
} fvp_base_aemv8a_aemv8a_cores[] = {
- /* Cluster 0 */
- { 0, 0 },
- { 0, 1 },
- { 0, 2 },
- { 0, 3 },
- { 0, 4 },
- { 0, 5 },
- { 0, 6 },
- { 0, 7 },
- /* Cluster 1 */
- { 1, 0 },
- { 1, 1 },
- { 1, 2 },
- { 1, 3 },
- { 1, 4 },
- { 1, 5 },
- { 1, 6 },
- { 1, 7 },
- /* Cluster 2 */
- { 2, 0 },
- { 2, 1 },
- { 2, 2 },
- { 2, 3 },
- { 2, 4 },
- { 2, 5 },
- { 2, 6 },
- { 2, 7 },
- /* Cluster 3 */
- { 3, 0 },
- { 3, 1 },
- { 3, 2 },
- { 3, 3 },
- { 3, 4 },
- { 3, 5 },
- { 3, 6 },
- { 3, 7 },
+ /* Clusters 0...3 */
+ CLUSTER_DEF(0),
+ CLUSTER_DEF(1),
+ CLUSTER_DEF(2),
+ CLUSTER_DEF(3)
};
/*
@@ -105,7 +99,12 @@
mpid = make_mpid(
fvp_base_aemv8a_aemv8a_cores[core_pos].cluster_id,
+#if FVP_MAX_PE_PER_CPU > 1
+ fvp_base_aemv8a_aemv8a_cores[core_pos].cpu_id,
+ fvp_base_aemv8a_aemv8a_cores[core_pos].thread_id);
+#else
fvp_base_aemv8a_aemv8a_cores[core_pos].cpu_id);
+#endif
if (fvp_pwrc_read_psysr(mpid) != PSYSR_INVALID)
return mpid;
diff --git a/plat/arm/fvp/platform.mk b/plat/arm/fvp/platform.mk
index c014d6d..27874e2 100644
--- a/plat/arm/fvp/platform.mk
+++ b/plat/arm/fvp/platform.mk
@@ -4,6 +4,19 @@
# SPDX-License-Identifier: BSD-3-Clause
#
+# Default number of threads per CPU on FVP
+FVP_MAX_PE_PER_CPU := 1
+
+# Check the PE per core count
+ifneq ($(FVP_MAX_PE_PER_CPU),$(filter $(FVP_MAX_PE_PER_CPU),1 2))
+$(error "Incorrect FVP_MAX_PE_PER_CPU specified for FVP port")
+endif
+
+# Pass FVP_MAX_PE_PER_CPU to the build system
+$(eval $(call add_define,TFTF_DEFINES,FVP_MAX_PE_PER_CPU))
+$(eval $(call add_define,NS_BL1U_DEFINES,FVP_MAX_PE_PER_CPU))
+$(eval $(call add_define,NS_BL2U_DEFINES,FVP_MAX_PE_PER_CPU))
+
PLAT_INCLUDES := -Iplat/arm/fvp/include/
PLAT_SOURCES := drivers/arm/gic/arm_gic_v2v3.c \
diff --git a/spm/cactus/cactus.mk b/spm/cactus/cactus.mk
index d964ab1..4acc715 100644
--- a/spm/cactus/cactus.mk
+++ b/spm/cactus/cactus.mk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2018, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -53,6 +53,7 @@
CACTUS_DEFINES :=
$(eval $(call add_define,CACTUS_DEFINES,DEBUG))
+$(eval $(call add_define,CACTUS_DEFINES,FVP_MAX_PE_PER_CPU))
$(eval $(call add_define,CACTUS_DEFINES,ENABLE_ASSERTIONS))
$(eval $(call add_define,CACTUS_DEFINES,LOG_LEVEL))
$(eval $(call add_define,CACTUS_DEFINES,PLAT_${PLAT}))
diff --git a/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c b/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c
index 9afd910..cc4ad19 100644
--- a/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c
+++ b/tftf/tests/runtime_services/standard_service/psci/api_tests/affinity_info/test_psci_affinity_info.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -214,7 +214,11 @@
* CPU on the platform. The PSCI implementation should ignore the
* affinity 0 field.
*/
+#if FVP_MAX_PE_PER_CPU > 1
+ target_mpid = make_mpid(cluster_id, 0, 0xE1);
+#else
target_mpid = make_mpid(cluster_id, 0xE1);
+#endif
aff_info = tftf_psci_affinity_info(target_mpid, MPIDR_AFFLVL1);
return get_test_result(expected_values, aff_info);
}