blob: 87ee6f74b720e885aeb942024a99fe9697383100 [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001/*
2 * Copyright (c) 2018, Arm Limited. All rights reserved.
3 *
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
35
36/*
37 * Identify a TSP service from function ID filtering the last 16 bits from the
38 * SMC function ID
39 */
40#define TSP_BARE_FID(fid) ((fid) & 0xffff)
41/*
42 * Generate function IDs for TSP services to be used in SMC calls, by
43 * appropriately setting bit 31 to differentiate standard and fast SMC calls
44 */
45#define TSP_STD_FID(fid) ((TSP_BARE_FID(fid) | 0x72000000))
46#define TSP_FAST_FID(fid) ((TSP_BARE_FID(fid) | 0x72000000) | (1u << 31))
47
48/* SMC function ID to request a previously preempted std smc */
49#define TSP_FID_RESUME TSP_STD_FID(0x3000)
50/*
51 * SMC function ID to request abortion of a previously preempted std smc. A
52 * fast SMC is used so that the TSP abort handler does not have to be
53 * reentrant.
54 */
55#define TSP_FID_ABORT TSP_FAST_FID(0x3001)
56
57#define TSP_SMC_PREEMPTED -2
58
59/*
60 * Total number of function IDs implemented for services offered to NS clients.
61 * The function IDs are defined above
62 */
63#define TSP_NUM_FID 0x5
64
65/* TSP implementation revision numbers */
66#define TSP_REVISION_MAJOR 0x0
67#define TSP_REVISION_MINOR 0x1
68
69/* TSP is multiprocessor capable so does not require migration */
70#define TSP_MIGRATE_INFO PSCI_TOS_NOT_PRESENT_MP
71
72#endif /* __TSP_H__ */