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