diff options
author | Anurag Koul <anurag.koul@arm.com> | 2020-06-08 03:46:44 +0100 |
---|---|---|
committer | jimqui01 <54316584+jimqui01@users.noreply.github.com> | 2020-09-15 17:03:53 +0100 |
commit | daacd8a235046e0d3c16c792a61c5c0829872350 (patch) | |
tree | e878820b2b6499ce425e096160e4b6241d9d9a11 /product/morello | |
parent | 8919a38080db5b1a305145105d841a2f1b337d37 (diff) |
morello/scp_ramfw_fvp: add scmi related config data
Add config data for SCMI Base, System Power; and
SMT modules.
Change-Id: I7e9f38f2f1ad897d8d1cdc063585cd77cbd870b1
Signed-off-by: Anurag Koul <anurag.koul@arm.com>
Diffstat (limited to 'product/morello')
-rw-r--r-- | product/morello/scp_ramfw_fvp/config_scmi.c | 109 | ||||
-rw-r--r-- | product/morello/scp_ramfw_fvp/config_scmi_power_domain.c | 11 | ||||
-rw-r--r-- | product/morello/scp_ramfw_fvp/config_scmi_system_power.c | 19 | ||||
-rw-r--r-- | product/morello/scp_ramfw_fvp/config_smt.c | 94 |
4 files changed, 233 insertions, 0 deletions
diff --git a/product/morello/scp_ramfw_fvp/config_scmi.c b/product/morello/scp_ramfw_fvp/config_scmi.c new file mode 100644 index 00000000..7f609dc8 --- /dev/null +++ b/product/morello/scp_ramfw_fvp/config_scmi.c @@ -0,0 +1,109 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "morello_scp_scmi.h" + +#include <internal/scmi.h> + +#include <mod_scmi.h> +#include <mod_smt.h> + +#include <fwk_element.h> +#include <fwk_id.h> +#include <fwk_macros.h> +#include <fwk_module.h> +#include <fwk_module_idx.h> + +static const struct fwk_element service_table[] = { + [SCP_MORELLO_SCMI_SERVICE_IDX_PSCI] = + { + .name = "SERVICE0", + .data = + &(struct mod_scmi_service_config){ + .transport_id = FWK_ID_ELEMENT_INIT( + FWK_MODULE_IDX_SMT, + SCP_MORELLO_SCMI_SERVICE_IDX_PSCI), + .transport_api_id = FWK_ID_API_INIT( + FWK_MODULE_IDX_SMT, + MOD_SMT_API_IDX_SCMI_TRANSPORT), + .transport_notification_init_id = FWK_ID_NOTIFICATION_INIT( + FWK_MODULE_IDX_SMT, + MOD_SMT_NOTIFICATION_IDX_INITIALIZED), + .scmi_agent_id = SCP_SCMI_AGENT_ID_PSCI, + .scmi_p2a_id = FWK_ID_NONE_INIT, + }, + }, + [SCP_MORELLO_SCMI_SERVICE_IDX_OSPM] = + { + .name = "SERVICE1", + .data = + &(struct mod_scmi_service_config){ + .transport_id = FWK_ID_ELEMENT_INIT( + FWK_MODULE_IDX_SMT, + SCP_MORELLO_SCMI_SERVICE_IDX_OSPM), + .transport_api_id = FWK_ID_API_INIT( + FWK_MODULE_IDX_SMT, + MOD_SMT_API_IDX_SCMI_TRANSPORT), + .transport_notification_init_id = FWK_ID_NOTIFICATION_INIT( + FWK_MODULE_IDX_SMT, + MOD_SMT_NOTIFICATION_IDX_INITIALIZED), + .scmi_agent_id = SCP_SCMI_AGENT_ID_OSPM, + .scmi_p2a_id = FWK_ID_NONE_INIT, + }, + }, + [SCP_MORELLO_SCMI_SERVICE_IDX_MCP] = + { + .name = "SERVICE2", + .data = + &(struct mod_scmi_service_config){ + .transport_id = FWK_ID_ELEMENT_INIT( + FWK_MODULE_IDX_SMT, + SCP_MORELLO_SCMI_SERVICE_IDX_MCP), + .transport_api_id = FWK_ID_API_INIT( + FWK_MODULE_IDX_SMT, + MOD_SMT_API_IDX_SCMI_TRANSPORT), + .transport_notification_init_id = FWK_ID_NONE_INIT, + .scmi_agent_id = SCP_SCMI_AGENT_ID_MCP, + .scmi_p2a_id = FWK_ID_NONE_INIT, + }, + }, + [SCP_MORELLO_SCMI_SERVICE_IDX_COUNT] = { 0 } +}; + +static const struct fwk_element *get_service_table(fwk_id_t module_id) +{ + return service_table; +} + +static struct mod_scmi_agent agent_table[] = { + [SCP_SCMI_AGENT_ID_OSPM] = + { + .type = SCMI_AGENT_TYPE_OSPM, + .name = "OSPM", + }, + [SCP_SCMI_AGENT_ID_PSCI] = + { + .type = SCMI_AGENT_TYPE_PSCI, + .name = "PSCI", + }, + [SCP_SCMI_AGENT_ID_MCP] = + { + .type = SCMI_AGENT_TYPE_MANAGEMENT, + .name = "MANAGEMENT", + }, +}; + +const struct fwk_module_config config_scmi = { + .elements = FWK_MODULE_DYNAMIC_ELEMENTS(get_service_table), + .data = &((struct mod_scmi_config){ + .protocol_count_max = 8, + .agent_count = FWK_ARRAY_SIZE(agent_table) - 1, + .agent_table = agent_table, + .vendor_identifier = "arm", + .sub_vendor_identifier = "arm", + }), +}; diff --git a/product/morello/scp_ramfw_fvp/config_scmi_power_domain.c b/product/morello/scp_ramfw_fvp/config_scmi_power_domain.c new file mode 100644 index 00000000..2d344b26 --- /dev/null +++ b/product/morello/scp_ramfw_fvp/config_scmi_power_domain.c @@ -0,0 +1,11 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <fwk_module.h> + +/* No elements, no module configuration data */ +struct fwk_module_config config_scmi_power_domain = { 0 }; diff --git a/product/morello/scp_ramfw_fvp/config_scmi_system_power.c b/product/morello/scp_ramfw_fvp/config_scmi_system_power.c new file mode 100644 index 00000000..31bb20d1 --- /dev/null +++ b/product/morello/scp_ramfw_fvp/config_scmi_system_power.c @@ -0,0 +1,19 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <mod_scmi_system_power.h> +#include <mod_system_power.h> + +#include <fwk_module.h> + +const struct fwk_module_config config_scmi_system_power = { + .data = + &(struct mod_scmi_system_power_config){ + .system_view = MOD_SCMI_SYSTEM_VIEW_FULL, + .system_suspend_state = MOD_SYSTEM_POWER_POWER_STATE_SLEEP0, + }, +}; diff --git a/product/morello/scp_ramfw_fvp/config_smt.c b/product/morello/scp_ramfw_fvp/config_smt.c new file mode 100644 index 00000000..75b66c83 --- /dev/null +++ b/product/morello/scp_ramfw_fvp/config_smt.c @@ -0,0 +1,94 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "config_power_domain.h" +#include "morello_core.h" +#include "morello_scp_mhu.h" +#include "morello_scp_mmap.h" +#include "morello_scp_scmi.h" +#include "morello_scp_software_mmap.h" + +#include <mod_smt.h> + +#include <fwk_element.h> +#include <fwk_id.h> +#include <fwk_module.h> +#include <fwk_module_idx.h> + +#include <stdint.h> + +static const struct fwk_element smt_element_table[] = { + [SCP_MORELLO_SCMI_SERVICE_IDX_PSCI] = + { + .name = "PSCI", + .data = + &(struct mod_smt_channel_config){ + .type = MOD_SMT_CHANNEL_TYPE_SLAVE, + .policies = + MOD_SMT_POLICY_INIT_MAILBOX | MOD_SMT_POLICY_SECURE, + .mailbox_address = SCP_AP_SHARED_SECURE_RAM, + .mailbox_size = SCP_SCMI_PAYLOAD_SIZE, + .driver_id = FWK_ID_SUB_ELEMENT_INIT( + FWK_MODULE_IDX_MHU, + MORELLO_MHU_DEVICE_IDX_S_CLUS0, + 0), + .driver_api_id = FWK_ID_API_INIT(FWK_MODULE_IDX_MHU, 0), + }, + }, + [SCP_MORELLO_SCMI_SERVICE_IDX_OSPM] = + { + .name = "OSPM", + .data = + &(struct mod_smt_channel_config){ + .type = MOD_SMT_CHANNEL_TYPE_SLAVE, + .policies = MOD_SMT_POLICY_INIT_MAILBOX, + .mailbox_address = SCP_AP_SHARED_NONSECURE_RAM, + .mailbox_size = SCP_SCMI_PAYLOAD_SIZE, + .driver_id = FWK_ID_SUB_ELEMENT_INIT( + FWK_MODULE_IDX_MHU, + MORELLO_MHU_DEVICE_IDX_NS_CLUS0, + 0), + .driver_api_id = FWK_ID_API_INIT(FWK_MODULE_IDX_MHU, 0), + }, + }, + [SCP_MORELLO_SCMI_SERVICE_IDX_MCP] = + { + .name = "MCP", + .data = + &(struct mod_smt_channel_config){ + .type = MOD_SMT_CHANNEL_TYPE_SLAVE, + .policies = + MOD_SMT_POLICY_INIT_MAILBOX | MOD_SMT_POLICY_SECURE, + .mailbox_address = SCP_MCP_SHARED_SECURE_RAM, + .mailbox_size = SCP_SCMI_PAYLOAD_SIZE, + .driver_id = FWK_ID_SUB_ELEMENT_INIT( + FWK_MODULE_IDX_MHU, + MORELLO_MHU_DEVICE_IDX_S_MCP, + 0), + .driver_api_id = FWK_ID_API_INIT(FWK_MODULE_IDX_MHU, 0), + }, + }, + [SCP_MORELLO_SCMI_SERVICE_IDX_COUNT] = { 0 }, +}; + +static const struct fwk_element *smt_get_element_table(fwk_id_t module_id) +{ + unsigned int idx; + struct mod_smt_channel_config *config; + + for (idx = 0; idx < SCP_MORELLO_SCMI_SERVICE_IDX_COUNT; idx++) { + config = (struct mod_smt_channel_config *)(smt_element_table[idx].data); + config->pd_source_id = FWK_ID_ELEMENT( + FWK_MODULE_IDX_POWER_DOMAIN, PD_SINGLE_CHIP_IDX_SYSTOP0); + } + + return smt_element_table; +} + +const struct fwk_module_config config_smt = { + .elements = FWK_MODULE_DYNAMIC_ELEMENTS(smt_get_element_table), +}; |