blob: dd9964c0b74f58b74f599e57033cb54cb0030819 [file] [log] [blame]
Julian Hallcfe2f5b2022-09-22 11:26:35 +01001/*
2 * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef VOLUME_INDEX_H
8#define VOLUME_INDEX_H
9
10#include <stdint.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16/**
17 * @brief Initialize the volume index
18 *
19 * The volume_index is a singleton that holds the mapping of volume IDs
20 * to concrete IO devices that can be used to access the volume. The
21 * mappings are setup during deployment configuration to meet the IO needs
22 * of the deployment. The volume_index realizes the tf-a function
23 * plat_get_image_source() to make the mappings available to tf-a components.
24 */
25void volume_index_init(void);
26
27/**
28 * @brief Clears the volume index
29 *
30 * Clears all mappings.
31 */
32void volume_index_clear(void);
33
34/**
35 * @brief Add an entry to the volume index
36 *
37 * @param[in] volume_id Volume identifier
38 * @param[in] dev_handle Device handle to use
39 * @param[in] volume_spec Additional information about the volume
40 *
41 * @return 0 if successful
42 */
43int volume_index_add(
44 unsigned int volume_id,
45 uintptr_t dev_handle,
46 uintptr_t volume_spec);
47
48#ifdef __cplusplus
49}
50#endif
51
52#endif /* VOLUME_INDEX_H */