mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 01:24:27 +00:00
feat(xilinx): add wrapper to handle cpu power down req
Firmware sends CPU power down request to TF-A through NOTIFY_CB callback. It indicates CPU needs to power down. Add wrapper to handle CPU power down request from firmware through IPI callback. Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com> Change-Id: Ic4aff874dd29da057c5ffde1899c7f0e5cdf6733
This commit is contained in:
parent
b225926181
commit
3dd118cf9d
1 changed files with 21 additions and 0 deletions
|
@ -31,11 +31,13 @@
|
|||
#define INVALID_SGI 0xFFU
|
||||
#define PM_INIT_SUSPEND_CB (30U)
|
||||
#define PM_NOTIFY_CB (32U)
|
||||
#define EVENT_CPU_PWRDWN (4U)
|
||||
DEFINE_RENAME_SYSREG_RW_FUNCS(icc_asgi1r_el1, S3_0_C12_C11_6)
|
||||
|
||||
/* pm_up = true - UP, pm_up = false - DOWN */
|
||||
static bool pm_up;
|
||||
static uint32_t sgi = (uint32_t)INVALID_SGI;
|
||||
static bool pwrdwn_req_received;
|
||||
|
||||
static void notify_os(void)
|
||||
{
|
||||
|
@ -48,6 +50,12 @@ static void notify_os(void)
|
|||
write_icc_asgi1r_el1(reg);
|
||||
}
|
||||
|
||||
static void request_cpu_pwrdwn(void)
|
||||
{
|
||||
VERBOSE("CPU power down request received\n");
|
||||
pm_ipi_irq_clear(primary_proc);
|
||||
}
|
||||
|
||||
static uint64_t ipi_fiq_handler(uint32_t id, uint32_t flags, void *handle,
|
||||
void *cookie)
|
||||
{
|
||||
|
@ -65,8 +73,21 @@ static uint64_t ipi_fiq_handler(uint32_t id, uint32_t flags, void *handle,
|
|||
|
||||
switch (payload[0]) {
|
||||
case PM_INIT_SUSPEND_CB:
|
||||
if (sgi != INVALID_SGI) {
|
||||
notify_os();
|
||||
}
|
||||
break;
|
||||
case PM_NOTIFY_CB:
|
||||
if (sgi != INVALID_SGI) {
|
||||
if (payload[2] == EVENT_CPU_PWRDWN) {
|
||||
if (pwrdwn_req_received) {
|
||||
pwrdwn_req_received = false;
|
||||
request_cpu_pwrdwn();
|
||||
break;
|
||||
} else {
|
||||
pwrdwn_req_received = true;
|
||||
}
|
||||
}
|
||||
notify_os();
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue