Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
a0d586ea
Commit
a0d586ea
authored
11 years ago
by
Jon Medhurst
Committed by
Sandrine Bailleux
11 years ago
Browse files
Options
Download
Email Patches
Plain Diff
juno: Implement PM ops to power down CPUs
Signed-off-by:
Jon Medhurst
<
tixy@linaro.org
>
parent
7441ac3a
v0.3-Juno
v0.3-Juno-0.3
v0.3-Juno-0.2
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plat/juno/plat_pm.c
+51
-1
plat/juno/plat_pm.c
with
51 additions
and
1 deletion
+51
-1
plat/juno/plat_pm.c
View file @
a0d586ea
...
...
@@ -93,12 +93,62 @@ int pm_on_finish(unsigned long mpidr, unsigned int afflvl, unsigned int state)
return
PSCI_E_SUCCESS
;
}
/*******************************************************************************
* Handler called when an affinity instance is about to be turned off. The
* level and mpidr determine the affinity instance. The 'state' arg. allows the
* platform to decide whether the cluster is being turned off and take apt
* actions.
*
* CAUTION: This function is called with coherent stacks so that caches can be
* turned off, flushed and coherency disabled. There is no guarantee that caches
* will remain turned on across calls to this function as each affinity level is
* dealt with. So do not write & read global variables across calls. It will be
* wise to do flush a write to the global to prevent unpredictable results.
******************************************************************************/
int
pm_off
(
unsigned
long
mpidr
,
unsigned
int
afflvl
,
unsigned
int
state
)
{
/* We're only interested in power off states */
if
(
state
!=
PSCI_STATE_OFF
)
return
PSCI_E_SUCCESS
;
switch
(
afflvl
)
{
case
MPIDR_AFFLVL1
:
/* Cluster is to be turned off, so disable coherency */
cci_disable_coherency
(
mpidr
);
break
;
case
MPIDR_AFFLVL0
:
/* Turn off intra-cluster coherency */
write_cpuectlr
(
read_cpuectlr
()
&
~
CPUECTLR_SMP_BIT
);
/* Prevent interrupts from spuriously waking up this cpu */
gic_cpuif_deactivate
(
GICC_BASE
);
/*
* Ask SCP to power down CPU.
*
* Note, we also ask for cluster power down as well because we
* know the SCP will only actually do that if this is the last
* CPU going down, and also, that final power down won't happen
* until this CPU executes the WFI instruction after the PSCI
* framework has done it's thing.
*/
scpi_set_css_power_state
(
mpidr
,
scpi_power_off
,
scpi_power_off
,
scpi_power_retention
);
break
;
}
return
PSCI_E_SUCCESS
;
}
/*******************************************************************************
* Export the platform handlers to enable psci to invoke them
******************************************************************************/
static
plat_pm_ops
pm_ops
=
{
.
affinst_on
=
pm_on
,
.
affinst_on_finish
=
pm_on_finish
.
affinst_on_finish
=
pm_on_finish
,
.
affinst_off
=
pm_off
};
/*******************************************************************************
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help