blob: 3f7eb941e318b6d5d1cbde8a38dbaa0af880496e [file] [log] [blame]
julhal012c18fbf2021-02-01 08:29:28 +00001/*
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
19extern "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 */
30struct 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 */
38void 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 */
47int platform_config_device_add(const struct device_region *device_region);
48
julhal0137e1aea2021-02-09 15:22:20 +000049/**
50 * \brief Returns a count of the number of device regions
51 *
52 * \return 0 if successful
53 */
54unsigned int platform_config_device_region_count(void);
55
julhal012c18fbf2021-02-01 08:29:28 +000056
57#ifdef __cplusplus
58}
59#endif
60
61#endif /* TS_CONFIG_INTERFACE_PLATFORM_CONFIG_H */