]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(versal-net): clear power down interrupt status before enable
authorJay Buddhabhatti <jay.buddhabhatti@amd.com>
Fri, 30 Dec 2022 05:47:54 +0000 (21:47 -0800)
committerJay Buddhabhatti <jay.buddhabhatti@amd.com>
Tue, 10 Jan 2023 10:19:33 +0000 (02:19 -0800)
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 <jay.buddhabhatti@amd.com>
Change-Id: Ia8d047b6078a49ab3dbe3e0bf24422357f0138c2

plat/xilinx/versal_net/include/versal_net_def.h
plat/xilinx/versal_net/pm_service/pm_client.c

index e370934fff36b2bfba0059c1b4bd03914d5c9b5b..bcf8315543590b57184e52d9636967cce0e86594 100644 (file)
 /* 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))))
index 64873241510a9a2e84a5725a6f68d6c29c12c181..b7c6db5a3f79f96bc9d8f4332af9ef4681fc65ee 100644 (file)
@@ -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);