1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2017, Linaro Limited
4  */
5 
6 #ifndef __PTA_INVOKE_TESTS_H
7 #define __PTA_INVOKE_TESTS_H
8 
9 #define PTA_INVOKE_TESTS_UUID \
10 		{ 0xd96a5b40, 0xc3e5, 0x21e3, \
11 			{ 0x87, 0x94, 0x10, 0x02, 0xa5, 0xd5, 0xc6, 0x1b } }
12 
13 /* Trace some hello string. Parameters are not used/checked. */
14 #define PTA_INVOKE_TESTS_CMD_TRACE		0
15 
16 /*
17  * Types of parameter drives the test sequences:
18  * - test on value parameters
19  * - test on SHM memory reference parameters
20  * - test on SDP memory reference parameters
21  */
22 #define PTA_INVOKE_TESTS_CMD_PARAMS		1
23 
24 /* Run some core internal tests. Parameters are not used/checked. */
25 #define PTA_INVOKE_TESTS_CMD_SELF_TESTS		2
26 
27 /*
28  * Secure data path: check that PTA can copy data from non-secure shared memory
29  * to SDP secure memory
30  *
31  * [in]     memref[0]        source (non-secure shared memory)
32  * [out]    memref[1]        destination (SDP secure memory)
33  */
34 #define PTA_INVOKE_TESTS_CMD_COPY_NSEC_TO_SEC	3
35 
36 /*
37  * Secure data path: check that PTA can read data from SDP secure memory and
38  * write it back. Data are processed so that client check the expected
39  * read/write sequence succeed.
40  *
41  * [in/out]     memref[0]        SDP secure buffer to read from and write to
42  */
43 #define PTA_INVOKE_TESTS_CMD_READ_MODIFY_SEC	4
44 
45 /*
46  * Secure data path: check that PTA can copy data from SDP secure memory to
47  * non-secure shared memory
48  *
49  * [in]     memref[0]        source (SDP secure memory)
50  * [out]    memref[1]        destination (non-secure shared memory)
51  */
52 #define PTA_INVOKE_TESTS_CMD_COPY_SEC_TO_NSEC	5
53 
54 /*
55  * Tests FS hash-tree corner cases in error handling
56  */
57 #define PTA_INVOKE_TESTS_CMD_FS_HTREE		6
58 
59 /*
60  * Tests mutex
61  *
62  * [in]  value[0].a	Test function PTA_MUTEX_TEST_*
63  * [in]  value[0].b	delay number
64  * [out] value[1].a	before lock concurency
65  * [out] value[1].b	during lock concurency
66  */
67 #define PTA_MUTEX_TEST_WRITER			0
68 #define PTA_MUTEX_TEST_READER			1
69 #define PTA_INVOKE_TESTS_CMD_MUTEX		7
70 
71 /*
72  * Tests lock dependency checking algorithm
73  */
74 #define PTA_INVOKE_TESTS_CMD_LOCKDEP		8
75 
76 /*
77  * These values should match the ones in
78  * optee_test/ta/aes_perf/include/ta_aes_perf.h
79  */
80 #define PTA_INVOKE_TESTS_AES_ECB		0
81 #define PTA_INVOKE_TESTS_AES_CBC		1
82 #define PTA_INVOKE_TESTS_AES_CTR		2
83 #define PTA_INVOKE_TESTS_AES_XTS		3
84 #define PTA_INVOKE_TESTS_AES_GCM		4
85 
86 /*
87  * AES performance tests
88  *
89  * [in]     value[0].a	Top 16 bits Decrypt, low 16 bits key size in bits
90  * [in]     value[0].b	AES mode, one of
91  *			PTA_INVOKE_TESTS_AES_{ECB_NOPAD,CBC_NOPAD,CTR,XTS,GCM}
92  * [in]     value[1].a	repetition count
93  * [in]     value[1].b	unit size
94  * [in]     memref[2]	In buffer
95  * [in]     memref[3]	Out buffer
96  */
97 #define PTA_INVOKE_TEST_CMD_AES_PERF		9
98 
99 /*
100  * NULL memory reference parameter
101  *
102  * [in/out] memref[0]	NULL memory reference of size zero
103  */
104 #define PTA_INVOKE_TESTS_CMD_MEMREF_NULL	10
105 
106 #endif /*__PTA_INVOKE_TESTS_H*/
107 
108