Skip to content

Commit

Permalink
product/tc0: Move from module smt to transport
Browse files Browse the repository at this point in the history
This change makes use of a more generic transport module instead of
smt for the tc0 platform. The new transport module has additional
features such as in-band message transport and fast channel
interface that are missing in the traditional smt.

Since the transport module provides all the features of the smt
module, the smt module will be removed entirely from the codebase
after all other dependent platforms moves to use the transport module.

Change-Id: I4559ac2b8fbdcc05dd6e344c10e45d20408ba6f1
Signed-off-by: Girish Pathak <[email protected]>
  • Loading branch information
girishpathak authored and tarek-arm committed Nov 8, 2022
1 parent 0b1d722 commit 74d526a
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 44 deletions.
4 changes: 2 additions & 2 deletions product/tc0/include/tc0_scmi.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Arm SCP/MCP Software
* Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
* Description:
* Definitions for SCMI and SMT module configurations.
* Definitions for SCMI and TRANSPORT module configurations.
*/

#ifndef SCP_TC0_SCMI_H
Expand Down
2 changes: 1 addition & 1 deletion product/tc0/scp_ramfw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ target_sources(
"${CMAKE_CURRENT_SOURCE_DIR}/config_power_domain.c"
"${CMAKE_CURRENT_SOURCE_DIR}/config_ppu_v1.c"
"${CMAKE_CURRENT_SOURCE_DIR}/config_mhu2.c"
"${CMAKE_CURRENT_SOURCE_DIR}/config_smt.c"
"${CMAKE_CURRENT_SOURCE_DIR}/config_transport.c"
"${CMAKE_CURRENT_SOURCE_DIR}/config_scmi.c"
"${CMAKE_CURRENT_SOURCE_DIR}/config_sds.c"
"${CMAKE_CURRENT_SOURCE_DIR}/config_scmi_system_power.c"
Expand Down
2 changes: 1 addition & 1 deletion product/tc0/scp_ramfw/Firmware.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ list(APPEND SCP_MODULES "timer")
list(APPEND SCP_MODULES "ppu-v1")
list(APPEND SCP_MODULES "system-power")
list(APPEND SCP_MODULES "mhu2")
list(APPEND SCP_MODULES "smt")
list(APPEND SCP_MODULES "transport")
list(APPEND SCP_MODULES "scmi")
list(APPEND SCP_MODULES "sds")
list(APPEND SCP_MODULES "system-pll")
Expand Down
34 changes: 17 additions & 17 deletions product/tc0/scp_ramfw/config_scmi.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*
* Arm SCP/MCP Software
* Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/

#include "tc0_scmi.h"

#include <mod_scmi.h>
#include <mod_smt.h>
#include <mod_transport.h>

#include <fwk_element.h>
#include <fwk_id.h>
Expand All @@ -21,14 +21,14 @@ static const struct fwk_element service_table[] = {
.name = "PSCI",
.data = &((struct mod_scmi_service_config) {
.transport_id = FWK_ID_ELEMENT_INIT(
FWK_MODULE_IDX_SMT,
FWK_MODULE_IDX_TRANSPORT,
SCP_TC0_SCMI_SERVICE_IDX_PSCI),
.transport_api_id = FWK_ID_API_INIT(
FWK_MODULE_IDX_SMT,
MOD_SMT_API_IDX_SCMI_TRANSPORT),
FWK_MODULE_IDX_TRANSPORT,
MOD_TRANSPORT_API_IDX_SCMI_TO_TRANSPORT),
.transport_notification_init_id = FWK_ID_NOTIFICATION_INIT(
FWK_MODULE_IDX_SMT,
MOD_SMT_NOTIFICATION_IDX_INITIALIZED),
FWK_MODULE_IDX_TRANSPORT,
MOD_TRANSPORT_NOTIFICATION_IDX_INITIALIZED),
.scmi_agent_id = SCP_SCMI_AGENT_ID_PSCI,
.scmi_p2a_id = FWK_ID_NONE_INIT,
}),
Expand All @@ -37,29 +37,29 @@ static const struct fwk_element service_table[] = {
.name = "OSPM0",
.data = &((struct mod_scmi_service_config) {
.transport_id = FWK_ID_ELEMENT_INIT(
FWK_MODULE_IDX_SMT,
FWK_MODULE_IDX_TRANSPORT,
SCP_TC0_SCMI_SERVICE_IDX_OSPM_0),
.transport_api_id = FWK_ID_API_INIT(
FWK_MODULE_IDX_SMT,
MOD_SMT_API_IDX_SCMI_TRANSPORT),
FWK_MODULE_IDX_TRANSPORT,
MOD_TRANSPORT_API_IDX_SCMI_TO_TRANSPORT),
.transport_notification_init_id = FWK_ID_NOTIFICATION_INIT(
FWK_MODULE_IDX_SMT,
MOD_SMT_NOTIFICATION_IDX_INITIALIZED),
FWK_MODULE_IDX_TRANSPORT,
MOD_TRANSPORT_NOTIFICATION_IDX_INITIALIZED),
.scmi_agent_id = SCP_SCMI_AGENT_ID_OSPM,
}),
},
[SCP_TC0_SCMI_SERVICE_IDX_OSPM_1] = {
.name = "OSPM1",
.data = &((struct mod_scmi_service_config) {
.transport_id = FWK_ID_ELEMENT_INIT(
FWK_MODULE_IDX_SMT,
FWK_MODULE_IDX_TRANSPORT,
SCP_TC0_SCMI_SERVICE_IDX_OSPM_1),
.transport_api_id = FWK_ID_API_INIT(
FWK_MODULE_IDX_SMT,
MOD_SMT_API_IDX_SCMI_TRANSPORT),
FWK_MODULE_IDX_TRANSPORT,
MOD_TRANSPORT_API_IDX_SCMI_TO_TRANSPORT),
.transport_notification_init_id = FWK_ID_NOTIFICATION_INIT(
FWK_MODULE_IDX_SMT,
MOD_SMT_NOTIFICATION_IDX_INITIALIZED),
FWK_MODULE_IDX_TRANSPORT,
MOD_TRANSPORT_NOTIFICATION_IDX_INITIALIZED),
.scmi_agent_id = SCP_SCMI_AGENT_ID_OSPM,
.scmi_p2a_id = FWK_ID_NONE_INIT,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "tc0_core.h"
#include "tc0_scmi.h"

#include <mod_smt.h>
#include <mod_transport.h>

#include <fwk_element.h>
#include <fwk_id.h>
Expand All @@ -20,14 +20,15 @@

#include <stdint.h>

static const struct fwk_element smt_element_table[] = {
static const struct fwk_element transport_element_table[] = {
/* SCP_TC0_SCMI_SERVICE_IDX_PSCI */
{ .name = "PSCI",
.data = &((struct mod_smt_channel_config){
.type = MOD_SMT_CHANNEL_TYPE_COMPLETER,
.policies = MOD_SMT_POLICY_INIT_MAILBOX | MOD_SMT_POLICY_SECURE,
.mailbox_address = (uintptr_t)SCP_SCMI_PAYLOAD_S_A2P_BASE,
.mailbox_size = SCP_SCMI_PAYLOAD_SIZE,
.data = &((struct mod_transport_channel_config){
.channel_type = MOD_TRANSPORT_CHANNEL_TYPE_COMPLETER,
.policies =
MOD_TRANSPORT_POLICY_INIT_MAILBOX | MOD_TRANSPORT_POLICY_SECURE,
.out_band_mailbox_address = (uintptr_t)SCP_SCMI_PAYLOAD_S_A2P_BASE,
.out_band_mailbox_size = SCP_SCMI_PAYLOAD_SIZE,
.driver_id = FWK_ID_SUB_ELEMENT_INIT(
FWK_MODULE_IDX_MHU2,
SCP_TC0_MHU_DEVICE_IDX_SCP_AP_S_CLUS0,
Expand All @@ -36,11 +37,11 @@ static const struct fwk_element smt_element_table[] = {
}) },
/* SCP_TC0_SCMI_SERVICE_IDX_OSPM_0 */
{ .name = "OSPM0",
.data = &((struct mod_smt_channel_config){
.type = MOD_SMT_CHANNEL_TYPE_COMPLETER,
.policies = MOD_SMT_POLICY_INIT_MAILBOX,
.mailbox_address = (uintptr_t)SCP_SCMI_PAYLOAD0_NS_A2P_BASE,
.mailbox_size = SCP_SCMI_PAYLOAD_SIZE,
.data = &((struct mod_transport_channel_config){
.channel_type = MOD_TRANSPORT_CHANNEL_TYPE_COMPLETER,
.policies = MOD_TRANSPORT_POLICY_INIT_MAILBOX,
.out_band_mailbox_address = (uintptr_t)SCP_SCMI_PAYLOAD0_NS_A2P_BASE,
.out_band_mailbox_size = SCP_SCMI_PAYLOAD_SIZE,
.driver_id = FWK_ID_SUB_ELEMENT_INIT(
FWK_MODULE_IDX_MHU2,
SCP_TC0_MHU_DEVICE_IDX_SCP_AP_NS_HP_CLUS0,
Expand All @@ -49,11 +50,11 @@ static const struct fwk_element smt_element_table[] = {
}) },
/* SCP_TC0_SCMI_SERVICE_IDX_OSPM_1 */
{ .name = "OSPM1",
.data = &((struct mod_smt_channel_config){
.type = MOD_SMT_CHANNEL_TYPE_COMPLETER,
.policies = MOD_SMT_POLICY_INIT_MAILBOX,
.mailbox_address = (uintptr_t)SCP_SCMI_PAYLOAD1_NS_A2P_BASE,
.mailbox_size = SCP_SCMI_PAYLOAD_SIZE,
.data = &((struct mod_transport_channel_config){
.channel_type = MOD_TRANSPORT_CHANNEL_TYPE_COMPLETER,
.policies = MOD_TRANSPORT_POLICY_INIT_MAILBOX,
.out_band_mailbox_address = (uintptr_t)SCP_SCMI_PAYLOAD1_NS_A2P_BASE,
.out_band_mailbox_size = SCP_SCMI_PAYLOAD_SIZE,
.driver_id = FWK_ID_SUB_ELEMENT_INIT(
FWK_MODULE_IDX_MHU2,
SCP_TC0_MHU_DEVICE_IDX_SCP_AP_NS_LP_CLUS0,
Expand All @@ -63,22 +64,24 @@ static const struct fwk_element smt_element_table[] = {
[SCP_TC0_SCMI_SERVICE_IDX_COUNT] = { 0 },
};

static const struct fwk_element *smt_get_element_table(fwk_id_t module_id)
static const struct fwk_element *transport_get_element_table(fwk_id_t module_id)
{
unsigned int idx;
struct mod_smt_channel_config *config;
struct mod_transport_channel_config *config;

for (idx = 0; idx < SCP_TC0_SCMI_SERVICE_IDX_COUNT; idx++) {
config = (struct mod_smt_channel_config *)(smt_element_table[idx].data);
config =
(struct mod_transport_channel_config *)(transport_element_table[idx]
.data);
config->pd_source_id = FWK_ID_ELEMENT(
FWK_MODULE_IDX_POWER_DOMAIN,
tc0_core_get_core_count() + tc0_core_get_cluster_count() +
PD_STATIC_DEV_IDX_SYSTOP);
}

return smt_element_table;
return transport_element_table;
}

const struct fwk_module_config config_smt = {
.elements = FWK_MODULE_DYNAMIC_ELEMENTS(smt_get_element_table),
const struct fwk_module_config config_transport = {
.elements = FWK_MODULE_DYNAMIC_ELEMENTS(transport_get_element_table),
};

0 comments on commit 74d526a

Please sign in to comment.