julhal01 | 2c18fbf | 2021-02-01 08:29:28 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef TS_CONFIG_INTERFACE_PLATFORM_CONFIG_H |
| 8 | #define TS_CONFIG_INTERFACE_PLATFORM_CONFIG_H |
| 9 | |
| 10 | #include <platform/interface/device_region.h> |
| 11 | #include <stddef.h> |
| 12 | |
| 13 | /** |
| 14 | * Provides a common interface for retrieving platform configuration |
| 15 | * data for initializing platform provided devices or services. |
| 16 | */ |
| 17 | |
| 18 | #ifdef __cplusplus |
| 19 | extern "C" { |
| 20 | #endif |
| 21 | |
| 22 | /** |
| 23 | * \brief Query platform configuartion for a particular device_region |
| 24 | * |
| 25 | * \param[in] dev_class Class of device (e.g. 'trng') |
| 26 | * \param[in] dev_instance The instance of the class of a device on platform |
| 27 | * |
| 28 | * \return Pointer to device_region or NULL if no qualifying configuration |
| 29 | */ |
| 30 | struct device_region *platform_config_device_query(const char *dev_class, |
| 31 | int dev_instance); |
| 32 | |
| 33 | /** |
| 34 | * \brief Frees a device region returned by platform_config_device_query() |
| 35 | * |
| 36 | * \param[in] device_region Device region object to free. Can be NULL. |
| 37 | */ |
| 38 | void platform_config_device_query_free(struct device_region *device_region); |
| 39 | |
| 40 | /** |
| 41 | * \brief Add a device_region to the platform configuration |
| 42 | * |
| 43 | * \param[in] device_region The device_region object to add |
| 44 | * |
| 45 | * \return 0 if successful |
| 46 | */ |
| 47 | int platform_config_device_add(const struct device_region *device_region); |
| 48 | |
| 49 | |
| 50 | #ifdef __cplusplus |
| 51 | } |
| 52 | #endif |
| 53 | |
| 54 | #endif /* TS_CONFIG_INTERFACE_PLATFORM_CONFIG_H */ |