blob: 6d2bcab6508c34959c86b3213458d8977f2f9564 [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
Julian Hall93df76a2022-09-22 17:30:06 +01007#ifndef MEDIA_VOLUME_INDEX_H
8#define MEDIA_VOLUME_INDEX_H
Julian Hallcfe2f5b2022-09-22 11:26:35 +01009
10#include <stdint.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16/**
Julian Hall93df76a2022-09-22 17:30:06 +010017 * For tf-a declaration of plat_get_image_source(). Included within C++ extern C
18 * guard to allow for calling from C++.
19 */
20#include <plat/common/platform.h>
21
22/**
Julian Hallcfe2f5b2022-09-22 11:26:35 +010023 * @brief Initialize the volume index
24 *
25 * The volume_index is a singleton that holds the mapping of volume IDs
26 * to concrete IO devices that can be used to access the volume. The
27 * mappings are setup during deployment configuration to meet the IO needs
28 * of the deployment. The volume_index realizes the tf-a function
29 * plat_get_image_source() to make the mappings available to tf-a components.
30 */
31void volume_index_init(void);
32
33/**
34 * @brief Clears the volume index
35 *
36 * Clears all mappings.
37 */
38void volume_index_clear(void);
39
40/**
41 * @brief Add an entry to the volume index
42 *
43 * @param[in] volume_id Volume identifier
44 * @param[in] dev_handle Device handle to use
45 * @param[in] volume_spec Additional information about the volume
46 *
47 * @return 0 if successful
48 */
49int volume_index_add(
50 unsigned int volume_id,
51 uintptr_t dev_handle,
52 uintptr_t volume_spec);
53
54#ifdef __cplusplus
55}
56#endif
57
Julian Hall93df76a2022-09-22 17:30:06 +010058#endif /* MEDIA_VOLUME_INDEX_H */