From 04cc91b43c1d10fcba563e18f06336987e6e3a24 Mon Sep 17 00:00:00 2001 From: Tanmay Shah Date: Tue, 13 Sep 2022 10:24:27 -0700 Subject: [PATCH] fix(versal): route GIC IPI interrupts during setup If primary core is down, then IPI interrupt should be routed to another core for processing. Signed-off-by: Tanmay Shah Change-Id: I01d7c4232a18c0c3b3f3f9ddadfa6ff5bd2f2471 --- plat/xilinx/versal/pm_service/pm_api_sys.c | 3 --- plat/xilinx/versal/pm_service/pm_api_sys.h | 1 - plat/xilinx/versal/pm_service/pm_svc_main.c | 5 +++++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plat/xilinx/versal/pm_service/pm_api_sys.c b/plat/xilinx/versal/pm_service/pm_api_sys.c index ecd8d082d..db9fae433 100644 --- a/plat/xilinx/versal/pm_service/pm_api_sys.c +++ b/plat/xilinx/versal/pm_service/pm_api_sys.c @@ -17,7 +17,6 @@ #include "pm_client.h" #include "pm_defs.h" #include "pm_svc_main.h" -#include "../drivers/arm/gic/v3/gicv3_private.h" /* default shutdown/reboot scope is system(2) */ static uint32_t pm_shutdown_scope = XPM_SHUTDOWN_SUBTYPE_RST_SYSTEM; @@ -466,8 +465,6 @@ enum pm_ret_status pm_api_ioctl(uint32_t device_id, uint32_t ioctl_id, if (ret != 0) { return PM_RET_ERROR_ARGS; } - gicd_write_irouter(gicv3_driver_data->gicd_base, - (uint32_t)PLAT_VERSAL_IPI_IRQ, MODE); ret = PM_RET_SUCCESS; break; default: diff --git a/plat/xilinx/versal/pm_service/pm_api_sys.h b/plat/xilinx/versal/pm_service/pm_api_sys.h index e2a3cf8ec..c539aa743 100644 --- a/plat/xilinx/versal/pm_service/pm_api_sys.h +++ b/plat/xilinx/versal/pm_service/pm_api_sys.h @@ -17,7 +17,6 @@ #define LIBPM_MODULE_ID 0x2U #define LOADER_MODULE_ID 0x7U -#define MODE 0x80000000U #define MODULE_ID_MASK 0x0000ff00U /********************************************************** * PM API function declarations diff --git a/plat/xilinx/versal/pm_service/pm_svc_main.c b/plat/xilinx/versal/pm_service/pm_svc_main.c index 4e26d87b2..01f52dda0 100644 --- a/plat/xilinx/versal/pm_service/pm_svc_main.c +++ b/plat/xilinx/versal/pm_service/pm_svc_main.c @@ -19,6 +19,9 @@ #include "pm_client.h" #include "pm_ipi.h" #include +#include "../drivers/arm/gic/v3/gicv3_private.h" + +#define MODE 0x80000000U #define XSCUGIC_SGIR_EL1_INITID_SHIFT 24U #define INVALID_SGI 0xFFU @@ -139,6 +142,8 @@ int32_t pm_setup(void) if (ret != 0) { WARN("BL31: registering IPI interrupt failed\n"); } + + gicd_write_irouter(gicv3_driver_data->gicd_base, PLAT_VERSAL_IPI_IRQ, MODE); return ret; } -- 2.39.5