blob: a85e94679b2fdda87b3929b94ebbe0dae1a5f72d [file] [log] [blame]
Imre Kis66321592020-11-23 03:15:50 +01001/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
4 */
5
6#ifndef LIBSP_INCLUDE_SP_DISCOVERY_H_
7#define LIBSP_INCLUDE_SP_DISCOVERY_H_
8
9#include "sp_api_defines.h"
10#include "sp_api_types.h"
11#include <stdbool.h>
12#include <stdint.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18struct sp_uuid {
19 uint8_t uuid[16];
20};
21
22struct sp_partition_info {
23 uint16_t partition_id;
24 uint16_t execution_context_count;
25 bool supports_direct_requests;
26 bool can_send_direct_requests;
27 bool supports_indirect_requests;
28};
29
30/**
31 * @brief Queries the FF-A version of the FF-A instance.
32 *
33 * @param[out] major The major FF-A version
34 * @param[out] minor The minor FF-A version
35 *
36 * @return The SP API result
37 */
38sp_result sp_discovery_ffa_version_get(uint16_t *major, uint16_t *minor);
39
40/**
41 * @brief Queries the 16 bit FF-A ID of the calling partition.
42 *
43 * @param[out] id The 16 bit FF-A ID of the calling partition
44 *
45 * @return The SP API result
46 */
47sp_result sp_discovery_own_id_get(uint16_t *id);
48
49/**
50 * @brief Queries the 16 bit FF-A ID of a partition by its UUID.
51 *
52 * @param[in] uuid The UUID of the partition
53 * @param[out] id The 16 bit FF-A ID of the partition
54 *
55 * @return The SP API result
56 */
57sp_result sp_discovery_partition_id_get(const struct sp_uuid *uuid,
58 uint16_t *id);
59
60/**
61 * @brief Queries the information about a partition by its UUID.
62 *
63 * @param[in] uuid The UUID of the partition
64 * @param[out] info The partition information
65 *
66 * @return The SP API result
67 */
68sp_result sp_discovery_partition_info_get(const struct sp_uuid *uuid,
69 struct sp_partition_info *info);
70
71/**
72 * @brief Queries partition information of all partitions.
73 *
74 * @param[out] info The partition information buffer
75 * @param[in,out] count As an input value it specifies the count of partition
76 * info structures that would fit into the output buffer.
77 * As an output it indicates the count of the valid
78 * entries in the buffer.
79 *
80 * @return The SP API result
81 */
82sp_result sp_discovery_partition_info_get_all(struct sp_partition_info info[],
83 uint32_t *count);
84
85#ifdef __cplusplus
86}
87#endif
88
89#endif /* LIBSP_INCLUDE_SP_DISCOVERY_H_ */