From 2d056db4e4981e0f8a58de0d1e44e46058b308f4 Mon Sep 17 00:00:00 2001 From: Jay Buddhabhatti Date: Thu, 29 Dec 2022 21:47:54 -0800 Subject: [PATCH] fix(versal-net): clear power down interrupt status before enable Currently power down interrupt status is set by default before its getting enabled. Because of that Linux is getting crashed since its triggering interrupt before core goes to WFI state. So clear interrupt status before enabling power down interrupt. Signed-off-by: Jay Buddhabhatti Change-Id: Ia8d047b6078a49ab3dbe3e0bf24422357f0138c2 --- plat/xilinx/versal_net/include/versal_net_def.h | 4 ++++ plat/xilinx/versal_net/pm_service/pm_client.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/plat/xilinx/versal_net/include/versal_net_def.h b/plat/xilinx/versal_net/include/versal_net_def.h index e370934ff..bcf831554 100644 --- a/plat/xilinx/versal_net/include/versal_net_def.h +++ b/plat/xilinx/versal_net/include/versal_net_def.h @@ -67,6 +67,10 @@ /* Firmware Image Package */ #define VERSAL_NET_PRIMARY_CPU U(0) +#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)))) +#define APU_PCIL_CORE_X_ISR_POWER_MASK U(0x00000001) #define CORE_0_IEN_POWER_OFFSET (0x00000018ULL) #define APU_PCIL_CORE_X_IEN_POWER_REG(cpu_id) (APU_PCLI + (CORE_0_IEN_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 648732415..b7c6db5a3 100644 --- a/plat/xilinx/versal_net/pm_service/pm_client.c +++ b/plat/xilinx/versal_net/pm_service/pm_client.c @@ -164,6 +164,10 @@ void pm_client_suspend(const struct pm_proc *proc, uint32_t state) isb(); + /* Clear power down interrupt status before enabling */ + mmio_write_32(APU_PCIL_CORE_X_ISR_POWER_REG(cpu_id), + APU_PCIL_CORE_X_ISR_POWER_MASK); + /* Enable power down interrupt */ mmio_write_32(APU_PCIL_CORE_X_IEN_POWER_REG(cpu_id), APU_PCIL_CORE_X_IEN_POWER_MASK); -- 2.39.5