mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-09-09 02:21:58 +01:00
lib: utils/hsm: wake sleeping Andes harts with an IPI
An IPI wakes a hart from light sleep and, once MSIP is kept as an SMU wakeup event, from deep sleep too. Drop the WAKEUP_CMD path and the boot state, hart type and sleep type conditions that selected it. Signed-off-by: Ben Zong-You Xie <ben717@andestech.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260728081041.2724668-6-ben717@andestech.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
committed by
Anup Patel
parent
9ceaf4738a
commit
e01bd7926b
@@ -47,11 +47,7 @@ static int ae350_system_suspend(u32 sleep_type, unsigned long addr)
|
||||
/* Prevent the core leaving the WFI mode unexpectedly */
|
||||
csr_write(CSR_MIE, 0);
|
||||
|
||||
/*
|
||||
* Only allow the S-mode external interrupts (UART2 and RTC alarm) to
|
||||
* wake up the primary hart
|
||||
*/
|
||||
csr_set(CSR_SIE, MIP_SEIP);
|
||||
/* SMU wakes the primary hart on RTC alarm / UART2 */
|
||||
atcsmu_set_wakeup_events(PCS_WAKEUP_RTC_ALARM_MASK | PCS_WAKEUP_UART2_MASK, hartid);
|
||||
|
||||
if (sleep_type == SBI_SUSP_AE350_LIGHT_SLEEP) {
|
||||
@@ -59,6 +55,8 @@ static int ae350_system_suspend(u32 sleep_type, unsigned long addr)
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
/* Clock-gated only: enable SEI to resume past the WFI */
|
||||
csr_set(CSR_MIE, MIP_SEIP);
|
||||
atcsmu_set_command(LIGHT_SLEEP_CMD, hartid);
|
||||
} else if (sleep_type == SBI_SUSP_SLEEP_TYPE_SUSPEND) {
|
||||
rc = check_secondary_harts_sleep(hartid, true);
|
||||
|
||||
Reference in New Issue
Block a user