From e663f09b3cc2a3c933191c110557c6ffe5db6d6c Mon Sep 17 00:00:00 2001 From: Jay Buddhabhatti Date: Thu, 29 Dec 2022 22:21:00 -0800 Subject: [PATCH] fix(versal-net): disable wakeup interrupt during client wakeup Clear and disable wakeup interrupt during client wakeup to avoid multiple wakeup events. Signed-off-by: Jay Buddhabhatti Change-Id: Iebc644ae582da03001830b96e3190fce10dbac42 --- plat/xilinx/versal_net/include/versal_net_def.h | 12 ++++++++++++ plat/xilinx/versal_net/pm_service/pm_client.c | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/plat/xilinx/versal_net/include/versal_net_def.h b/plat/xilinx/versal_net/include/versal_net_def.h index bcf831554..929186aae 100644 --- a/plat/xilinx/versal_net/include/versal_net_def.h +++ b/plat/xilinx/versal_net/include/versal_net_def.h @@ -67,6 +67,18 @@ /* Firmware Image Package */ #define VERSAL_NET_PRIMARY_CPU U(0) +#define CORE_0_ISR_WAKE_OFFSET (0x00000020ULL) +#define APU_PCIL_CORE_X_ISR_WAKE_REG(cpu_id) (APU_PCLI + (CORE_0_ISR_WAKE_OFFSET + \ + (APU_PCLI_CPU_STEP * (cpu_id)))) +#define APU_PCIL_CORE_X_ISR_WAKE_MASK (0x00000001U) +#define CORE_0_IEN_WAKE_OFFSET (0x00000028ULL) +#define APU_PCIL_CORE_X_IEN_WAKE_REG(cpu_id) (APU_PCLI + (CORE_0_IEN_WAKE_OFFSET + \ + (APU_PCLI_CPU_STEP * (cpu_id)))) +#define APU_PCIL_CORE_X_IEN_WAKE_MASK (0x00000001U) +#define CORE_0_IDS_WAKE_OFFSET (0x0000002CULL) +#define APU_PCIL_CORE_X_IDS_WAKE_REG(cpu_id) (APU_PCLI + (CORE_0_IDS_WAKE_OFFSET + \ + (APU_PCLI_CPU_STEP * (cpu_id)))) +#define APU_PCIL_CORE_X_IDS_WAKE_MASK (0x00000001U) #define CORE_0_ISR_POWER_OFFSET (0x00000010ULL) #define APU_PCIL_CORE_X_ISR_POWER_REG(cpu_id) (APU_PCLI + (CORE_0_ISR_POWER_OFFSET + \ (APU_PCLI_CPU_STEP * (cpu_id)))) diff --git a/plat/xilinx/versal_net/pm_service/pm_client.c b/plat/xilinx/versal_net/pm_service/pm_client.c index 0142f3358..b42b46651 100644 --- a/plat/xilinx/versal_net/pm_service/pm_client.c +++ b/plat/xilinx/versal_net/pm_service/pm_client.c @@ -219,6 +219,12 @@ void pm_client_wakeup(const struct pm_proc *proc) /* Disabled power down interrupt */ mmio_write_32(APU_PCIL_CORE_X_IDS_POWER_REG(cpuid), APU_PCIL_CORE_X_IDS_POWER_MASK); + /* Clear wakeup interrupt status before disabling */ + mmio_write_32(APU_PCIL_CORE_X_ISR_WAKE_REG(cpuid), + APU_PCIL_CORE_X_ISR_WAKE_MASK); + /* Disable wake interrupt */ + mmio_write_32(APU_PCIL_CORE_X_IDS_WAKE_REG(cpuid), + APU_PCIL_CORE_X_IDS_WAKE_MASK); bakery_lock_release(&pm_client_secure_lock); } -- 2.39.5