mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 18:14:24 +00:00
SPCI is now called PSA FF-A
SPCI is renamed as PSA FF-A which stands for Platform Security Architecture Firmware Framework for A class processors. This patch replaces the occurrence of SPCI with PSA FF-A(in documents) or simply FFA(in code). Change-Id: I4ab10adb9ffeef1ff784641dfafd99f515133760 Signed-off-by: J-Alves <joao.alves@arm.com>
This commit is contained in:
parent
beff491075
commit
662af36d9c
14 changed files with 253 additions and 248 deletions
|
@ -108,8 +108,8 @@ Still to come
|
||||||
|
|
||||||
- Refinements to Position Independent Executable (PIE) support.
|
- Refinements to Position Independent Executable (PIE) support.
|
||||||
|
|
||||||
- Continued support for the draft SPCI specification, to enable the use of
|
- Continued support for the PSA FF-A v1.0 (formally known as SPCI) specification, to enable the
|
||||||
secure partition management in the secure world.
|
use of secure partition management in the secure world.
|
||||||
|
|
||||||
- Documentation enhancements.
|
- Documentation enhancements.
|
||||||
|
|
||||||
|
|
|
@ -17,5 +17,5 @@ Components
|
||||||
romlib-design
|
romlib-design
|
||||||
sdei
|
sdei
|
||||||
secure-partition-manager-design
|
secure-partition-manager-design
|
||||||
spci-manifest-binding
|
psa-ffa-manifest-binding
|
||||||
xlat-tables-lib-v2-design
|
xlat-tables-lib-v2-design
|
||||||
|
|
|
@ -1,33 +1,33 @@
|
||||||
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,
|
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
|
Version 1.0
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
spci-manifest-partition
|
psa-ffa-manifest-partition
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
- compatible [mandatory]
|
- compatible [mandatory]
|
||||||
- value type: <string>
|
- value type: <string>
|
||||||
- Must be the string "arm,spci-manifest-X.Y" which specifies the major and
|
- Must be the string "arm,ffa-manifest-X.Y" which specifies the major and
|
||||||
minor versions fo the device tree binding for the SPCI manifest represented
|
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
|
by this node. The minor number is incremented if the binding changes in a
|
||||||
backwards compatible manner.
|
backwards compatible manner.
|
||||||
|
|
||||||
- X is an integer representing the major version number of this document.
|
- X is an integer representing the major version number of this document.
|
||||||
- Y is an integer representing the minor 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>
|
- value type: <u32>
|
||||||
- Must be two 16 bits values (X, Y), concatenated as 31:16 -> X,
|
- Must be two 16 bits values (X, Y), concatenated as 31:16 -> X,
|
||||||
15:0 -> Y, where:
|
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.
|
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.
|
instance it will execute.
|
||||||
|
|
||||||
- uuid [mandatory]
|
- uuid [mandatory]
|
||||||
|
@ -40,7 +40,7 @@ spci-manifest-partition
|
||||||
- If there are multiple instances of a Trusted OS, then the UUID can be
|
- If there are multiple instances of a Trusted OS, then the UUID can be
|
||||||
shared by all instances.
|
shared by all instances.
|
||||||
- The TEE driver in the HLOS can use the UUID with the
|
- 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
|
- Number of Trusted OSs
|
||||||
- The partition ID of each instance of the Trusted OS
|
- The partition ID of each instance of the Trusted OS
|
||||||
|
@ -116,7 +116,7 @@ spci-manifest-partition
|
||||||
- value type: "memory-regions" node
|
- value type: "memory-regions" node
|
||||||
- Specific "memory-regions" nodes that describe the RX/TX buffers expected
|
- Specific "memory-regions" nodes that describe the RX/TX buffers expected
|
||||||
by the partition.
|
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]
|
- messaging-method [mandatory]
|
||||||
- value type: <u32>
|
- value type: <u32>
|
||||||
|
@ -146,7 +146,7 @@ spci-manifest-partition
|
||||||
- gp-register-num
|
- gp-register-num
|
||||||
- value type: <u32>
|
- value type: <u32>
|
||||||
- Presence of this field indicates that the partition expects the
|
- 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.
|
register.
|
||||||
The field specifies the general purpose register number but not its width.
|
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
|
The width is derived from the partition's execution state, as specified in
|
||||||
|
@ -164,7 +164,7 @@ memory-regions
|
||||||
|
|
||||||
- compatible [mandatory]
|
- compatible [mandatory]
|
||||||
- value type: <string>
|
- value type: <string>
|
||||||
- Must be the string "arm,spci-manifest-memory-regions".
|
- Must be the string "arm,ffa-manifest-memory-regions".
|
||||||
|
|
||||||
- description
|
- description
|
||||||
- value type: <string>
|
- value type: <string>
|
||||||
|
@ -184,7 +184,7 @@ memory-regions
|
||||||
- Base address of the region. The address must be aligned to the translation
|
- Base address of the region. The address must be aligned to the translation
|
||||||
granule size.
|
granule size.
|
||||||
The address given may be a Physical Address (PA), Virtual Address (VA), or
|
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.
|
more information on the restrictions around the address type.
|
||||||
If the base address is omitted then the partition manager must map a memory
|
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
|
region of the specified size into the partition's translation regime and
|
||||||
|
@ -196,7 +196,7 @@ device-regions
|
||||||
|
|
||||||
- compatible [mandatory]
|
- compatible [mandatory]
|
||||||
- value type: <string>
|
- value type: <string>
|
||||||
- Must be the string "arm,spci-manifest-device-regions".
|
- Must be the string "arm,ffa-manifest-device-regions".
|
||||||
|
|
||||||
- description
|
- description
|
||||||
- value type: <string>
|
- value type: <string>
|
|
@ -14,6 +14,7 @@
|
||||||
.. |EHF| replace:: :term:`EHF`
|
.. |EHF| replace:: :term:`EHF`
|
||||||
.. |FCONF| replace:: :term:`FCONF`
|
.. |FCONF| replace:: :term:`FCONF`
|
||||||
.. |FDT| replace:: :term:`FDT`
|
.. |FDT| replace:: :term:`FDT`
|
||||||
|
.. |FFA| replace:: :term:`FFA`
|
||||||
.. |FIP| replace:: :term:`FIP`
|
.. |FIP| replace:: :term:`FIP`
|
||||||
.. |FVP| replace:: :term:`FVP`
|
.. |FVP| replace:: :term:`FVP`
|
||||||
.. |FWU| replace:: :term:`FWU`
|
.. |FWU| replace:: :term:`FWU`
|
||||||
|
@ -44,7 +45,6 @@
|
||||||
.. |SMCCC| replace:: :term:`SMCCC`
|
.. |SMCCC| replace:: :term:`SMCCC`
|
||||||
.. |SoC| replace:: :term:`SoC`
|
.. |SoC| replace:: :term:`SoC`
|
||||||
.. |SP| replace:: :term:`SP`
|
.. |SP| replace:: :term:`SP`
|
||||||
.. |SPCI| replace:: :term:`SPCI`
|
|
||||||
.. |SPD| replace:: :term:`SPD`
|
.. |SPD| replace:: :term:`SPD`
|
||||||
.. |SPM| replace:: :term:`SPM`
|
.. |SPM| replace:: :term:`SPM`
|
||||||
.. |SSBS| replace:: :term:`SSBS`
|
.. |SSBS| replace:: :term:`SSBS`
|
||||||
|
|
|
@ -57,6 +57,9 @@ You can find additional definitions in the `Arm Glossary`_.
|
||||||
FDT
|
FDT
|
||||||
Flattened Device Tree
|
Flattened Device Tree
|
||||||
|
|
||||||
|
FFA
|
||||||
|
Firmware Framework for A-class processors
|
||||||
|
|
||||||
FIP
|
FIP
|
||||||
Firmware Image Package
|
Firmware Image Package
|
||||||
|
|
||||||
|
@ -107,6 +110,9 @@ You can find additional definitions in the `Arm Glossary`_.
|
||||||
PMF
|
PMF
|
||||||
Performance Measurement Framework
|
Performance Measurement Framework
|
||||||
|
|
||||||
|
PSA
|
||||||
|
Platform Security Architecture
|
||||||
|
|
||||||
PSCI
|
PSCI
|
||||||
Power State Coordination Interface
|
Power State Coordination Interface
|
||||||
|
|
||||||
|
@ -149,9 +155,6 @@ You can find additional definitions in the `Arm Glossary`_.
|
||||||
SP
|
SP
|
||||||
Secure Partition
|
Secure Partition
|
||||||
|
|
||||||
SPCI
|
|
||||||
Secure Partition Client Interface
|
|
||||||
|
|
||||||
SPD
|
SPD
|
||||||
Secure Payload Dispatcher
|
Secure Payload Dispatcher
|
||||||
|
|
||||||
|
|
139
include/services/ffa_svc.h
Normal file
139
include/services/ffa_svc.h
Normal file
|
@ -0,0 +1,139 @@
|
||||||
|
/*
|
||||||
|
* 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 */
|
|
@ -1,139 +0,0 @@
|
||||||
/*
|
|
||||||
* 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 */
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
typedef struct spm_core_manifest_sect_attribute {
|
typedef struct spm_core_manifest_sect_attribute {
|
||||||
/*
|
/*
|
||||||
* SPCI version (mandatory).
|
* FFA version (mandatory).
|
||||||
*/
|
*/
|
||||||
uint32_t major_version;
|
uint32_t major_version;
|
||||||
uint32_t minor_version;
|
uint32_t minor_version;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#define SPMD_SVC_H
|
#define SPMD_SVC_H
|
||||||
|
|
||||||
#ifndef __ASSEMBLER__
|
#ifndef __ASSEMBLER__
|
||||||
#include <services/spci_svc.h>
|
#include <services/ffa_svc.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
int spmd_setup(void);
|
int spmd_setup(void);
|
||||||
|
|
|
@ -6,12 +6,14 @@
|
||||||
/dts-v1/;
|
/dts-v1/;
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
compatible = "arm,spci-core-manifest-1.0";
|
compatible = "arm,ffa-core-manifest-1.0";
|
||||||
|
#address-cells = <2>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
|
||||||
attribute {
|
attribute {
|
||||||
spmc_id = <0x8000>;
|
spmc_id = <0x8000>;
|
||||||
maj_ver = <0x0>;
|
maj_ver = <0x1>;
|
||||||
min_ver = <0x9>;
|
min_ver = <0x0>;
|
||||||
exec_state = <0x0>;
|
exec_state = <0x0>;
|
||||||
load_address = <0x0 0x6000000>;
|
load_address = <0x0 0x6000000>;
|
||||||
entrypoint = <0x0 0x6000000>;
|
entrypoint = <0x0 0x6000000>;
|
||||||
|
@ -25,12 +27,12 @@
|
||||||
hypervisor {
|
hypervisor {
|
||||||
compatible = "hafnium,hafnium";
|
compatible = "hafnium,hafnium";
|
||||||
vm1 {
|
vm1 {
|
||||||
is_spci_partition;
|
is_ffa_partition;
|
||||||
debug_name = "cactus-primary";
|
debug_name = "cactus-primary";
|
||||||
load_address = <0x7000000>;
|
load_address = <0x7000000>;
|
||||||
};
|
};
|
||||||
vm2 {
|
vm2 {
|
||||||
is_spci_partition;
|
is_ffa_partition;
|
||||||
debug_name = "cactus-secondary";
|
debug_name = "cactus-secondary";
|
||||||
load_address = <0x7100000>;
|
load_address = <0x7100000>;
|
||||||
vcpu_count = <2>;
|
vcpu_count = <2>;
|
||||||
|
@ -62,6 +64,6 @@
|
||||||
|
|
||||||
memory@60000000 {
|
memory@60000000 {
|
||||||
device_type = "memory";
|
device_type = "memory";
|
||||||
reg = <0x6000000 0x2000000>; /* Trusted DRAM */
|
reg = <0x0 0x6000000 0x2000000>; /* Trusted DRAM */
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -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);
|
rc = fdt_read_uint32(fdt, node, "maj_ver", &attr->major_version);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
ERROR("Missing SPCI %s version in SPM Core manifest.\n",
|
ERROR("Missing FFA %s version in SPM Core manifest.\n",
|
||||||
"major");
|
"major");
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = fdt_read_uint32(fdt, node, "min_ver", &attr->minor_version);
|
rc = fdt_read_uint32(fdt, node, "min_ver", &attr->minor_version);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
ERROR("Missing SPCI %s version in SPM Core manifest.\n",
|
ERROR("Missing FFA %s version in SPM Core manifest.\n",
|
||||||
"minor");
|
"minor");
|
||||||
return rc;
|
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);
|
VERBOSE("Reading SPM Core manifest at address %p\n", pm_addr);
|
||||||
|
|
||||||
rc = fdt_node_offset_by_compatible(pm_addr, -1,
|
rc = fdt_node_offset_by_compatible(pm_addr, -1,
|
||||||
"arm,spci-core-manifest-1.0");
|
"arm,ffa-core-manifest-1.0");
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
ERROR("Unrecognized SPM Core manifest\n");
|
ERROR("Unrecognized SPM Core manifest\n");
|
||||||
goto exit_unmap;
|
goto exit_unmap;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include <plat/common/common_def.h>
|
#include <plat/common/common_def.h>
|
||||||
#include <plat/common/platform.h>
|
#include <plat/common/platform.h>
|
||||||
#include <platform_def.h>
|
#include <platform_def.h>
|
||||||
#include <services/spci_svc.h>
|
#include <services/ffa_svc.h>
|
||||||
#include <services/spmd_svc.h>
|
#include <services/spmd_svc.h>
|
||||||
#include <smccc_helpers.h>
|
#include <smccc_helpers.h>
|
||||||
#include "spmd_private.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 int32_t spmd_init(void);
|
||||||
static int spmd_spmc_init(void *pm_addr);
|
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);
|
int error_code);
|
||||||
static uint64_t spmd_smc_forward(uint32_t smc_fid,
|
static uint64_t spmd_smc_forward(uint32_t smc_fid,
|
||||||
bool secure_origin,
|
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
|
* Ensure that the SPM Core version is compatible with the SPM
|
||||||
* Dispatcher version.
|
* Dispatcher version.
|
||||||
*/
|
*/
|
||||||
if ((spmc_attrs.major_version != SPCI_VERSION_MAJOR) ||
|
if ((spmc_attrs.major_version != FFA_VERSION_MAJOR) ||
|
||||||
(spmc_attrs.minor_version > SPCI_VERSION_MINOR)) {
|
(spmc_attrs.minor_version > FFA_VERSION_MINOR)) {
|
||||||
WARN("Unsupported SPCI version (%u.%u)\n",
|
WARN("Unsupported FFA version (%u.%u)\n",
|
||||||
spmc_attrs.major_version, spmc_attrs.minor_version);
|
spmc_attrs.major_version, spmc_attrs.minor_version);
|
||||||
return -EINVAL;
|
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);
|
spmc_attrs.minor_version);
|
||||||
|
|
||||||
VERBOSE("SPM Core run time EL%x.\n",
|
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,
|
SMC_RET8(handle, FFA_ERROR,
|
||||||
SPCI_TARGET_INFO_MBZ, error_code,
|
FFA_TARGET_INFO_MBZ, error_code,
|
||||||
SPCI_PARAM_MBZ, SPCI_PARAM_MBZ, SPCI_PARAM_MBZ,
|
FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
|
||||||
SPCI_PARAM_MBZ, SPCI_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
|
* either forwarded to the other security state or handled by the SPM dispatcher
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
uint64_t spmd_smc_handler(uint32_t smc_fid,
|
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));
|
SMC_GET_GP(handle, CTX_GPREG_X7));
|
||||||
|
|
||||||
switch (smc_fid) {
|
switch (smc_fid) {
|
||||||
case SPCI_ERROR:
|
case FFA_ERROR:
|
||||||
/*
|
/*
|
||||||
* Check if this is the first invocation of this interface on
|
* Check if this is the first invocation of this interface on
|
||||||
* this CPU. If so, then indicate that the SPM Core initialised
|
* 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);
|
x1, x2, x3, x4, handle);
|
||||||
break; /* not reached */
|
break; /* not reached */
|
||||||
|
|
||||||
case SPCI_VERSION:
|
case FFA_VERSION:
|
||||||
/*
|
/*
|
||||||
* TODO: This is an optimization that the version information
|
* TODO: This is an optimization that the version information
|
||||||
* provided by the SPM Core manifest is returned by the SPM
|
* provided by the SPM Core manifest is returned by the SPM
|
||||||
* dispatcher. It might be a better idea to simply forward this
|
* dispatcher. It might be a better idea to simply forward this
|
||||||
* call to the SPM Core and wash our hands completely.
|
* 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);
|
spmc_attrs.minor_version);
|
||||||
SMC_RET8(handle, SPCI_SUCCESS_SMC32, SPCI_TARGET_INFO_MBZ, ret,
|
SMC_RET8(handle, FFA_SUCCESS_SMC32, FFA_TARGET_INFO_MBZ, ret,
|
||||||
SPCI_PARAM_MBZ, SPCI_PARAM_MBZ, SPCI_PARAM_MBZ,
|
FFA_PARAM_MBZ, FFA_PARAM_MBZ, FFA_PARAM_MBZ,
|
||||||
SPCI_PARAM_MBZ, SPCI_PARAM_MBZ);
|
FFA_PARAM_MBZ, FFA_PARAM_MBZ);
|
||||||
break; /* not reached */
|
break; /* not reached */
|
||||||
|
|
||||||
case SPCI_FEATURES:
|
case FFA_FEATURES:
|
||||||
/*
|
/*
|
||||||
* This is an optional interface. Do the minimal checks and
|
* This is an optional interface. Do the minimal checks and
|
||||||
* forward to SPM Core which will handle it if implemented.
|
* 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.
|
* optimization.
|
||||||
*/
|
*/
|
||||||
if (!is_spci_fid(x1)) {
|
if (!is_ffa_fid(x1)) {
|
||||||
return spmd_spci_error_return(handle,
|
return spmd_ffa_error_return(handle,
|
||||||
SPCI_ERROR_NOT_SUPPORTED);
|
FFA_ERROR_NOT_SUPPORTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Forward SMC from Normal world to the SPM Core */
|
/* 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
|
* 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.
|
* 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_X5),
|
||||||
SMC_GET_GP(handle, CTX_GPREG_X6),
|
SMC_GET_GP(handle, CTX_GPREG_X6),
|
||||||
SMC_GET_GP(handle, CTX_GPREG_X7));
|
SMC_GET_GP(handle, CTX_GPREG_X7));
|
||||||
|
|
||||||
break; /* not reached */
|
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) {
|
if (!secure_origin) {
|
||||||
SMC_RET8(handle, SPCI_SUCCESS_SMC32,
|
SMC_RET8(handle, FFA_SUCCESS_SMC32,
|
||||||
SPCI_TARGET_INFO_MBZ, SPCI_NS_ENDPOINT_ID,
|
FFA_TARGET_INFO_MBZ, FFA_NS_ENDPOINT_ID,
|
||||||
SPCI_PARAM_MBZ, SPCI_PARAM_MBZ,
|
FFA_PARAM_MBZ, FFA_PARAM_MBZ,
|
||||||
SPCI_PARAM_MBZ, SPCI_PARAM_MBZ,
|
FFA_PARAM_MBZ, FFA_PARAM_MBZ,
|
||||||
SPCI_PARAM_MBZ);
|
FFA_PARAM_MBZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
SMC_RET8(handle, SPCI_SUCCESS_SMC32,
|
SMC_RET8(handle, FFA_SUCCESS_SMC32,
|
||||||
SPCI_TARGET_INFO_MBZ, spmc_attrs.spmc_id,
|
FFA_TARGET_INFO_MBZ, spmc_attrs.spmc_id,
|
||||||
SPCI_PARAM_MBZ, SPCI_PARAM_MBZ,
|
FFA_PARAM_MBZ, FFA_PARAM_MBZ,
|
||||||
SPCI_PARAM_MBZ, SPCI_PARAM_MBZ,
|
FFA_PARAM_MBZ, FFA_PARAM_MBZ,
|
||||||
SPCI_PARAM_MBZ);
|
FFA_PARAM_MBZ);
|
||||||
|
|
||||||
break; /* not reached */
|
break; /* not reached */
|
||||||
|
|
||||||
case SPCI_RX_RELEASE:
|
case FFA_RX_RELEASE:
|
||||||
case SPCI_RXTX_MAP_SMC32:
|
case FFA_RXTX_MAP_SMC32:
|
||||||
case SPCI_RXTX_MAP_SMC64:
|
case FFA_RXTX_MAP_SMC64:
|
||||||
case SPCI_RXTX_UNMAP:
|
case FFA_RXTX_UNMAP:
|
||||||
case SPCI_MSG_RUN:
|
case FFA_MSG_RUN:
|
||||||
/* This interface must be invoked only by the Normal world */
|
/* This interface must be invoked only by the Normal world */
|
||||||
if (secure_origin) {
|
if (secure_origin) {
|
||||||
return spmd_spci_error_return(handle,
|
return spmd_ffa_error_return(handle,
|
||||||
SPCI_ERROR_NOT_SUPPORTED);
|
FFA_ERROR_NOT_SUPPORTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fall through to forward the call to the other world */
|
/* Fall through to forward the call to the other world */
|
||||||
|
|
||||||
case SPCI_PARTITION_INFO_GET:
|
case FFA_PARTITION_INFO_GET:
|
||||||
case SPCI_MSG_SEND:
|
case FFA_MSG_SEND:
|
||||||
case SPCI_MSG_SEND_DIRECT_REQ_SMC32:
|
case FFA_MSG_SEND_DIRECT_REQ_SMC32:
|
||||||
case SPCI_MSG_SEND_DIRECT_REQ_SMC64:
|
case FFA_MSG_SEND_DIRECT_REQ_SMC64:
|
||||||
case SPCI_MSG_SEND_DIRECT_RESP_SMC32:
|
case FFA_MSG_SEND_DIRECT_RESP_SMC32:
|
||||||
case SPCI_MSG_SEND_DIRECT_RESP_SMC64:
|
case FFA_MSG_SEND_DIRECT_RESP_SMC64:
|
||||||
case SPCI_MEM_DONATE_SMC32:
|
case FFA_MEM_DONATE_SMC32:
|
||||||
case SPCI_MEM_DONATE_SMC64:
|
case FFA_MEM_DONATE_SMC64:
|
||||||
case SPCI_MEM_LEND_SMC32:
|
case FFA_MEM_LEND_SMC32:
|
||||||
case SPCI_MEM_LEND_SMC64:
|
case FFA_MEM_LEND_SMC64:
|
||||||
case SPCI_MEM_SHARE_SMC32:
|
case FFA_MEM_SHARE_SMC32:
|
||||||
case SPCI_MEM_SHARE_SMC64:
|
case FFA_MEM_SHARE_SMC64:
|
||||||
case SPCI_MEM_RETRIEVE_REQ_SMC32:
|
case FFA_MEM_RETRIEVE_REQ_SMC32:
|
||||||
case SPCI_MEM_RETRIEVE_REQ_SMC64:
|
case FFA_MEM_RETRIEVE_REQ_SMC64:
|
||||||
case SPCI_MEM_RETRIEVE_RESP:
|
case FFA_MEM_RETRIEVE_RESP:
|
||||||
case SPCI_MEM_RELINQUISH:
|
case FFA_MEM_RELINQUISH:
|
||||||
case SPCI_MEM_RECLAIM:
|
case FFA_MEM_RECLAIM:
|
||||||
case SPCI_SUCCESS_SMC32:
|
case FFA_SUCCESS_SMC32:
|
||||||
case SPCI_SUCCESS_SMC64:
|
case FFA_SUCCESS_SMC64:
|
||||||
/*
|
/*
|
||||||
* TODO: Assume that no requests originate from EL3 at the
|
* TODO: Assume that no requests originate from EL3 at the
|
||||||
* moment. This will change if a SP service is required in
|
* 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);
|
x1, x2, x3, x4, handle);
|
||||||
break; /* not reached */
|
break; /* not reached */
|
||||||
|
|
||||||
case SPCI_MSG_WAIT:
|
case FFA_MSG_WAIT:
|
||||||
/*
|
/*
|
||||||
* Check if this is the first invocation of this interface on
|
* Check if this is the first invocation of this interface on
|
||||||
* this CPU from the Secure world. If so, then indicate that the
|
* 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 */
|
/* 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 */
|
/* This interface must be invoked only by the Secure world */
|
||||||
if (!secure_origin) {
|
if (!secure_origin) {
|
||||||
return spmd_spci_error_return(handle,
|
return spmd_ffa_error_return(handle,
|
||||||
SPCI_ERROR_NOT_SUPPORTED);
|
FFA_ERROR_NOT_SUPPORTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
return spmd_smc_forward(smc_fid, secure_origin,
|
return spmd_smc_forward(smc_fid, secure_origin,
|
||||||
|
@ -509,6 +509,6 @@ uint64_t spmd_smc_handler(uint32_t smc_fid,
|
||||||
|
|
||||||
default:
|
default:
|
||||||
WARN("SPM: Unsupported call 0x%08x\n", smc_fid);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#define SPMD_C_RT_CTX_ENTRIES (SPMD_C_RT_CTX_SIZE >> DWORD_SHIFT)
|
#define SPMD_C_RT_CTX_ENTRIES (SPMD_C_RT_CTX_SIZE >> DWORD_SHIFT)
|
||||||
|
|
||||||
#ifndef __ASSEMBLER__
|
#ifndef __ASSEMBLER__
|
||||||
#include <services/spci_svc.h>
|
#include <services/ffa_svc.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
typedef enum spmc_state {
|
typedef enum spmc_state {
|
||||||
|
@ -49,11 +49,11 @@ typedef struct spmd_spm_core_context {
|
||||||
} spmd_spm_core_context_t;
|
} 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_MASK U(1)
|
||||||
#define SPMC_SECURE_ID_SHIFT U(15)
|
#define SPMC_SECURE_ID_SHIFT U(15)
|
||||||
|
|
||||||
|
|
|
@ -123,10 +123,10 @@ static uintptr_t std_svc_smc_handler(uint32_t smc_fid,
|
||||||
|
|
||||||
#if defined(SPD_spmd)
|
#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
|
* 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,
|
return spmd_smc_handler(smc_fid, x1, x2, x3, x4, cookie,
|
||||||
handle, flags);
|
handle, flags);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue