Skip to content
GitLab
Menu
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
7ce05106
Commit
7ce05106
authored
Oct 28, 2014
by
danh-arm
Browse files
Merge pull request #216 from vikramkanigiri/vk/juno_standby_support
Juno: Support entry into a standby state
parents
d1d92a23
fc680456
Changes
1
Show whitespace changes
Inline
Side-by-side
plat/juno/plat_pm.c
View file @
7ce05106
...
...
@@ -274,6 +274,40 @@ static void __dead2 juno_system_reset(void)
panic
();
}
/*******************************************************************************
* Handler called when an affinity instance is about to enter standby.
******************************************************************************/
int32_t
juno_affinst_standby
(
unsigned
int
power_state
)
{
unsigned
int
target_afflvl
;
unsigned
int
scr
;
/* Sanity check the requested state */
target_afflvl
=
psci_get_pstate_afflvl
(
power_state
);
/*
* It's possible to enter standby only on affinity level 0 i.e. a cpu
* on the Juno. Ignore any other affinity level.
*/
if
(
target_afflvl
!=
MPIDR_AFFLVL0
)
return
PSCI_E_INVALID_PARAMS
;
scr
=
read_scr_el3
();
/* Enable PhysicalIRQ bit for NS world to wake the CPU */
write_scr_el3
(
scr
|
SCR_IRQ_BIT
);
isb
();
dsb
();
wfi
();
/*
* Restore SCR to the original value, synchronisation of scr_el3 is
* done by eret while el3_exit to save some execution cycles.
*/
write_scr_el3
(
scr
);
return
PSCI_E_SUCCESS
;
}
/*******************************************************************************
* Export the platform handlers to enable psci to invoke them
******************************************************************************/
...
...
@@ -281,6 +315,7 @@ static const plat_pm_ops_t juno_ops = {
.
affinst_on
=
juno_affinst_on
,
.
affinst_on_finish
=
juno_affinst_on_finish
,
.
affinst_off
=
juno_affinst_off
,
.
affinst_standby
=
juno_affinst_standby
,
.
affinst_suspend
=
juno_affinst_suspend
,
.
affinst_suspend_finish
=
juno_affinst_suspend_finish
,
.
system_off
=
juno_system_off
,
...
...
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