1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
6 * Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
9 #ifndef __SANDBOX_ARM_FFA_H
10 #define __SANDBOX_ARM_FFA_H
15 * This header provides public sandbox FF-A emulator declarations
16 * and declarations needed by FF-A sandbox clients
19 /* UUIDs strings of the emulated services */
20 #define SANDBOX_SERVICE1_UUID "ed32d533-4209-99e6-2d72-cdd998a79cc0"
21 #define SANDBOX_SERVICE2_UUID "ed32d544-4209-99e6-2d72-cdd998a79cc0"
23 /* IDs of the emulated secure partitions (SPs) */
24 #define SANDBOX_SP1_ID 0x1245
25 #define SANDBOX_SP2_ID 0x9836
26 #define SANDBOX_SP3_ID 0x6452
27 #define SANDBOX_SP4_ID 0x7814
29 /* Invalid service UUID (no matching SP) */
30 #define SANDBOX_SERVICE3_UUID "55d532ed-0942-e699-722d-c09ca798d9cd"
32 /* Invalid service UUID (invalid UUID string format) */
33 #define SANDBOX_SERVICE4_UUID "32ed-0942-e699-722d-c09ca798d9cd"
35 /* Number of valid services */
36 #define SANDBOX_SP_COUNT_PER_VALID_SERVICE 2
39 * struct ffa_sandbox_data - query ABI state data structure
40 * @data0_size: size of the first argument
41 * @data0: pointer to the first argument
42 * @data1_size>: size of the second argument
43 * @data1: pointer to the second argument
45 * Used to pass various types of data with different sizes between
46 * the test cases and the sandbox emulator.
47 * The data is for querying FF-A ABIs state.
49 struct ffa_sandbox_data {
50 u32 data0_size; /* size of the first argument */
51 void *data0; /* pointer to the first argument */
52 u32 data1_size; /* size of the second argument */
53 void *data1; /* pointer to the second argument */
56 /* The sandbox FF-A emulator public functions */
59 * sandbox_query_ffa_emul_state() - Inspect the FF-A ABIs
60 * @queried_func_id: The FF-A function to be queried
61 * @func_data: Pointer to the FF-A function arguments container structure
63 * Query the status of FF-A ABI specified in the input argument.
67 * 0 on success. Otherwise, failure
69 int sandbox_query_ffa_emul_state(u32 queried_func_id,
70 struct ffa_sandbox_data *func_data);