diff options
author | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2019-01-30 16:01:49 +0000 |
---|---|---|
committer | Antonio Nino Diaz <antonio.ninodiaz@arm.com> | 2019-01-30 16:01:49 +0000 |
commit | 0709055ed66330fe7709c77d2dfbcb87f0c94272 (patch) | |
tree | 31b5d3b7354ad9a8b1bb3e423762e5ea1235d05b /include/lib/smccc.h | |
parent | 7e9b0c8eef2b90f51ed41bb8ddf15d7c47672ca9 (diff) | |
download | platform_external_arm-trusted-firmware-0709055ed66330fe7709c77d2dfbcb87f0c94272.tar.gz platform_external_arm-trusted-firmware-0709055ed66330fe7709c77d2dfbcb87f0c94272.tar.bz2 platform_external_arm-trusted-firmware-0709055ed66330fe7709c77d2dfbcb87f0c94272.zip |
Remove support for the SMC Calling Convention 2.0
This reverts commit 2f370465241c ("Add support for the SMC Calling
Convention 2.0").
SMCCC v2.0 is no longer required for SPM, and won't be needed in the
future. Removing it makes the SMC handling code less complicated.
The SPM implementation based on SPCI and SPRT was using it, but it has
been adapted to SMCCC v1.0.
Change-Id: I36795b91857b2b9c00437cfbfed04b3c1627f578
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'include/lib/smccc.h')
-rw-r--r-- | include/lib/smccc.h | 74 |
1 files changed, 64 insertions, 10 deletions
diff --git a/include/lib/smccc.h b/include/lib/smccc.h index b10c52ce9..94c39d2a6 100644 --- a/include/lib/smccc.h +++ b/include/lib/smccc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -19,15 +19,69 @@ | (((uint32_t)(_minor) & SMCCC_VERSION_MINOR_MASK) << \ SMCCC_VERSION_MINOR_SHIFT)) -#if SMCCC_MAJOR_VERSION == 1 -# define SMCCC_MINOR_VERSION U(1) -# include <lib/smccc_v1.h> -#elif SMCCC_MAJOR_VERSION == 2 -# define SMCCC_MINOR_VERSION U(0) -# include <lib/smccc_v2.h> -#else -# error "Unsupported version of SMCCC." -#endif +#define SMCCC_MAJOR_VERSION U(1) +#define SMCCC_MINOR_VERSION U(1) + +/******************************************************************************* + * Bit definitions inside the function id as per the SMC calling convention + ******************************************************************************/ +#define FUNCID_TYPE_SHIFT U(31) +#define FUNCID_TYPE_MASK U(0x1) +#define FUNCID_TYPE_WIDTH U(1) + +#define FUNCID_CC_SHIFT U(30) +#define FUNCID_CC_MASK U(0x1) +#define FUNCID_CC_WIDTH U(1) + +#define FUNCID_OEN_SHIFT U(24) +#define FUNCID_OEN_MASK U(0x3f) +#define FUNCID_OEN_WIDTH U(6) + +#define FUNCID_NUM_SHIFT U(0) +#define FUNCID_NUM_MASK U(0xffff) +#define FUNCID_NUM_WIDTH U(16) + +#define GET_SMC_TYPE(id) (((id) >> FUNCID_TYPE_SHIFT) & \ + FUNCID_TYPE_MASK) +#define GET_SMC_CC(id) (((id) >> FUNCID_CC_SHIFT) & \ + FUNCID_CC_MASK) +#define GET_SMC_OEN(id) (((id) >> FUNCID_OEN_SHIFT) & \ + FUNCID_OEN_MASK) + +/******************************************************************************* + * Owning entity number definitions inside the function id as per the SMC + * calling convention + ******************************************************************************/ +#define OEN_ARM_START U(0) +#define OEN_ARM_END U(0) +#define OEN_CPU_START U(1) +#define OEN_CPU_END U(1) +#define OEN_SIP_START U(2) +#define OEN_SIP_END U(2) +#define OEN_OEM_START U(3) +#define OEN_OEM_END U(3) +#define OEN_STD_START U(4) /* Standard Service Calls */ +#define OEN_STD_END U(4) +#define OEN_STD_HYP_START U(5) /* Standard Hypervisor Service calls */ +#define OEN_STD_HYP_END U(5) +#define OEN_VEN_HYP_START U(6) /* Vendor Hypervisor Service calls */ +#define OEN_VEN_HYP_END U(6) +#define OEN_TAP_START U(48) /* Trusted Applications */ +#define OEN_TAP_END U(49) +#define OEN_TOS_START U(50) /* Trusted OS */ +#define OEN_TOS_END U(63) +#define OEN_LIMIT U(64) + +/* Flags and error codes */ +#define SMC_64 U(1) +#define SMC_32 U(0) + +#define SMC_TYPE_FAST ULL(1) +#define SMC_TYPE_YIELD ULL(0) + +#define SMC_OK ULL(0) +#define SMC_UNK -1 +#define SMC_PREEMPTED -2 /* Not defined by the SMCCC */ /* Various flags passed to SMC handlers */ #define SMC_FROM_SECURE (U(0) << 0) |