Julian Hall | cfe2f5b | 2022-09-22 11:26:35 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Julian Hall | 93df76a | 2022-09-22 17:30:06 +0100 | [diff] [blame^] | 7 | #ifndef MEDIA_VOLUME_INDEX_H |
| 8 | #define MEDIA_VOLUME_INDEX_H |
Julian Hall | cfe2f5b | 2022-09-22 11:26:35 +0100 | [diff] [blame] | 9 | |
| 10 | #include <stdint.h> |
| 11 | |
| 12 | #ifdef __cplusplus |
| 13 | extern "C" { |
| 14 | #endif |
| 15 | |
| 16 | /** |
Julian Hall | 93df76a | 2022-09-22 17:30:06 +0100 | [diff] [blame^] | 17 | * 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 Hall | cfe2f5b | 2022-09-22 11:26:35 +0100 | [diff] [blame] | 23 | * @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 | */ |
| 31 | void volume_index_init(void); |
| 32 | |
| 33 | /** |
| 34 | * @brief Clears the volume index |
| 35 | * |
| 36 | * Clears all mappings. |
| 37 | */ |
| 38 | void 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 | */ |
| 49 | int 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 Hall | 93df76a | 2022-09-22 17:30:06 +0100 | [diff] [blame^] | 58 | #endif /* MEDIA_VOLUME_INDEX_H */ |