diff --git a/docs/about/features.rst b/docs/about/features.rst index 7c73952..964cb25 100644 --- a/docs/about/features.rst +++ b/docs/about/features.rst @@ -108,8 +108,8 @@ - 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. diff --git a/docs/components/index.rst b/docs/components/index.rst index e3ce614..c5f6264 100644 --- a/docs/components/index.rst +++ b/docs/components/index.rst @@ -17,5 +17,5 @@ romlib-design sdei secure-partition-manager-design - spci-manifest-binding + psa-ffa-manifest-binding xlat-tables-lib-v2-design diff --git a/docs/components/psa-ffa-manifest-binding.rst b/docs/components/psa-ffa-manifest-binding.rst new file mode 100644 index 0000000..7a1c1eb --- /dev/null +++ b/docs/components/psa-ffa-manifest-binding.rst @@ -0,0 +1,253 @@ +PSA FF-A manifest binding to device tree +======================================== + +This document defines the nodes and properties used to define a partition, +according to the PSA FF-A specification. + +Version 1.0 +----------- + +psa-ffa-manifest-partition +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- compatible [mandatory] + - value type: + - 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. + +- ffa-version [mandatory] + - value type: + - 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 FFA + instance it will execute. + - Y is the minor version of PSA-FF-A expected by the partition at the FFA + instance it will execute. + +- uuid [mandatory] + - value type: + - An array consisting of 4 values, identifying the UUID of the service + implemented by this partition. The UUID format is described in RFC 4122. + UUID can be shared by multiple instances of partitions that offer the same + service For example: + + - 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 + FFA_PARTITION_INFO_GET interface to determine the: + + - Number of Trusted OSs + - The partition ID of each instance of the Trusted OS + +- id + - value type: + - Pre-allocated partition ID. + +- auxiliary-id + - value type: + - Pre-allocated ID that could be used in memory management transactions. + +- description + - value type: + - Name of the partition e.g. for debugging purposes. + +- execution-ctx-count [mandatory] + - value type: + - Number of vCPUs that a VM or SP wants to instantiate. + + - In the absence of virtualization, this is the number of execution + contexts that a partition implements. + - If value of this field = 1 and number of PEs > 1 then the partition is + treated as UP & migrate capable. + - If the value of this field > 1 then the partition is treated as a MP + capable partition irrespective of the number of PEs. + +- exception-level [mandatory] + - value type: + - The target exception level for the partition: + + - 0x0: EL1 + - 0x1: S_EL0 + - 0x2: S_EL1 + - 0x3: EL2 + - 0x4: Supervisor mode + - 0x5: Secure User mode + +- execution-state [mandatory] + - value type: + - The target execution state of the partition: + + - 0: AArch64 + - 1: AArch32 + +- load-address + - value type: + - Physical base address of the partition in memory. Absence of this field + indicates that the partition is position independent and can be loaded at + any address chosen at boot time. + +- entrypoint-offset + - value type: + - Offset from the base of the partition's binary image to the entry point of + the partition. Absence of this field indicates that the entry point is at + offset 0x0 from the base of the partition's binary. + +- xlat-granule [mandatory] + - value type: + - Translation granule used with the partition: + + - 0x0: 4k + - 0x1: 16k + - 0x2: 32k + +- boot-order + - value type: + - A unique number amongst all partitions that specifies if this partition + must be booted before others. The partition with the smaller number will be + booted first. + +- rx-tx-buffer + - 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,ffa-manifest-rx_tx-buffer". + +- messaging-method [mandatory] + - value type: + - Specifies which messaging methods are supported by the partition: + + - 0x0: direct messaging method + - 0x1: indirect messaging method + - 0x2: both direct and indirect messaging methods + +- has-primary-scheduler + - value type: + - Presence of this field indicates that the partition implements the primary + scheduler. If so, run-time EL must be EL1. + +- run-time-model + - value type: + - Run time model that the SPM must enforce for this SP: + + - 0x0: Run to completion + - 0x1: Preemptible + +- time-slice-mem + - value type: + - Presence of this field indicates that the partition doesn't expect the + partition manager to time slice long running memory management functions. + +- gp-register-num + - value type: + - Presence of this field indicates that the partition expects the + 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 + the partition properties. For example, if the number value is 1 then the + general-purpose register used will be x1 in AArch64 state and w1 in AArch32 + state. + +- stream-endpoint-ids + - value type: + - List of tuples, identifying the IDs this partition is acting as + proxy for. + +memory-regions +-------------- + +- compatible [mandatory] + - value type: + - Must be the string "arm,ffa-manifest-memory-regions". + +- description + - value type: + - Name of the memory region e.g. for debugging purposes. + +- pages-count [mandatory] + - value type: + - Count of pages of memory region as a multiple of the translation granule + size + +- attributes [mandatory] + - value type: + - ?? TO DEFINE + +- base-address + - value type: + - 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 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 + then communicate the region properties (including the base address chosen + by the partition manager) to the partition. + +device-regions +-------------- + +- compatible [mandatory] + - value type: + - Must be the string "arm,ffa-manifest-device-regions". + +- description + - value type: + - Name of the device region e.g. for debugging purposes. + +- reg [mandatory] + - value type: + - A (address, num-pages) pair describing the device, where: + + - address: The physical base address value of the device MMIO + region. + - num-pages: The number of pages of the region. The total size of + the region is this value multiplied by the translation granule size. + +- attributes [mandatory] + - value type: + - ?? TO DEFINE + +- smmu-id + - value type: + - On systems with multiple System Memory Management Units (SMMUs) this + identifier is used to inform the partition manager which SMMU the device is + upstream of. If the field is omitted then it is assumed that the device is + not upstream of any SMMU. + +- stream-ids [mandatory] + - value type: + - A list of (id, mem-manage) pair, where: + + - id: A unique value amongst all devices assigned to the partition. + - mem-manage: A value used in memory management operations. + +- interrupts [mandatory] + - value type: + - A list of (id, attributes) pair describing the device interrupts, where: + + - id: The interrupt IDs. + - attributes: A ?? TO DEFINE value, + containing the attributes for each interrupt ID: + + - Interrupt type: SPI, PPI, SGI + - Interrupt configuration: Edge triggered, Level triggered + - Interrupt security state: Secure, Non-secure + - Interrupt priority value + - Target execution context/vCPU for each SPI + +- exclusive-access + - value type: + - Presence of this field implies that this endpoint must be granted exclusive + access and ownership of this devices's MMIO region. + +-------------- + +*Copyright (c) 2019-2020, Arm Limited and Contributors. All rights reserved.* diff --git a/docs/components/spci-manifest-binding.rst b/docs/components/spci-manifest-binding.rst deleted file mode 100644 index 5848169..0000000 --- a/docs/components/spci-manifest-binding.rst +++ /dev/null @@ -1,253 +0,0 @@ -SPCI manifest binding to device tree -==================================== - -This document defines the nodes and properties used to define a partition, -according to the SPCI specification. - -Version 1.0 ------------ - -spci-manifest-partition -^^^^^^^^^^^^^^^^^^^^^^^ - -- compatible [mandatory] - - value type: - - 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 - 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] - - value type: - - 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 - instance it will execute. - - Y is the minor version of PSA-FF-A expected by the partition at the SPCI - instance it will execute. - -- uuid [mandatory] - - value type: - - An array consisting of 4 values, identifying the UUID of the service - implemented by this partition. The UUID format is described in RFC 4122. - UUID can be shared by multiple instances of partitions that offer the same - service For example: - - - 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: - - - Number of Trusted OSs - - The partition ID of each instance of the Trusted OS - -- id - - value type: - - Pre-allocated partition ID. - -- auxiliary-id - - value type: - - Pre-allocated ID that could be used in memory management transactions. - -- description - - value type: - - Name of the partition e.g. for debugging purposes. - -- execution-ctx-count [mandatory] - - value type: - - Number of vCPUs that a VM or SP wants to instantiate. - - - In the absence of virtualization, this is the number of execution - contexts that a partition implements. - - If value of this field = 1 and number of PEs > 1 then the partition is - treated as UP & migrate capable. - - If the value of this field > 1 then the partition is treated as a MP - capable partition irrespective of the number of PEs. - -- exception-level [mandatory] - - value type: - - The target exception level for the partition: - - - 0x0: EL1 - - 0x1: S_EL0 - - 0x2: S_EL1 - - 0x3: EL2 - - 0x4: Supervisor mode - - 0x5: Secure User mode - -- execution-state [mandatory] - - value type: - - The target execution state of the partition: - - - 0: AArch64 - - 1: AArch32 - -- load-address - - value type: - - Physical base address of the partition in memory. Absence of this field - indicates that the partition is position independent and can be loaded at - any address chosen at boot time. - -- entrypoint-offset - - value type: - - Offset from the base of the partition's binary image to the entry point of - the partition. Absence of this field indicates that the entry point is at - offset 0x0 from the base of the partition's binary. - -- xlat-granule [mandatory] - - value type: - - Translation granule used with the partition: - - - 0x0: 4k - - 0x1: 16k - - 0x2: 32k - -- boot-order - - value type: - - A unique number amongst all partitions that specifies if this partition - must be booted before others. The partition with the smaller number will be - booted first. - -- rx-tx-buffer - - 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". - -- messaging-method [mandatory] - - value type: - - Specifies which messaging methods are supported by the partition: - - - 0x0: direct messaging method - - 0x1: indirect messaging method - - 0x2: both direct and indirect messaging methods - -- has-primary-scheduler - - value type: - - Presence of this field indicates that the partition implements the primary - scheduler. If so, run-time EL must be EL1. - -- run-time-model - - value type: - - Run time model that the SPM must enforce for this SP: - - - 0x0: Run to completion - - 0x1: Preemptible - -- time-slice-mem - - value type: - - Presence of this field indicates that the partition doesn't expect the - partition manager to time slice long running memory management functions. - -- gp-register-num - - value type: - - Presence of this field indicates that the partition expects the - spci_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 - the partition properties. For example, if the number value is 1 then the - general-purpose register used will be x1 in AArch64 state and w1 in AArch32 - state. - -- stream-endpoint-ids - - value type: - - List of tuples, identifying the IDs this partition is acting as - proxy for. - -memory-regions --------------- - -- compatible [mandatory] - - value type: - - Must be the string "arm,spci-manifest-memory-regions". - -- description - - value type: - - Name of the memory region e.g. for debugging purposes. - -- pages-count [mandatory] - - value type: - - Count of pages of memory region as a multiple of the translation granule - size - -- attributes [mandatory] - - value type: - - ?? TO DEFINE - -- base-address - - value type: - - 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 - 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 - then communicate the region properties (including the base address chosen - by the partition manager) to the partition. - -device-regions --------------- - -- compatible [mandatory] - - value type: - - Must be the string "arm,spci-manifest-device-regions". - -- description - - value type: - - Name of the device region e.g. for debugging purposes. - -- reg [mandatory] - - value type: - - A (address, num-pages) pair describing the device, where: - - - address: The physical base address value of the device MMIO - region. - - num-pages: The number of pages of the region. The total size of - the region is this value multiplied by the translation granule size. - -- attributes [mandatory] - - value type: - - ?? TO DEFINE - -- smmu-id - - value type: - - On systems with multiple System Memory Management Units (SMMUs) this - identifier is used to inform the partition manager which SMMU the device is - upstream of. If the field is omitted then it is assumed that the device is - not upstream of any SMMU. - -- stream-ids [mandatory] - - value type: - - A list of (id, mem-manage) pair, where: - - - id: A unique value amongst all devices assigned to the partition. - - mem-manage: A value used in memory management operations. - -- interrupts [mandatory] - - value type: - - A list of (id, attributes) pair describing the device interrupts, where: - - - id: The interrupt IDs. - - attributes: A ?? TO DEFINE value, - containing the attributes for each interrupt ID: - - - Interrupt type: SPI, PPI, SGI - - Interrupt configuration: Edge triggered, Level triggered - - Interrupt security state: Secure, Non-secure - - Interrupt priority value - - Target execution context/vCPU for each SPI - -- exclusive-access - - value type: - - Presence of this field implies that this endpoint must be granted exclusive - access and ownership of this devices's MMIO region. - --------------- - -*Copyright (c) 2019-2020, Arm Limited and Contributors. All rights reserved.* diff --git a/docs/global_substitutions.txt b/docs/global_substitutions.txt index 4dda1dc..d33155b 100644 --- a/docs/global_substitutions.txt +++ b/docs/global_substitutions.txt @@ -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` diff --git a/docs/glossary.rst b/docs/glossary.rst index 3da30b0..e087079 100644 --- a/docs/glossary.rst +++ b/docs/glossary.rst @@ -57,6 +57,9 @@ FDT Flattened Device Tree + FFA + Firmware Framework for A-class processors + FIP Firmware Image Package @@ -107,6 +110,9 @@ PMF Performance Measurement Framework + PSA + Platform Security Architecture + PSCI Power State Coordination Interface @@ -149,9 +155,6 @@ SP Secure Partition - SPCI - Secure Partition Client Interface - SPD Secure Payload Dispatcher diff --git a/include/services/ffa_svc.h b/include/services/ffa_svc.h new file mode 100644 index 0000000..fe32175 --- /dev/null +++ b/include/services/ffa_svc.h @@ -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 +#include +#include + +/* 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 */ diff --git a/include/services/spci_svc.h b/include/services/spci_svc.h deleted file mode 100644 index 49ba408..0000000 --- a/include/services/spci_svc.h +++ /dev/null @@ -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 -#include -#include - -/* 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 */ diff --git a/include/services/spm_core_manifest.h b/include/services/spm_core_manifest.h index 0c43636..64ecce0 100644 --- a/include/services/spm_core_manifest.h +++ b/include/services/spm_core_manifest.h @@ -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; diff --git a/include/services/spmd_svc.h b/include/services/spmd_svc.h index a766dcf..1e7e6aa 100644 --- a/include/services/spmd_svc.h +++ b/include/services/spmd_svc.h @@ -8,7 +8,7 @@ #define SPMD_SVC_H #ifndef __ASSEMBLER__ -#include +#include #include int spmd_setup(void); diff --git a/plat/arm/board/fvp/fdts/fvp_spmc_manifest.dts b/plat/arm/board/fvp/fdts/fvp_spmc_manifest.dts index ebfbe17..a1c9094 100644 --- a/plat/arm/board/fvp/fdts/fvp_spmc_manifest.dts +++ b/plat/arm/board/fvp/fdts/fvp_spmc_manifest.dts @@ -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 = <0x0>; - min_ver = <0x9>; + maj_ver = <0x1>; + min_ver = <0x0>; 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 */ }; }; diff --git a/plat/common/plat_spmd_manifest.c b/plat/common/plat_spmd_manifest.c index 109b001..455b980 100644 --- a/plat/common/plat_spmd_manifest.c +++ b/plat/common/plat_spmd_manifest.c @@ -31,14 +31,14 @@ 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 @@ 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; diff --git a/services/std_svc/spmd/spmd_main.c b/services/std_svc/spmd/spmd_main.c index 501782f..a818037 100644 --- a/services/std_svc/spmd/spmd_main.c +++ b/services/std_svc/spmd/spmd_main.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include "spmd_private.h" @@ -56,7 +56,7 @@ ******************************************************************************/ 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 @@ * 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 @@ } /******************************************************************************* - * 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 @@ 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 @@ 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 @@ /* * 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 @@ 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 @@ /* 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 @@ 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); } } diff --git a/services/std_svc/spmd/spmd_private.h b/services/std_svc/spmd/spmd_private.h index 232031b..4946309 100644 --- a/services/std_svc/spmd/spmd_private.h +++ b/services/std_svc/spmd/spmd_private.h @@ -30,7 +30,7 @@ #define SPMD_C_RT_CTX_ENTRIES (SPMD_C_RT_CTX_SIZE >> DWORD_SHIFT) #ifndef __ASSEMBLER__ -#include +#include #include typedef enum spmc_state { @@ -49,11 +49,11 @@ } 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) diff --git a/services/std_svc/std_svc_setup.c b/services/std_svc/std_svc_setup.c index 895fd29..cdd17bc 100644 --- a/services/std_svc/std_svc_setup.c +++ b/services/std_svc/std_svc_setup.c @@ -123,10 +123,10 @@ #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); }