Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 1 | /* |
| 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 | |
| 18 | static const uuid_t tsp_uuid = { |
| 19 | 0x5b3056a0, 0x3291, 0x427b, 0x98, 0x11, |
| 20 | { 0x71, 0x68, 0xca, 0x50, 0xf3, 0xfa } |
| 21 | }; |
| 22 | |
| 23 | /* |
| 24 | * Identifiers for various TSP services. Corresponding function IDs (whether |
| 25 | * fast or standard) are generated by macros defined below |
| 26 | */ |
| 27 | #define TSP_ADD 0x2000 |
| 28 | #define TSP_SUB 0x2001 |
| 29 | #define TSP_MUL 0x2002 |
| 30 | #define TSP_DIV 0x2003 |
| 31 | #define TSP_HANDLE_SEL1_INTR_AND_RETURN 0x2004 |
| 32 | |
| 33 | /* |
| 34 | * Identify a TSP service from function ID filtering the last 16 bits from the |
| 35 | * SMC function ID |
| 36 | */ |
| 37 | #define TSP_BARE_FID(fid) ((fid) & 0xffff) |
| 38 | /* |
| 39 | * Generate function IDs for TSP services to be used in SMC calls, by |
| 40 | * appropriately setting bit 31 to differentiate standard and fast SMC calls |
| 41 | */ |
| 42 | #define TSP_STD_FID(fid) ((TSP_BARE_FID(fid) | 0x72000000)) |
| 43 | #define TSP_FAST_FID(fid) ((TSP_BARE_FID(fid) | 0x72000000) | (1u << 31)) |
| 44 | |
| 45 | /* SMC function ID to request a previously preempted std smc */ |
| 46 | #define TSP_FID_RESUME TSP_STD_FID(0x3000) |
| 47 | /* |
| 48 | * SMC function ID to request abortion of a previously preempted std smc. A |
| 49 | * fast SMC is used so that the TSP abort handler does not have to be |
| 50 | * reentrant. |
| 51 | */ |
| 52 | #define TSP_FID_ABORT TSP_FAST_FID(0x3001) |
| 53 | |
| 54 | #define TSP_SMC_PREEMPTED -2 |
| 55 | |
| 56 | /* |
| 57 | * Total number of function IDs implemented for services offered to NS clients. |
| 58 | * The function IDs are defined above |
| 59 | */ |
| 60 | #define TSP_NUM_FID 0x5 |
| 61 | |
| 62 | /* TSP implementation revision numbers */ |
| 63 | #define TSP_REVISION_MAJOR 0x0 |
| 64 | #define TSP_REVISION_MINOR 0x1 |
| 65 | |
| 66 | /* TSP is multiprocessor capable so does not require migration */ |
| 67 | #define TSP_MIGRATE_INFO PSCI_TOS_NOT_PRESENT_MP |
| 68 | |
| 69 | #endif /* __TSP_H__ */ |