Skip to content

Commit

Permalink
product/tc1: Improve transport module init sequence
Browse files Browse the repository at this point in the history
At present, the transport module delays the initialization of
the shared memory channel due to dependency on the power domain
responsible for the shared memory. The transport module registers
a notification for the status of this power domain and waits
for powered on notification, it will then initialize the channel
once it receives power on notification from the power domain module.
However, for some platforms power domain can be initialized early
using default_power_on = true setting in respective
platform-specific config_ppu*.c as many platforms have its shared
memory in the SYSTOP power domain which is usually enabled by default.
The reason we need above early initialization because few other
modules would not be proceeding without the transport module channel
initialization which would further interact with the transport module
using notifications, thus deferring its initialization.
If we can initialize the transport module early we can also
initialize other modules early too.

This change includes modifications to
    1. ppu configuration that sets default_power_on = true
    for SYSTOP
    2. Change the order of module initialisation in cmake file

Change-Id: I5322064eb00ebcfe682c2c9c6bdf5a6a765cca90
Signed-off-by: Girish Pathak <[email protected]>
  • Loading branch information
girishpathak authored and tarek-arm committed Aug 7, 2023
1 parent f7c3da8 commit 7f55ccd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 28 deletions.
4 changes: 2 additions & 2 deletions product/tc1/scp_ramfw/Firmware.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Arm SCP/MCP Software
# Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
# Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down Expand Up @@ -35,6 +35,7 @@ list(APPEND SCP_MODULES "armv7m-mpu")
list(APPEND SCP_MODULES "pl011")
list(APPEND SCP_MODULES "ppu-v1")
list(APPEND SCP_MODULES "system-power")
list(APPEND SCP_MODULES "power-domain")
list(APPEND SCP_MODULES "mhu2")
list(APPEND SCP_MODULES "transport")
list(APPEND SCP_MODULES "scmi")
Expand All @@ -43,7 +44,6 @@ list(APPEND SCP_MODULES "system-pll")
list(APPEND SCP_MODULES "pik-clock")
list(APPEND SCP_MODULES "css-clock")
list(APPEND SCP_MODULES "clock")
list(APPEND SCP_MODULES "power-domain")
list(APPEND SCP_MODULES "scmi-power-domain")
list(APPEND SCP_MODULES "scmi-system-power")
list(APPEND SCP_MODULES "dvfs")
Expand Down
3 changes: 2 additions & 1 deletion product/tc1/scp_ramfw/config_ppu_v1.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Arm SCP/MCP Software
* Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down Expand Up @@ -47,6 +47,7 @@ static const struct fwk_element ppu_v1_system_element_table[1] = {
.pd_type = MOD_PD_TYPE_SYSTEM,
.ppu.reg_base = SCP_PPU_SYS0_BASE,
.observer_id = FWK_ID_NONE_INIT,
.default_power_on = true,
}),
},
};
Expand Down
14 changes: 4 additions & 10 deletions product/tc1/scp_ramfw/config_scmi.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Arm SCP/MCP Software
* Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand All @@ -27,9 +27,7 @@ static const struct fwk_element service_table[
.transport_api_id = FWK_ID_API_INIT(
FWK_MODULE_IDX_TRANSPORT,
MOD_TRANSPORT_API_IDX_SCMI_TO_TRANSPORT),
.transport_notification_init_id = FWK_ID_NOTIFICATION_INIT(
FWK_MODULE_IDX_TRANSPORT,
MOD_TRANSPORT_NOTIFICATION_IDX_INITIALIZED),
.transport_notification_init_id = FWK_ID_NONE_INIT,
.scmi_agent_id = SCP_SCMI_AGENT_ID_PSCI,
.scmi_p2a_id = FWK_ID_NONE_INIT,
}),
Expand All @@ -43,9 +41,7 @@ static const struct fwk_element service_table[
.transport_api_id = FWK_ID_API_INIT(
FWK_MODULE_IDX_TRANSPORT,
MOD_TRANSPORT_API_IDX_SCMI_TO_TRANSPORT),
.transport_notification_init_id = FWK_ID_NOTIFICATION_INIT(
FWK_MODULE_IDX_TRANSPORT,
MOD_TRANSPORT_NOTIFICATION_IDX_INITIALIZED),
.transport_notification_init_id = FWK_ID_NONE_INIT,
.scmi_agent_id = SCP_SCMI_AGENT_ID_OSPM,
.scmi_p2a_id = FWK_ID_NONE_INIT,
}),
Expand All @@ -59,9 +55,7 @@ static const struct fwk_element service_table[
.transport_api_id = FWK_ID_API_INIT(
FWK_MODULE_IDX_TRANSPORT,
MOD_TRANSPORT_API_IDX_SCMI_TO_TRANSPORT),
.transport_notification_init_id = FWK_ID_NOTIFICATION_INIT(
FWK_MODULE_IDX_TRANSPORT,
MOD_TRANSPORT_NOTIFICATION_IDX_INITIALIZED),
.transport_notification_init_id = FWK_ID_NONE_INIT,
.scmi_agent_id = SCP_SCMI_AGENT_ID_OSPM,
.scmi_p2a_id = FWK_ID_NONE_INIT,
}),
Expand Down
16 changes: 1 addition & 15 deletions product/tc1/scp_ramfw/config_transport.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*
* Arm SCP/MCP Software
* Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
* Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/

#include "config_power_domain.h"
#include "scp_mmap.h"
#include "scp_tc1_mhu.h"
#include "tc1_core.h"
Expand Down Expand Up @@ -90,19 +89,6 @@ static const struct fwk_element transport_element_table[

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

for (idx = 0; idx < SCP_TC1_SCMI_SERVICE_IDX_COUNT; idx++) {
config =
(struct mod_transport_channel_config *)(transport_element_table[idx]
.data);
config->pd_source_id = FWK_ID_ELEMENT(
FWK_MODULE_IDX_POWER_DOMAIN,
tc1_core_get_core_count() + tc1_core_get_cluster_count() +
PD_STATIC_DEV_IDX_SYSTOP);
}

return transport_element_table;
}

Expand Down

0 comments on commit 7f55ccd

Please sign in to comment.