From 3aeb7ca72969ae9d70505fe3b2b471bb2569d619 Mon Sep 17 00:00:00 2001 From: Manoj Kumar Date: Tue, 13 Nov 2018 13:31:52 +0530 Subject: n1sdp: add n1sdp_mhu/n1sdp_smt/agent config files for mcp ramfw Change-Id: Id1e28c23e4c547b5e726bb8758ba4fb6ee048aa7 Signed-off-by: Manoj Kumar --- product/n1sdp/mcp_ramfw/config_mhu.c | 36 +++++++++++++++++++++++++ product/n1sdp/mcp_ramfw/config_scmi_agent.c | 41 +++++++++++++++++++++++++++++ product/n1sdp/mcp_ramfw/config_smt.c | 40 ++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 product/n1sdp/mcp_ramfw/config_mhu.c create mode 100644 product/n1sdp/mcp_ramfw/config_scmi_agent.c create mode 100644 product/n1sdp/mcp_ramfw/config_smt.c diff --git a/product/n1sdp/mcp_ramfw/config_mhu.c b/product/n1sdp/mcp_ramfw/config_mhu.c new file mode 100644 index 00000000..8466a478 --- /dev/null +++ b/product/n1sdp/mcp_ramfw/config_mhu.c @@ -0,0 +1,36 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include +#include +#include +#include +#include +#include + +static const struct fwk_element mhu_element_table[] = { + [N1SDP_MHU_DEVICE_IDX_S_SCP] = { + .name = "SCP_MCP_MHU_S", + .sub_element_count = 1, + .data = &((struct mod_mhu_device_config) { + .irq = MHU_SCP_SEC_IRQ, + .in = MHU_SCP_TO_MCP_S, + .out = MHU_MCP_TO_SCP_S, + }) + }, + [N1SDP_MHU_DEVICE_IDX_COUNT] = { 0 }, +}; + +static const struct fwk_element *mhu_get_element_table(fwk_id_t module_id) +{ + return mhu_element_table; +} + +struct fwk_module_config config_n1sdp_mhu = { + .get_element_table = mhu_get_element_table, +}; diff --git a/product/n1sdp/mcp_ramfw/config_scmi_agent.c b/product/n1sdp/mcp_ramfw/config_scmi_agent.c new file mode 100644 index 00000000..28a08bb6 --- /dev/null +++ b/product/n1sdp/mcp_ramfw/config_scmi_agent.c @@ -0,0 +1,41 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct fwk_element agent_table[] = { + [MCP_N1SDP_SCMI_AGENT_IDX_MANAGEMENT] = { + .name = "MCP-AGENT", + .data = &((struct mod_scmi_agent_config) { + .transport_id = FWK_ID_ELEMENT_INIT( + FWK_MODULE_IDX_N1SDP_SMT, + MCP_N1SDP_SCMI_AGENT_IDX_MANAGEMENT), + .transport_api_id = FWK_ID_API_INIT( + FWK_MODULE_IDX_N1SDP_SMT, + MOD_SMT_API_IDX_SCMI_AGENT_TRANSPORT), + }), + }, + [MCP_N1SDP_SCMI_AGENT_IDX_COUNT] = { 0 } +}; + +static const struct fwk_element *get_agent_table(fwk_id_t module_id) +{ + return agent_table; +} + +const struct fwk_module_config config_scmi_agent = { + .get_element_table = get_agent_table, + .data = NULL, +}; diff --git a/product/n1sdp/mcp_ramfw/config_smt.c b/product/n1sdp/mcp_ramfw/config_smt.c new file mode 100644 index 00000000..d3ae55ef --- /dev/null +++ b/product/n1sdp/mcp_ramfw/config_smt.c @@ -0,0 +1,40 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2018, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct fwk_element smt_element_table[] = { + [0] = { + .name = "MANAGEMENT-S", + .data = &((struct mod_smt_channel_config) { + .type = MOD_SMT_CHANNEL_TYPE_MASTER, + .policies = MOD_SMT_POLICY_INIT_MAILBOX | MOD_SMT_POLICY_SECURE, + .mailbox_address = (uintptr_t)SCMI_PAYLOAD_SCP_TO_MCP_S, + .mailbox_size = MCP_SCMI_PAYLOAD_SIZE, + .driver_id = FWK_ID_SUB_ELEMENT_INIT(FWK_MODULE_IDX_N1SDP_MHU, + N1SDP_MHU_DEVICE_IDX_S_SCP, 0), + .driver_api_id = FWK_ID_API_INIT(FWK_MODULE_IDX_N1SDP_MHU, 0), + }) + }, + [1] = { 0 }, +}; + +static const struct fwk_element *smt_get_element_table(fwk_id_t module_id) +{ + return smt_element_table; +} + +const struct fwk_module_config config_n1sdp_smt = { + .get_element_table = smt_get_element_table, +}; -- cgit v1.2.3