2016-09-19 11:21:03 +01:00
|
|
|
/*
|
2018-10-25 16:53:04 +01:00
|
|
|
* Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
|
2016-09-19 11:21:03 +01:00
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2016-09-19 11:21:03 +01:00
|
|
|
*/
|
|
|
|
|
2018-10-25 16:53:04 +01:00
|
|
|
#ifndef ARM_SIP_SVC_H
|
|
|
|
#define ARM_SIP_SVC_H
|
|
|
|
|
2018-12-14 00:18:21 +00:00
|
|
|
#include <lib/utils_def.h>
|
2016-09-19 11:21:03 +01:00
|
|
|
|
|
|
|
/* SMC function IDs for SiP Service queries */
|
|
|
|
|
2018-10-25 16:53:04 +01:00
|
|
|
#define ARM_SIP_SVC_CALL_COUNT U(0x8200ff00)
|
|
|
|
#define ARM_SIP_SVC_UID U(0x8200ff01)
|
|
|
|
/* U(0x8200ff02) is reserved */
|
|
|
|
#define ARM_SIP_SVC_VERSION U(0x8200ff03)
|
2016-09-19 11:21:03 +01:00
|
|
|
|
Introduce ARM SiP service to switch execution state
In AArch64, privileged exception levels control the execution state
(a.k.a. register width) of the immediate lower Exception Level; i.e.
whether the lower exception level executes in AArch64 or AArch32 state.
For an exception level to have its execution state changed at run time,
it must request the change by raising a synchronous exception to the
higher exception level.
This patch implements and adds such a provision to the ARM SiP service,
by which an immediate lower exception level can request to switch its
execution state. The execution state is switched if the request is:
- raised from non-secure world;
- raised on the primary CPU, before any secondaries are brought online
with CPU_ON PSCI call;
- raised from an exception level immediately below EL3: EL2, if
implemented; otherwise NS EL1.
If successful, the SMC doesn't return to the caller, but to the entry
point supplied with the call. Otherwise, the caller will observe the SMC
returning with STATE_SW_E_DENIED code. If ARM Trusted Firmware is built
for AArch32, the feature is not supported, and the call will always
fail.
For the ARM SiP service:
- Add SMC function IDs for both AArch32 and AArch64;
- Increment the SiP service minor version to 2;
- Adjust the number of supported SiP service calls.
Add documentation for ARM SiP service.
Fixes ARM-software/tf-issues#436
Change-Id: I4347f2d6232e69fbfbe333b340fcd0caed0a4cea
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2017-02-16 14:55:15 +00:00
|
|
|
/* Function ID for requesting state switch of lower EL */
|
2018-10-25 16:53:04 +01:00
|
|
|
#define ARM_SIP_SVC_EXE_STATE_SWITCH U(0x82000020)
|
Introduce ARM SiP service to switch execution state
In AArch64, privileged exception levels control the execution state
(a.k.a. register width) of the immediate lower Exception Level; i.e.
whether the lower exception level executes in AArch64 or AArch32 state.
For an exception level to have its execution state changed at run time,
it must request the change by raising a synchronous exception to the
higher exception level.
This patch implements and adds such a provision to the ARM SiP service,
by which an immediate lower exception level can request to switch its
execution state. The execution state is switched if the request is:
- raised from non-secure world;
- raised on the primary CPU, before any secondaries are brought online
with CPU_ON PSCI call;
- raised from an exception level immediately below EL3: EL2, if
implemented; otherwise NS EL1.
If successful, the SMC doesn't return to the caller, but to the entry
point supplied with the call. Otherwise, the caller will observe the SMC
returning with STATE_SW_E_DENIED code. If ARM Trusted Firmware is built
for AArch32, the feature is not supported, and the call will always
fail.
For the ARM SiP service:
- Add SMC function IDs for both AArch32 and AArch64;
- Increment the SiP service minor version to 2;
- Adjust the number of supported SiP service calls.
Add documentation for ARM SiP service.
Fixes ARM-software/tf-issues#436
Change-Id: I4347f2d6232e69fbfbe333b340fcd0caed0a4cea
Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
2017-02-16 14:55:15 +00:00
|
|
|
|
2016-09-19 11:21:03 +01:00
|
|
|
/* ARM SiP Service Calls version numbers */
|
2018-10-25 16:53:04 +01:00
|
|
|
#define ARM_SIP_SVC_VERSION_MAJOR U(0x0)
|
|
|
|
#define ARM_SIP_SVC_VERSION_MINOR U(0x2)
|
2016-09-19 11:21:03 +01:00
|
|
|
|
2018-10-25 16:53:04 +01:00
|
|
|
#endif /* ARM_SIP_SVC_H */
|