1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include "clock_soc.h"
9 #include "tc1_scmi.h"
10 
11 #include <mod_scmi_clock.h>
12 
13 #include <fwk_id.h>
14 #include <fwk_macros.h>
15 #include <fwk_module.h>
16 #include <fwk_module_idx.h>
17 
18 static const struct mod_scmi_clock_device agent_device_table_ospm[3] = {
19     {
20         /* DPU */
21         .element_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK, CLOCK_IDX_DPU),
22     },
23     {
24         /* PIXEL_0 */
25         .element_id =
26             FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK, CLOCK_IDX_PIXEL_0),
27     },
28     {
29         /* PIXEL_1 */
30         .element_id =
31             FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK, CLOCK_IDX_PIXEL_1),
32     },
33 };
34 
35 static const struct mod_scmi_clock_agent agent_table[SCP_SCMI_AGENT_ID_COUNT] =
36     {
37         [SCP_SCMI_AGENT_ID_PSCI] = { 0 /* No access */ },
38         [SCP_SCMI_AGENT_ID_OSPM] =
39             {
40                 .device_table = agent_device_table_ospm,
41                 .device_count = FWK_ARRAY_SIZE(agent_device_table_ospm),
42             },
43     };
44 
45 const struct fwk_module_config config_scmi_clock = {
46     .data = &((struct mod_scmi_clock_config){
47         .max_pending_transactions = 0,
48         .agent_table = agent_table,
49         .agent_count = FWK_ARRAY_SIZE(agent_table),
50     }),
51 };
52