Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
4b0695ac
Commit
4b0695ac
authored
May 26, 2020
by
Olivier Deprez
Committed by
TrustedFirmware Code Review
May 26, 2020
Browse files
Merge "SPCI is now called PSA FF-A" into integration
parents
beff4910
662af36d
Changes
14
Hide whitespace changes
Inline
Side-by-side
docs/about/features.rst
View file @
4b0695ac
...
...
@@ -108,8 +108,8 @@ Still to come
- Refinements to Position Independent Executable (PIE) support.
- Continued support for the
draft
SPCI specification, to enable the
use of
secure partition management in the secure world.
- Continued support for the
PSA FF-A v1.0 (formally known as
SPCI
)
specification, to enable the
use of
secure partition management in the secure world.
- Documentation enhancements.
...
...
docs/components/index.rst
View file @
4b0695ac
...
...
@@ -17,5 +17,5 @@ Components
romlib-design
sdei
secure-partition-manager-design
spci
-manifest-binding
psa-ffa
-manifest-binding
xlat-tables-lib-v2-design
docs/components/
spci
-manifest-binding.rst
→
docs/components/
psa-ffa
-manifest-binding.rst
View file @
4b0695ac
SPCI
manifest binding to device tree
====================================
PSA FF-A
manifest binding to device tree
====================================
====
This document defines the nodes and properties used to define a partition,
according to the
SPCI
specification.
according to the
PSA FF-A
specification.
Version 1.0
-----------
spci
-manifest-partition
^^^^^^^^^^^^^^^^^^^^^^^
psa-ffa
-manifest-partition
^^^^^^^^^^^^^^^^^^^^^^^
^^^
- compatible [mandatory]
- value type: <string>
- Must be the string "arm,
spci
-manifest-X.Y" which specifies the major and
minor versions fo the device tree binding for the
SPCI
manifest represented
- Must be the string "arm,
ffa
-manifest-X.Y" which specifies the major and
minor versions fo the device tree binding for the
FFA
manifest represented
by this node. The minor number is incremented if the binding changes in a
backwards compatible manner.
- X is an integer representing the major version number of this document.
- Y is an integer representing the minor version number of this document.
-
spci
-version [mandatory]
-
ffa
-version [mandatory]
- value type: <u32>
- Must be two 16 bits values (X, Y), concatenated as 31:16 -> X,
15:0 -> Y, where:
- X is the major version of PSA-FF-A expected by the partition at the
SPCI
- X is the major version of PSA-FF-A expected by the partition at the
FFA
instance it will execute.
- Y is the minor version of PSA-FF-A expected by the partition at the
SPCI
- Y is the minor version of PSA-FF-A expected by the partition at the
FFA
instance it will execute.
- uuid [mandatory]
...
...
@@ -40,7 +40,7 @@ spci-manifest-partition
- If there are multiple instances of a Trusted OS, then the UUID can be
shared by all instances.
- The TEE driver in the HLOS can use the UUID with the
SPCI
_PARTITION_INFO_GET interface to determine the:
FFA
_PARTITION_INFO_GET interface to determine the:
- Number of Trusted OSs
- The partition ID of each instance of the Trusted OS
...
...
@@ -116,7 +116,7 @@ spci-manifest-partition
- value type: "memory-regions" node
- Specific "memory-regions" nodes that describe the RX/TX buffers expected
by the partition.
The "compatible" must be the string "arm,
spci
-manifest-rx_tx-buffer".
The "compatible" must be the string "arm,
ffa
-manifest-rx_tx-buffer".
- messaging-method [mandatory]
- value type: <u32>
...
...
@@ -146,7 +146,7 @@ spci-manifest-partition
- gp-register-num
- value type: <u32>
- Presence of this field indicates that the partition expects the
spci
_init_info structure to be passed in via the specified general purpose
ffa
_init_info structure to be passed in via the specified general purpose
register.
The field specifies the general purpose register number but not its width.
The width is derived from the partition's execution state, as specified in
...
...
@@ -164,7 +164,7 @@ memory-regions
- compatible [mandatory]
- value type: <string>
- Must be the string "arm,
spci
-manifest-memory-regions".
- Must be the string "arm,
ffa
-manifest-memory-regions".
- description
- value type: <string>
...
...
@@ -184,7 +184,7 @@ memory-regions
- Base address of the region. The address must be aligned to the translation
granule size.
The address given may be a Physical Address (PA), Virtual Address (VA), or
Intermediate Physical Address (IPA). Refer to the
SPCI
specification for
Intermediate Physical Address (IPA). Refer to the
FFA
specification for
more information on the restrictions around the address type.
If the base address is omitted then the partition manager must map a memory
region of the specified size into the partition's translation regime and
...
...
@@ -196,7 +196,7 @@ device-regions
- compatible [mandatory]
- value type: <string>
- Must be the string "arm,
spci
-manifest-device-regions".
- Must be the string "arm,
ffa
-manifest-device-regions".
- description
- value type: <string>
...
...
docs/global_substitutions.txt
View file @
4b0695ac
...
...
@@ -14,6 +14,7 @@
.. |EHF| replace:: :term:`EHF`
.. |FCONF| replace:: :term:`FCONF`
.. |FDT| replace:: :term:`FDT`
.. |FFA| replace:: :term:`FFA`
.. |FIP| replace:: :term:`FIP`
.. |FVP| replace:: :term:`FVP`
.. |FWU| replace:: :term:`FWU`
...
...
@@ -44,7 +45,6 @@
.. |SMCCC| replace:: :term:`SMCCC`
.. |SoC| replace:: :term:`SoC`
.. |SP| replace:: :term:`SP`
.. |SPCI| replace:: :term:`SPCI`
.. |SPD| replace:: :term:`SPD`
.. |SPM| replace:: :term:`SPM`
.. |SSBS| replace:: :term:`SSBS`
...
...
docs/glossary.rst
View file @
4b0695ac
...
...
@@ -57,6 +57,9 @@ You can find additional definitions in the `Arm Glossary`_.
FDT
Flattened Device Tree
FFA
Firmware Framework for A-class processors
FIP
Firmware Image Package
...
...
@@ -107,6 +110,9 @@ You can find additional definitions in the `Arm Glossary`_.
PMF
Performance Measurement Framework
PSA
Platform Security Architecture
PSCI
Power State Coordination Interface
...
...
@@ -149,9 +155,6 @@ You can find additional definitions in the `Arm Glossary`_.
SP
Secure Partition
SPCI
Secure Partition Client Interface
SPD
Secure Payload Dispatcher
...
...
include/services/ffa_svc.h
0 → 100644
View file @
4b0695ac
/*
* Copyright (c) 2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef FFA_SVC_H
#define FFA_SVC_H
#include <lib/smccc.h>
#include <lib/utils_def.h>
#include <tools_share/uuid.h>
/* FFA error codes. */
#define FFA_ERROR_NOT_SUPPORTED -1
#define FFA_ERROR_INVALID_PARAMETER -2
#define FFA_ERROR_NO_MEMORY -3
#define FFA_ERROR_BUSY -4
#define FFA_ERROR_INTERRUPTED -5
#define FFA_ERROR_DENIED -6
#define FFA_ERROR_RETRY -7
/* The macros below are used to identify FFA calls from the SMC function ID */
#define FFA_FNUM_MIN_VALUE U(0x60)
#define FFA_FNUM_MAX_VALUE U(0x7f)
#define is_ffa_fid(fid) __extension__ ({ \
__typeof__(fid) _fid = (fid); \
((GET_SMC_NUM(_fid) >= FFA_FNUM_MIN_VALUE) && \
(GET_SMC_NUM(_fid) <= FFA_FNUM_MAX_VALUE)); })
/* FFA_VERSION helpers */
#define FFA_VERSION_MAJOR U(1)
#define FFA_VERSION_MAJOR_SHIFT 16
#define FFA_VERSION_MAJOR_MASK U(0x7FFF)
#define FFA_VERSION_MINOR U(0)
#define FFA_VERSION_MINOR_SHIFT 0
#define FFA_VERSION_MINOR_MASK U(0xFFFF)
#define MAKE_FFA_VERSION(major, minor) \
((((major) & FFA_VERSION_MAJOR_MASK) << FFA_VERSION_MAJOR_SHIFT) | \
(((minor) & FFA_VERSION_MINOR_MASK) << FFA_VERSION_MINOR_SHIFT))
#define FFA_VERSION_COMPILED MAKE_FFA_VERSION(FFA_VERSION_MAJOR, \
FFA_VERSION_MINOR)
/* FFA_MSG_SEND helpers */
#define FFA_MSG_SEND_ATTRS_BLK_SHIFT U(0)
#define FFA_MSG_SEND_ATTRS_BLK_MASK U(0x1)
#define FFA_MSG_SEND_ATTRS_BLK U(0)
#define FFA_MSG_SEND_ATTRS_BLK_NOT U(1)
#define FFA_MSG_SEND_ATTRS(blk) \
(((blk) & FFA_MSG_SEND_ATTRS_BLK_MASK) \
<< FFA_MSG_SEND_ATTRS_BLK_SHIFT)
/* Get FFA fastcall std FID from function number */
#define FFA_FID(smc_cc, func_num) \
((SMC_TYPE_FAST << FUNCID_TYPE_SHIFT) | \
((smc_cc) << FUNCID_CC_SHIFT) | \
(OEN_STD_START << FUNCID_OEN_SHIFT) | \
((func_num) << FUNCID_NUM_SHIFT))
/* FFA function numbers */
#define FFA_FNUM_ERROR U(0x60)
#define FFA_FNUM_SUCCESS U(0x61)
#define FFA_FNUM_INTERRUPT U(0x62)
#define FFA_FNUM_VERSION U(0x63)
#define FFA_FNUM_FEATURES U(0x64)
#define FFA_FNUM_RX_RELEASE U(0x65)
#define FFA_FNUM_RXTX_MAP U(0x66)
#define FFA_FNUM_RXTX_UNMAP U(0x67)
#define FFA_FNUM_PARTITION_INFO_GET U(0x68)
#define FFA_FNUM_ID_GET U(0x69)
#define FFA_FNUM_MSG_POLL U(0x6A)
#define FFA_FNUM_MSG_WAIT U(0x6B)
#define FFA_FNUM_MSG_YIELD U(0x6C)
#define FFA_FNUM_MSG_RUN U(0x6D)
#define FFA_FNUM_MSG_SEND U(0x6E)
#define FFA_FNUM_MSG_SEND_DIRECT_REQ U(0x6F)
#define FFA_FNUM_MSG_SEND_DIRECT_RESP U(0x70)
#define FFA_FNUM_MEM_DONATE U(0x71)
#define FFA_FNUM_MEM_LEND U(0x72)
#define FFA_FNUM_MEM_SHARE U(0x73)
#define FFA_FNUM_MEM_RETRIEVE_REQ U(0x74)
#define FFA_FNUM_MEM_RETRIEVE_RESP U(0x75)
#define FFA_FNUM_MEM_RELINQUISH U(0x76)
#define FFA_FNUM_MEM_RECLAIM U(0x77)
/* FFA SMC32 FIDs */
#define FFA_ERROR FFA_FID(SMC_32, FFA_FNUM_ERROR)
#define FFA_SUCCESS_SMC32 FFA_FID(SMC_32, FFA_FNUM_SUCCESS)
#define FFA_INTERRUPT FFA_FID(SMC_32, FFA_FNUM_INTERRUPT)
#define FFA_VERSION FFA_FID(SMC_32, FFA_FNUM_VERSION)
#define FFA_FEATURES FFA_FID(SMC_32, FFA_FNUM_FEATURES)
#define FFA_RX_RELEASE FFA_FID(SMC_32, FFA_FNUM_RX_RELEASE)
#define FFA_RXTX_MAP_SMC32 FFA_FID(SMC_32, FFA_FNUM_RXTX_MAP)
#define FFA_RXTX_UNMAP FFA_FID(SMC_32, FFA_FNUM_RXTX_UNMAP)
#define FFA_PARTITION_INFO_GET FFA_FID(SMC_32, FFA_FNUM_PARTITION_INFO_GET)
#define FFA_ID_GET FFA_FID(SMC_32, FFA_FNUM_ID_GET)
#define FFA_MSG_POLL FFA_FID(SMC_32, FFA_FNUM_MSG_POLL)
#define FFA_MSG_WAIT FFA_FID(SMC_32, FFA_FNUM_MSG_WAIT)
#define FFA_MSG_YIELD FFA_FID(SMC_32, FFA_FNUM_MSG_YIELD)
#define FFA_MSG_RUN FFA_FID(SMC_32, FFA_FNUM_MSG_RUN)
#define FFA_MSG_SEND FFA_FID(SMC_32, FFA_FNUM_MSG_SEND)
#define FFA_MSG_SEND_DIRECT_REQ_SMC32 \
FFA_FID(SMC_32, FFA_FNUM_MSG_SEND_DIRECT_REQ)
#define FFA_MSG_SEND_DIRECT_RESP_SMC32 \
FFA_FID(SMC_32, FFA_FNUM_MSG_SEND_DIRECT_RESP)
#define FFA_MEM_DONATE_SMC32 FFA_FID(SMC_32, FFA_FNUM_MEM_DONATE)
#define FFA_MEM_LEND_SMC32 FFA_FID(SMC_32, FFA_FNUM_MEM_LEND)
#define FFA_MEM_SHARE_SMC32 FFA_FID(SMC_32, FFA_FNUM_MEM_SHARE)
#define FFA_MEM_RETRIEVE_REQ_SMC32 \
FFA_FID(SMC_32, FFA_FNUM_MEM_RETRIEVE_REQ)
#define FFA_MEM_RETRIEVE_RESP FFA_FID(SMC_32, FFA_FNUM_MEM_RETRIEVE_RESP)
#define FFA_MEM_RELINQUISH FFA_FID(SMC_32, FFA_FNUM_MEM_RELINQUISH)
#define FFA_MEM_RECLAIM FFA_FID(SMC_32, FFA_FNUM_MEM_RECLAIM)
/* FFA SMC64 FIDs */
#define FFA_SUCCESS_SMC64 FFA_FID(SMC_64, FFA_FNUM_SUCCESS)
#define FFA_RXTX_MAP_SMC64 FFA_FID(SMC_64, FFA_FNUM_RXTX_MAP)
#define FFA_MSG_SEND_DIRECT_REQ_SMC64 \
FFA_FID(SMC_64, FFA_FNUM_MSG_SEND_DIRECT_REQ)
#define FFA_MSG_SEND_DIRECT_RESP_SMC64 \
FFA_FID(SMC_64, FFA_FNUM_MSG_SEND_DIRECT_RESP)
#define FFA_MEM_DONATE_SMC64 FFA_FID(SMC_64, FFA_FNUM_MEM_DONATE)
#define FFA_MEM_LEND_SMC64 FFA_FID(SMC_64, FFA_FNUM_MEM_LEND)
#define FFA_MEM_SHARE_SMC64 FFA_FID(SMC_64, FFA_FNUM_MEM_SHARE)
#define FFA_MEM_RETRIEVE_REQ_SMC64 \
FFA_FID(SMC_64, FFA_FNUM_MEM_RETRIEVE_REQ)
/*
* Reserve a special value for traffic targeted to the Hypervisor or SPM.
*/
#define FFA_TARGET_INFO_MBZ U(0x0)
/*
* Reserve a special value for MBZ parameters.
*/
#define FFA_PARAM_MBZ U(0x0)
#endif
/* FFA_SVC_H */
include/services/spci_svc.h
deleted
100644 → 0
View file @
beff4910
/*
* Copyright (c) 2019, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef SPCI_SVC_H
#define SPCI_SVC_H
#include <lib/smccc.h>
#include <lib/utils_def.h>
#include <tools_share/uuid.h>
/* SPCI error codes. */
#define SPCI_ERROR_NOT_SUPPORTED -1
#define SPCI_ERROR_INVALID_PARAMETER -2
#define SPCI_ERROR_NO_MEMORY -3
#define SPCI_ERROR_BUSY -4
#define SPCI_ERROR_INTERRUPTED -5
#define SPCI_ERROR_DENIED -6
#define SPCI_ERROR_RETRY -7
/* The macros below are used to identify SPCI calls from the SMC function ID */
#define SPCI_FNUM_MIN_VALUE U(0x60)
#define SPCI_FNUM_MAX_VALUE U(0x7f)
#define is_spci_fid(fid) __extension__ ({ \
__typeof__(fid) _fid = (fid); \
((GET_SMC_NUM(_fid) >= SPCI_FNUM_MIN_VALUE) && \
(GET_SMC_NUM(_fid) <= SPCI_FNUM_MAX_VALUE)); })
/* SPCI_VERSION helpers */
#define SPCI_VERSION_MAJOR U(0)
#define SPCI_VERSION_MAJOR_SHIFT 16
#define SPCI_VERSION_MAJOR_MASK U(0x7FFF)
#define SPCI_VERSION_MINOR U(9)
#define SPCI_VERSION_MINOR_SHIFT 0
#define SPCI_VERSION_MINOR_MASK U(0xFFFF)
#define MAKE_SPCI_VERSION(major, minor) \
((((major) & SPCI_VERSION_MAJOR_MASK) << SPCI_VERSION_MAJOR_SHIFT) | \
(((minor) & SPCI_VERSION_MINOR_MASK) << SPCI_VERSION_MINOR_SHIFT))
#define SPCI_VERSION_COMPILED MAKE_SPCI_VERSION(SPCI_VERSION_MAJOR, \
SPCI_VERSION_MINOR)
/* SPCI_MSG_SEND helpers */
#define SPCI_MSG_SEND_ATTRS_BLK_SHIFT U(0)
#define SPCI_MSG_SEND_ATTRS_BLK_MASK U(0x1)
#define SPCI_MSG_SEND_ATTRS_BLK U(0)
#define SPCI_MSG_SEND_ATTRS_BLK_NOT U(1)
#define SPCI_MSG_SEND_ATTRS(blk) \
(((blk) & SPCI_MSG_SEND_ATTRS_BLK_MASK) \
<< SPCI_MSG_SEND_ATTRS_BLK_SHIFT)
/* Get SPCI fastcall std FID from function number */
#define SPCI_FID(smc_cc, func_num) \
((SMC_TYPE_FAST << FUNCID_TYPE_SHIFT) | \
((smc_cc) << FUNCID_CC_SHIFT) | \
(OEN_STD_START << FUNCID_OEN_SHIFT) | \
((func_num) << FUNCID_NUM_SHIFT))
/* SPCI function numbers */
#define SPCI_FNUM_ERROR U(0x60)
#define SPCI_FNUM_SUCCESS U(0x61)
#define SPCI_FNUM_INTERRUPT U(0x62)
#define SPCI_FNUM_VERSION U(0x63)
#define SPCI_FNUM_FEATURES U(0x64)
#define SPCI_FNUM_RX_RELEASE U(0x65)
#define SPCI_FNUM_RXTX_MAP U(0x66)
#define SPCI_FNUM_RXTX_UNMAP U(0x67)
#define SPCI_FNUM_PARTITION_INFO_GET U(0x68)
#define SPCI_FNUM_ID_GET U(0x69)
#define SPCI_FNUM_MSG_POLL U(0x6A)
#define SPCI_FNUM_MSG_WAIT U(0x6B)
#define SPCI_FNUM_MSG_YIELD U(0x6C)
#define SPCI_FNUM_MSG_RUN U(0x6D)
#define SPCI_FNUM_MSG_SEND U(0x6E)
#define SPCI_FNUM_MSG_SEND_DIRECT_REQ U(0x6F)
#define SPCI_FNUM_MSG_SEND_DIRECT_RESP U(0x70)
#define SPCI_FNUM_MEM_DONATE U(0x71)
#define SPCI_FNUM_MEM_LEND U(0x72)
#define SPCI_FNUM_MEM_SHARE U(0x73)
#define SPCI_FNUM_MEM_RETRIEVE_REQ U(0x74)
#define SPCI_FNUM_MEM_RETRIEVE_RESP U(0x75)
#define SPCI_FNUM_MEM_RELINQUISH U(0x76)
#define SPCI_FNUM_MEM_RECLAIM U(0x77)
/* SPCI SMC32 FIDs */
#define SPCI_ERROR SPCI_FID(SMC_32, SPCI_FNUM_ERROR)
#define SPCI_SUCCESS_SMC32 SPCI_FID(SMC_32, SPCI_FNUM_SUCCESS)
#define SPCI_INTERRUPT SPCI_FID(SMC_32, SPCI_FNUM_INTERRUPT)
#define SPCI_VERSION SPCI_FID(SMC_32, SPCI_FNUM_VERSION)
#define SPCI_FEATURES SPCI_FID(SMC_32, SPCI_FNUM_FEATURES)
#define SPCI_RX_RELEASE SPCI_FID(SMC_32, SPCI_FNUM_RX_RELEASE)
#define SPCI_RXTX_MAP_SMC32 SPCI_FID(SMC_32, SPCI_FNUM_RXTX_MAP)
#define SPCI_RXTX_UNMAP SPCI_FID(SMC_32, SPCI_FNUM_RXTX_UNMAP)
#define SPCI_PARTITION_INFO_GET SPCI_FID(SMC_32, SPCI_FNUM_PARTITION_INFO_GET)
#define SPCI_ID_GET SPCI_FID(SMC_32, SPCI_FNUM_ID_GET)
#define SPCI_MSG_POLL SPCI_FID(SMC_32, SPCI_FNUM_MSG_POLL)
#define SPCI_MSG_WAIT SPCI_FID(SMC_32, SPCI_FNUM_MSG_WAIT)
#define SPCI_MSG_YIELD SPCI_FID(SMC_32, SPCI_FNUM_MSG_YIELD)
#define SPCI_MSG_RUN SPCI_FID(SMC_32, SPCI_FNUM_MSG_RUN)
#define SPCI_MSG_SEND SPCI_FID(SMC_32, SPCI_FNUM_MSG_SEND)
#define SPCI_MSG_SEND_DIRECT_REQ_SMC32 \
SPCI_FID(SMC_32, SPCI_FNUM_MSG_SEND_DIRECT_REQ)
#define SPCI_MSG_SEND_DIRECT_RESP_SMC32 \
SPCI_FID(SMC_32, SPCI_FNUM_MSG_SEND_DIRECT_RESP)
#define SPCI_MEM_DONATE_SMC32 SPCI_FID(SMC_32, SPCI_FNUM_MEM_DONATE)
#define SPCI_MEM_LEND_SMC32 SPCI_FID(SMC_32, SPCI_FNUM_MEM_LEND)
#define SPCI_MEM_SHARE_SMC32 SPCI_FID(SMC_32, SPCI_FNUM_MEM_SHARE)
#define SPCI_MEM_RETRIEVE_REQ_SMC32 \
SPCI_FID(SMC_32, SPCI_FNUM_MEM_RETRIEVE_REQ)
#define SPCI_MEM_RETRIEVE_RESP SPCI_FID(SMC_32, SPCI_FNUM_MEM_RETRIEVE_RESP)
#define SPCI_MEM_RELINQUISH SPCI_FID(SMC_32, SPCI_FNUM_MEM_RELINQUISH)
#define SPCI_MEM_RECLAIM SPCI_FID(SMC_32, SPCI_FNUM_MEM_RECLAIM)
/* SPCI SMC64 FIDs */
#define SPCI_SUCCESS_SMC64 SPCI_FID(SMC_64, SPCI_FNUM_SUCCESS)
#define SPCI_RXTX_MAP_SMC64 SPCI_FID(SMC_64, SPCI_FNUM_RXTX_MAP)
#define SPCI_MSG_SEND_DIRECT_REQ_SMC64 \
SPCI_FID(SMC_64, SPCI_FNUM_MSG_SEND_DIRECT_REQ)
#define SPCI_MSG_SEND_DIRECT_RESP_SMC64 \
SPCI_FID(SMC_64, SPCI_FNUM_MSG_SEND_DIRECT_RESP)
#define SPCI_MEM_DONATE_SMC64 SPCI_FID(SMC_64, SPCI_FNUM_MEM_DONATE)
#define SPCI_MEM_LEND_SMC64 SPCI_FID(SMC_64, SPCI_FNUM_MEM_LEND)
#define SPCI_MEM_SHARE_SMC64 SPCI_FID(SMC_64, SPCI_FNUM_MEM_SHARE)
#define SPCI_MEM_RETRIEVE_REQ_SMC64 \
SPCI_FID(SMC_64, SPCI_FNUM_MEM_RETRIEVE_REQ)
/*
* Reserve a special value for traffic targeted to the Hypervisor or SPM.
*/
#define SPCI_TARGET_INFO_MBZ U(0x0)
/*
* Reserve a special value for MBZ parameters.
*/
#define SPCI_PARAM_MBZ U(0x0)
#endif
/* SPCI_SVC_H */
include/services/spm_core_manifest.h
View file @
4b0695ac
...
...
@@ -15,7 +15,7 @@
typedef
struct
spm_core_manifest_sect_attribute
{
/*
*
SPCI
version (mandatory).
*
FFA
version (mandatory).
*/
uint32_t
major_version
;
uint32_t
minor_version
;
...
...
include/services/spmd_svc.h
View file @
4b0695ac
...
...
@@ -8,7 +8,7 @@
#define SPMD_SVC_H
#ifndef __ASSEMBLER__
#include <services/
spci
_svc.h>
#include <services/
ffa
_svc.h>
#include <stdint.h>
int
spmd_setup
(
void
);
...
...
plat/arm/board/fvp/fdts/fvp_spmc_manifest.dts
View file @
4b0695ac
...
...
@@ -6,12 +6,14 @@
/dts-v1/;
/ {
compatible = "arm,spci-core-manifest-1.0";
compatible = "arm,ffa-core-manifest-1.0";
#address-cells = <2>;
#size-cells = <1>;
attribute {
spmc_id = <0x8000>;
maj_ver = <0x
0
>;
min_ver = <0x
9
>;
maj_ver = <0x
1
>;
min_ver = <0x
0
>;
exec_state = <0x0>;
load_address = <0x0 0x6000000>;
entrypoint = <0x0 0x6000000>;
...
...
@@ -25,12 +27,12 @@
hypervisor {
compatible = "hafnium,hafnium";
vm1 {
is_
spci
_partition;
is_
ffa
_partition;
debug_name = "cactus-primary";
load_address = <0x7000000>;
};
vm2 {
is_
spci
_partition;
is_
ffa
_partition;
debug_name = "cactus-secondary";
load_address = <0x7100000>;
vcpu_count = <2>;
...
...
@@ -62,6 +64,6 @@
memory@60000000 {
device_type = "memory";
reg = <0x6000000 0x2000000>; /* Trusted DRAM */
reg = <
0x0
0x6000000 0x2000000>; /* Trusted DRAM */
};
};
plat/common/plat_spmd_manifest.c
View file @
4b0695ac
...
...
@@ -31,14 +31,14 @@ static int manifest_parse_attribute(spmc_manifest_attribute_t *attr,
rc
=
fdt_read_uint32
(
fdt
,
node
,
"maj_ver"
,
&
attr
->
major_version
);
if
(
rc
!=
0
)
{
ERROR
(
"Missing
SPCI
%s version in SPM Core manifest.
\n
"
,
ERROR
(
"Missing
FFA
%s version in SPM Core manifest.
\n
"
,
"major"
);
return
rc
;
}
rc
=
fdt_read_uint32
(
fdt
,
node
,
"min_ver"
,
&
attr
->
minor_version
);
if
(
rc
!=
0
)
{
ERROR
(
"Missing
SPCI
%s version in SPM Core manifest.
\n
"
,
ERROR
(
"Missing
FFA
%s version in SPM Core manifest.
\n
"
,
"minor"
);
return
rc
;
}
...
...
@@ -163,7 +163,7 @@ int plat_spm_core_manifest_load(spmc_manifest_attribute_t *manifest,
VERBOSE
(
"Reading SPM Core manifest at address %p
\n
"
,
pm_addr
);
rc
=
fdt_node_offset_by_compatible
(
pm_addr
,
-
1
,
"arm,
spci
-core-manifest-1.0"
);
"arm,
ffa
-core-manifest-1.0"
);
if
(
rc
<
0
)
{
ERROR
(
"Unrecognized SPM Core manifest
\n
"
);
goto
exit_unmap
;
...
...
services/std_svc/spmd/spmd_main.c
View file @
4b0695ac
...
...
@@ -20,7 +20,7 @@
#include <plat/common/common_def.h>
#include <plat/common/platform.h>
#include <platform_def.h>
#include <services/
spci
_svc.h>
#include <services/
ffa
_svc.h>
#include <services/spmd_svc.h>
#include <smccc_helpers.h>
#include "spmd_private.h"
...
...
@@ -56,7 +56,7 @@ spmd_spm_core_context_t *spmd_get_context(void)
******************************************************************************/
static
int32_t
spmd_init
(
void
);
static
int
spmd_spmc_init
(
void
*
pm_addr
);
static
uint64_t
spmd_
spci
_error_return
(
void
*
handle
,
static
uint64_t
spmd_
ffa
_error_return
(
void
*
handle
,
int
error_code
);
static
uint64_t
spmd_smc_forward
(
uint32_t
smc_fid
,
bool
secure_origin
,
...
...
@@ -161,14 +161,14 @@ static int spmd_spmc_init(void *pm_addr)
* Ensure that the SPM Core version is compatible with the SPM
* Dispatcher version.
*/
if
((
spmc_attrs
.
major_version
!=
SPCI
_VERSION_MAJOR
)
||
(
spmc_attrs
.
minor_version
>
SPCI
_VERSION_MINOR
))
{
WARN
(
"Unsupported
SPCI
version (%u.%u)
\n
"
,
if
((
spmc_attrs
.
major_version
!=
FFA
_VERSION_MAJOR
)
||
(
spmc_attrs
.
minor_version
>
FFA
_VERSION_MINOR
))
{
WARN
(
"Unsupported
FFA
version (%u.%u)
\n
"
,
spmc_attrs
.
major_version
,
spmc_attrs
.
minor_version
);
return
-
EINVAL
;
}
VERBOSE
(
"
SPCI
version (%u.%u)
\n
"
,
spmc_attrs
.
major_version
,
VERBOSE
(
"
FFA
version (%u.%u)
\n
"
,
spmc_attrs
.
major_version
,
spmc_attrs
.
minor_version
);
VERBOSE
(
"SPM Core run time EL%x.
\n
"
,
...
...
@@ -324,18 +324,18 @@ static uint64_t spmd_smc_forward(uint32_t smc_fid,
}
/*******************************************************************************
* Return
SPCI
_ERROR with specified error code
* Return
FFA
_ERROR with specified error code
******************************************************************************/
static
uint64_t
spmd_
spci
_error_return
(
void
*
handle
,
int
error_code
)
static
uint64_t
spmd_
ffa
_error_return
(
void
*
handle
,
int
error_code
)
{
SMC_RET8
(
handle
,
SPCI
_ERROR
,
SPCI
_TARGET_INFO_MBZ
,
error_code
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
);
SMC_RET8
(
handle
,
FFA
_ERROR
,
FFA
_TARGET_INFO_MBZ
,
error_code
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
);
}
/*******************************************************************************
* This function handles all SMCs in the range reserved for
SPCI
. Each call is
* This function handles all SMCs in the range reserved for
FFA
. Each call is
* either forwarded to the other security state or handled by the SPM dispatcher
******************************************************************************/
uint64_t
spmd_smc_handler
(
uint32_t
smc_fid
,
...
...
@@ -360,7 +360,7 @@ uint64_t spmd_smc_handler(uint32_t smc_fid,
SMC_GET_GP
(
handle
,
CTX_GPREG_X7
));
switch
(
smc_fid
)
{
case
SPCI
_ERROR
:
case
FFA
_ERROR
:
/*
* Check if this is the first invocation of this interface on
* this CPU. If so, then indicate that the SPM Core initialised
...
...
@@ -374,33 +374,33 @@ uint64_t spmd_smc_handler(uint32_t smc_fid,
x1
,
x2
,
x3
,
x4
,
handle
);
break
;
/* not reached */
case
SPCI
_VERSION
:
case
FFA
_VERSION
:
/*
* TODO: This is an optimization that the version information
* provided by the SPM Core manifest is returned by the SPM
* dispatcher. It might be a better idea to simply forward this
* call to the SPM Core and wash our hands completely.
*/
ret
=
MAKE_
SPCI
_VERSION
(
spmc_attrs
.
major_version
,
ret
=
MAKE_
FFA
_VERSION
(
spmc_attrs
.
major_version
,
spmc_attrs
.
minor_version
);
SMC_RET8
(
handle
,
SPCI
_SUCCESS_SMC32
,
SPCI
_TARGET_INFO_MBZ
,
ret
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
);
SMC_RET8
(
handle
,
FFA
_SUCCESS_SMC32
,
FFA
_TARGET_INFO_MBZ
,
ret
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
);
break
;
/* not reached */
case
SPCI
_FEATURES
:
case
FFA
_FEATURES
:
/*
* This is an optional interface. Do the minimal checks and
* forward to SPM Core which will handle it if implemented.
*/
/*
* Check if x1 holds a valid
SPCI
fid. This is an
* Check if x1 holds a valid
FFA
fid. This is an
* optimization.
*/
if
(
!
is_
spci
_fid
(
x1
))
{
return
spmd_
spci
_error_return
(
handle
,
SPCI
_ERROR_NOT_SUPPORTED
);
if
(
!
is_
ffa
_fid
(
x1
))
{
return
spmd_
ffa
_error_return
(
handle
,
FFA
_ERROR_NOT_SUPPORTED
);
}
/* Forward SMC from Normal world to the SPM Core */
...
...
@@ -411,68 +411,68 @@ uint64_t spmd_smc_handler(uint32_t smc_fid,
/*
* Return success if call was from secure world i.e. all
*
SPCI
functions are supported. This is essentially a
*
FFA
functions are supported. This is essentially a
* nop.
*/
SMC_RET8
(
handle
,
SPCI
_SUCCESS_SMC32
,
x1
,
x2
,
x3
,
x4
,
SMC_RET8
(
handle
,
FFA
_SUCCESS_SMC32
,
x1
,
x2
,
x3
,
x4
,
SMC_GET_GP
(
handle
,
CTX_GPREG_X5
),
SMC_GET_GP
(
handle
,
CTX_GPREG_X6
),
SMC_GET_GP
(
handle
,
CTX_GPREG_X7
));
break
;
/* not reached */
case
SPCI
_ID_GET
:
case
FFA
_ID_GET
:
/*
* Returns the ID of the calling
SPCI
component.
* Returns the ID of the calling
FFA
component.
*/
if
(
!
secure_origin
)
{
SMC_RET8
(
handle
,
SPCI
_SUCCESS_SMC32
,
SPCI
_TARGET_INFO_MBZ
,
SPCI
_NS_ENDPOINT_ID
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
);
SMC_RET8
(
handle
,
FFA
_SUCCESS_SMC32
,
FFA
_TARGET_INFO_MBZ
,
FFA
_NS_ENDPOINT_ID
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
);
}
SMC_RET8
(
handle
,
SPCI
_SUCCESS_SMC32
,
SPCI
_TARGET_INFO_MBZ
,
spmc_attrs
.
spmc_id
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
,
SPCI
_PARAM_MBZ
);
SMC_RET8
(
handle
,
FFA
_SUCCESS_SMC32
,
FFA
_TARGET_INFO_MBZ
,
spmc_attrs
.
spmc_id
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
,
FFA
_PARAM_MBZ
);
break
;
/* not reached */
case
SPCI
_RX_RELEASE
:
case
SPCI
_RXTX_MAP_SMC32
:
case
SPCI
_RXTX_MAP_SMC64
:
case
SPCI
_RXTX_UNMAP
:
case
SPCI
_MSG_RUN
:
case
FFA
_RX_RELEASE
:
case
FFA
_RXTX_MAP_SMC32
:
case
FFA
_RXTX_MAP_SMC64
:
case
FFA
_RXTX_UNMAP
:
case
FFA
_MSG_RUN
:
/* This interface must be invoked only by the Normal world */
if
(
secure_origin
)
{
return
spmd_
spci
_error_return
(
handle
,
SPCI
_ERROR_NOT_SUPPORTED
);
return
spmd_
ffa
_error_return
(
handle
,
FFA
_ERROR_NOT_SUPPORTED
);
}
/* Fall through to forward the call to the other world */
case
SPCI
_PARTITION_INFO_GET
:
case
SPCI
_MSG_SEND
:
case
SPCI
_MSG_SEND_DIRECT_REQ_SMC32
:
case
SPCI
_MSG_SEND_DIRECT_REQ_SMC64
:
case
SPCI
_MSG_SEND_DIRECT_RESP_SMC32
:
case
SPCI
_MSG_SEND_DIRECT_RESP_SMC64
:
case
SPCI
_MEM_DONATE_SMC32
:
case
SPCI
_MEM_DONATE_SMC64
:
case
SPCI
_MEM_LEND_SMC32
:
case
SPCI
_MEM_LEND_SMC64
:
case
SPCI
_MEM_SHARE_SMC32
:
case
SPCI
_MEM_SHARE_SMC64
:
case
SPCI
_MEM_RETRIEVE_REQ_SMC32
:
case
SPCI
_MEM_RETRIEVE_REQ_SMC64
:
case
SPCI
_MEM_RETRIEVE_RESP
:
case
SPCI
_MEM_RELINQUISH
:
case
SPCI
_MEM_RECLAIM
:
case
SPCI
_SUCCESS_SMC32
:
case
SPCI
_SUCCESS_SMC64
:
case
FFA
_PARTITION_INFO_GET
:
case
FFA
_MSG_SEND
:
case
FFA
_MSG_SEND_DIRECT_REQ_SMC32
:
case
FFA
_MSG_SEND_DIRECT_REQ_SMC64
:
case
FFA
_MSG_SEND_DIRECT_RESP_SMC32
:
case
FFA
_MSG_SEND_DIRECT_RESP_SMC64
:
case
FFA
_MEM_DONATE_SMC32
:
case
FFA
_MEM_DONATE_SMC64
:
case
FFA
_MEM_LEND_SMC32
:
case
FFA
_MEM_LEND_SMC64
:
case
FFA
_MEM_SHARE_SMC32
:
case
FFA
_MEM_SHARE_SMC64
:
case
FFA
_MEM_RETRIEVE_REQ_SMC32
:
case
FFA
_MEM_RETRIEVE_REQ_SMC64
:
case
FFA
_MEM_RETRIEVE_RESP
:
case
FFA
_MEM_RELINQUISH
:
case
FFA
_MEM_RECLAIM
:
case
FFA
_SUCCESS_SMC32
:
case
FFA
_SUCCESS_SMC64
:
/*
* TODO: Assume that no requests originate from EL3 at the
* moment. This will change if a SP service is required in
...
...
@@ -484,7 +484,7 @@ uint64_t spmd_smc_handler(uint32_t smc_fid,
x1
,
x2
,
x3
,
x4
,
handle
);
break
;
/* not reached */
case
SPCI
_MSG_WAIT
:
case
FFA
_MSG_WAIT
:
/*
* Check if this is the first invocation of this interface on
* this CPU from the Secure world. If so, then indicate that the
...
...
@@ -496,11 +496,11 @@ uint64_t spmd_smc_handler(uint32_t smc_fid,
/* Fall through to forward the call to the other world */
case
SPCI
_MSG_YIELD
:
case
FFA
_MSG_YIELD
:
/* This interface must be invoked only by the Secure world */
if
(
!
secure_origin
)
{
return
spmd_
spci
_error_return
(
handle
,
SPCI
_ERROR_NOT_SUPPORTED
);
return
spmd_
ffa
_error_return
(
handle
,
FFA
_ERROR_NOT_SUPPORTED
);
}
return
spmd_smc_forward
(
smc_fid
,
secure_origin
,
...
...
@@ -509,6 +509,6 @@ uint64_t spmd_smc_handler(uint32_t smc_fid,
default:
WARN
(
"SPM: Unsupported call 0x%08x
\n
"
,
smc_fid
);
return
spmd_
spci
_error_return
(
handle
,
SPCI
_ERROR_NOT_SUPPORTED
);
return
spmd_
ffa
_error_return
(
handle
,
FFA
_ERROR_NOT_SUPPORTED
);
}
}
services/std_svc/spmd/spmd_private.h
View file @
4b0695ac
...
...
@@ -30,7 +30,7 @@
#define SPMD_C_RT_CTX_ENTRIES (SPMD_C_RT_CTX_SIZE >> DWORD_SHIFT)
#ifndef __ASSEMBLER__
#include <services/
spci
_svc.h>
#include <services/
ffa
_svc.h>
#include <stdint.h>
typedef
enum
spmc_state
{
...
...
@@ -49,11 +49,11 @@ typedef struct spmd_spm_core_context {
}
spmd_spm_core_context_t
;
/*
* Reserve ID for NS physical
SPCI
Endpoint.
* Reserve ID for NS physical
FFA
Endpoint.
*/
#define
SPCI
_NS_ENDPOINT_ID U(0)
#define
FFA
_NS_ENDPOINT_ID U(0)
/* Mask and shift to check valid secure
SPCI
Endpoint ID. */
/* Mask and shift to check valid secure
FFA
Endpoint ID. */
#define SPMC_SECURE_ID_MASK U(1)
#define SPMC_SECURE_ID_SHIFT U(15)
...
...
services/std_svc/std_svc_setup.c
View file @
4b0695ac
...
...
@@ -123,10 +123,10 @@ static uintptr_t std_svc_smc_handler(uint32_t smc_fid,
#if defined(SPD_spmd)
/*
* Dispatch
SPCI
calls to the
SPCI
SMC handler implemented by the SPM
* Dispatch
FFA
calls to the
FFA
SMC handler implemented by the SPM
* dispatcher and return its return value
*/
if
(
is_
spci
_fid
(
smc_fid
))
{
if
(
is_
ffa
_fid
(
smc_fid
))
{
return
spmd_smc_handler
(
smc_fid
,
x1
,
x2
,
x3
,
x4
,
cookie
,
handle
,
flags
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment