blob: 19db911adf41cb4d16f694c62b3fac631698238b [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001/*
Daniel Boulby0e4629f2021-10-26 14:01:23 +01002 * Copyright (c) 2018-2022, Arm Limited. All rights reserved.
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7/*
8 * This header file contains definitions related to the Trusted Firmware-A
9 * Test Secure-EL1 Payload (TSP).
10 */
11
12#ifndef __TSP_H__
13#define __TSP_H__
14
15#include <psci.h>
16#include <uuid.h>
17
18static const uuid_t tsp_uuid = {
Oliver Swede35d824e2019-10-01 13:50:36 +010019 {0xa0, 0x56, 0x30, 0x5b},
20 {0x91, 0x32},
21 {0x7b, 0x42},
22 0x98, 0x11,
23 {0x71, 0x68, 0xca, 0x50, 0xf3, 0xfa}
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020024};
25
26/*
27 * Identifiers for various TSP services. Corresponding function IDs (whether
28 * fast or standard) are generated by macros defined below
29 */
30#define TSP_ADD 0x2000
31#define TSP_SUB 0x2001
32#define TSP_MUL 0x2002
33#define TSP_DIV 0x2003
34#define TSP_HANDLE_SEL1_INTR_AND_RETURN 0x2004
Daniel Boulby0e4629f2021-10-26 14:01:23 +010035#define TSP_CHECK_DIT 0x2005
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +020036
37/*
38 * Identify a TSP service from function ID filtering the last 16 bits from the
39 * SMC function ID
40 */
41#define TSP_BARE_FID(fid) ((fid) & 0xffff)
42/*
43 * Generate function IDs for TSP services to be used in SMC calls, by
44 * appropriately setting bit 31 to differentiate standard and fast SMC calls
45 */
46#define TSP_STD_FID(fid) ((TSP_BARE_FID(fid) | 0x72000000))
47#define TSP_FAST_FID(fid) ((TSP_BARE_FID(fid) | 0x72000000) | (1u << 31))
48
49/* SMC function ID to request a previously preempted std smc */
50#define TSP_FID_RESUME TSP_STD_FID(0x3000)
51/*
52 * SMC function ID to request abortion of a previously preempted std smc. A
53 * fast SMC is used so that the TSP abort handler does not have to be
54 * reentrant.
55 */
56#define TSP_FID_ABORT TSP_FAST_FID(0x3001)
57
58#define TSP_SMC_PREEMPTED -2
59
60/*
61 * Total number of function IDs implemented for services offered to NS clients.
62 * The function IDs are defined above
63 */
64#define TSP_NUM_FID 0x5
65
66/* TSP implementation revision numbers */
67#define TSP_REVISION_MAJOR 0x0
68#define TSP_REVISION_MINOR 0x1
69
70/* TSP is multiprocessor capable so does not require migration */
71#define TSP_MIGRATE_INFO PSCI_TOS_NOT_PRESENT_MP
72
73#endif /* __TSP_H__ */