blob: 977c875440392c2309ee553769d1dbb53281fc94 [file] [log] [blame]
Imre Kis66321592020-11-23 03:15:50 +01001/* SPDX-License-Identifier: BSD-3-Clause */
2/*
Jelle Sels318263e2022-12-07 14:15:39 +01003 * Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved.
Imre Kis66321592020-11-23 03:15:50 +01004 */
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 *
Jelle Sels318263e2022-12-07 14:15:39 +010063 * @param[in] uuid The UUID of the partition
64 * @param[out] info The partition information
65 * @param[in,out] count As an input value it specifies the count of partition
66 * info structures that would fit into the output buffer.
67 * As an output it indicates the count of the valid
68 * entries in the buffer.
Imre Kis66321592020-11-23 03:15:50 +010069 *
Jelle Sels318263e2022-12-07 14:15:39 +010070 * @return The SP API result
Imre Kis66321592020-11-23 03:15:50 +010071 */
72sp_result sp_discovery_partition_info_get(const struct sp_uuid *uuid,
Jelle Sels318263e2022-12-07 14:15:39 +010073 struct sp_partition_info *info,
74 uint32_t *count);
Imre Kis66321592020-11-23 03:15:50 +010075
76/**
77 * @brief Queries partition information of all partitions.
78 *
79 * @param[out] info The partition information buffer
80 * @param[in,out] count As an input value it specifies the count of partition
81 * info structures that would fit into the output buffer.
82 * As an output it indicates the count of the valid
83 * entries in the buffer.
84 *
85 * @return The SP API result
86 */
87sp_result sp_discovery_partition_info_get_all(struct sp_partition_info info[],
88 uint32_t *count);
89
90#ifdef __cplusplus
91}
92#endif
93
94#endif /* LIBSP_INCLUDE_SP_DISCOVERY_H_ */