1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2022, Linaro Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include <fwk_element.h>
9 #include <fwk_id.h>
10 #include <fwk_macros.h>
11 #include <fwk_log.h>
12 #include <fwk_module.h>
13 #include <fwk_module_idx.h>
14 
15 #include <internal/scmi.h>
16 #include <mod_optee_smt.h>
17 #include <mod_scmi.h>
18 #include <scmi_agents.h>
19 
20 static const struct fwk_element service_table[] = {
21     [SCMI_SERVICE_IDX_NS_CHANNEL0] = {
22         .name = "service-0",
23         .data = &((struct mod_scmi_service_config) {
24             .transport_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_OPTEE_SMT, 0),
25             .transport_api_id = FWK_ID_API_INIT(FWK_MODULE_IDX_OPTEE_SMT,
26                                                 MOD_OPTEE_SMT_API_IDX_SCMI_TRANSPORT),
27             .scmi_agent_id = SCMI_AGENT_ID_NSEC0,
28             .scmi_p2a_id = FWK_ID_NONE_INIT,
29         }),
30     },
31     [SCMI_SERVICE_IDX_COUNT] = { 0 }
32 };
33 
get_scmi_service_table(fwk_id_t module_id)34 static const struct fwk_element *get_scmi_service_table(fwk_id_t module_id)
35 {
36     return service_table;
37 }
38 
39 static const struct mod_scmi_agent agent_table[] = {
40     [SCMI_AGENT_ID_NSEC0] = {
41         .type = SCMI_AGENT_TYPE_OSPM,
42         .name = "OSPM0",
43     },
44 };
45 
46 struct fwk_module_config config_scmi = {
47     .data = &((struct mod_scmi_config) {
48         .protocol_count_max = 9,
49         .agent_count = FWK_ARRAY_SIZE(agent_table) - 1,
50         .agent_table = agent_table,
51         .vendor_identifier = "Linaro",
52         .sub_vendor_identifier = "PMWG",
53     }),
54     .elements = FWK_MODULE_DYNAMIC_ELEMENTS(get_scmi_service_table),
55 };
56