1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  *
7  * Description:
8  *     Power domain utilities.
9  */
10 
11 #ifndef POWER_DOMAIN_UTILS_H
12 #define POWER_DOMAIN_UTILS_H
13 
14 /*!
15  * \addtogroup GroupPowerDomain
16  * \{
17  */
18 
19 #include <fwk_element.h>
20 #include <fwk_id.h>
21 
22 /*!
23  * \brief Create power domain element table.
24  *
25  * \details This function will create power domain element table for an SoC
26  *      that contains the same number of cores for each cluster. Also, all cores
27  *      supports the same state table and all clusters support the same state
28  *      table. Devices power domain configuration other than cores and clusters
29  *      as well as systop should be provided in the static table.
30  *
31  * \param core_count Number of cores in the system.
32  * \param cluster_count Number of clusters in the system.
33  * \param driver_idx The index of the driver which controls the cores domain.
34  * \param api_idx The driver api index.
35  * \param core_state_table The cores state mask table.
36  * \param core_state_table_size The cores state table size.
37  * \param cluster_state_table The cluster state mask table.
38  * \param cluster_state_table_size The cluster state table size.
39  * \param static_table Power domain static elements for devices and systop.
40  * \param static_table_size Power domain static table size.
41  *
42  * \retval A pointer to the newly created power domain elements table.
43  * \retval NULL if the table creation failed.
44  */
45 const struct fwk_element *create_power_domain_element_table(
46     unsigned int core_count,
47     unsigned int cluster_count,
48     unsigned int driver_idx,
49     unsigned int api_idx,
50     const uint32_t *core_state_table,
51     size_t core_state_table_size,
52     const uint32_t *cluster_state_table,
53     size_t cluster_state_table_size,
54     struct fwk_element *static_table,
55     size_t static_table_size);
56 
57 /*!
58  * \}
59  */
60 
61 #endif /* POWER_DOMAIN_UTILS_H */
62