mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-23 21:44:15 +00:00
feat(tc): add save/restore DSU PMU register support
This patch adds support for preserving DSU PMU registers over a power cycle in TC platform. These PMU registers need to be manually saved/restored because they are part of cluster power domain and OS doesn't know when DSU is powered OFF. Change-Id: Ife9573f205d99d092039cb95674e7434bb5f9239 Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com>
This commit is contained in:
parent
f99a69c386
commit
b87d7ab13f
2 changed files with 15 additions and 2 deletions
|
@ -68,6 +68,9 @@ $(eval $(call add_defines, \
|
||||||
|
|
||||||
CSS_LOAD_SCP_IMAGES := 1
|
CSS_LOAD_SCP_IMAGES := 1
|
||||||
|
|
||||||
|
# Save DSU PMU registers on cluster off and restore them on cluster on
|
||||||
|
PRESERVE_DSU_PMU_REGS := 1
|
||||||
|
|
||||||
# Include GICv3 driver files
|
# Include GICv3 driver files
|
||||||
include drivers/arm/gic/v3/gicv3.mk
|
include drivers/arm/gic/v3/gicv3.mk
|
||||||
|
|
||||||
|
@ -128,6 +131,7 @@ BL31_SOURCES += ${INTERCONNECT_SOURCES} \
|
||||||
${TC_BASE}/tc_topology.c \
|
${TC_BASE}/tc_topology.c \
|
||||||
lib/fconf/fconf.c \
|
lib/fconf/fconf.c \
|
||||||
lib/fconf/fconf_dyn_cfg_getter.c \
|
lib/fconf/fconf_dyn_cfg_getter.c \
|
||||||
|
drivers/arm/css/dsu/dsu.c \
|
||||||
drivers/cfi/v2m/v2m_flash.c \
|
drivers/cfi/v2m/v2m_flash.c \
|
||||||
lib/utils/mem_region.c \
|
lib/utils/mem_region.c \
|
||||||
plat/arm/common/arm_nor_psci_mem_protect.c \
|
plat/arm/common/arm_nor_psci_mem_protect.c \
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include <bl31/interrupt_mgmt.h>
|
#include <bl31/interrupt_mgmt.h>
|
||||||
#include <common/debug.h>
|
#include <common/debug.h>
|
||||||
#include <drivers/arm/css/css_scp.h>
|
#include <drivers/arm/css/css_scp.h>
|
||||||
|
#include <drivers/arm/css/dsu.h>
|
||||||
#include <lib/cassert.h>
|
#include <lib/cassert.h>
|
||||||
#include <plat/arm/common/plat_arm.h>
|
#include <plat/arm/common/plat_arm.h>
|
||||||
|
|
||||||
|
@ -82,9 +83,13 @@ static void css_pwr_domain_on_finisher_common(
|
||||||
* Perform the common cluster specific operations i.e enable coherency
|
* Perform the common cluster specific operations i.e enable coherency
|
||||||
* if this cluster was off.
|
* if this cluster was off.
|
||||||
*/
|
*/
|
||||||
if (CSS_CLUSTER_PWR_STATE(target_state) == ARM_LOCAL_STATE_OFF)
|
if (CSS_CLUSTER_PWR_STATE(target_state) == ARM_LOCAL_STATE_OFF) {
|
||||||
|
#if PRESERVE_DSU_PMU_REGS
|
||||||
|
cluster_on_dsu_pmu_context_restore();
|
||||||
|
#endif
|
||||||
plat_arm_interconnect_enter_coherency();
|
plat_arm_interconnect_enter_coherency();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Handler called when a power level has just been powered on after
|
* Handler called when a power level has just been powered on after
|
||||||
|
@ -131,9 +136,13 @@ static void css_power_down_common(const psci_power_state_t *target_state)
|
||||||
plat_arm_gic_cpuif_disable();
|
plat_arm_gic_cpuif_disable();
|
||||||
|
|
||||||
/* Cluster is to be turned off, so disable coherency */
|
/* Cluster is to be turned off, so disable coherency */
|
||||||
if (CSS_CLUSTER_PWR_STATE(target_state) == ARM_LOCAL_STATE_OFF)
|
if (CSS_CLUSTER_PWR_STATE(target_state) == ARM_LOCAL_STATE_OFF) {
|
||||||
|
#if PRESERVE_DSU_PMU_REGS
|
||||||
|
cluster_off_dsu_pmu_context_save();
|
||||||
|
#endif
|
||||||
plat_arm_interconnect_exit_coherency();
|
plat_arm_interconnect_exit_coherency();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Handler called when a power domain is about to be turned off. The
|
* Handler called when a power domain is about to be turned off. The
|
||||||
|
|
Loading…
Add table
Reference in a new issue